(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.Whenzel = 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){
/**
 * DO NOT EDIT MANUALLY
 * Use `scripts/deltat.js` to generate file.
 * Datasets are from <http://maia.usno.navy.mil/ser7>
 */
module.exports = {
  historic: {
    table: [44, 43, 43, 41, 40, 39, 38, 37, 37, 36, 36, 36, 37, 37, 38, 37, 36, 36, 35, 35, 34, 33, 33, 32, 32, 31, 31, 30, 30, 29, 29, 29, 29, 29, 28, 28, 27, 27, 26, 26, 25, 25, 25, 26, 26, 26, 26, 25, 25, 25, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 20, 20, 20, 20, 19, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21.1, 21, 21, 21, 20.9, 20.8, 20.7, 20.6, 20.4, 20.2, 20, 19.7, 19.4, 19.1, 18.7, 18.3, 17.8, 17.4, 17, 16.8, 16.6, 16.4, 16.1, 15.9, 15.7, 15.5, 15.3, 15, 14.7, 14.5, 14.3, 14.2, 14.1, 14.1, 14.1, 13.9, 13.7, 13.6, 13.5, 13.5, 13.5, 13.5, 13.4, 13.4, 13.4, 13.4, 13.3, 13.3, 13.2, 13.2, 13.2, 13.1, 13.1, 13.1, 13, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 13.8, 13.9, 14, 14, 14.1, 14.1, 14.1, 14.1, 14.2, 14.3, 14.4, 14.4, 14.5, 14.6, 14.6, 14.7, 14.7, 14.7, 14.8, 14.8, 14.9, 14.9, 15, 15, 15.1, 15.2, 15.3, 15.4, 15.5, 15.6, 15.6, 15.6, 15.8, 15.9, 15.9, 15.9, 15.8, 15.7, 15.8, 15.7, 15.7, 15.7, 15.8, 15.9, 16.1, 16.1, 16, 15.9, 15.9, 15.7, 15.4, 15.3, 15.4, 15.5, 15.6, 15.6, 15.6, 15.6, 15.6, 15.6, 15.6, 15.5, 15.5, 15.4, 15.3, 15.2, 15.1, 14.9, 14.8, 14.6, 14.4, 14.3, 14.2, 14.1, 14.2, 14.2, 13.9, 13.7, 13.5, 13.3, 13.1, 13, 13.2, 13.2, 13.1, 13.1, 13.2, 13.3, 13.5, 13.5, 13.4, 13.2, 13.2, 13.1, 13.1, 13, 12.8, 12.6, 12.7, 12.6, 12.3, 12, 11.9, 11.8, 11.6, 11.4, 11.2, 11.1, 11.1, 11.1, 11.1, 11.1, 11.2, 11.1, 11.1, 11.2, 11.4, 11.5, 11.3, 11.2, 11.4, 11.7, 11.9, 11.9, 11.9, 11.8, 11.7, 11.8, 11.8, 11.8, 11.7, 11.6, 11.6, 11.5, 11.5, 11.4, 11.4, 11.3, 11.3, 11.13, 11.16, 10.94, 10.72, 10.29, 10.04, 9.94, 9.91, 9.88, 9.86, 9.72, 9.67, 9.66, 9.64, 9.51, 9.4, 9.21, 9, 8.6, 8.29, 7.95, 7.73, 7.59, 7.49, 7.36, 7.26, 7.1, 7, 6.89, 6.82, 6.73, 6.64, 6.39, 6.28, 6.25, 6.27, 6.25, 6.27, 6.22, 6.24, 6.22, 6.27, 6.3, 6.36, 6.35, 6.37, 6.32, 6.33, 6.33, 6.37, 6.37, 6.41, 6.4, 6.44, 6.46, 6.51, 6.48, 6.51, 6.53, 6.58, 6.55, 6.61, 6.69, 6.8, 6.84, 6.94, 7.03, 7.13, 7.15, 7.22, 7.26, 7.3, 7.23, 7.22, 7.21, 7.2, 6.99, 6.98, 7.19, 7.36, 7.35, 7.39, 7.41, 7.45, 7.36, 7.18, 6.95, 6.72, 6.45, 6.24, 5.92, 5.59, 5.15, 4.67, 4.11, 3.52, 2.94, 2.47, 1.97, 1.52, 1.04, 0.6, 0.11, -0.34, -0.82, -1.25, -1.7, -2.08, -2.48, -2.82, -3.19, -3.5, -3.84, -4.14, -4.43, -4.59, -4.79, -4.92, -5.09, -5.24, -5.36, -5.34, -5.37, -5.32, -5.34, -5.33, -5.4, -5.47, -5.58, -5.66, -5.74, -5.68, -5.69, -5.65, -5.67, -5.68, -5.73, -5.72, -5.78, -5.79, -5.86, -5.89, -6.01, -6.13, -6.28, -6.41, -6.53, -6.49, -6.5, -6.45, -6.41, -6.26, -6.11, -5.9, -5.63, -5.13, -4.68, -4.19, -3.72, -3.21, -2.7, -2.09, -1.48, -0.75, -0.08, 0.62, 1.26, 1.95, 2.59, 3.28, 3.92, 4.61, 5.2, 5.73, 6.29, 7, 7.68, 8.45, 9.13, 9.78, 10.38, 10.99, 11.64, 12.47, 13.23, 14, 14.69, 15.38, 16, 16.64, 17.19, 17.72, 18.19, 18.67, 19.13, 19.69, 20.14, 20.54, 20.86, 21.14, 21.41, 21.78, 22.06, 22.3, 22.51, 22.79, 23.01, 23.29, 23.46, 23.55, 23.63, 23.8, 23.95, 24.25, 24.39, 24.42, 24.34, 24.22, 24.1, 24.08, 24.02, 24.04, 23.98, 23.91, 23.89, 23.95, 23.93, 23.92, 23.88, 23.94, 23.91, 23.82, 23.76, 23.87, 23.91, 23.95, 23.96, 24, 24.04, 24.2, 24.35, 24.61, 24.82, 25.09, 25.3, 25.56, 25.77, 26.05, 26.27, 26.54, 26.76, 27.04, 27.27, 27.55, 27.77, 28.03, 28.25, 28.5, 28.7, 28.95, 29.15, 29.38, 29.57, 29.8, 29.97, 30.19, 30.36, 30.57, 30.72, 30.93, 31.07, 31.24, 31.349, 31.516, 31.677, 31.923, 32.166, 32.449, 32.671, 32.919, 33.15, 33.397, 33.584, 33.804, 33.992, 34.24, 34.466, 34.731, 35.03, 35.4, 35.738, 36.147, 36.546, 36.995, 37.429, 37.879, 38.291, 38.753, 39.204, 39.707, 40.182, 40.706, 41.17, 41.686, 42.227, 42.825, 43.373, 43.959, 44.486, 44.997, 45.477, 45.983, 46.458, 46.997, 47.521, 48.034, 48.535, 49.099, 49.589, 50.102, 50.54, 50.975, 51.382, 51.81, 52.168, 52.572, 52.957, 53.434, 53.789, 54.087],
    first: 1657,
    last: 1984.5
  },
  data: {
    table: [43.4724, 43.5648, 43.6737, 43.7782, 43.8763, 43.9562, 44.0315, 44.1132, 44.1982, 44.2952, 44.3936, 44.4841, 44.5646, 44.6425, 44.7386, 44.837, 44.9302, 44.9986, 45.0584, 45.1284, 45.2064, 45.298, 45.3897, 45.4761, 45.5632, 45.645, 45.7375, 45.8284, 45.9133, 45.982, 46.0407, 46.1067, 46.1825, 46.2789, 46.3713, 46.4567, 46.5445, 46.6311, 46.7302, 46.8284, 46.9247, 46.997, 47.0709, 47.145, 47.2362, 47.3413, 47.4319, 47.5214, 47.6049, 47.6837, 47.7781, 47.8771, 47.9687, 48.0348, 48.0942, 48.1608, 48.246, 48.3439, 48.4355, 48.5344, 48.6324, 48.7294, 48.8365, 48.9353, 49.0319, 49.1013, 49.1591, 49.2286, 49.307, 49.4018, 49.4945, 49.5861, 49.6805, 49.7602, 49.8556, 49.9489, 50.0347, 50.1019, 50.1622, 50.226, 50.2968, 50.3831, 50.4599, 50.5387, 50.616, 50.6866, 50.7658, 50.8454, 50.9187, 50.9761, 51.0278, 51.0843, 51.1538, 51.2319, 51.3063, 51.3808, 51.4526, 51.516, 51.5985, 51.6809, 51.7573, 51.8133, 51.8532, 51.9014, 51.9603, 52.0328, 52.0985, 52.1668, 52.2316, 52.2938, 52.368, 52.4465, 52.518, 52.5751, 52.6178, 52.6668, 52.734, 52.8056, 52.8792, 52.9565, 53.0445, 53.1268, 53.2197, 53.3024, 53.3747, 53.4335, 53.4778, 53.53, 53.5845, 53.6523, 53.7256, 53.7882, 53.8367, 53.883, 53.9443, 54.0042, 54.0536, 54.0856, 54.1084, 54.1463, 54.1914, 54.2452, 54.2958, 54.3427, 54.3911, 54.432, 54.4898, 54.5456, 54.5977, 54.6355, 54.6532, 54.6776, 54.7174, 54.7741, 54.8253, 54.8712, 54.9161, 54.9581, 54.9997, 55.0476, 55.0912, 55.1132, 55.1328, 55.1532, 55.1898, 55.2416, 55.2838, 55.3222, 55.3613, 55.4063, 55.4629, 55.5111, 55.5524, 55.5812, 55.6004, 55.6262, 55.6656, 55.7168, 55.7698, 55.8197, 55.8615, 55.913, 55.9663, 56.022, 56.07, 56.0939, 56.1105, 56.1314, 56.1611, 56.2068, 56.2582, 56.3, 56.3399, 56.379, 56.4283, 56.4804, 56.5352, 56.5697, 56.5983, 56.6328, 56.6739, 56.7332, 56.7972, 56.8553, 56.9111, 56.9755, 57.0471, 57.1136, 57.1738, 57.2226, 57.2597, 57.3073, 57.3643, 57.4334, 57.5016, 57.5653, 57.6333, 57.6973, 57.7711, 57.8407, 57.9058, 57.9576, 57.9975, 58.0425, 58.1043, 58.1679, 58.2389, 58.3091659, 58.3833021, 58.4536748, 58.5401438, 58.6227714, 58.6916662, 58.7409628, 58.7836189, 58.8405543, 58.898579, 58.9713678, 59.043837, 59.1218414, 59.2002687, 59.274737, 59.3574134, 59.4433827, 59.5242416, 59.5849787, 59.6343497, 59.6927827, 59.758805, 59.8386448, 59.9110567, 59.9844537, 60.056435, 60.123065, 60.2042185, 60.2803745, 60.3530352, 60.4011891, 60.4439959, 60.4900257, 60.5578054, 60.6324446, 60.7058569, 60.7853482, 60.8663504, 60.9386672, 61.0276757, 61.1103448, 61.1870458, 61.2453891, 61.2881024, 61.3377799, 61.4036165, 61.4760366, 61.5524599, 61.6286593, 61.6845819, 61.743306, 61.8132425, 61.8823203, 61.9496762, 61.9968743, 62.0342938, 62.0714108, 62.1202315, 62.1809508, 62.2382046, 62.2950486, 62.3506479, 62.3995381, 62.475395, 62.5463091, 62.6136031, 62.6570739, 62.6941742, 62.7383271, 62.7926305, 62.8566986, 62.9145607, 62.9658689, 63.0216632, 63.0807052, 63.1461718, 63.2052946, 63.2599441, 63.2844088, 63.2961369, 63.3126092, 63.3421622, 63.3871303, 63.4339302, 63.4673369, 63.4978642, 63.5319327, 63.5679441, 63.6104432, 63.6444291, 63.6641815, 63.6739403, 63.692603, 63.7147066, 63.7518055, 63.792717, 63.8285221, 63.8556871, 63.8803854, 63.9075025, 63.9392787, 63.9690744, 63.9798604, 63.9833077, 63.9938011, 64.0093384, 64.0399621, 64.0670429, 64.0907881, 64.1068077, 64.1282125, 64.1584211, 64.1832722, 64.2093975, 64.2116628, 64.2073173, 64.2115565, 64.2222858, 64.2499625, 64.2760973, 64.2998037, 64.3191858, 64.345013, 64.3734584, 64.3943291, 64.4151156, 64.4132064, 64.4118464, 64.4096536, 64.4167832, 64.43292, 64.4510529, 64.4734276, 64.4893377, 64.5053342, 64.5269189, 64.5470942, 64.5596729, 64.5512293, 64.5370906, 64.5359472, 64.5414947, 64.5543634, 64.5654298, 64.5736111, 64.5891142, 64.6014759, 64.6176147, 64.6374397, 64.6548674, 64.6530021, 64.6379271, 64.637161, 64.6399614, 64.6543152, 64.6723164, 64.6876311, 64.7051905, 64.7313433, 64.7575312, 64.7811143, 64.8000929, 64.7994561, 64.7876424, 64.783095, 64.7920604, 64.8096421, 64.8310888, 64.8451826, 64.8597013, 64.8849929, 64.9174991, 64.9480298, 64.9793881, 64.9894772, 65.0028155, 65.0138193, 65.0371432, 65.0772597, 65.112197, 65.1464034, 65.1832638, 65.2145358, 65.2493713, 65.2920645, 65.3279403, 65.3413366, 65.3451881, 65.34964, 65.3711307, 65.3971998, 65.4295547, 65.4573487, 65.486752, 65.5152012, 65.5449916, 65.5780768, 65.612728, 65.6287505, 65.6370091, 65.6493375, 65.6759928, 65.7096966, 65.746092, 65.7768362, 65.8024614, 65.8236695, 65.8595036, 65.8973008, 65.932291, 65.950911, 65.9534105, 65.962833, 65.9838647, 66.0146733, 66.042049, 66.0699217, 66.0961343, 66.1310116, 66.1682713, 66.2071627, 66.2355846, 66.2408549, 66.2335423, 66.2349107, 66.2441095, 66.2751123, 66.3054334, 66.3245568, 66.3405713, 66.3624433, 66.3957101, 66.428903, 66.4618675, 66.4748837, 66.4751281, 66.4828678, 66.5056165, 66.5382912, 66.5705628, 66.6030198, 66.6339689, 66.6569117, 66.6925011, 66.7288729, 66.7578719, 66.7707625, 66.7740427, 66.7846288, 66.810324, 66.840048, 66.8778601, 66.9069091, 66.944259, 66.9762508, 67.0258126, 67.0716286, 67.1100184, 67.1266401, 67.1331391, 67.145797, 67.17174, 67.2091069, 67.2459812, 67.2810383, 67.3136452, 67.3456968, 67.389003, 67.4318433, 67.4666209, 67.4858459, 67.4989147, 67.5110936, 67.5352658, 67.571103, 67.6070253, 67.6439167, 67.6765272, 67.7116693, 67.7590634, 67.8011542, 67.840213, 67.8606318, 67.8821576, 67.9120101, 67.9546462, 68.0054839, 68.051412, 68.1024205, 68.1577127, 68.2043653, 68.2664507, 68.3188171, 68.3703564, 68.3964356, 68.4094472, 68.4304611, 68.4629791, 68.507818, 68.5537018, 68.5927179, 68.6298107, 68.6670627, 68.7135208, 68.7622755, 68.8032843, 68.8244838, 68.8373427, 68.847693, 68.8688567, 68.9005814, 68.9354999, 68.9676423, 68.9875354, 69.0175531, 69.049908, 69.0823435, 69.1070035, 69.1134025, 69.1141856, 69.1207111, 69.1355558, 69.1645848, 69.1964195, 69.2201543, 69.2451589, 69.2761266, 69.314876, 69.3495713, 69.3712662, 69.3756156, 69.3698108, 69.3691319, 69.3937054, 69.4216829, 69.4546536, 69.4773121, 69.4908726],
    first: 1973.0849315068492,
    firstYM: [1973, 2],
    last: 2020.0874316939892,
    lastYM: [2020, 2]
  },
  prediction: {
    table: [69.34, 69.48, 69.62, 69.71, 69.87, 70.03, 70.16, 70.24, 70.39, 70.55, 70.68, 70.76, 70.91, 71.06, 71.18, 71.25, 71.4, 71.54, 71.67, 71.74, 71.88, 72.03, 72.15, 72.22, 72.36, 72.5, 72.62, 72.69, 72.83, 72.98, 73.1, 73.17, 73.32, 73.46, 73.58, 73.66],
    first: 2019,
    last: 2027.75
  }
};
},{}],2:[function(require,module,exports){
module.exports = {
  L: {
    "0": [
      [1.75347045673, 0, 0],
      [0.03341656453, 4.66925680415, 6283.0758499914],
      [0.00034894275, 4.62610242189, 12566.1516999828],
      [0.00003417572, 2.82886579754, 3.523118349],
      [0.00003497056, 2.74411783405, 5753.3848848968],
      [0.00003135899, 3.62767041756, 77713.7714681205],
      [0.00002676218, 4.41808345438, 7860.4193924392],
      [0.00002342691, 6.13516214446, 3930.2096962196],
      [0.00001273165, 2.03709657878, 529.6909650946],
      [0.00001324294, 0.74246341673, 11506.7697697936],
      [0.00000901854, 2.04505446477, 26.2983197998],
      [0.00001199167, 1.10962946234, 1577.3435424478],
      [0.00000857223, 3.50849152283, 398.1490034082],
      [0.00000779786, 1.17882681962, 5223.6939198022],
      [0.0000099025, 5.23268072088, 5884.9268465832],
      [0.00000753141, 2.53339052847, 5507.5532386674],
      [0.00000505267, 4.58292599973, 18849.2275499742],
      [0.00000492392, 4.20505711826, 775.522611324],
      [0.00000356672, 2.91954114478, 0.0673103028],
      [0.00000284125, 1.89869240932, 796.2980068164],
      [0.00000242879, 0.34481445893, 5486.777843175],
      [0.00000317087, 5.84901948512, 11790.6290886588],
      [0.00000271112, 0.31486255375, 10977.078804699],
      [0.00000206217, 4.80646631478, 2544.3144198834],
      [0.00000205478, 1.86953770281, 5573.1428014331],
      [0.00000202318, 2.45767790232, 6069.7767545534],
      [0.00000126225, 1.08295459501, 20.7753954924],
      [0.00000155516, 0.83306084617, 213.299095438],
      [0.00000115132, 0.64544911683, 0.9803210682],
      [0.00000102851, 0.63599845579, 4694.0029547076],
      [0.00000101724, 4.2667980198, 7.1135470008],
      [9.9206e-7, 6.20992926918, 2146.1654164752],
      [0.00000132212, 3.41118292683, 2942.4634232916],
      [9.7607e-7, 0.68101342359, 155.4203994342],
      [8.5128e-7, 1.29870764804, 6275.9623029906],
      [7.4651e-7, 1.755089133, 5088.6288397668],
      [0.00000101895, 0.97569280312, 15720.8387848784],
      [8.4711e-7, 3.67080093031, 71430.69561812909],
      [7.3547e-7, 4.67926633877, 801.8209311238],
      [7.3874e-7, 3.50319414955, 3154.6870848956],
      [7.8757e-7, 3.03697458703, 12036.4607348882],
      [7.9637e-7, 1.80791287082, 17260.1546546904],
      [8.5803e-7, 5.9832263126, 161000.6857376741],
      [5.6963e-7, 2.78430458592, 6286.5989683404],
      [6.1148e-7, 1.81839892984, 7084.8967811152],
      [6.9627e-7, 0.83297621398, 9437.762934887],
      [5.6116e-7, 4.38694865354, 14143.4952424306],
      [6.2449e-7, 3.97763912806, 8827.3902698748],
      [5.1145e-7, 0.28306832879, 5856.4776591154],
      [5.5577e-7, 3.47006059924, 6279.5527316424],
      [4.1036e-7, 5.36817592855, 8429.2412664666],
      [5.1605e-7, 1.33282739866, 1748.016413067],
      [5.1992e-7, 0.18914947184, 12139.5535091068],
      [4.9e-7, 0.48735014197, 1194.4470102246],
      [3.92e-7, 6.16833020996, 10447.3878396044],
      [3.557e-7, 1.775968892, 6812.766815086],
      [3.677e-7, 6.04133863162, 10213.285546211],
      [3.6596e-7, 2.56957481827, 1059.3819301892],
      [3.3296e-7, 0.59310278598, 17789.845619785],
      [3.5954e-7, 1.70875808777, 2352.8661537718],
      [4.0938e-7, 2.39850938714, 19651.048481098],
      [3.0047e-7, 2.73975124088, 1349.8674096588],
      [3.0412e-7, 0.44294464169, 83996.84731811189],
      [2.3663e-7, 0.48473622521, 8031.0922630584],
      [2.3574e-7, 2.06528133162, 3340.6124266998],
      [2.1089e-7, 4.14825468851, 951.7184062506],
      [2.4738e-7, 0.21484762138, 3.5904286518],
      [2.5352e-7, 3.16470891653, 4690.4798363586],
      [2.2823e-7, 5.22195230819, 4705.7323075436],
      [2.1419e-7, 1.42563910473, 16730.4636895958],
      [2.1891e-7, 5.55594302779, 553.5694028424],
      [1.7481e-7, 4.56052900312, 135.0650800354],
      [1.9927e-7, 5.22209149316, 12168.0026965746],
      [1.986e-7, 5.77470242235, 6309.3741697912],
      [2.03e-7, 0.37133792946, 283.8593188652],
      [1.4421e-7, 4.19315052005, 242.728603974],
      [1.6225e-7, 5.98837767951, 11769.8536931664],
      [1.5077e-7, 4.1956716337, 6256.7775301916],
      [1.9124e-7, 3.82219958698, 23581.2581773176],
      [1.8888e-7, 5.38626892076, 149854.4001348079],
      [1.4346e-7, 3.72355084422, 38.0276726358],
      [1.7898e-7, 2.21490566029, 13367.9726311066],
      [1.2054e-7, 2.62229602614, 955.5997416086],
      [1.1287e-7, 0.17739329984, 4164.311989613],
      [1.3973e-7, 4.40134615007, 6681.2248533996],
      [1.3621e-7, 1.88934516495, 7632.9432596502],
      [1.2503e-7, 1.13052412208, 5.5229243074],
      [1.0498e-7, 5.35909979317, 1592.5960136328],
      [9.803e-8, 0.99948172646, 11371.7046897582],
      [9.22e-8, 4.57138585348, 4292.3308329504],
      [1.0327e-7, 6.19982170609, 6438.4962494256],
      [1.2003e-7, 1.00351462266, 632.7837393132],
      [1.0827e-7, 0.32734523824, 103.0927742186],
      [8.356e-8, 4.53902748706, 25132.3033999656],
      [1.0005e-7, 6.0291496328, 5746.271337896],
      [8.409e-8, 3.29946177848, 7234.794256242],
      [8.006e-8, 5.82145271855, 28.4491874678],
      [1.0523e-7, 0.93870455544, 11926.2544136688],
      [7.686e-8, 3.1214364064, 7238.6755916],
      [9.378e-8, 2.62413793196, 5760.4984318976],
      [8.127e-8, 6.11227839253, 4732.0306273434],
      [9.232e-8, 0.48344234496, 522.5774180938],
      [9.802e-8, 5.24413877132, 27511.4678735372],
      [7.871e-8, 0.99590133077, 5643.1785636774],
      [8.123e-8, 6.27053020099, 426.598190876],
      [9.048e-8, 5.33686323585, 6386.16862421],
      [8.621e-8, 4.16537179089, 7058.5984613154],
      [6.297e-8, 4.71723143652, 6836.6452528338],
      [7.575e-8, 3.97381357237, 11499.6562227928],
      [7.756e-8, 2.95728422442, 23013.5395395872],
      [7.314e-8, 0.60652522715, 11513.8833167944],
      [5.955e-8, 2.87641047954, 6283.14316029419],
      [6.534e-8, 5.79046406784, 18073.7049386502],
      [7.188e-8, 3.99831461988, 74.7815985673],
      [7.346e-8, 4.38582423903, 316.3918696566],
      [5.413e-8, 5.39199023275, 419.4846438752],
      [5.127e-8, 2.36059551778, 10973.55568635],
      [7.056e-8, 0.32258442532, 263.0839233728],
      [6.624e-8, 3.6647416584, 17298.1823273262],
      [6.762e-8, 5.91131766896, 90955.5516944961],
      [4.938e-8, 5.73672172371, 9917.6968745098],
      [5.547e-8, 2.45152589382, 12352.8526045448],
      [5.958e-8, 3.3205134466, 6283.0085396886],
      [4.471e-8, 2.06386138131, 7079.3738568078],
      [6.153e-8, 1.45823347458, 233141.3144043615],
      [4.348e-8, 4.42338625285, 5216.5803728014],
      [6.124e-8, 1.07494838623, 19804.8272915828],
      [4.488e-8, 3.65285033073, 206.1855484372],
      [4.02e-8, 0.83995823171, 20.3553193988],
      [5.188e-8, 4.06503864016, 6208.2942514241],
      [5.307e-8, 0.38216728132, 31441.6775697568],
      [3.785e-8, 2.34369213733, 3.881335358],
      [4.497e-8, 3.27230792447, 11015.1064773348],
      [4.132e-8, 0.92129851256, 3738.761430108],
      [3.521e-8, 5.9784480361, 3894.1818295422],
      [4.215e-8, 1.90601721876, 245.8316462294],
      [3.701e-8, 5.03067498875, 536.8045120954],
      [3.866e-8, 1.82632980909, 11856.2186514245],
      [3.652e-8, 1.01840564429, 16200.7727245012],
      [3.39e-8, 0.97784870142, 8635.9420037632],
      [3.737e-8, 2.9537891957, 3128.3887650958],
      [3.507e-8, 3.71291946317, 6290.1893969922],
      [3.086e-8, 3.64646921512, 10.6366653498],
      [3.397e-8, 1.10589356888, 14712.317116458],
      [3.334e-8, 0.83684903082, 6496.3749454294],
      [2.805e-8, 2.58503711584, 14314.1681130498],
      [3.65e-8, 1.08344142571, 88860.05707098669],
      [3.388e-8, 3.20182380957, 5120.6011455836],
      [3.252e-8, 3.47857474229, 6133.5126528568],
      [2.553e-8, 3.9486902726, 1990.745017041],
      [3.52e-8, 2.05559692878, 244287.60000722768],
      [2.565e-8, 1.56072409371, 23543.23050468179],
      [2.621e-8, 3.85639359951, 266.6070417218],
      [2.954e-8, 3.39692614359, 9225.539273283],
      [2.876e-8, 6.02633318445, 154717.6098876827],
      [2.395e-8, 1.16130078696, 10984.1923516998],
      [3.161e-8, 1.32798862116, 10873.9860304804],
      [3.163e-8, 5.08946546862, 21228.3920235458],
      [2.361e-8, 4.27212461943, 6040.3472460174],
      [3.03e-8, 1.80210001168, 35371.8872659764],
      [2.343e-8, 3.57688971514, 10969.9652576982],
      [2.618e-8, 2.57870151918, 22483.84857449259],
      [2.113e-8, 3.71711179417, 65147.6197681377],
      [2.019e-8, 0.81393923319, 170.6728706192],
      [2.003e-8, 0.38091017375, 6172.869528772],
      [2.506e-8, 3.74378169126, 10575.4066829418],
      [2.381e-8, 0.10581361289, 7.046236698],
      [1.949e-8, 4.86892513469, 36.0278666774],
      [2.074e-8, 4.22802468213, 5650.2921106782],
      [1.924e-8, 5.59460549844, 6282.0955289232],
      [1.949e-8, 1.06999605576, 5230.807466803],
      [1.988e-8, 5.19734705445, 6262.300454499],
      [1.887e-8, 3.74365662683, 23.8784377478],
      [1.787e-8, 1.25929659066, 12559.038152982],
      [1.883e-8, 1.90364058477, 15.252471185],
      [1.816e-8, 3.68083794819, 15110.4661198662],
      [1.701e-8, 4.41109562589, 110.2063212194],
      [1.99e-8, 3.93295788548, 6206.8097787158],
      [2.103e-8, 0.75354936681, 13521.7514415914],
      [1.774e-8, 0.48750515837, 1551.045222648],
      [1.882e-8, 0.86685462305, 22003.9146348698],
      [1.924e-8, 1.22901099088, 709.9330485583],
      [2.073e-8, 4.62531597856, 6037.244203762],
      [1.924e-8, 0.60231842492, 6284.0561710596],
      [1.596e-8, 3.98332879712, 13916.0191096416],
      [1.664e-8, 4.41947015623, 8662.240323563],
      [1.971e-8, 1.04560686192, 18209.33026366019],
      [1.942e-8, 4.31335979989, 6244.9428143536],
      [1.476e-8, 0.93274523818, 2379.1644735716],
      [1.81e-8, 0.49112137707, 1.4844727083],
      [1.346e-8, 1.51574753411, 4136.9104335162],
      [1.528e-8, 5.61833568587, 6127.6554505572],
      [1.791e-8, 3.22191142746, 39302.096962196],
      [1.747e-8, 3.05595292589, 18319.5365848796],
      [1.432e-8, 4.51123984264, 20426.571092422],
      [1.695e-8, 0.22049418623, 25158.6017197654],
      [1.242e-8, 4.46665354536, 17256.6315363414],
      [1.463e-8, 4.69248613506, 14945.3161735544],
      [1.205e-8, 1.86911906771, 4590.910180489],
      [1.19e-8, 2.74169967367, 12569.6748183318],
      [1.222e-8, 5.18120087481, 5333.9002410216],
      [1.39e-8, 5.42888623322, 143571.32428481648],
      [1.473e-8, 1.70487100866, 11712.9553182308],
      [1.362e-8, 2.61069503292, 6062.6632075526],
      [1.148e-8, 6.0300843061, 3634.6210245184],
      [1.198e-8, 5.15296117339, 10177.2576795336],
      [1.266e-8, 0.11422490557, 18422.62935909819],
      [1.411e-8, 1.09910890045, 3496.032826134],
      [1.349e-8, 2.99804623019, 17654.7805397496],
      [1.253e-8, 2.79844902576, 167283.7615876655],
      [1.311e-8, 1.609410743, 5481.2549188676],
      [1.079e-8, 6.20304501787, 3.2863574178],
      [1.181e-8, 1.20653777627, 131.5419616864],
      [1.254e-8, 5.45103277799, 6076.8903015542],
      [1.036e-8, 2.32136959491, 7342.4577801806],
      [1.117e-8, 0.38842340979, 949.1756089698],
      [9.66e-9, 3.18352079941, 11087.2851259184],
      [1.171e-8, 3.39635167732, 12562.6285816338],
      [1.121e-8, 0.72631814699, 220.4126424388],
      [1.024e-8, 2.19381113265, 11403.676995575],
      [8.88e-9, 3.91167196431, 4686.8894077068],
      [9.1e-9, 1.98802695087, 735.8765135318],
      [8.23e-9, 0.48822202854, 24072.9214697764],
      [1.096e-8, 6.17377835617, 5436.9930152402],
      [9.08e-9, 0.44959148878, 7477.522860216],
      [9.74e-9, 1.52996313552, 9623.6882766912],
      [8.4e-9, 1.79540573407, 5429.8794682394],
      [7.78e-9, 6.17703744517, 38.1330356378],
      [7.76e-9, 4.09859968447, 14.2270940016],
      [1.068e-8, 4.64209577648, 43232.3066584156],
      [9.54e-9, 1.49985885818, 1162.4747044078],
      [9.07e-9, 0.86986870809, 10344.2950653858],
      [9.31e-9, 4.06049877517, 28766.924424484],
      [7.39e-9, 5.04368192034, 639.897286314],
      [9.65e-9, 3.44286716197, 1589.0728952838],
      [7.63e-9, 5.86304776787, 16858.4825329332],
      [9.53e-9, 4.20801492835, 11190.377900137],
      [7.08e-9, 1.72432323967, 13095.8426650774],
      [9.69e-9, 1.64437243011, 29088.811415985],
      [7.17e-9, 0.16688678895, 11.729352836],
      [9.62e-9, 3.53101876172, 12416.5885028482],
      [7.45e-9, 5.77741082302, 12592.4500197826],
      [6.72e-9, 1.91091228744, 3.9321532631],
      [6.71e-9, 5.46240758839, 18052.9295431578],
      [6.75e-9, 6.28311649798, 4535.0594369244],
      [6.84e-9, 0.39975011401, 5849.3641121146],
      [7.99e-9, 0.29859056777, 12132.439962106],
      [7.58e-9, 0.96370719224, 1052.2683831884],
      [7.82e-9, 5.33875702541, 13517.8701062334],
      [7.3e-9, 1.70114998543, 17267.26820169119],
      [7.49e-9, 2.59607005624, 11609.8625440122],
      [7.34e-9, 2.7842049778, 640.8776073822],
      [6.88e-9, 5.15097673557, 16496.3613962024],
      [7.7e-9, 1.62459252416, 4701.1165017084],
      [6.33e-9, 2.20588443066, 25934.1243310894],
      [7.6e-9, 4.21317219403, 377.3736079158],
      [5.84e-9, 2.13420121623, 10557.5941608238],
      [5.72e-9, 0.24649745829, 9779.1086761254],
      [5.73e-9, 3.16435264609, 533.2140834436],
      [6.85e-9, 3.19344289472, 12146.6670561076],
      [6.75e-9, 0.96179234176, 10454.5013866052],
      [6.48e-9, 1.46327342554, 6268.8487559898],
      [5.89e-9, 2.50543543638, 3097.88382272579],
      [5.51e-9, 5.28106257475, 9388.0059094152],
      [6.96e-9, 3.6534215555, 4804.209275927],
      [6.69e-9, 2.5103005926, 2388.8940204492],
      [5.5e-9, 0.06883090057, 20199.094959633],
      [6.29e-9, 4.13350997495, 45892.73043315699],
      [6.78e-9, 6.09190163533, 135.62532501],
      [5.93e-9, 1.50129499103, 226858.23855437007],
      [5.42e-9, 3.58582033525, 6148.010769956],
      [5.99e-9, 6.12058050643, 18875.525869774],
      [6.82e-9, 5.0221361683, 17253.04110768959],
      [5.65e-9, 4.29309214275, 11933.3679606696],
      [4.86e-9, 0.77746204893, 27.4015560968],
      [5.03e-9, 0.58974557727, 15671.0817594066],
      [6.16e-9, 4.06539884128, 227.476132789],
      [5.37e-9, 2.15064382406, 21954.15760939799],
      [6.69e-9, 6.06995500278, 47162.5163546352],
      [5.4e-9, 2.83444221432, 5326.7866940208],
      [4.74e-9, 0.40346826846, 6915.8595893046],
      [5.32e-9, 5.26131065063, 10988.808157535],
      [5.82e-9, 3.24533095664, 153.7788104848],
      [6.41e-9, 3.24711790399, 2107.0345075424],
      [6.19e-9, 3.08302108547, 33019.0211122046],
      [4.66e-9, 3.14982369789, 10440.2742926036],
      [4.66e-9, 0.90708835651, 5966.6839803348],
      [5.28e-9, 0.8192645447, 813.5502839598],
      [6.03e-9, 3.81378921927, 316428.22867391503],
      [5.59e-9, 1.8189498573, 17996.0311682222],
      [4.37e-9, 2.28631745987, 6303.8512454838],
      [5.18e-9, 4.86068318058, 20597.2439630412],
      [4.24e-9, 6.23520018697, 6489.2613984286],
      [5.18e-9, 6.17617826756, 0.2438174835],
      [4.04e-9, 5.72804304258, 5642.1982426092],
      [4.58e-9, 1.34117773914, 6287.0080032545],
      [5.48e-9, 5.6845445832, 155427.542936241],
      [5.47e-9, 1.03391472434, 3646.3503773544],
      [4.28e-9, 4.6980968782, 846.0828347512],
      [4.13e-9, 6.0252069939, 6279.4854213396],
      [5.34e-9, 3.03030638223, 66567.48586525429],
      [3.83e-9, 1.4905558804, 19800.9459562248],
      [4.11e-9, 5.28384176408, 18451.07854656599],
      [3.52e-9, 4.68891600525, 4907.3020501456],
      [4.8e-9, 5.36572651091, 348.924420448],
      [3.44e-9, 5.89157452889, 6546.1597733642],
      [3.4e-9, 0.37557440365, 13119.72110282519],
      [4.34e-9, 4.98417856239, 6702.5604938666],
      [3.32e-9, 2.6890934443, 29296.6153895786],
      [4.48e-9, 2.16478480251, 5905.7022420756],
      [3.44e-9, 2.06546633735, 49.7570254718],
      [3.15e-9, 1.24023810969, 4061.2192153944],
      [3.24e-9, 2.30897526929, 5017.508371365],
      [4.13e-9, 0.17171692945, 6286.6662786432],
      [4.31e-9, 3.8660110138, 12489.8856287072],
      [3.49e-9, 4.55372493131, 4933.2084403326],
      [3.23e-9, 0.41971136084, 10770.8932562618],
      [3.41e-9, 2.68612860807, 11.0457002639],
      [3.16e-9, 3.52966641606, 17782.7320727842],
      [3.15e-9, 5.63357264999, 568.8218740274],
      [3.4e-9, 3.83571212349, 10660.6869350424],
      [2.96e-9, 0.62703270489, 20995.3929664494],
      [4.05e-9, 1.00084965393, 16460.33352952499],
      [4.14e-9, 1.21998752076, 51092.7260508548],
      [3.36e-9, 4.71465945215, 6179.9830757728],
      [3.61e-9, 3.71235613733, 28237.2334593894],
      [3.27e-9, 1.05606504715, 11919.140866668],
      [3.27e-9, 6.1422242098, 6254.6266625236],
      [2.68e-9, 2.47224339737, 664.75604513],
      [2.69e-9, 1.86210872453, 23141.5583829246],
      [3.45e-9, 0.93461290184, 6058.7310542895],
      [3.53e-9, 4.50033650657, 36949.2308084242],
      [3.44e-9, 6.26166140367, 24356.7807886416],
      [3e-9, 4.46964001975, 6418.1409300268],
      [2.6e-9, 4.04967464725, 6525.8044539654],
      [2.98e-9, 2.20018811054, 156137.47598479927],
      [2.53e-9, 3.49930797865, 29864.334027309],
      [2.54e-9, 2.44883530154, 5331.3574437408],
      [2.96e-9, 0.84341183907, 5729.506447149],
      [2.41e-9, 2.00721298729, 16737.5772365966],
      [3.11e-9, 1.23668016336, 6281.5913772831],
      [3.32e-9, 3.55576945724, 7668.6374249425],
      [2.36e-9, 2.47437156031, 6245.0481773556],
      [2.64e-9, 4.43924412283, 12964.300703391],
      [2.57e-9, 1.79654471948, 11080.1715789176],
      [2.6e-9, 3.3307759606, 5888.4499649322],
      [2.85e-9, 0.3088636143, 11823.1616394502],
      [2.9e-9, 5.70141882483, 77.673770428],
      [2.55e-9, 4.00939662024, 5881.4037282342],
      [2.53e-9, 4.73318512715, 16723.350142595],
      [2.28e-9, 0.95333661324, 5540.0857894588],
      [2.81e-9, 1.29199646396, 22805.7355659936],
      [3.19e-9, 1.38633229189, 163096.18036118348],
      [2.24e-9, 1.65156322696, 10027.9031957292],
      [2.26e-9, 0.34125379653, 17796.9591667858],
      [2.36e-9, 4.19817431922, 19.66976089979],
      [2.81e-9, 4.14114899916, 12539.853380183],
      [2.75e-9, 5.50306930248, 32.5325507914],
      [2.23e-9, 5.23334210294, 56.8983749356],
      [2.17e-9, 6.08598789777, 6805.6532680852],
      [2.28e-9, 5.17114391778, 11720.0688652316],
      [2.74e-9, 4.50716805713, 6016.4688082696],
      [2.45e-9, 3.96486270306, 22.7752014508],
      [2.2e-9, 4.7207808197, 6.62855890001],
      [2.07e-9, 5.71701403951, 41.5507909848],
      [2.04e-9, 3.9122741125, 2699.7348193176],
      [2.09e-9, 0.86881969024, 6321.1035226272],
      [2e-9, 2.11984442601, 4274.5183108324],
      [2e-9, 5.39839888151, 6019.9919266186],
      [2.09e-9, 5.67606291663, 11293.4706743556],
      [2.52e-9, 1.6496572935, 9380.9596727172],
      [2.75e-9, 5.04826903506, 73.297125859],
      [2.08e-9, 1.88207277133, 11300.5842213564],
      [2.06e-9, 5.0728488933, 6277.552925684],
      [2.72e-9, 0.74640924904, 1975.492545856],
      [1.99e-9, 3.30813142103, 22743.4093795164],
      [2.69e-9, 4.48560812155, 64471.99124174489],
      [1.92e-9, 2.17463565107, 5863.5912061162],
      [2.28e-9, 5.85373115869, 128.0188433374],
      [2.61e-9, 2.64321183295, 55022.9357470744],
      [1.96e-9, 2.4853762232, 16062.1845261168],
      [1.87e-9, 1.3189176028, 29826.3063546732],
      [2.2e-9, 5.75012110079, 29.429508536],
      [1.87e-9, 4.03230554718, 467.9649903544],
      [2e-9, 5.60555262896, 1066.49547719],
      [2.31e-9, 1.09802712785, 12341.8069042809],
      [1.98e-9, 0.29474229005, 149.5631971346],
      [2.49e-9, 5.1047702317, 7875.6718636242],
      [1.79e-9, 0.87066197995, 12721.572099417],
      [2.03e-9, 1.56914310573, 28286.9904848612],
      [1.98e-9, 3.54061588502, 30.914125635],
      [1.71e-9, 3.45366018621, 5327.4761083828],
      [1.83e-9, 0.72325421604, 6272.0301497275],
      [2.16e-9, 2.97175184412, 19402.7969528166],
      [1.68e-9, 2.51559879907, 23937.856389741],
      [1.95e-9, 0.09045393425, 156.4007205024],
      [2.16e-9, 0.42162375972, 23539.7073863328],
      [1.89e-9, 0.37542530191, 9814.6041002912],
      [2.07e-9, 2.01752547259, 238004.5241572363],
      [2.18e-9, 2.36835893645, 16627.3709153772],
      [1.66e-9, 4.23182960518, 16840.67001081519],
      [2e-9, 2.02153258098, 16097.6799502826],
      [1.69e-9, 0.91318727, 95.9792272178],
      [2.11e-9, 5.73370637657, 151.8972810852],
      [2.04e-9, 0.42643085174, 515.463871093],
      [2.12e-9, 3.00223140894, 12043.574281889],
      [1.92e-9, 5.46153589821, 6379.0550772092],
      [1.6e-9, 6.23798383332, 202.2533951741],
      [2.15e-9, 0.20889073407, 5621.8429232104],
      [1.5e-9, 3.12999753018, 799.8211251654],
      [1.87e-9, 2.12345787867, 491.6632924588],
      [1.92e-9, 1.33928820063, 394.6258850592],
      [1.49e-9, 2.65697593276, 21.335640467],
      [1.46e-9, 5.58021191726, 412.3710968744],
      [1.56e-9, 3.7565767638, 12323.4230960088],
      [1.43e-9, 3.28248547724, 29.8214381488],
      [1.44e-9, 1.07862546598, 1265.5674786264],
      [1.48e-9, 0.2338663109, 10021.8372800994],
      [1.64e-9, 0.94288727597, 14919.0178537546],
      [1.93e-9, 5.92751083827, 40879.4405046438],
      [1.4e-9, 4.97612440269, 158.9435177832],
      [1.48e-9, 2.61651818006, 17157.0618804718],
      [1.4e-9, 3.66947933935, 26084.0218062162],
      [1.47e-9, 5.09968173403, 661.232926781],
      [1.47e-9, 1.36976712162, 4171.4255366138],
      [1.34e-9, 4.79432636012, 111.1866422876],
      [1.4e-9, 1.27748013377, 107.6635239386],
      [1.71e-9, 2.77586207403, 26735.9452622132],
      [1.83e-9, 5.43418358741, 369.6998159404],
      [1.34e-9, 3.09132862833, 17.812522118],
      [1.32e-9, 3.05633896779, 22490.9621214934],
      [1.81e-9, 4.22950689891, 966.9708774356],
      [1.66e-9, 3.67660435776, 15508.6151232744],
      [1.52e-9, 5.28885813387, 12669.2444742014],
      [1.5e-9, 5.86819430895, 97238.62754448749],
      [1.45e-9, 5.07330784304, 87.30820453981],
      [1.33e-9, 5.65471067133, 31.9723058168],
      [1.24e-9, 2.83326216907, 12566.2190102856],
      [1.4e-9, 5.84212721453, 22476.73502749179],
      [1.34e-9, 3.12858101887, 32217.2001810808],
      [1.37e-9, 0.86487461904, 9924.8104215106],
      [1.72e-9, 1.98369595114, 174242.4659640497],
      [1.7e-9, 4.41115280254, 327574.51427678124],
      [1.28e-9, 4.49087631612, 31415.379249957],
      [1.51e-9, 0.46542092001, 39609.6545831656],
      [1.53e-9, 3.78801830344, 17363.24742890899],
      [1.65e-9, 5.31654110459, 16943.7627850338],
      [1.65e-9, 4.06747587817, 58953.145443294],
      [1.18e-9, 0.63846333239, 6.0659156298],
      [1.59e-9, 0.86086959274, 221995.02880149524],
      [1.19e-9, 5.96432932413, 1385.8952763362],
      [1.14e-9, 5.16516114595, 25685.872802808],
      [1.12e-9, 4.92889233335, 56.8032621698],
      [1.19e-9, 2.40626699328, 18635.9284545362],
      [1.15e-9, 0.23374479051, 418.9243989006],
      [1.13e-9, 2.7938757674, 6272.4391846416],
      [1.22e-9, 0.936940724, 24492.40611365159],
      [1.33e-9, 4.87155573413, 22345.2603761082],
      [1.13e-9, 3.80362889046, 6293.7125153412],
      [1.3e-9, 3.72996018683, 12573.2652469836],
      [1.07e-9, 3.40227152756, 21393.5419698576],
      [1.22e-9, 1.00385670948, 95143.1329209781],
      [1.4e-9, 1.094130757, 44809.6502008634],
      [1.12e-9, 6.05462382871, 433.7117378768],
      [1.23e-9, 4.55640196386, 239424.39025435288],
      [1.04e-9, 1.54931540602, 127.9515330346],
      [1.11e-9, 3.04186517428, 8982.810669309],
      [1.02e-9, 4.12448497391, 15664.03552270859],
      [1.07e-9, 4.67919356465, 77690.75950573849],
      [1.18e-9, 4.5232017012, 19004.6479494084],
      [1.07e-9, 5.71774478555, 77736.78343050249],
      [1.03e-9, 4.79332126649, 33794.5437235286],
      [1.43e-9, 1.81201813018, 4214.0690150848],
      [1.02e-9, 3.7581778657, 58864.5439181463],
      [1.25e-9, 1.14419195615, 625.6701923124],
      [1.24e-9, 3.27736513892, 12566.08438968],
      [1.1e-9, 1.08705709966, 2787.0430238574],
      [1.02e-9, 4.75119578149, 12242.6462833254],
      [1.01e-9, 4.91289409429, 401.6721217572],
      [1.38e-9, 2.89578979744, 9411.4646150872],
      [1.29e-9, 1.23516042371, 12029.3471878874],
      [1.38e-9, 2.45654707076, 7576.560073574],
      [9.8e-10, 5.4477176502, 29026.48522950779],
      [1.34e-9, 1.43105174912, 86464.6133168312],
      [1.08e-9, 0.9898977494, 5636.0650166766],
      [1.17e-9, 5.17362847134, 34520.3093093808],
      [9.7e-10, 3.34717130592, 16310.9790457206],
      [1.07e-9, 2.94547931851, 24602.61243487099],
      [9.8e-10, 4.37041908717, 34513.2630726828],
      [1.25e-9, 2.72182830814, 24065.80792277559],
      [1.11e-9, 0.58899131543, 6303.4311693902],
      [1.02e-9, 0.66938025772, 10239.5838660108],
      [1.19e-9, 1.21666517886, 1478.8665740644],
      [1.11e-9, 1.04321934681, 16522.6597160022],
      [9.4e-10, 4.31076339857, 26880.3198130326],
      [9.8e-10, 4.14248433763, 6599.467719648],
      [9.5e-10, 2.89807657534, 34911.412076091],
      [9.7e-10, 0.89642320201, 71980.63357473118],
      [9.5e-10, 0.65717727948, 6288.5987742988],
      [1.16e-9, 4.19967201116, 206.7007372966],
      [9.5e-10, 1.78315464297, 18139.2945014159],
      [9.9e-10, 1.37437847718, 1039.0266107904],
      [1.26e-9, 3.21642544972, 305281.9430710488],
      [9.4e-10, 0.6899503186, 7834.1210726394],
      [9.5e-10, 5.58111421744, 3104.9300594238],
      [1.08e-9, 0.52696637156, 276.7457718644],
      [1.24e-9, 3.43899862683, 172146.9713405403],
      [8.7e-10, 1.18764938806, 18842.11400297339],
      [8.7e-10, 0.09094166389, 15141.390794312],
      [1.08e-9, 1.03363414379, 82576.9812209953],
      [1.19e-9, 2.86729109648, 90394.82301305079],
      [1.04e-9, 3.39218586218, 290.972865866],
      [9.4e-10, 5.68284937444, 32367.0976562076],
      [1.17e-9, 0.78475956902, 83286.91426955358],
      [1.05e-9, 3.96551057233, 6357.8574485587],
      [9.4e-10, 4.03443174853, 13341.6743113068],
      [9.6e-10, 0.92742567538, 1062.9050485382],
      [8.9e-10, 4.45371820659, 792.7748884674],
      [8.7e-10, 0.40013481685, 90279.92316810328],
      [1.13e-9, 2.48165313368, 48739.859897083],
      [8.7e-10, 3.43122851097, 27707.5424942948],
      [1.01e-9, 5.32081603011, 2301.58581590939],
      [8.4e-10, 0.67020912458, 28628.3362260996],
      [8.2e-10, 0.87060089842, 10241.2022911672],
      [8.6e-10, 4.6206479229, 36147.4098773004],
      [8e-10, 4.77649625396, 6819.8803620868],
      [9.5e-10, 2.87032913492, 23020.65308658799],
      [1.07e-9, 5.77864921649, 34115.1140692746],
      [1.1e-9, 3.32898859416, 72140.6286666874],
      [8.7e-10, 4.40657711727, 142.1786270362],
      [1.03e-9, 4.2250672681, 30666.1549584328],
      [8.2e-10, 3.89404392552, 5547.1993364596],
      [1.09e-9, 1.94546065204, 24279.10701821359],
      [8.7e-10, 4.32472045435, 742.9900605326],
      [1.07e-9, 4.91580912547, 277.0349937414],
      [8.8e-10, 2.10180817713, 26482.1708096244],
      [8.6e-10, 4.01895021483, 12491.3701014155],
      [1.06e-9, 5.49092372854, 62883.3551395136],
      [8e-10, 6.1978570495, 6709.6740408674],
      [1.05e-9, 2.44166529175, 6298.3283211764],
      [8.3e-10, 4.90662164029, 51.28033786241],
      [7.4e-10, 2.34622575625, 7018.9523635232],
      [7.8e-10, 6.06947270265, 148434.53403769128],
      [7.9e-10, 3.03048221644, 838.9692877504],
      [7.3e-10, 3.05008665738, 567.7186377304],
      [1.02e-9, 3.59223815483, 22380.755800274],
      [8.4e-10, 0.46604373274, 45.1412196366],
      [9.2e-10, 4.12917744733, 18216.443810661],
      [9.1e-10, 0.49382398887, 6453.7487206106],
      [7.3e-10, 1.72446569088, 21424.4666443034],
      [6.9e-10, 1.4937267773, 21548.9623692918],
      [6.9e-10, 4.73181018058, 8858.3149443206],
      [7.7e-10, 0.47683782532, 11520.9968637952],
      [7.8e-10, 5.4394263099, 15265.8865193004],
      [7.7e-10, 2.53773750372, 76.2660712756],
      [6.9e-10, 2.53932635192, 9910.583327509],
      [7.5e-10, 0.1559472921, 23006.42599258639],
      [7.8e-10, 2.41004950269, 6393.2821712108],
      [6.7e-10, 5.05152846816, 57375.8019008462],
      [7.7e-10, 3.9107560486, 24383.0791084414],
      [6.7e-10, 0.78239147387, 12779.4507954208],
      [7.1e-10, 1.24817900687, 10419.9862835076],
      [6.7e-10, 5.7785122776, 6311.5250374592],
      [6.1e-10, 2.66705754411, 18852.7506683232],
      [7.9e-10, 1.89137330427, 6528.9074962208],
      [8.4e-10, 5.11523704221, 50317.2034395308],
      [5.9e-10, 3.38290426621, 35707.7100829074],
      [6.5e-10, 4.66767908854, 26709.6469424134],
      [7.9e-10, 5.59773848156, 71960.38658322369],
      [6.1e-10, 3.30733768968, 18845.7044316252],
      [5.7e-10, 3.90831298022, 5999.2165311262],
      [5.8e-10, 3.92572820333, 30348.883772767],
      [6.1e-10, 0.05695045822, 7856.89627409019],
      [6.1e-10, 5.63297960691, 7863.9425107882],
      [6.8e-10, 2.53986117507, 20452.8694122218],
      [5.3e-10, 5.44021645443, 32370.9789915656],
      [5.9e-10, 4.95695131145, 11925.2740926006],
      [5.9e-10, 5.34668243273, 137288.2484348251],
      [5.6e-10, 4.05779957425, 17892.93839400359],
      [5.3e-10, 3.94182462468, 18624.8827542723],
      [4.9e-10, 2.11782803206, 22594.05489571199],
      [6.2e-10, 2.47154086715, 12345.739057544],
      [4.9e-10, 5.7659693738, 18606.4989460002],
      [5.2e-10, 6.20902099741, 21947.1113727],
      [5.1e-10, 3.13287981215, 33326.5787331742],
      [5.7e-10, 6.17003357597, 61306.0115970658],
      [6.4e-10, 5.66596451842, 34596.3646546524],
      [6.6e-10, 3.922623355, 69853.3520756813],
      [5.3e-10, 5.51119362049, 77710.24834977149],
      [5.3e-10, 4.88573986965, 77717.29458646949],
      [4.8e-10, 2.71399112516, 20760.4270331914],
      [4.6e-10, 6.08376164442, 29822.7832363242],
      [5.2e-10, 0.3139748138, 37724.7534197482],
      [4.5e-10, 5.53587248663, 6262.7205305926],
      [5.9e-10, 2.45437896854, 69166.430989505],
      [6e-10, 5.24261569842, 56600.2792895222],
      [5.1e-10, 6.15794342172, 11616.976091013],
      [6e-10, 1.74758109828, 44034.1275895394],
      [4.9e-10, 5.08973141046, 33990.6183442862],
      [4.4e-10, 3.28270864884, 29424.634232916],
      [5.2e-10, 5.34866947943, 28313.288804661],
      [5.9e-10, 2.12384971916, 36173.7081971002],
      [5e-10, 0.46480931695, 25287.7237993998],
      [4.4e-10, 2.0550351721, 63658.8777508376],
      [4.4e-10, 1.71009200258, 13362.4497067992],
      [4.1e-10, 3.91721318316, 6279.1945146334],
      [4.2e-10, 1.52106001448, 23550.34405168259],
      [4.2e-10, 3.10938258068, 84672.47584450469],
      [4.1e-10, 3.78863023321, 35050.00027447539],
      [4.2e-10, 5.57543459263, 38500.2760310722],
      [4e-10, 5.55145719363, 12565.1713789146],
      [5.4e-10, 0.889354921, 50290.905119731],
      [5.5e-10, 2.50268487636, 77828.671313068],
      [5.4e-10, 4.16257918787, 22910.44676536859],
      [4.1e-10, 2.32141215064, 6286.9571853494],
      [4.5e-10, 3.18590576311, 45585.1728121874],
      [4.5e-10, 2.24348941683, 23646.32327890039],
      [4.3e-10, 3.8789211095, 6549.6828917132],
      [4.8e-10, 2.11364139445, 31570.7996493912],
      [4.3e-10, 5.55099558987, 12359.9661515456],
      [4.1e-10, 4.88191569433, 23536.11695768099],
      [4.9e-10, 2.44790922235, 13613.804277336],
      [4.7e-10, 3.5818169391, 4797.0957289262]
    ],
    "1": [
      [6283.0758499914, 0, 0],
      [0.00206058863, 2.67823455808, 6283.0758499914],
      [0.00004303419, 2.63512233481, 12566.1516999828],
      [0.00000425264, 1.59046982018, 3.523118349],
      [0.00000109017, 2.96631010675, 1577.3435424478],
      [9.3479e-7, 2.59211109542, 18849.2275499742],
      [0.00000119305, 5.79555765566, 26.2983197998],
      [7.2121e-7, 1.13840581212, 529.6909650946],
      [6.7784e-7, 1.87453300345, 398.1490034082],
      [6.735e-7, 4.40932832004, 5507.5532386674],
      [5.9045e-7, 2.88815790631, 5223.6939198022],
      [5.5976e-7, 2.17471740035, 155.4203994342],
      [4.5411e-7, 0.39799502896, 796.2980068164],
      [3.6298e-7, 0.46875437227, 775.522611324],
      [2.8962e-7, 2.64732254645, 7.1135470008],
      [1.9097e-7, 1.84628376049, 5486.777843175],
      [2.0844e-7, 5.34138275149, 0.9803210682],
      [1.8508e-7, 4.96855179468, 213.299095438],
      [1.6233e-7, 0.03216587315, 2544.3144198834],
      [1.7293e-7, 2.9911676063, 6275.9623029906],
      [1.5832e-7, 1.43049301283, 2146.1654164752],
      [1.4608e-7, 1.2046979369, 10977.078804699],
      [1.1877e-7, 3.25805082007, 5088.6288397668],
      [1.1514e-7, 2.07502080082, 4694.0029547076],
      [9.721e-8, 4.2392586526, 1349.8674096588],
      [9.969e-8, 1.30263423409, 6286.5989683404],
      [9.452e-8, 2.69956827011, 242.728603974],
      [1.2461e-7, 2.83432282119, 1748.016413067],
      [1.1808e-7, 5.27379760438, 1194.4470102246],
      [8.577e-8, 5.6447608598, 951.7184062506],
      [1.0641e-7, 0.76614722966, 553.5694028424],
      [7.576e-8, 5.30056172859, 2352.8661537718],
      [5.764e-8, 1.77228445837, 1059.3819301892],
      [6.385e-8, 2.65034514038, 9437.762934887],
      [5.223e-8, 5.66135782131, 71430.69561812909],
      [5.315e-8, 0.91110018969, 3154.6870848956],
      [6.101e-8, 4.66633726278, 4690.4798363586],
      [4.335e-8, 0.23934560382, 6812.766815086],
      [5.041e-8, 1.42489704722, 6438.4962494256],
      [4.259e-8, 0.77355543889, 10447.3878396044],
      [5.2e-8, 1.85528830215, 801.8209311238],
      [3.744e-8, 2.00119905572, 8031.0922630584],
      [3.553e-8, 2.42789590229, 14143.4952424306],
      [3.372e-8, 3.86210786421, 1592.5960136328],
      [3.38e-8, 0.88545388924, 12036.4607348882],
      [3.196e-8, 3.19713328141, 4705.7323075436],
      [3.221e-8, 0.6160104899, 8429.2412664666],
      [4.132e-8, 5.23992584671, 7084.8967811152],
      [2.97e-8, 6.07029819073, 4292.3308329504],
      [2.9e-8, 2.32464208411, 20.3553193988],
      [3.504e-8, 4.79976712702, 6279.5527316424],
      [2.95e-8, 1.43108874817, 5746.271337896],
      [2.697e-8, 4.80365209201, 7234.794256242],
      [2.531e-8, 6.22289990904, 6836.6452528338],
      [2.745e-8, 0.93466065396, 5760.4984318976],
      [3.25e-8, 3.39951915286, 7632.9432596502],
      [2.278e-8, 5.00339914806, 17789.845619785],
      [2.076e-8, 3.95551309007, 10213.285546211],
      [2.061e-8, 2.2240771919, 5856.4776591154],
      [2.252e-8, 5.67166717686, 11499.6562227928],
      [2.148e-8, 5.20182663314, 11513.8833167944],
      [1.886e-8, 0.53198539077, 3340.6124266998],
      [1.875e-8, 4.73511969924, 83996.84731811189],
      [2.06e-8, 2.54985307819, 25132.3033999656],
      [1.794e-8, 1.47435300254, 4164.311989613],
      [1.778e-8, 3.02473091781, 5.5229243074],
      [2.036e-8, 0.90908165072, 6256.7775301916],
      [2.064e-8, 2.27051326957, 522.5774180938],
      [1.773e-8, 3.03090500693, 5753.3848848968],
      [1.569e-8, 6.12406216872, 5216.5803728014],
      [1.59e-8, 4.63713748247, 3.2863574178],
      [1.533e-8, 4.20305593883, 13367.9726311066],
      [1.427e-8, 1.19087535126, 3894.1818295422],
      [1.376e-8, 4.24955891338, 426.598190876],
      [1.375e-8, 3.09301252193, 135.0650800354],
      [1.308e-8, 3.0849213889, 5643.1785636774],
      [1.34e-8, 5.76513167968, 6040.3472460174],
      [1.25e-8, 3.07748196332, 11926.2544136688],
      [1.551e-8, 3.07664090662, 6681.2248533996],
      [1.148e-8, 3.24144202282, 12168.0026965746],
      [1.268e-8, 2.09201189992, 6290.1893969922],
      [1.248e-8, 3.44506939791, 536.8045120954],
      [1.118e-8, 2.31830078762, 16730.4636895958],
      [1.105e-8, 5.31966001019, 23.8784377478],
      [1.012e-8, 3.74953487087, 7860.4193924392],
      [1.025e-8, 2.4468377161, 1990.745017041],
      [9.62e-9, 0.81771017882, 3.881335358],
      [9.11e-9, 0.41724352112, 7079.3738568078],
      [1.091e-8, 3.98233608618, 11506.7697697936],
      [9.57e-9, 4.07671436153, 6127.6554505572],
      [8.35e-9, 5.28348689371, 11790.6290886588],
      [8.02e-9, 3.88779080089, 10973.55568635],
      [7.73e-9, 2.41044394817, 1589.0728952838],
      [7.58e-9, 1.30034365873, 103.0927742186],
      [7.49e-9, 4.96281442361, 6496.3749454294],
      [7.65e-9, 3.36312388424, 36.0278666774],
      [9.15e-9, 5.41549763095, 206.1855484372],
      [7.76e-9, 2.57589060224, 11371.7046897582],
      [7.72e-9, 3.98363364977, 955.5997416086],
      [7.49e-9, 5.17900231417, 10969.9652576982],
      [8.06e-9, 0.34226117299, 9917.6968745098],
      [7.28e-9, 5.20962563787, 38.0276726358],
      [6.85e-9, 2.77592961854, 20.7753954924],
      [6.36e-9, 4.28242193632, 28.4491874678],
      [6.08e-9, 5.63278510221, 10984.1923516998],
      [7.04e-9, 5.60739437733, 3738.761430108],
      [6.85e-9, 0.38876148682, 15.252471185],
      [6.01e-9, 0.73489602442, 419.4846438752],
      [7.16e-9, 2.65286869987, 6309.3741697912],
      [5.84e-9, 5.54508741381, 17298.1823273262],
      [6.28e-9, 1.11733054796, 7058.5984613154],
      [6.88e-9, 2.59684132401, 3496.032826134],
      [4.85e-9, 0.44470714066, 12352.8526045448],
      [5.62e-9, 2.82510352358, 3930.2096962196],
      [5.97e-9, 5.27675789973, 10575.4066829418],
      [5.83e-9, 3.1893153986, 4732.0306273434],
      [5.26e-9, 5.01737745304, 5884.9268465832],
      [5.4e-9, 1.29182747488, 640.8776073822],
      [4.81e-9, 5.49721461067, 5230.807466803],
      [4.06e-9, 5.21253018484, 220.4126424388],
      [3.95e-9, 1.87489912123, 16200.7727245012],
      [3.67e-9, 0.88533542945, 6283.14316029419],
      [3.69e-9, 3.84778078192, 18073.7049386502],
      [3.79e-9, 0.37991716505, 10177.2576795336],
      [3.56e-9, 3.84152910109, 11712.9553182308],
      [3.74e-9, 5.01577520608, 7.046236698],
      [3.81e-9, 4.30250406634, 6062.6632075526],
      [4.71e-9, 0.86388942467, 6069.7767545534],
      [3.67e-9, 1.3294383993, 6283.0085396886],
      [4.6e-9, 5.19667219582, 6284.0561710596],
      [3.33e-9, 5.54250425107, 4686.8894077068],
      [3.41e-9, 4.36524495363, 7238.6755916],
      [3.36e-9, 4.00205876835, 3097.88382272579],
      [3.59e-9, 6.22679790284, 245.8316462294],
      [3.07e-9, 2.35299010924, 170.6728706192],
      [3.43e-9, 3.77164927142, 6076.8903015542],
      [2.96e-9, 5.44138799494, 17260.1546546904],
      [3.28e-9, 0.13817705132, 11015.1064773348],
      [2.69e-9, 1.13308244952, 12569.6748183318],
      [2.63e-9, 0.0055073751, 4136.9104335162],
      [2.82e-9, 5.04399588559, 7477.522860216],
      [2.8e-9, 3.13703211405, 12559.038152982],
      [2.59e-9, 0.93882269388, 5642.1982426092],
      [2.92e-9, 1.98426314297, 12132.439962106],
      [2.47e-9, 3.84244798673, 5429.8794682394],
      [3.19e-9, 5.0417014879, 90617.7374312997],
      [2.45e-9, 5.70469737024, 65147.6197681377],
      [3.18e-9, 1.35581968834, 78051.5857313169],
      [2.41e-9, 0.99469787369, 3634.6210245184],
      [2.46e-9, 3.06168069393, 110.2063212194],
      [2.39e-9, 6.11854529589, 11856.2186514245],
      [2.67e-9, 0.65297608414, 21228.3920235458],
      [2.62e-9, 1.51070507866, 12146.6670561076],
      [2.3e-9, 1.75923794017, 9779.1086761254],
      [2.23e-9, 2.00967043606, 6172.869528772],
      [2.46e-9, 1.10411690861, 6282.0955289232],
      [2.14e-9, 4.03840492266, 14314.1681130498],
      [2.12e-9, 2.13695623228, 5849.3641121146],
      [2.07e-9, 3.07724246401, 11.729352836],
      [2.07e-9, 6.10303325026, 23543.23050468179],
      [2.66e-9, 1.00720021877, 2388.8940204492],
      [2.17e-9, 6.27840212312, 17267.26820169119],
      [2.31e-9, 5.37372783468, 13916.0191096416],
      [2.04e-9, 2.34615348695, 266.6070417218],
      [1.95e-9, 5.55015549753, 6133.5126528568],
      [2.03e-9, 4.65616806503, 24072.9214697764],
      [1.88e-9, 2.52682282169, 6525.8044539654],
      [1.77e-9, 1.73426919199, 154717.6098876827],
      [1.87e-9, 4.76501318048, 4535.0594369244],
      [1.86e-9, 4.63080493407, 10440.2742926036],
      [1.83e-9, 3.20060840641, 8635.9420037632],
      [1.72e-9, 1.45551703877, 9225.539273283],
      [1.62e-9, 3.30665137166, 639.897286314],
      [1.68e-9, 2.17671416605, 27.4015560968],
      [1.6e-9, 1.6816871275, 15110.4661198662],
      [1.94e-9, 2.79243768345, 7342.4577801806],
      [1.83e-9, 0.56273524797, 13517.8701062334],
      [1.72e-9, 5.97039514134, 4701.1165017084],
      [1.79e-9, 3.58450811616, 87.30820453981],
      [1.52e-9, 2.84070476839, 5650.2921106782],
      [1.56e-9, 1.07156076421, 18319.5365848796],
      [1.82e-9, 0.44053620124, 17253.04110768959],
      [1.42e-9, 1.4629013752, 11087.2851259184],
      [1.31e-9, 5.40912137746, 2699.7348193176],
      [1.44e-9, 2.07312089638, 25158.6017197654],
      [1.47e-9, 6.15107800602, 9623.6882766912],
      [1.41e-9, 5.55739979498, 10454.5013866052],
      [1.35e-9, 0.0609812943, 16723.350142595],
      [1.23e-9, 5.81194797368, 17256.6315363414],
      [1.24e-9, 2.36269386269, 4933.2084403326],
      [1.26e-9, 3.47483886466, 22483.84857449259],
      [1.59e-9, 5.63944722033, 5729.506447149],
      [1.37e-9, 1.93811728826, 20426.571092422],
      [1.23e-9, 3.92815962825, 17996.0311682222],
      [1.48e-9, 3.02542567608, 1551.045222648],
      [1.21e-9, 0.05537321071, 13095.8426650774],
      [1.2e-9, 5.91904349732, 6206.8097787158],
      [1.34e-9, 3.11122937825, 21954.15760939799],
      [1.19e-9, 5.52143897201, 709.9330485583],
      [1.22e-9, 3.00840036775, 19800.9459562248],
      [1.27e-9, 1.37534182407, 14945.3161735544],
      [1.41e-9, 2.56886299638, 1052.2683831884],
      [1.23e-9, 2.83671175442, 11919.140866668],
      [1.18e-9, 0.81918292547, 5331.3574437408],
      [1.51e-9, 2.68728567951, 11769.8536931664],
      [1.19e-9, 5.08654046247, 5481.2549188676],
      [1.13e-9, 4.42675663942, 18422.62935909819],
      [1.53e-9, 2.46021790779, 11933.3679606696],
      [1.08e-9, 1.04936452151, 11403.676995575],
      [1.28e-9, 0.99810456461, 8827.3902698748],
      [1.44e-9, 2.54869747042, 227.476132789],
      [1.5e-9, 4.50631437136, 2379.1644735716],
      [1.09e-9, 0.29269062317, 16737.5772365966],
      [1.22e-9, 4.23040027813, 29.429508536],
      [1.11e-9, 5.16970710025, 17782.7320727842],
      [1.05e-9, 1.61738153441, 13119.72110282519],
      [1e-9, 3.52204690579, 18052.9295431578],
      [1.08e-9, 1.08493117155, 16858.4825329332],
      [1.35e-9, 3.2016061697, 6262.300454499],
      [1.06e-9, 1.96085069786, 74.7815985673],
      [1.29e-9, 4.85949366504, 16496.3613962024],
      [1.1e-9, 2.30605777952, 16460.33352952499],
      [9.7e-10, 3.5091894021, 5333.9002410216],
      [9.9e-10, 3.56417337974, 735.8765135318],
      [9.6e-10, 3.40918487598, 15720.8387848784],
      [9.4e-10, 5.01601027363, 3128.3887650958],
      [9.7e-10, 1.65579893894, 533.2140834436],
      [9.2e-10, 0.89219199493, 29296.6153895786],
      [1.23e-9, 3.16062062663, 9380.9596727172],
      [1.02e-9, 1.20493500565, 23020.65308658799],
      [8.8e-10, 2.21265504437, 12721.572099417],
      [8.9e-10, 1.5432266957, 20199.094959633],
      [1.21e-9, 6.19860353182, 9388.0059094152],
      [8.9e-10, 4.08082274765, 22805.7355659936],
      [9.8e-10, 1.09176668094, 12043.574281889],
      [8.6e-10, 1.13649001466, 143571.32428481648],
      [8.8e-10, 5.96980472191, 107.6635239386],
      [8.2e-10, 5.01561173481, 22003.9146348698],
      [9.4e-10, 1.69615700473, 23006.42599258639],
      [8.1e-10, 3.00664741995, 2118.7638603784],
      [9.8e-10, 1.39215287161, 8662.240323563],
      [8e-10, 5.16340988714, 17796.9591667858],
      [8.2e-10, 5.86893959287, 2787.0430238574],
      [7.7e-10, 0.80723694712, 167283.7615876655],
      [9.1e-10, 5.74902425304, 21424.4666443034],
      [7.6e-10, 5.67183650604, 14.2270940016],
      [8.1e-10, 6.16619455699, 1039.0266107904],
      [7.6e-10, 3.21449884756, 111.1866422876],
      [7.8e-10, 1.37531518377, 21947.1113727],
      [7.4e-10, 3.58814195051, 11609.8625440122],
      [7.7e-10, 4.84846488388, 22743.4093795164],
      [9e-10, 1.48869013606, 15671.0817594066],
      [8.2e-10, 3.48618398216, 29088.811415985],
      [7.1e-10, 2.2159156119, 12029.3471878874],
      [6.9e-10, 1.93625656075, 135.62532501],
      [7e-10, 2.66552760898, 18875.525869774],
      [6.9e-10, 5.41478093731, 26735.9452622132],
      [7.9e-10, 5.15158156951, 12323.4230960088],
      [7.8e-10, 4.17014063638, 1066.49547719],
      [6.5e-10, 5.64584720343, 12139.5535091068],
      [7.1e-10, 3.89804774037, 22779.4372461938],
      [6.3e-10, 4.53968787714, 8982.810669309],
      [7.6e-10, 3.29088891716, 2942.4634232916],
      [6.9e-10, 0.94232113005, 14919.0178537546],
      [6.3e-10, 4.0918653549, 16062.1845261168],
      [6.5e-10, 3.34580407184, 51.28033786241],
      [6.5e-10, 5.75757544877, 52670.0695933026],
      [5.7e-10, 5.25050277534, 20995.3929664494],
      [6.1e-10, 1.92290673861, 6805.6532680852],
      [6.1e-10, 0.08878901558, 13362.4497067992],
      [7.6e-10, 1.86947679415, 25287.7237993998],
      [5.6e-10, 4.25396542622, 6709.6740408674],
      [5.8e-10, 4.79429715781, 6286.3622074092],
      [7.3e-10, 0.53299090807, 2301.58581590939],
      [7e-10, 4.31243357502, 19402.7969528166],
      [6.7e-10, 2.53852336668, 377.3736079158],
      [5.6e-10, 3.20816844695, 24889.5747959916],
      [5.4e-10, 5.17336469511, 26084.0218062162],
      [5.3e-10, 3.17675406016, 18451.07854656599],
      [5.3e-10, 3.61529270216, 77.673770428],
      [5.3e-10, 0.45467549335, 30666.1549584328],
      [5.3e-10, 2.97761644192, 21548.9623692918],
      [6.1e-10, 0.14805728543, 23013.5395395872],
      [5.1e-10, 3.32803972907, 56.8983749356],
      [5.2e-10, 3.41304011355, 23141.5583829246],
      [5.8e-10, 3.13638677202, 309.2783226558],
      [5.4e-10, 1.60896548545, 13341.6743113068],
      [5.3e-10, 5.81426394852, 16193.65917750039],
      [6.7e-10, 6.27917920454, 22345.2603761082],
      [5e-10, 0.42577644151, 25685.872802808],
      [4.8e-10, 0.70204553352, 1162.4747044078],
      [6.6e-10, 3.64350022359, 15265.8865193004],
      [5e-10, 5.7438291744, 19.66976089979],
      [5.4e-10, 1.97277370837, 23581.2581773176],
      [5.1e-10, 1.23713196525, 12539.853380183],
      [4.6e-10, 5.41431704639, 33019.0211122046],
      [4.6e-10, 4.80640843261, 19651.048481098],
      [5e-10, 1.23847511223, 22476.73502749179],
      [5.1e-10, 4.91913434178, 12592.4500197826],
      [4.6e-10, 2.41369976086, 98068.53671630539],
      [4.5e-10, 3.45227074337, 30774.5016425748],
      [4.5e-10, 4.39659083856, 433.7117378768],
      [4.5e-10, 3.71921056816, 18209.33026366019],
      [4.4e-10, 2.47683925106, 24356.7807886416],
      [4.9e-10, 2.17835058609, 13521.7514415914],
      [4.6e-10, 0.26142733448, 11.0457002639],
      [4.5e-10, 2.46230645202, 51868.2486621788],
      [4.3e-10, 4.29458463014, 28230.18722269139],
      [4.8e-10, 0.89551707131, 56600.2792895222],
      [4.2e-10, 3.63410684699, 4590.910180489],
      [4.9e-10, 3.17757670967, 6303.8512454838],
      [4.3e-10, 4.93350349236, 10021.8372800994],
      [5.2e-10, 3.65410195699, 7872.1487452752],
      [4.1e-10, 4.82166756935, 10988.808157535],
      [4e-10, 1.81891629936, 34596.3646546524],
      [4.3e-10, 1.94164978061, 1903.4368125012],
      [4.1e-10, 0.74461854136, 23937.856389741],
      [4.5e-10, 5.4557501753, 60530.4889857418],
      [5e-10, 5.67355640472, 18216.443810661],
      [4e-10, 0.04502010161, 38526.574350872],
      [5.3e-10, 3.64807615995, 11925.2740926006],
      [4.2e-10, 5.19292937193, 19004.6479494084],
      [4.1e-10, 0.94309683296, 9924.8104215106],
      [3.9e-10, 4.61184303844, 95.9792272178],
      [4.9e-10, 2.05532526216, 12573.2652469836],
      [4.5e-10, 3.73717824543, 7875.6718636242],
      [4.3e-10, 1.14078465002, 49.7570254718],
      [3.9e-10, 1.70539366023, 32217.2001810808],
      [3.7e-10, 1.29390383811, 310.8407988684],
      [3.8e-10, 0.9597092595, 664.75604513],
      [3.9e-10, 0.85957361635, 16522.6597160022],
      [4e-10, 1.00170796001, 36949.2308084242],
      [4e-10, 3.78164718776, 55798.4583583984],
      [3.7e-10, 5.42237070904, 6286.6662786432],
      [3.6e-10, 1.68167662194, 10344.2950653858],
      [4e-10, 5.13217319067, 15664.03552270859],
      [4.9e-10, 3.62741283878, 77713.7714681205],
      [4.5e-10, 6.15877872538, 28286.9904848612],
      [3.6e-10, 3.32158458257, 16207.886271502],
      [3.5e-10, 5.83917764292, 6321.1035226272],
      [3.6e-10, 1.80784164083, 6279.7894925736],
      [3.5e-10, 4.60279245362, 28237.2334593894],
      [3.3e-10, 0.47301775923, 18635.9284545362],
      [3.5e-10, 4.36571027474, 48739.859897083],
      [3.1e-10, 3.06828028412, 6819.8803620868],
      [3.1e-10, 2.4020319848, 28628.3362260996],
      [3.4e-10, 1.90096411242, 12964.300703391],
      [2.9e-10, 6.09291010354, 18606.4989460002],
      [2.8e-10, 3.42046112698, 6288.5987742988],
      [2.8e-10, 3.437361406, 34115.1140692746],
      [2.9e-10, 1.48920816078, 6489.2613984286],
      [2.8e-10, 3.07474749886, 29822.7832363242],
      [3.8e-10, 2.44608264663, 31415.379249957],
      [2.8e-10, 2.98392582088, 6277.552925684],
      [2.7e-10, 5.03556015623, 12779.4507954208],
      [2.7e-10, 5.40812977287, 26087.9031415742],
      [3.8e-10, 5.56439937893, 27832.0382192832],
      [2.6e-10, 3.87685883153, 6262.7205305926],
      [2.7e-10, 6.1556539284, 28759.81087748319],
      [2.5e-10, 5.17122153205, 6915.8595893046],
      [2.7e-10, 4.03132006944, 9910.583327509],
      [3.3e-10, 3.97763407373, 12410.7313005486],
      [2.4e-10, 5.31307120044, 29026.48522950779],
      [2.5e-10, 0.81055213297, 36173.7081971002],
      [2.4e-10, 1.2870610131, 24491.4257925834],
      [2.1e-10, 2.02548478742, 28766.924424484],
      [2.1e-10, 6.07545114034, 18139.2945014159],
      [2.2e-10, 2.31199937131, 6303.4311693902],
      [2.3e-10, 1.35235057478, 49515.382508407],
      [2.3e-10, 2.92765926961, 65236.2212932854],
      [1.9e-10, 0.03636659763, 29864.334027309],
      [2e-10, 0.91374066194, 45585.1728121874],
      [2.1e-10, 4.45003013294, 22490.9621214934],
      [2.2e-10, 1.97119365888, 34513.2630726828],
      [2e-10, 4.11682669951, 17157.0618804718],
      [2.4e-10, 1.40243942415, 14712.317116458],
      [2.2e-10, 2.19759737115, 31570.7996493912],
      [2.1e-10, 1.48739821208, 61306.0115970658],
      [2.5e-10, 5.71465573409, 25934.1243310894]
    ],
    "2": [
      [0.00008721859, 1.07253635559, 6283.0758499914],
      [0.0000099099, 3.14159265359, 0],
      [0.00000294833, 0.43717350256, 12566.1516999828],
      [2.7338e-7, 0.05295636147, 3.523118349],
      [1.6333e-7, 5.18820215724, 26.2983197998],
      [1.5745e-7, 3.68504712183, 155.4203994342],
      [9.425e-8, 0.29667114694, 18849.2275499742],
      [8.938e-8, 2.05706319592, 77713.7714681205],
      [6.94e-8, 0.82691541038, 775.522611324],
      [5.061e-8, 4.6624323168, 1577.3435424478],
      [4.06e-8, 1.03067032318, 7.1135470008],
      [3.464e-8, 5.14021224609, 796.2980068164],
      [3.172e-8, 6.05479318507, 5507.5532386674],
      [3.02e-8, 1.19240008524, 242.728603974],
      [2.885e-8, 6.11705865396, 529.6909650946],
      [3.809e-8, 3.44043369494, 5573.1428014331],
      [2.719e-8, 0.30363248164, 398.1490034082],
      [2.365e-8, 4.37666117992, 5223.6939198022],
      [2.538e-8, 2.27966434314, 553.5694028424],
      [2.078e-8, 3.75435095487, 0.9803210682],
      [1.675e-8, 0.90149951436, 951.7184062506],
      [1.534e-8, 5.75895831192, 1349.8674096588],
      [1.224e-8, 2.97285792195, 2146.1654164752],
      [1.449e-8, 4.36401639552, 1748.016413067],
      [1.341e-8, 3.72019379666, 1194.4470102246],
      [1.253e-8, 2.9488872631, 6438.4962494256],
      [9.99e-9, 5.98665341008, 6286.5989683404],
      [9.17e-9, 4.79722195184, 5088.6288397668],
      [8.29e-9, 3.31021398862, 213.299095438],
      [1.102e-8, 1.27094359244, 161000.6857376741],
      [7.64e-9, 3.41231607038, 5486.777843175],
      [1.046e-8, 0.60374190029, 3154.6870848956],
      [8.87e-9, 5.23364022595, 7084.8967811152],
      [6.44e-9, 1.59974355582, 2544.3144198834],
      [6.81e-9, 3.42742947469, 4694.0029547076],
      [6.06e-9, 2.47688996663, 10977.078804699],
      [7.06e-9, 6.19369692903, 4690.4798363586],
      [6.43e-9, 1.98119869589, 801.8209311238],
      [5.02e-9, 1.44415463861, 6836.6452528338],
      [4.9e-9, 2.33889753806, 1592.5960136328],
      [4.58e-9, 1.30867922972, 4292.3308329504],
      [4.31e-9, 0.03542536476, 7234.794256242],
      [3.49e-9, 0.98779272263, 6040.3472460174],
      [3.85e-9, 1.57065592218, 71430.69561812909],
      [3.71e-9, 3.16149051601, 6309.3741697912],
      [3.48e-9, 0.64980950594, 1059.3819301892],
      [4.58e-9, 3.81505682017, 149854.4001348079],
      [3.02e-9, 1.91723873447, 10447.3878396044],
      [3.06e-9, 3.55405857884, 8031.0922630584],
      [3.95e-9, 4.93742673052, 7632.9432596502],
      [3.14e-9, 3.18058352846, 2352.8661537718],
      [2.81e-9, 4.41751404023, 9437.762934887],
      [2.76e-9, 2.71075791682, 3894.1818295422],
      [2.98e-9, 2.52045757001, 6127.6554505572],
      [2.72e-9, 0.24370191144, 25132.3033999656],
      [2.51e-9, 0.55449375765, 6279.5527316424],
      [2.24e-9, 1.40790249012, 4705.7323075436],
      [2.58e-9, 5.29510765044, 6812.766815086],
      [1.78e-9, 0.92636669742, 1990.745017041],
      [2.17e-9, 0.68543630022, 6256.7775301916],
      [1.54e-9, 0.77808632062, 14143.4952424306],
      [1.5e-9, 2.40636982736, 426.598190876],
      [1.96e-9, 6.06877865012, 640.8776073822],
      [1.37e-9, 2.21947617717, 8429.2412664666],
      [1.27e-9, 5.47380312768, 12036.4607348882],
      [1.21e-9, 3.32740512021, 17789.845619785],
      [1.23e-9, 2.16004509785, 10213.285546211],
      [1.16e-9, 0.49705139709, 7058.5984613154],
      [1.38e-9, 2.36181661472, 11506.7697697936],
      [1.01e-9, 0.86299995919, 6290.1893969922],
      [1.18e-9, 5.82317768355, 7860.4193924392],
      [9.2e-10, 5.11639978593, 7079.3738568078],
      [1.25e-9, 2.65424538513, 88860.05707098669],
      [8.8e-10, 4.3118823616, 83996.84731811189],
      [8.4e-10, 3.57682769713, 16730.4636895958],
      [9.7e-10, 5.58011309774, 13367.9726311066],
      [1.02e-9, 2.05853060226, 87.30820453981],
      [8e-10, 4.73827128421, 11926.2544136688],
      [8e-10, 5.41344057121, 10973.55568635],
      [1.06e-9, 4.10978997399, 3496.032826134],
      [7.5e-10, 4.89166898876, 5643.1785636774],
      [1e-9, 3.62645659087, 244287.60000722768],
      [9.6e-10, 1.39443577787, 6681.2248533996],
      [6.9e-10, 1.88399189965, 10177.2576795336],
      [8.7e-10, 0.40842153208, 11015.1064773348],
      [6.6e-10, 0.99444831932, 6525.8044539654],
      [6.6e-10, 1.42471816453, 9917.6968745098],
      [6.7e-10, 5.5124099707, 3097.88382272579],
      [7.6e-10, 2.7156469351, 4164.311989613],
      [8.5e-10, 0.4965552367, 10575.4066829418],
      [7.7e-10, 3.51693861509, 11856.2186514245],
      [6.2e-10, 3.6258762869, 16496.3613962024],
      [5.4e-10, 5.25957420065, 3340.6124266998],
      [5.3e-10, 1.10902178415, 8635.9420037632],
      [4.9e-10, 5.65761054625, 20426.571092422],
      [6.4e-10, 5.79211164779, 2388.8940204492],
      [4.6e-10, 5.45092696155, 6275.9623029906],
      [5.7e-10, 4.97077155798, 14945.3161735544],
      [4.3e-10, 3.30685683359, 9779.1086761254],
      [4.2e-10, 1.61412785248, 12168.0026965746],
      [4.9e-10, 3.92715473768, 5729.506447149],
      [4.2e-10, 0.6348125893, 2699.7348193176],
      [5.6e-10, 4.34038639086, 90955.5516944961],
      [4e-10, 5.66871428338, 11712.9553182308],
      [3.9e-10, 3.10911294009, 16200.7727245012],
      [4e-10, 5.71338386146, 709.9330485583],
      [5.3e-10, 6.17067257683, 233141.3144043615],
      [3.7e-10, 0.32095173508, 24356.7807886416],
      [3.5e-10, 0.95557073457, 17298.1823273262],
      [3.5e-10, 0.64913397996, 25158.6017197654],
      [4.1e-10, 1.53850422484, 65147.6197681377],
      [3.5e-10, 0.77655626359, 13916.0191096416],
      [3.1e-10, 5.35897350775, 5331.3574437408],
      [3e-10, 4.48114682755, 23543.23050468179],
      [3.2e-10, 3.45976963453, 7477.522860216],
      [2.9e-10, 3.46648040769, 13119.72110282519],
      [3.8e-10, 2.90863974625, 12721.572099417],
      [2.9e-10, 3.13390968321, 4136.9104335162],
      [3.5e-10, 3.79717126309, 143571.32428481648],
      [2.7e-10, 0.95726093828, 12559.038152982],
      [2.6e-10, 4.9532687703, 5753.3848848968],
      [3.2e-10, 3.49943896928, 6284.0561710596],
      [2.6e-10, 4.59276256636, 5884.9268465832],
      [2.6e-10, 1.53958920253, 154717.6098876827],
      [2.3e-10, 4.88012908735, 13095.8426650774],
      [2.3e-10, 0.35935706511, 31415.379249957],
      [2.4e-10, 5.11515116629, 18319.5365848796],
      [2.1e-10, 5.73872879912, 12569.6748183318],
      [2.1e-10, 1.32901200081, 10988.808157535],
      [1.9e-10, 2.24263229491, 18073.7049386502],
      [1.9e-10, 3.14253175605, 6496.3749454294],
      [2.1e-10, 2.80122025076, 6282.0955289232],
      [2.3e-10, 0.14288760398, 6283.0085396886],
      [1.9e-10, 4.28209473754, 3930.2096962196],
      [1.6e-10, 0.25933207663, 11790.6290886588],
      [1.5e-10, 6.0962350124, 13517.8701062334],
      [2e-10, 5.06358906224, 6283.14316029419],
      [1.5e-10, 1.0768066315, 4933.2084403326],
      [1.9e-10, 5.74000581249, 3128.3887650958],
      [1.6e-10, 6.18924226747, 7342.4577801806],
      [1.3e-10, 1.69105044945, 4535.0594369244],
      [1.5e-10, 3.36968394452, 17260.1546546904],
      [1e-10, 3.78885035015, 22003.9146348698],
      [1.1e-10, 2.12851973876, 7875.6718636242]
    ],
    "3": [
      [0.00000289058, 5.84173149732, 6283.0758499914],
      [2.0712e-7, 6.0498393902, 12566.1516999828],
      [2.962e-8, 5.1956057957, 155.4203994342],
      [2.527e-8, 3.14159265359, 0],
      [1.288e-8, 4.7219761197, 3.523118349],
      [6.35e-9, 5.96904899168, 242.728603974],
      [5.7e-9, 5.54182903238, 18849.2275499742],
      [4.02e-9, 3.78606612895, 553.5694028424],
      [7.2e-10, 4.37131884946, 6286.5989683404],
      [6.7e-10, 0.91133898967, 6127.6554505572],
      [3.7e-10, 5.28611190997, 6438.4962494256],
      [2.1e-10, 2.94917211527, 6309.3741697912],
      [1.5e-10, 3.63037493932, 71430.69561812909],
      [1.1e-10, 4.83261533939, 25132.3033999656],
      [1.1e-10, 5.84259014283, 6525.8044539654],
      [1.2e-10, 3.82296977522, 7058.5984613154],
      [1.3e-10, 2.39991715131, 5729.506447149],
      [8e-11, 0.55390332094, 6040.3472460174],
      [8e-11, 1.46298993048, 11856.2186514245],
      [8e-11, 5.07535888338, 6256.7775301916],
      [6e-11, 2.88803526743, 5507.5532386674],
      [5e-11, 3.87019253131, 12036.4607348882],
      [5e-11, 2.70838853362, 83996.84731811189]
    ],
    "4": [
      [7.714e-8, 4.14117321449, 6283.0758499914],
      [1.016e-8, 3.27573644241, 12566.1516999828],
      [4.2e-9, 0.41892851415, 155.4203994342],
      [4.7e-10, 3.50591071186, 18849.2275499742],
      [4.1e-10, 3.14032562331, 3.523118349],
      [3.5e-10, 5.0111077, 5573.1428014331],
      [1e-10, 5.64816633449, 6127.6554505572],
      [1.3e-10, 0.48609240774, 77713.7714681205],
      [7e-11, 2.84139222289, 161000.6857376741],
      [4e-11, 3.6550904707, 25132.3033999656],
      [2e-11, 0.54880603487, 6438.4962494256]
    ],
    "5": [
      [1.72e-9, 2.74854172392, 6283.0758499914],
      [5e-10, 2.01352986713, 155.4203994342],
      [2.8e-10, 2.93369985477, 12566.1516999828],
      [5e-11, 1.93829214518, 18849.2275499742]
    ]
  },
  B: {
    "0": [
      [0.0000027962, 3.19870156017, 84334.66158130829],
      [0.00000101643, 5.42248619256, 5507.5532386674],
      [8.0445e-7, 3.88013204458, 5223.6939198022],
      [4.3806e-7, 3.70444689759, 2352.8661537718],
      [3.1933e-7, 4.00026369781, 1577.3435424478],
      [2.2724e-7, 3.9847383156, 1047.7473117547],
      [1.6392e-7, 3.56456119782, 5856.4776591154],
      [1.8141e-7, 4.98367470262, 6283.0758499914],
      [1.4443e-7, 3.70275614915, 9437.762934887],
      [1.4304e-7, 3.41117857526, 10213.285546211],
      [1.1246e-7, 4.82820690527, 14143.4952424306],
      [1.09e-7, 2.08574562329, 6812.766815086],
      [9.714e-8, 3.47303947751, 4694.0029547076],
      [1.0367e-7, 4.05663927945, 71092.88135493269],
      [8.775e-8, 4.44016515666, 5753.3848848968],
      [8.366e-8, 4.99251512183, 7084.8967811152],
      [6.921e-8, 4.32559054073, 6275.9623029906],
      [9.145e-8, 1.14182646613, 6620.8901131878],
      [7.194e-8, 3.60193205744, 529.6909650946],
      [7.698e-8, 5.55425745881, 167621.5758508619],
      [5.285e-8, 2.48446991536, 4705.7323075436],
      [5.208e-8, 6.24992674532, 18073.7049386502],
      [4.529e-8, 2.33827747356, 6309.3741697912],
      [5.579e-8, 4.41023653719, 7860.4193924392],
      [4.743e-8, 0.70995680136, 5884.9268465832],
      [4.301e-8, 1.10255777773, 6681.2248533996],
      [3.849e-8, 1.82229412532, 5486.777843175],
      [4.093e-8, 5.11700141197, 13367.9726311066],
      [3.681e-8, 0.43793170336, 3154.6870848956],
      [3.42e-8, 5.42034800952, 6069.7767545534],
      [3.617e-8, 6.04641937568, 3930.2096962196],
      [3.67e-8, 4.58210192227, 12194.0329146209],
      [2.918e-8, 1.95463881136, 10977.078804699],
      [2.797e-8, 5.61259274877, 11790.6290886588],
      [2.502e-8, 0.60499729368, 6496.3749454294],
      [2.319e-8, 5.01648216088, 1059.3819301892],
      [2.684e-8, 1.39470396487, 22003.9146348698],
      [2.428e-8, 3.24183056545, 78051.5857313169],
      [2.12e-8, 4.30691000285, 5643.1785636774],
      [2.257e-8, 3.15557225087, 90617.7374312997],
      [1.813e-8, 3.75574218286, 3340.6124266998],
      [2.226e-8, 2.79699346673, 12036.4607348882],
      [1.888e-8, 0.86991545944, 8635.9420037632],
      [1.517e-8, 1.9585205571, 398.1490034082],
      [1.581e-8, 3.19976230948, 5088.6288397668],
      [1.421e-8, 6.25530883828, 2544.3144198834],
      [1.595e-8, 0.25619915132, 17298.1823273262],
      [1.391e-8, 4.69964175574, 7058.5984613154],
      [1.478e-8, 2.81808207569, 25934.1243310894],
      [1.481e-8, 3.6582355461, 11506.7697697936],
      [1.693e-8, 4.95689385293, 156475.2902479957],
      [1.183e-8, 1.29343060777, 775.522611324],
      [1.114e-8, 2.37889311847, 3738.761430108],
      [9.94e-9, 4.30088900425, 9225.539273283],
      [9.24e-9, 3.06451026809, 4164.311989613],
      [8.67e-9, 0.55606931068, 8429.2412664666],
      [9.88e-9, 5.97286104208, 7079.3738568078],
      [8.24e-9, 1.50984806177, 10447.3878396044],
      [9.15e-9, 0.12635654605, 11015.1064773348],
      [7.42e-9, 1.99159139281, 26087.9031415742],
      [1.039e-8, 3.14159265359, 0],
      [8.5e-9, 4.24120016095, 29864.334027309],
      [7.55e-9, 2.89631873314, 4732.0306273434],
      [7.14e-9, 1.37548118605, 2146.1654164752],
      [7.08e-9, 1.91406542362, 8031.0922630584],
      [7.46e-9, 0.57893808622, 796.2980068164],
      [8.02e-9, 5.12339137235, 2942.4634232916],
      [7.51e-9, 1.67479850166, 21228.3920235458],
      [6.02e-9, 4.099765389, 64809.80550494129],
      [5.94e-9, 3.49580704849, 16496.3613962024],
      [5.92e-9, 4.59481504319, 4690.4798363586],
      [5.3e-9, 5.73979295194, 8827.3902698748],
      [5.03e-9, 5.66433137112, 33794.5437235286],
      [4.83e-9, 1.57106522322, 801.8209311238],
      [4.38e-9, 0.0670773372, 3128.3887650958],
      [4.23e-9, 2.86944596145, 12566.1516999828],
      [5.04e-9, 3.2620766916, 7632.9432596502],
      [5.52e-9, 1.02926440457, 239762.20451754928],
      [4.27e-9, 3.67434378208, 213.299095438],
      [4.04e-9, 1.4619329736, 15720.8387848784],
      [5.03e-9, 4.85802444134, 6290.1893969922],
      [4.17e-9, 0.81920713533, 5216.5803728014],
      [3.65e-9, 0.01002966145, 12168.0026965746],
      [3.63e-9, 1.28376436579, 6206.8097787158],
      [3.53e-9, 4.7005913311, 7234.794256242],
      [4.15e-9, 0.96862624176, 4136.9104335162],
      [3.87e-9, 3.09145061418, 25158.6017197654],
      [3.73e-9, 2.65119262808, 7342.4577801806],
      [3.61e-9, 2.97762937735, 9623.6882766912],
      [4.18e-9, 3.75759994446, 5230.807466803],
      [3.96e-9, 1.22507712354, 6438.4962494256],
      [3.22e-9, 1.21162178805, 8662.240323563],
      [2.84e-9, 5.64170320179, 1589.0728952838],
      [3.79e-9, 1.72248432756, 14945.3161735544],
      [3.2e-9, 3.94161159658, 7330.8231617461],
      [3.13e-9, 5.47602376451, 1194.4470102246],
      [2.92e-9, 1.38971327568, 11769.8536931664],
      [3.05e-9, 0.80429352049, 37724.7534197482],
      [2.57e-9, 5.81382810029, 426.598190876],
      [2.65e-9, 6.10358507671, 6836.6452528338],
      [2.5e-9, 4.56452895547, 7477.522860216],
      [2.66e-9, 2.62926282354, 7238.6755916],
      [2.63e-9, 6.22089501237, 6133.5126528568],
      [3.06e-9, 2.79682380532, 1748.016413067],
      [2.36e-9, 2.46093023707, 11371.7046897582],
      [3.16e-9, 1.62662805006, 250908.4901204155],
      [2.16e-9, 3.68721275185, 5849.3641121146],
      [2.3e-9, 0.36165162947, 5863.5912061162],
      [2.33e-9, 5.03509933618, 20426.571092422],
      [2e-9, 5.86073159059, 4535.0594369244],
      [2.77e-9, 4.65400292395, 82239.1669577989],
      [2.09e-9, 3.72323200803, 10973.55568635],
      [1.99e-9, 5.05186622555, 5429.8794682394],
      [2.56e-9, 2.40923279886, 19651.048481098],
      [2.1e-9, 4.50691909144, 29088.811415985],
      [1.81e-9, 6.00294783127, 4292.3308329504],
      [2.49e-9, 0.12900984422, 154379.7956244863],
      [2.09e-9, 3.87759458541, 17789.845619785],
      [2.25e-9, 3.18339652605, 18875.525869774],
      [1.91e-9, 4.53897489216, 18477.1087646123],
      [1.72e-9, 2.0969418273, 13095.8426650774],
      [1.82e-9, 3.16107943487, 16730.4636895958],
      [1.88e-9, 2.22746128596, 41654.9631159678],
      [1.64e-9, 5.18686274999, 5481.2549188676],
      [1.6e-9, 2.4929885502, 12592.4500197826],
      [1.55e-9, 1.59595438224, 10021.8372800994],
      [1.35e-9, 0.21349051305, 10988.808157535],
      [1.78e-9, 3.80375178044, 23581.2581773176],
      [1.23e-9, 1.66800739151, 15110.4661198662],
      [1.22e-9, 2.72678272224, 18849.2275499742],
      [1.26e-9, 1.17675512872, 14919.0178537546],
      [1.42e-9, 3.95053440992, 337.8142631964],
      [1.16e-9, 6.06340906212, 6709.6740408674],
      [1.37e-9, 3.52143246244, 12139.5535091068],
      [1.36e-9, 2.92179113491, 32217.2001810808],
      [1.1e-9, 3.51203379263, 18052.9295431578],
      [1.47e-9, 4.63371971408, 22805.7355659936],
      [1.08e-9, 5.45280815225, 7.1135470008],
      [1.48e-9, 0.65447253687, 95480.9471841745],
      [1.19e-9, 5.92110458985, 33019.0211122046],
      [1.1e-9, 5.34824206403, 639.897286314],
      [1.06e-9, 3.71081682614, 14314.1681130498],
      [1.39e-9, 6.17607198262, 24356.7807886416],
      [1.18e-9, 5.59738712949, 161338.5000008705],
      [1.17e-9, 3.6506527164, 45585.1728121874],
      [1.27e-9, 4.74596574209, 49515.382508407],
      [1.2e-9, 1.04211499785, 6915.8595893046],
      [1.2e-9, 5.60638811846, 5650.2921106782],
      [1.15e-9, 3.10668213303, 14712.317116458],
      [9.9e-10, 0.6901893993, 12779.4507954208],
      [9.7e-10, 1.07908724794, 9917.6968745098],
      [9.3e-10, 2.62295197146, 17260.1546546904],
      [9.9e-10, 4.45774681732, 4933.2084403326],
      [1.23e-9, 1.37488921994, 28286.9904848612],
      [1.21e-9, 5.19767249869, 27511.4678735372],
      [1.05e-9, 0.87192268229, 77375.95720492408],
      [8.7e-10, 3.9363781295, 17654.7805397496],
      [1.22e-9, 2.2395606868, 83997.09113559539],
      [8.7e-10, 4.18201600921, 22779.4372461938],
      [1.04e-9, 4.59580877285, 1349.8674096588],
      [1.02e-9, 2.83545248595, 12352.8526045448],
      [1.02e-9, 3.97386522171, 10818.1352869158],
      [1.01e-9, 4.32892825818, 36147.4098773004],
      [9.4e-10, 5.00001709338, 150192.2143980043],
      [7.7e-10, 3.971993693, 1592.5960136328],
      [1e-9, 6.07733097102, 26735.9452622132],
      [8.6e-10, 5.2602963825, 28313.288804661],
      [9.3e-10, 4.31900620254, 44809.6502008634],
      [7.6e-10, 6.22743405935, 13521.7514415914],
      [7.2e-10, 1.55820597747, 6256.7775301916],
      [8.2e-10, 4.95202664555, 10575.4066829418],
      [8.2e-10, 1.69647647075, 1990.745017041],
      [7.5e-10, 2.29836095644, 3634.6210245184],
      [7.5e-10, 2.66367876557, 16200.7727245012],
      [8.7e-10, 0.26630214764, 31441.6775697568],
      [7.7e-10, 2.25530952876, 5235.3285382367],
      [7.6e-10, 1.09869730334, 12903.9659631792],
      [5.8e-10, 4.28246137794, 12559.038152982],
      [6.4e-10, 5.51112829602, 173904.65170085328],
      [5.6e-10, 2.60133794851, 73188.3759784421],
      [5.5e-10, 5.81483150022, 143233.51002162008],
      [5.4e-10, 3.38482031504, 323049.11878710287],
      [3.9e-10, 3.28500401937, 71768.50988132549],
      [3.9e-10, 3.11239910096, 96900.81328129109]
    ],
    "1": [
      [0.00227777722, 3.4137662053, 6283.0758499914],
      [0.00003805678, 3.37063423795, 12566.1516999828],
      [0.00003619589, 0, 0],
      [7.1542e-7, 3.32777549735, 18849.2275499742],
      [7.655e-8, 1.79489607186, 5223.6939198022],
      [8.107e-8, 3.89190403643, 5507.5532386674],
      [6.456e-8, 5.1978942475, 2352.8661537718],
      [3.894e-8, 2.15568517178, 6279.5527316424],
      [3.892e-8, 1.53021064904, 6286.5989683404],
      [3.897e-8, 4.87293945629, 10213.285546211],
      [3.812e-8, 1.43523182316, 12036.4607348882],
      [3.577e-8, 2.32913869227, 83996.84731811189],
      [3.57e-8, 4.92637739003, 71430.69561812909],
      [3.494e-8, 2.20864641831, 529.6909650946],
      [2.421e-8, 6.22876183393, 7860.4193924392],
      [2.056e-8, 3.06747139741, 14143.4952424306],
      [1.399e-8, 0.50107877909, 6309.3741697912],
      [1.417e-8, 3.28454570977, 25132.3033999656],
      [1.544e-8, 1.82062047625, 5856.4776591154],
      [1.457e-8, 1.75339303307, 5884.9268465832],
      [1.497e-8, 2.19673914456, 9437.762934887],
      [1.549e-8, 5.73650061398, 17789.845619785],
      [1.277e-8, 3.9672171733, 4705.7323075436],
      [1.038e-8, 2.9481870117, 6256.7775301916],
      [1.018e-8, 2.24114547164, 6681.2248533996],
      [1.021e-8, 1.4679502613, 11790.6290886588],
      [9.16e-9, 3.72965830745, 1059.3819301892],
      [1.156e-8, 6.04591336669, 398.1490034082],
      [1.24e-8, 0.77195902957, 6812.766815086],
      [1.115e-8, 3.92255876225, 12168.0026965746],
      [9.08e-9, 1.78447918237, 3930.2096962196],
      [8.33e-9, 0.09941579828, 11506.7697697936],
      [7.9e-9, 2.45555993228, 775.522611324],
      [6.66e-9, 4.40761401665, 5753.3848848968],
      [5.2e-9, 1.60179602491, 4694.0029547076],
      [3.82e-9, 0.26754532042, 1577.3435424478],
      [4.05e-9, 1.97558286872, 6283.0085396886],
      [4.05e-9, 1.53147989887, 6283.14316029419],
      [3.88e-9, 2.59563818411, 7058.5984613154],
      [3.41e-9, 3.61275156842, 13367.9726311066],
      [2.8e-9, 4.63052251735, 796.2980068164],
      [2.76e-9, 0.43350778219, 7079.3738568078],
      [3.11e-9, 5.28219636656, 17260.1546546904],
      [2.75e-9, 5.27597553634, 11769.8536931664],
      [2.86e-9, 2.98639716345, 6275.9623029906],
      [2.51e-9, 2.81315684448, 6290.1893969922],
      [2.39e-9, 5.77837903893, 10977.078804699],
      [2.28e-9, 0.14375973844, 3738.761430108],
      [2.27e-9, 2.51020991853, 7084.8967811152],
      [2.11e-9, 4.7202946547, 6496.3749454294],
      [2.34e-9, 3.1153527401, 709.9330485583],
      [2.34e-9, 0.5707581762, 11856.2186514245],
      [2.37e-9, 2.38791907394, 213.299095438],
      [2.27e-9, 1.12059781634, 12352.8526045448],
      [1.69e-9, 3.20148089605, 5486.777843175],
      [1.59e-9, 3.14604135756, 8827.3902698748],
      [1.6e-9, 1.14784478002, 5643.1785636774],
      [1.44e-9, 5.23285657431, 78051.5857313169],
      [1.44e-9, 1.16454654602, 90617.7374312997],
      [1.44e-9, 3.81203756929, 6262.300454499],
      [1.43e-9, 5.97809021355, 6303.8512454838],
      [1.38e-9, 4.29829933273, 1589.0728952838],
      [1.61e-9, 3.03298851492, 20426.571092422],
      [1.65e-9, 5.09134896587, 17298.1823273262],
      [1.28e-9, 4.41590143012, 6127.6554505572],
      [1.58e-9, 2.00984506334, 5230.807466803],
      [1.3e-9, 1.44170683802, 12569.6748183318],
      [1.25e-9, 1.69950379498, 3128.3887650958],
      [1.52e-9, 4.96946111415, 65147.6197681377],
      [1.31e-9, 4.24961399629, 6282.0955289232],
      [1.31e-9, 5.54051222995, 6284.0561710596],
      [1.61e-9, 3.32421999691, 6283.3196674749],
      [1.23e-9, 2.93221463795, 15720.8387848784],
      [1.52e-9, 1.56488157456, 18319.5365848796],
      [1.14e-9, 1.89110005546, 18073.7049386502],
      [1.13e-9, 4.95214866677, 4136.9104335162],
      [1.11e-9, 4.79699611405, 8429.2412664666],
      [1.18e-9, 3.06184958762, 22003.9146348698],
      [1.28e-9, 2.09693027395, 12562.6285816338],
      [1.38e-9, 0.84648544836, 6069.7767545534],
      [1e-9, 0.41938790104, 5481.2549188676],
      [1.01e-9, 4.43791289246, 19651.048481098],
      [1.16e-9, 1.87002428935, 77713.7714681205],
      [9.5e-10, 0.68638183645, 3340.6124266998],
      [1.04e-9, 4.90822646457, 8635.9420037632],
      [1.14e-9, 0.36008214928, 23543.23050468179],
      [9.1e-10, 1.1761121931, 9225.539273283],
      [9.1e-10, 2.74682631104, 5216.5803728014],
      [8.6e-10, 3.09315282195, 1194.4470102246],
      [9.3e-10, 6.2764351319, 12559.038152982],
      [8.7e-10, 3.64926989547, 7.1135470008],
      [8.3e-10, 0.37008971174, 11371.7046897582],
      [9.8e-10, 4.68473306376, 167283.7615876655],
      [9.8e-10, 0.99865886857, 154717.6098876827],
      [8.6e-10, 4.41152307486, 25934.1243310894],
      [9.8e-10, 4.98209568932, 16496.3613962024],
      [8.5e-10, 2.35438163823, 3154.6870848956],
      [8.3e-10, 0.24859477658, 21228.3920235458],
      [7.6e-10, 5.46661600296, 29864.334027309],
      [6.9e-10, 3.22045334237, 801.8209311238],
      [6.8e-10, 2.19928242745, 37724.7534197482],
      [7e-10, 5.33711014698, 2544.3144198834],
      [5.5e-10, 5.37872238211, 11015.1064773348],
      [5.1e-10, 5.03600618727, 5863.5912061162],
      [5.9e-10, 3.54984809612, 4535.0594369244],
      [5.3e-10, 1.50812064137, 7342.4577801806],
      [4.4e-10, 1.33712241647, 4164.311989613],
      [5.5e-10, 5.38460045253, 7477.522860216],
      [4.9e-10, 5.61844340512, 24072.9214697764],
      [5.7e-10, 6.17973522898, 8031.0922630584],
      [5.2e-10, 4.24379064407, 5088.6288397668],
      [4.1e-10, 3.41960196246, 26087.9031415742],
      [5.2e-10, 1.68150981131, 25158.6017197654],
      [5.3e-10, 0.11041408311, 29088.811415985],
      [4.3e-10, 0.53354396923, 2146.1654164752],
      [5e-10, 0.60270799844, 33794.5437235286],
      [4.5e-10, 1.69577010458, 6702.5604938666],
      [3.7e-10, 6.09033460795, 64809.80550494129],
      [4.4e-10, 2.67993061247, 15110.4661198662],
      [4.7e-10, 3.62555676035, 41654.9631159678],
      [3.6e-10, 0.47219666269, 13095.8426650774],
      [3.5e-10, 5.99520523215, 23581.2581773176],
      [4.3e-10, 4.08726331262, 156137.47598479927],
      [4.3e-10, 5.17376496602, 18422.62935909819],
      [3.4e-10, 2.14460100274, 4933.2084403326],
      [3e-10, 4.12992793541, 426.598190876],
      [3.6e-10, 2.28596930002, 90279.92316810328],
      [3.2e-10, 0.81117747619, 26.2983197998],
      [2.8e-10, 4.07036560467, 14712.317116458],
      [2.5e-10, 1.92905243842, 1748.016413067],
      [2.4e-10, 5.06152880842, 16730.4636895958],
      [2.3e-10, 3.24047012195, 31415.379249957],
      [2.7e-10, 3.90672018305, 18451.07854656599],
      [2.1e-10, 3.51419811826, 10447.3878396044]
    ],
    "2": [
      [0.00009721424, 5.1519280992, 6283.0758499914],
      [0.00000233002, 3.14159265359, 0],
      [0.00000134188, 0.64406212977, 12566.1516999828],
      [6.504e-8, 1.07333397797, 18849.2275499742],
      [1.662e-8, 1.62746869551, 84334.66158130829],
      [6.35e-9, 3.51985338656, 6279.5527316424],
      [4.92e-9, 2.41382223971, 1047.7473117547],
      [3.07e-9, 6.10181422085, 5223.6939198022],
      [3.22e-9, 0.37660897389, 6286.5989683404],
      [3.26e-9, 2.35727931602, 5507.5532386674],
      [2.74e-9, 1.65307581765, 7860.4193924392],
      [2.28e-9, 1.14082932988, 25132.3033999656],
      [2.02e-9, 0.4983668253, 2352.8661537718],
      [2.01e-9, 0.155527656, 10213.285546211],
      [1.67e-9, 3.98005254015, 529.6909650946],
      [1.7e-9, 5.28668290523, 6256.7775301916],
      [1.66e-9, 3.04613930284, 12036.4607348882],
      [1.53e-9, 4.06779216239, 83996.84731811189],
      [1.5e-9, 3.18772213951, 71430.69561812909],
      [1.2e-9, 3.13558669517, 5884.9268465832],
      [1.23e-9, 4.17102530625, 6309.3741697912],
      [1e-9, 1.46356761368, 11506.7697697936],
      [1e-9, 3.00322421365, 11790.6290886588],
      [7.7e-10, 1.65643898948, 4705.7323075436],
      [6.8e-10, 6.03791904123, 6812.766815086],
      [7.5e-10, 4.85191600582, 14143.4952424306],
      [7.9e-10, 4.12628805658, 5753.3848848968],
      [6.4e-10, 2.7194416046, 6127.6554505572],
      [6.3e-10, 0.78655326011, 6438.4962494256],
      [7.5e-10, 0.84213523741, 167621.5758508619],
      [5.1e-10, 4.55059044701, 5486.777843175],
      [5e-10, 5.29314320585, 7079.3738568078],
      [4.5e-10, 0.33147576416, 775.522611324],
      [4.3e-10, 3.6179371164, 1577.3435424478],
      [5.7e-10, 6.15295833679, 12194.0329146209],
      [4.5e-10, 1.18274698508, 17789.845619785],
      [4.7e-10, 1.11643162773, 398.1490034082],
      [4.7e-10, 5.5298423843, 12168.0026965746],
      [4.2e-10, 2.6437530062, 10988.808157535],
      [3.7e-10, 0.31226891972, 6681.2248533996],
      [4.6e-10, 3.38617099014, 156475.2902479957],
      [3.3e-10, 1.26266496002, 6290.1893969922],
      [3.3e-10, 2.25067065498, 6275.9623029906],
      [2.7e-10, 1.72859626293, 1059.3819301892],
      [2.8e-10, 2.88681054153, 796.2980068164],
      [3e-10, 5.52021264181, 7058.5984613154],
      [2.1e-10, 6.22275008403, 6069.7767545534],
      [2.4e-10, 5.83690442827, 6282.0955289232],
      [2.4e-10, 3.95322179797, 6284.0561710596],
      [2.1e-10, 4.87022458966, 3738.761430108],
      [2.1e-10, 3.58048145762, 6496.3749454294],
      [2.2e-10, 1.97770318395, 7.1135470008],
      [1.9e-10, 3.4597988877, 4136.9104335162],
      [1.5e-10, 2.81379880771, 1589.0728952838],
      [1.5e-10, 1.61313151838, 1194.4470102246],
      [1.5e-10, 0.63083434831, 11769.8536931664],
      [1.9e-10, 0.28082047767, 17260.1546546904],
      [1.7e-10, 1.35165136146, 78051.5857313169],
      [1.5e-10, 2.3094159956, 11856.2186514245],
      [1.2e-10, 1.12997370513, 90617.7374312997],
      [1.2e-10, 0.00611601597, 18073.7049386502],
      [1.2e-10, 1.70058636365, 12559.038152982]
    ],
    "3": [
      [0.00000275993, 0.59480097092, 6283.0758499914],
      [1.7034e-7, 3.14159265359, 0],
      [3.617e-8, 0.11750575325, 12566.1516999828],
      [3.39e-9, 5.66087461682, 18849.2275499742],
      [5.6e-10, 5.02765554835, 6279.5527316424],
      [1.9e-10, 5.99007646261, 6256.7775301916],
      [1.8e-10, 3.80004734567, 6309.3741697912],
      [1.8e-10, 1.21049250774, 6127.6554505572],
      [1.8e-10, 2.29734567137, 6438.4962494256],
      [1.5e-10, 4.72881467263, 6286.5989683404],
      [1.2e-10, 0.41481671808, 83996.84731811189],
      [1.3e-10, 5.54637369296, 25132.3033999656],
      [1e-10, 2.91937214232, 71430.69561812909],
      [6e-11, 2.1417324121, 11856.2186514245]
    ],
    "4": [
      [5.745e-8, 2.26734029843, 6283.0758499914],
      [8.7e-9, 0, 0],
      [1.19e-9, 4.26807972611, 12566.1516999828],
      [1.7e-10, 4.0742262044, 18849.2275499742],
      [5e-11, 0.84308705203, 1047.7473117547],
      [5e-11, 0.05711572303, 84334.66158130829]
    ],
    "5": [
      [1.14e-9, 4.31455980099, 6283.0758499914],
      [2.4e-10, 0, 0]
    ]
  },
  R: {
    "0": [
      [1.00013988784, 0, 0],
      [0.01670699632, 3.09846350258, 6283.0758499914],
      [0.00013956024, 3.05524609456, 12566.1516999828],
      [0.0000308372, 5.19846674381, 77713.7714681205],
      [0.00001628463, 1.17387558054, 5753.3848848968],
      [0.00001575572, 2.84685214877, 7860.4193924392],
      [0.00000924799, 5.45292236722, 11506.7697697936],
      [0.00000542439, 4.56409151453, 3930.2096962196],
      [0.0000047211, 3.66100022149, 5884.9268465832],
      [0.0000032878, 5.89983686142, 5223.6939198022],
      [0.00000345969, 0.96368627272, 5507.5532386674],
      [0.00000306784, 0.29867139512, 5573.1428014331],
      [0.00000174844, 3.01193636733, 18849.2275499742],
      [0.00000243181, 4.2734953079, 11790.6290886588],
      [0.00000211836, 5.84714461348, 1577.3435424478],
      [0.0000018574, 5.02199710705, 10977.078804699],
      [0.00000109835, 5.0551063586, 5486.777843175],
      [9.8316e-7, 0.88681311278, 6069.7767545534],
      [8.65e-7, 5.68956418946, 15720.8387848784],
      [8.5831e-7, 1.27079125277, 161000.6857376741],
      [6.2917e-7, 0.92177053978, 529.6909650946],
      [5.7056e-7, 2.01374292245, 83996.84731811189],
      [6.4908e-7, 0.27251341435, 17260.1546546904],
      [4.9384e-7, 3.24501240359, 2544.3144198834],
      [5.5736e-7, 5.2415979917, 71430.69561812909],
      [4.252e-7, 6.01110257982, 6275.9623029906],
      [4.6966e-7, 2.57799853213, 775.522611324],
      [3.8963e-7, 5.36063832897, 4694.0029547076],
      [4.4666e-7, 5.53715663816, 9437.762934887],
      [3.5661e-7, 1.67447135798, 12036.4607348882],
      [3.1922e-7, 0.18368299942, 5088.6288397668],
      [3.1846e-7, 1.77775642078, 398.1490034082],
      [3.3193e-7, 0.24370221704, 7084.8967811152],
      [3.8245e-7, 2.39255343973, 8827.3902698748],
      [2.8468e-7, 1.21344887533, 6286.5989683404],
      [3.7486e-7, 0.82961281844, 19651.048481098],
      [3.6957e-7, 4.90107587287, 12139.5535091068],
      [3.4537e-7, 1.84270693281, 2942.4634232916],
      [2.6275e-7, 4.58896863104, 10447.3878396044],
      [2.4596e-7, 3.78660838036, 8429.2412664666],
      [2.3587e-7, 0.26866098169, 796.2980068164],
      [2.7795e-7, 1.89934427832, 6279.5527316424],
      [2.3927e-7, 4.99598548145, 5856.4776591154],
      [2.0345e-7, 4.65282190725, 2146.1654164752],
      [2.3287e-7, 2.80783632869, 14143.4952424306],
      [2.2099e-7, 1.95002636847, 3154.6870848956],
      [1.9509e-7, 5.38233922479, 2352.8661537718],
      [1.7958e-7, 0.1987136996, 6812.766815086],
      [1.7178e-7, 4.43322156854, 10213.285546211],
      [1.619e-7, 5.23159323213, 17789.845619785],
      [1.7315e-7, 6.15224075188, 16730.4636895958],
      [1.3814e-7, 5.18962074032, 8031.0922630584],
      [1.8834e-7, 0.67280058021, 149854.4001348079],
      [1.833e-7, 2.25348717053, 23581.2581773176],
      [1.3639e-7, 3.68511810757, 4705.7323075436],
      [1.3142e-7, 0.65267698994, 13367.9726311066],
      [1.0414e-7, 4.33285688501, 11769.8536931664],
      [9.978e-8, 4.20126336356, 6309.3741697912],
      [1.017e-7, 1.59366684542, 4690.4798363586],
      [7.564e-8, 2.62560597391, 6256.7775301916],
      [9.654e-8, 3.67583728703, 27511.4678735372],
      [6.743e-8, 0.56269927047, 3340.6124266998],
      [8.743e-8, 6.06359123461, 1748.016413067],
      [7.786e-8, 3.67371235367, 12168.0026965746],
      [6.633e-8, 5.66149277789, 11371.7046897582],
      [7.712e-8, 0.31242577788, 7632.9432596502],
      [6.586e-8, 3.13580054586, 801.8209311238],
      [7.46e-8, 5.6475806666, 11926.2544136688],
      [6.933e-8, 2.92384586372, 6681.2248533996],
      [6.805e-8, 1.42327153767, 23013.5395395872],
      [6.118e-8, 5.13395999022, 1194.4470102246],
      [6.477e-8, 2.64986648493, 19804.8272915828],
      [5.233e-8, 4.62432817299, 6438.4962494256],
      [6.147e-8, 3.02863936662, 233141.3144043615],
      [4.608e-8, 1.72194702724, 7234.794256242],
      [4.221e-8, 1.55697533726, 7238.6755916],
      [5.31e-8, 2.40821524293, 11499.6562227928],
      [5.128e-8, 5.3239896569, 11513.8833167944],
      [4.77e-8, 0.2555431173, 11856.2186514245],
      [5.519e-8, 2.09089153789, 17298.1823273262],
      [5.625e-8, 4.34052903053, 90955.5516944961],
      [4.578e-8, 4.4656964157, 5746.271337896],
      [3.788e-8, 4.9072829481, 4164.311989613],
      [5.337e-8, 5.09957905103, 31441.6775697568],
      [3.967e-8, 1.20054555175, 1349.8674096588],
      [4.005e-8, 3.02853885902, 1059.3819301892],
      [3.48e-8, 0.76066308841, 10973.55568635],
      [4.232e-8, 1.05485713117, 5760.4984318976],
      [4.582e-8, 3.76570026763, 6386.16862421],
      [3.335e-8, 3.13829943354, 6836.6452528338],
      [3.42e-8, 3.00043974511, 4292.3308329504],
      [3.595e-8, 5.70703236079, 5643.1785636774],
      [3.236e-8, 4.16387400645, 9917.6968745098],
      [4.154e-8, 2.59940749519, 7058.5984613154],
      [3.362e-8, 4.54577164994, 4732.0306273434],
      [2.978e-8, 1.3056126882, 6283.14316029419],
      [2.765e-8, 0.51311975671, 26.2983197998],
      [2.807e-8, 5.66230537649, 8635.9420037632],
      [2.927e-8, 5.7378783408, 16200.7727245012],
      [3.167e-8, 1.691817599, 11015.1064773348],
      [2.598e-8, 2.96244118358, 25132.3033999656],
      [3.519e-8, 3.62639325753, 244287.60000722768],
      [2.676e-8, 4.20727719487, 18073.7049386502],
      [2.978e-8, 1.74971565805, 6283.0085396886],
      [2.287e-8, 1.06976449088, 14314.1681130498],
      [2.863e-8, 5.92838917309, 14712.317116458],
      [3.071e-8, 0.23793217, 35371.8872659764],
      [2.656e-8, 0.89959301615, 12352.8526045448],
      [2.415e-8, 2.799751768, 709.9330485583],
      [2.811e-8, 3.51513864541, 21228.3920235458],
      [1.977e-8, 2.61358297551, 951.7184062506],
      [2.548e-8, 2.47684686575, 6208.2942514241],
      [1.999e-8, 0.56090396506, 7079.3738568078],
      [2.305e-8, 1.05376463592, 22483.84857449259],
      [1.855e-8, 2.86093570752, 5216.5803728014],
      [2.157e-8, 1.31395211105, 154717.6098876827],
      [1.97e-8, 4.36931551625, 167283.7615876655],
      [1.754e-8, 2.14452400686, 6290.1893969922],
      [1.628e-8, 5.85704450617, 10984.1923516998],
      [2.154e-8, 6.03828353794, 10873.9860304804],
      [1.714e-8, 3.70158195222, 1592.5960136328],
      [1.541e-8, 6.21599512982, 23543.23050468179],
      [1.602e-8, 1.99860679677, 10969.9652576982],
      [1.712e-8, 1.34295218697, 3128.3887650958],
      [1.647e-8, 5.54948299069, 6496.3749454294],
      [1.495e-8, 5.43980459648, 155.4203994342],
      [1.827e-8, 5.91227480351, 3738.761430108],
      [1.726e-8, 2.16765465036, 10575.4066829418],
      [1.532e-8, 5.35683107063, 13521.7514415914],
      [1.824e-8, 1.66056145084, 39302.096962196],
      [1.605e-8, 1.90930973224, 6133.5126528568],
      [1.282e-8, 2.46013372544, 13916.0191096416],
      [1.211e-8, 4.4136063155, 3894.1818295422],
      [1.394e-8, 1.7780192925, 9225.539273283],
      [1.571e-8, 4.95512957606, 25158.6017197654],
      [1.205e-8, 1.19212756308, 3.523118349],
      [1.132e-8, 2.69830084955, 6040.3472460174],
      [1.504e-8, 5.77577388271, 18209.33026366019],
      [1.393e-8, 1.62625077326, 5120.6011455836],
      [1.081e-8, 2.93726744446, 17256.6315363414],
      [1.232e-8, 0.71651766504, 143571.32428481648],
      [1.087e-8, 0.99769687961, 955.5997416086],
      [1.068e-8, 5.28472576591, 65147.6197681377],
      [1.169e-8, 3.11663802316, 14945.3161735544],
      [9.75e-9, 5.1088726078, 6172.869528772],
      [1.202e-8, 4.02992510403, 553.5694028424],
      [9.79e-9, 2.00000879106, 15110.4661198662],
      [9.62e-9, 4.023807714, 6282.0955289232],
      [9.99e-9, 3.6264300279, 6262.300454499],
      [1.03e-8, 5.84987815239, 213.299095438],
      [1.014e-8, 2.84227679965, 8662.240323563],
      [1.185e-8, 1.51330629149, 17654.7805397496],
      [9.67e-9, 2.67081017562, 5650.2921106782],
      [1.222e-8, 2.65423784904, 88860.05707098669],
      [9.86e-9, 2.36212814824, 6206.8097787158],
      [1.034e-8, 0.13634950642, 11712.9553182308],
      [1.103e-8, 3.08477302937, 43232.3066584156],
      [7.81e-9, 2.53374971725, 16496.3613962024],
      [1.019e-8, 3.04569392376, 6037.244203762],
      [7.95e-9, 5.80662989126, 5230.807466803],
      [8.13e-9, 3.57702871938, 10177.2576795336],
      [9.62e-9, 5.31470594766, 6284.0561710596],
      [7.17e-9, 5.95797471837, 12559.038152982],
      [9.67e-9, 2.74413738053, 6244.9428143536],
      [9.21e-9, 0.1016016083, 29088.811415985],
      [7.19e-9, 5.91788189939, 4136.9104335162],
      [6.88e-9, 3.89489045092, 1589.0728952838],
      [7.72e-9, 4.05505380285, 6127.6554505572],
      [7.06e-9, 5.49323197725, 22003.9146348698],
      [6.65e-9, 1.60002747134, 11087.2851259184],
      [6.9e-9, 4.50539825729, 426.598190876],
      [8.54e-9, 3.2610464506, 20426.571092422],
      [6.56e-9, 4.3241018294, 16858.4825329332],
      [8.4e-9, 2.59572585212, 28766.924424484],
      [6.86e-9, 0.61944033771, 11403.676995575],
      [7e-9, 3.40901412473, 7.1135470008],
      [7.28e-9, 0.04050185963, 5481.2549188676],
      [6.53e-9, 1.0386945123, 6062.6632075526],
      [5.59e-9, 4.79221805695, 20199.094959633],
      [6.33e-9, 5.70229959167, 45892.73043315699],
      [5.91e-9, 6.10986487621, 9623.6882766912],
      [5.2e-9, 3.62310356479, 5333.9002410216],
      [6.02e-9, 5.58381898589, 10344.2950653858],
      [4.96e-9, 2.21027756314, 1990.745017041],
      [6.91e-9, 1.96733114988, 12416.5885028482],
      [6.4e-9, 1.59062417043, 18319.5365848796],
      [6.25e-9, 3.82358168221, 13517.8701062334],
      [4.75e-9, 1.1702590418, 12569.6748183318],
      [6.6e-9, 5.08498512995, 283.8593188652],
      [6.64e-9, 4.50029469969, 47162.5163546352],
      [5.69e-9, 0.16318535463, 17267.26820169119],
      [5.68e-9, 3.86100969474, 6076.8903015542],
      [4.62e-9, 0.26368763517, 4590.910180489],
      [5.35e-9, 4.83225423196, 18422.62935909819],
      [4.66e-9, 0.75873879417, 7342.4577801806],
      [5.41e-9, 3.07212190556, 226858.23855437007],
      [6.1e-9, 1.53597089605, 33019.0211122046],
      [6.17e-9, 2.62356328726, 11190.377900137],
      [5.48e-9, 4.55798855803, 18875.525869774],
      [6.33e-9, 4.60110281228, 66567.48586525429],
      [5.87e-9, 5.78087907808, 632.7837393132],
      [6.03e-9, 5.38458554802, 316428.22867391503],
      [5.25e-9, 5.01522072363, 12132.439962106],
      [4.69e-9, 0.59975173763, 21954.15760939799],
      [5.48e-9, 3.50627043672, 17253.04110768959],
      [5.02e-9, 0.98804327589, 11609.8625440122],
      [5.68e-9, 1.98497313089, 7668.6374249425],
      [4.82e-9, 1.62460405687, 12146.6670561076],
      [3.91e-9, 3.68718382972, 18052.9295431578],
      [4.57e-9, 3.7721489661, 156137.47598479927],
      [4.01e-9, 5.2922154024, 15671.0817594066],
      [4.69e-9, 1.80963351735, 12562.6285816338],
      [5.14e-9, 3.37031288919, 20597.2439630412],
      [4.52e-9, 5.66811219778, 10454.5013866052],
      [3.75e-9, 4.98528185039, 9779.1086761254],
      [5.23e-9, 0.97215560834, 155427.542936241],
      [4.03e-9, 5.1394818977, 1551.045222648],
      [3.72e-9, 3.69883738807, 9388.0059094152],
      [3.67e-9, 4.43875659833, 4535.0594369244],
      [4.06e-9, 4.20863156497, 12592.4500197826],
      [3.62e-9, 2.55099560446, 242.728603974],
      [4.71e-9, 4.61907324819, 5436.9930152402],
      [3.88e-9, 4.960209284, 24356.7807886416],
      [4.41e-9, 5.83872966262, 3496.032826134],
      [3.49e-9, 6.16307810648, 19800.9459562248],
      [3.56e-9, 0.2381908124, 5429.8794682394],
      [3.46e-9, 5.60809622572, 2379.1644735716],
      [3.8e-9, 2.72105213132, 11933.3679606696],
      [4.32e-9, 0.24215988572, 17996.0311682222],
      [3.78e-9, 5.22516848076, 7477.522860216],
      [3.37e-9, 5.10885555836, 5849.3641121146],
      [3.15e-9, 0.57827745123, 10557.5941608238],
      [3.18e-9, 4.4994900732, 3634.6210245184],
      [3.23e-9, 1.55850824803, 10440.2742926036],
      [3.14e-9, 5.77154773334, 20.7753954924],
      [3.03e-9, 2.34615580398, 4686.8894077068],
      [4.14e-9, 5.9323760231, 51092.7260508548],
      [3.62e-9, 2.17561997119, 28237.2334593894],
      [2.88e-9, 0.18377405421, 13095.8426650774],
      [2.77e-9, 5.1295220503, 13119.72110282519],
      [3.25e-9, 6.18608287927, 6268.8487559898],
      [2.73e-9, 0.30522428863, 23141.5583829246],
      [2.67e-9, 5.76152585786, 5966.6839803348],
      [3.45e-9, 2.94246040875, 36949.2308084242],
      [2.53e-9, 5.20994580359, 24072.9214697764],
      [3.42e-9, 5.76212804329, 16460.33352952499],
      [3.07e-9, 6.01039067183, 22805.7355659936],
      [2.61e-9, 2.00304796059, 6148.010769956],
      [2.38e-9, 5.08241964961, 6915.8595893046],
      [2.49e-9, 2.94762789744, 135.0650800354],
      [3.06e-9, 3.89765478921, 10988.808157535],
      [3.08e-9, 0.05451027736, 4701.1165017084],
      [3.19e-9, 2.95712862064, 163096.18036118348],
      [2.72e-9, 2.07967681309, 4804.209275927],
      [2.09e-9, 4.43768461442, 6546.1597733642],
      [2.17e-9, 0.73691592312, 6303.8512454838],
      [2.03e-9, 0.32033085531, 25934.1243310894],
      [2.05e-9, 5.22936478995, 20995.3929664494],
      [2.13e-9, 0.20671418919, 28286.9904848612],
      [1.97e-9, 0.4828613129, 16737.5772365966],
      [2.3e-9, 6.06567392849, 6287.0080032545],
      [2.19e-9, 1.291942163, 5326.7866940208],
      [2.01e-9, 1.74700937253, 22743.4093795164],
      [2.07e-9, 4.45440927276, 6279.4854213396],
      [2.69e-9, 6.0564044503, 64471.99124174489],
      [1.9e-9, 0.99261116842, 29296.6153895786],
      [1.94e-9, 3.82656562755, 419.4846438752],
      [2.62e-9, 5.26961924126, 522.5774180938],
      [2.1e-9, 4.68618183158, 6254.6266625236],
      [1.97e-9, 2.80624554186, 4933.2084403326],
      [2.52e-9, 4.3622015462, 40879.4405046438],
      [2.61e-9, 1.07241516738, 55022.9357470744],
      [2.33e-9, 5.41751014958, 39609.6545831656],
      [1.85e-9, 4.14324541379, 5642.1982426092],
      [2.47e-9, 3.44855612987, 6702.5604938666],
      [2.05e-9, 4.04424043226, 536.8045120954],
      [1.91e-9, 3.15807087926, 16723.350142595],
      [2.22e-9, 5.16259496507, 23539.7073863328],
      [1.8e-9, 4.56214752149, 6489.2613984286],
      [2.27e-9, 0.60156339452, 5905.7022420756],
      [1.7e-9, 0.93185903228, 16062.1845261168],
      [1.59e-9, 0.92751013112, 23937.856389741],
      [1.57e-9, 4.69607868164, 6805.6532680852],
      [2.18e-9, 0.8553337343, 16627.3709153772],
      [1.69e-9, 0.94641052064, 3097.88382272579],
      [2.07e-9, 4.88410451334, 6286.6662786432],
      [1.6e-9, 4.95943826819, 10021.8372800994],
      [1.75e-9, 6.12762824563, 239424.39025435288],
      [1.73e-9, 3.13887234973, 6179.9830757728],
      [1.57e-9, 3.62822057807, 18451.07854656599],
      [2.06e-9, 5.74617821138, 3646.3503773544],
      [1.57e-9, 4.67695912207, 6709.6740408674],
      [1.46e-9, 3.09506069745, 4907.3020501456],
      [1.65e-9, 2.2713912876, 10660.6869350424],
      [1.44e-9, 3.96947747592, 6019.9919266186],
      [1.71e-9, 5.91302216729, 6058.7310542895],
      [1.44e-9, 2.1315565512, 26084.0218062162],
      [1.51e-9, 0.67417383565, 2388.8940204492],
      [1.96e-9, 1.67718461229, 2107.0345075424],
      [1.46e-9, 5.10373877968, 10770.8932562618],
      [1.87e-9, 1.23915444627, 19402.7969528166],
      [1.37e-9, 1.26247412216, 12566.2190102856],
      [1.91e-9, 5.03547476279, 263.0839233728],
      [1.37e-9, 3.52825454595, 639.897286314],
      [1.35e-9, 0.73840670927, 5017.508371365],
      [1.64e-9, 2.39195095081, 6357.8574485587],
      [1.68e-9, 0.05515907462, 9380.9596727172],
      [1.61e-9, 1.15721259392, 26735.9452622132],
      [1.44e-9, 1.76097645199, 5888.4499649322],
      [1.31e-9, 2.51859277344, 6599.467719648],
      [1.42e-9, 2.43802911123, 5881.4037282342],
      [1.59e-9, 5.90325893762, 6281.5913772831],
      [1.51e-9, 3.72338532519, 12669.2444742014],
      [1.32e-9, 2.38417741883, 6525.8044539654],
      [1.27e-9, 0.00254936441, 10027.9031957292],
      [1.48e-9, 2.85102145528, 6418.1409300268],
      [1.43e-9, 5.7446027956, 26087.9031415742],
      [1.72e-9, 0.4128996224, 174242.4659640497],
      [1.36e-9, 4.15497742275, 6311.5250374592],
      [1.7e-9, 5.98194913129, 327574.51427678124],
      [1.36e-9, 2.48430537541, 13341.6743113068],
      [1.49e-9, 0.33002271275, 245.8316462294],
      [1.65e-9, 2.496679246, 58953.145443294],
      [1.23e-9, 1.67328384813, 32217.2001810808],
      [1.23e-9, 3.45660563754, 6277.552925684],
      [1.17e-9, 0.86065134175, 6245.0481773556],
      [1.49e-9, 5.61358281003, 5729.506447149],
      [1.28e-9, 0.71204006448, 103.0927742186],
      [1.59e-9, 2.43166592149, 221995.02880149524],
      [1.37e-9, 1.706577092, 12566.08438968],
      [1.29e-9, 2.80667872683, 6016.4688082696],
      [1.13e-9, 3.58302904101, 25685.872802808],
      [1.09e-9, 3.26403795962, 6819.8803620868],
      [1.22e-9, 0.34120688202, 1162.4747044078],
      [1.06e-9, 1.59721172719, 17782.7320727842],
      [1.44e-9, 2.28891651774, 12489.8856287072],
      [1.37e-9, 5.82029768354, 44809.6502008634],
      [1.34e-9, 1.26539983018, 5331.3574437408],
      [1.03e-9, 5.96518130595, 6321.1035226272],
      [1.09e-9, 0.33808549034, 11300.5842213564],
      [1.29e-9, 5.8918727719, 12029.3471878874],
      [1.22e-9, 5.77325634636, 11919.140866668],
      [1.07e-9, 6.2499898935, 77690.75950573849],
      [1.07e-9, 1.00535580713, 77736.78343050249],
      [1.15e-9, 5.86963518266, 12721.572099417],
      [1.02e-9, 5.66283467269, 5540.0857894588],
      [1.43e-9, 0.24122178432, 4214.0690150848],
      [1.43e-9, 0.88529649733, 7576.560073574],
      [1.07e-9, 2.92124030351, 31415.379249957],
      [1e-9, 5.99485644501, 4061.2192153944],
      [1.03e-9, 2.41941934525, 5547.1993364596],
      [1.04e-9, 4.44106051277, 2118.7638603784],
      [1.1e-9, 0.37559635174, 5863.5912061162],
      [1.24e-9, 2.55619029611, 12539.853380183],
      [1.1e-9, 3.66952094465, 238004.5241572363],
      [1.12e-9, 4.32512422724, 97238.62754448749],
      [1.2e-9, 1.26895630075, 12043.574281889],
      [9.7e-10, 5.42612959752, 7834.1210726394],
      [9.4e-10, 2.56461130309, 19004.6479494084],
      [1.05e-9, 5.68272475301, 16522.6597160022],
      [1.17e-9, 3.65425622684, 34520.3093093808],
      [1.08e-9, 1.24206843948, 84672.47584450469],
      [9.8e-10, 0.13589994287, 11080.1715789176],
      [9.7e-10, 2.46722096722, 71980.63357473118],
      [9.5e-10, 5.36958330451, 6288.5987742988],
      [9.6e-10, 0.20796618776, 18139.2945014159],
      [1.11e-9, 5.01961920313, 11823.1616394502],
      [9e-10, 2.72355843779, 26880.3198130326],
      [9.9e-10, 0.90164266199, 18635.9284545362],
      [1.26e-9, 4.78722177847, 305281.9430710488],
      [1.24e-9, 5.00979495566, 172146.9713405403],
      [9e-10, 4.50544881196, 40077.61957352],
      [1.04e-9, 5.6367968071, 2787.0430238574],
      [9.1e-10, 5.43564326147, 6272.0301497275],
      [1e-9, 2.00639461597, 12323.4230960088],
      [1.17e-9, 2.35555589778, 83286.91426955358],
      [1.05e-9, 2.59824000109, 30666.1549584328],
      [9e-10, 2.35779490026, 12491.3701014155],
      [8.9e-10, 3.57152453732, 11720.0688652316],
      [9.5e-10, 5.67015349858, 14919.0178537546],
      [8.7e-10, 1.86043406047, 27707.5424942948],
      [1.06e-9, 3.04150600352, 22345.2603761082],
      [8.2e-10, 5.58298993353, 10241.2022911672],
      [8.3e-10, 3.10607039533, 36147.4098773004],
      [9.4e-10, 5.47749711149, 9924.8104215106],
      [8.2e-10, 4.71988314145, 15141.390794312],
      [9.6e-10, 3.89073946348, 6379.0550772092],
      [1.1e-9, 4.92131611151, 5621.8429232104],
      [1.1e-9, 4.89978492291, 72140.6286666874],
      [9.7e-10, 5.20764563059, 6303.4311693902],
      [8.5e-10, 1.61269222311, 33326.5787331742],
      [9.3e-10, 1.32651591333, 23020.65308658799],
      [9e-10, 0.5773301638, 26482.1708096244],
      [7.8e-10, 3.99588630754, 11293.4706743556],
      [1.06e-9, 3.92012705073, 62883.3551395136],
      [9.8e-10, 2.94397773524, 316.3918696566],
      [7.6e-10, 3.96310417608, 29026.48522950779],
      [9.8e-10, 0.95914722366, 48739.859897083],
      [7.8e-10, 1.97068528043, 90279.92316810328],
      [7.6e-10, 0.23027966596, 21424.4666443034],
      [7.9e-10, 1.46227790922, 8982.810669309],
      [7.8e-10, 2.28840998832, 266.6070417218],
      [7.1e-10, 1.5194076559, 33794.5437235286],
      [7.6e-10, 0.22880641443, 57375.8019008462],
      [9.7e-10, 0.39449562097, 24279.10701821359],
      [7.5e-10, 2.77638584795, 12964.300703391],
      [7.7e-10, 5.18846946344, 11520.9968637952],
      [6.8e-10, 0.50006599129, 4274.5183108324],
      [7.5e-10, 2.07323762803, 15664.03552270859],
      [7.7e-10, 0.4666517878, 16207.886271502],
      [8.1e-10, 4.10452219483, 161710.6187862324],
      [7.1e-10, 3.91415328513, 7875.6718636242],
      [8.1e-10, 0.91938383406, 74.7815985673],
      [8.3e-10, 4.69916218791, 23006.42599258639],
      [6.9e-10, 0.98999300277, 6393.2821712108],
      [6.5e-10, 5.41938745446, 28628.3362260996],
      [7.3e-10, 2.45564765251, 15508.6151232744],
      [6.5e-10, 3.02336771694, 5959.570433334],
      [6.4e-10, 0.18375587635, 1066.49547719],
      [8e-10, 5.81239171612, 12341.8069042809],
      [6.6e-10, 2.15105504851, 38.0276726358],
      [6.7e-10, 5.14047250153, 9814.6041002912],
      [6.2e-10, 2.43313614978, 10138.1095169486],
      [6.8e-10, 2.24442548639, 24383.0791084414],
      [7.8e-10, 1.39649333997, 9411.4646150872],
      [5.9e-10, 4.95362151577, 35707.7100829074],
      [7.3e-10, 1.35229143121, 5327.4761083828],
      [5.7e-10, 3.16018882154, 5490.300961524],
      [7.2e-10, 5.91833527334, 10881.0995774812],
      [6.7e-10, 0.66414713064, 29864.334027309],
      [6.5e-10, 0.30352816135, 7018.9523635232],
      [5.9e-10, 5.36231868425, 10239.5838660108],
      [5.6e-10, 3.22196331515, 2636.725472637],
      [6.8e-10, 5.32086226658, 3116.6594122598],
      [5.9e-10, 1.63156134967, 61306.0115970658],
      [5.4e-10, 4.29491690425, 21947.1113727],
      [7e-10, 0.29271565928, 6528.9074962208],
      [5.7e-10, 5.89190132575, 34513.2630726828],
      [5.4e-10, 2.51856815404, 6279.1945146334],
      [7.4e-10, 1.38235845304, 9967.4538999816],
      [5.4e-10, 0.92276712152, 6286.9571853494],
      [7e-10, 5.00933012248, 6453.7487206106],
      [5.3e-10, 3.86543309344, 32370.9789915656],
      [5.5e-10, 4.51794544854, 34911.412076091],
      [6.3e-10, 5.41479412056, 11502.8376165305],
      [6.3e-10, 2.34416220742, 11510.7019230567],
      [5.6e-10, 0.91310629913, 9910.583327509],
      [6.7e-10, 4.03308763854, 34596.3646546524],
      [6e-10, 5.57024703495, 5756.9080032458],
      [7.2e-10, 2.80863088166, 10866.8724834796],
      [6.6e-10, 6.12047940728, 12074.488407524],
      [5.1e-10, 2.59519527563, 11396.5634485742],
      [6.2e-10, 5.14746754396, 25287.7237993998],
      [5.4e-10, 2.50994032776, 5999.2165311262],
      [5.1e-10, 4.51195861837, 29822.7832363242],
      [5.9e-10, 0.44167237876, 250570.6758572191],
      [5.1e-10, 3.6884906676, 6262.7205305926],
      [4.9e-10, 0.54704693048, 22594.05489571199],
      [6.5e-10, 2.38423614501, 52670.0695933026],
      [6.9e-10, 5.34363738671, 66813.5648357332],
      [5.6e-10, 2.67216180349, 17892.93839400359],
      [4.9e-10, 4.18361320516, 18606.4989460002],
      [5.5e-10, 0.83886167974, 20452.8694122218],
      [5e-10, 1.46327331958, 37455.7264959744],
      [5.8e-10, 3.34847975377, 33990.6183442862],
      [6.5e-10, 1.45522693982, 76251.32777062019],
      [5.6e-10, 2.356506642, 37724.7534197482],
      [4.8e-10, 1.80689447612, 206.1855484372],
      [5.6e-10, 3.84224878744, 5483.254724826],
      [5.3e-10, 0.17334326094, 77717.29458646949],
      [5.3e-10, 0.79879700631, 77710.24834977149],
      [4.7e-10, 0.43240779709, 735.8765135318],
      [5.3e-10, 4.58786566028, 11616.976091013],
      [4.8e-10, 6.20230111054, 4171.4255366138],
      [5.2e-10, 2.9171905303, 6993.0088985497],
      [5.7e-10, 3.42008310383, 50317.2034395308],
      [4.8e-10, 0.12356889012, 13362.4497067992],
      [6e-10, 5.52056066934, 949.1756089698],
      [4.5e-10, 3.37963782356, 10763.779709261],
      [4.7e-10, 5.50958184902, 12779.4507954208],
      [5.2e-10, 5.42770349015, 310145.1528239236],
      [6.1e-10, 2.93237974631, 5791.4125575326],
      [4.4e-10, 2.87440620802, 8584.6616659008],
      [4.6e-10, 4.0314179656, 10667.8004820432],
      [4.4e-10, 1.21579107625, 6272.4391846416],
      [4.7e-10, 2.57670800912, 11492.542675792],
      [4.4e-10, 3.62570223167, 63658.8777508376],
      [5.1e-10, 0.84531181151, 12345.739057544],
      [4.6e-10, 1.17584556517, 149.5631971346],
      [4.3e-10, 0.01524970172, 37853.8754993826],
      [4.3e-10, 0.79038834934, 640.8776073822],
      [4.4e-10, 2.22554419931, 6293.7125153412],
      [4.9e-10, 1.01528394907, 149144.46708624958],
      [4.1e-10, 3.27146326065, 8858.3149443206],
      [4.5e-10, 3.03765521215, 65236.2212932854],
      [5.8e-10, 5.45843180927, 1975.492545856],
      [4.1e-10, 1.32190847146, 2547.8375382324],
      [4.7e-10, 3.67626039848, 28313.288804661],
      [4.7e-10, 6.21438985953, 10991.3058987006],
      [4e-10, 2.37237751212, 8273.8208670324],
      [5.6e-10, 1.09773690181, 77376.2010224076],
      [4e-10, 2.35698541041, 2699.7348193176],
      [4.3e-10, 5.28030897946, 17796.9591667858],
      [5.4e-10, 2.59175932091, 22910.44676536859],
      [5.5e-10, 0.07988985505, 83467.15635301729],
      [4.1e-10, 4.47510694062, 5618.3198048614],
      [4e-10, 1.35670430524, 27177.8515292002],
      [4.1e-10, 2.48011323946, 6549.6828917132],
      [5e-10, 2.56387920528, 82576.9812209953],
      [4.2e-10, 4.78798367468, 7856.89627409019],
      [4.7e-10, 2.75482175292, 18202.21671665939],
      [3.9e-10, 1.97008298629, 24491.4257925834],
      [4.2e-10, 4.04346599946, 7863.9425107882],
      [3.9e-10, 3.0103393642, 853.196381752],
      [3.8e-10, 0.49178679251, 38650.173506199],
      [4.4e-10, 1.35931241699, 21393.5419698576],
      [3.6e-10, 4.86047906533, 4157.1984426122],
      [4.3e-10, 5.64354880978, 1062.9050485382],
      [3.9e-10, 3.92736779879, 3903.9113764198],
      [4e-10, 5.3969491832, 9498.2122306346],
      [4.3e-10, 2.40863861919, 29424.634232916],
      [4.6e-10, 2.08022244271, 12573.2652469836],
      [5e-10, 6.15760345261, 78051.34191383338]
    ],
    "1": [
      [0.00103018607, 1.10748968172, 6283.0758499914],
      [0.00001721238, 1.06442300386, 12566.1516999828],
      [0.00000702217, 3.14159265359, 0],
      [3.2345e-7, 1.02168583254, 18849.2275499742],
      [3.0801e-7, 2.84358443952, 5507.5532386674],
      [2.4978e-7, 1.31906570344, 5223.6939198022],
      [1.8487e-7, 1.42428709076, 1577.3435424478],
      [1.0077e-7, 5.91385248388, 10977.078804699],
      [8.635e-8, 0.27158192945, 5486.777843175],
      [8.654e-8, 1.42046854427, 6275.9623029906],
      [5.069e-8, 1.68613408916, 5088.6288397668],
      [4.985e-8, 6.01402338185, 6286.5989683404],
      [4.667e-8, 5.98749245692, 529.6909650946],
      [4.395e-8, 0.51800423445, 4694.0029547076],
      [3.87e-8, 4.74932206877, 2544.3144198834],
      [3.755e-8, 5.07053801166, 796.2980068164],
      [4.1e-8, 1.08424801084, 9437.762934887],
      [3.518e-8, 0.02290216978, 83996.84731811189],
      [3.436e-8, 0.94937503872, 71430.69561812909],
      [3.221e-8, 6.15628775321, 2146.1654164752],
      [3.418e-8, 5.4115158188, 775.522611324],
      [2.863e-8, 5.48433323746, 10447.3878396044],
      [2.525e-8, 0.24296913555, 398.1490034082],
      [2.205e-8, 4.94892172085, 6812.766815086],
      [2.186e-8, 0.41991932164, 8031.0922630584],
      [2.828e-8, 3.41986300734, 2352.8661537718],
      [2.554e-8, 6.13241770582, 6438.4962494256],
      [1.932e-8, 5.31374587091, 8429.2412664666],
      [2.427e-8, 3.09118902115, 4690.4798363586],
      [1.73e-8, 1.53685999718, 4705.7323075436],
      [2.25e-8, 3.6883639562, 7084.8967811152],
      [2.094e-8, 1.281690604, 1748.016413067],
      [1.483e-8, 3.22226346483, 7234.794256242],
      [1.434e-8, 0.81293662216, 14143.4952424306],
      [1.754e-8, 3.22883705112, 6279.5527316424],
      [1.583e-8, 4.09815978783, 11499.6562227928],
      [1.575e-8, 5.53890314149, 3154.6870848956],
      [1.847e-8, 1.82041234937, 7632.9432596502],
      [1.499e-8, 3.63177937611, 11513.8833167944],
      [1.337e-8, 4.64442556061, 6836.6452528338],
      [1.275e-8, 2.69329661394, 1349.8674096588],
      [1.348e-8, 6.15284035323, 5746.271337896],
      [1.126e-8, 3.35676107739, 17789.845619785],
      [1.47e-8, 3.65282991735, 1194.4470102246],
      [1.101e-8, 4.4974742767, 4292.3308329504],
      [1.168e-8, 2.58033028504, 13367.9726311066],
      [1.236e-8, 5.64980098028, 5760.4984318976],
      [9.85e-9, 0.65326301914, 5856.4776591154],
      [9.28e-9, 2.3255501829, 10213.285546211],
      [1.073e-8, 5.82672338169, 12036.4607348882],
      [9.18e-9, 0.76907130762, 16730.4636895958],
      [8.76e-9, 1.50335727807, 11926.2544136688],
      [1.023e-8, 5.62071200879, 6256.7775301916],
      [8.53e-9, 0.6567813463, 155.4203994342],
      [8.02e-9, 4.10519132094, 951.7184062506],
      [8.59e-9, 1.42880883564, 5753.3848848968],
      [9.92e-9, 1.1423800161, 1059.3819301892],
      [8.14e-9, 1.63584008733, 6681.2248533996],
      [6.64e-9, 4.55039663226, 5216.5803728014],
      [6.27e-9, 1.50782904323, 5643.1785636774],
      [6.44e-9, 4.19480024859, 6040.3472460174],
      [5.9e-9, 6.18371704849, 4164.311989613],
      [6.35e-9, 0.5242358477, 6290.1893969922],
      [6.5e-9, 0.97935492869, 25132.3033999656],
      [5.68e-9, 2.30121525349, 10973.55568635],
      [5.49e-9, 5.26737827342, 3340.6124266998],
      [5.47e-9, 2.20143332641, 1592.5960136328],
      [5.26e-9, 0.92464258271, 11371.7046897582],
      [4.93e-9, 5.91036281399, 3894.1818295422],
      [4.83e-9, 1.6600571154, 12168.0026965746],
      [5.14e-9, 3.59683072524, 10969.9652576982],
      [5.16e-9, 3.97164781773, 17298.1823273262],
      [5.29e-9, 5.0353867768, 9917.6968745098],
      [4.87e-9, 2.50544745305, 6127.6554505572],
      [4.19e-9, 4.05235655996, 10984.1923516998],
      [5.38e-9, 5.54081539813, 553.5694028424],
      [4.02e-9, 2.16859478359, 7860.4193924392],
      [5.52e-9, 2.32219865498, 11506.7697697936],
      [3.67e-9, 3.39145698451, 6496.3749454294],
      [3.6e-9, 5.34467204596, 7079.3738568078],
      [3.34e-9, 3.61346365667, 11790.6290886588],
      [4.54e-9, 0.28755421898, 801.8209311238],
      [4.19e-9, 3.69613970002, 10575.4066829418],
      [3.19e-9, 0.30793759304, 16200.7727245012],
      [3.76e-9, 5.81560210508, 7058.5984613154],
      [3.64e-9, 1.08425056923, 6309.3741697912],
      [2.94e-9, 4.54798604178, 11856.2186514245],
      [2.9e-9, 1.26451946335, 8635.9420037632],
      [3.94e-9, 4.15683669084, 26.2983197998],
      [2.6e-9, 5.09424572996, 10177.2576795336],
      [2.41e-9, 2.25766000302, 11712.9553182308],
      [2.39e-9, 1.06936978753, 242.728603974],
      [2.76e-9, 3.44260568764, 5884.9268465832],
      [2.55e-9, 5.38496803122, 21228.3920235458],
      [3.07e-9, 4.24313885601, 3738.761430108],
      [2.13e-9, 3.44661200485, 213.299095438],
      [1.98e-9, 0.69427265195, 1990.745017041],
      [1.95e-9, 5.16563409007, 12352.8526045448],
      [2.13e-9, 3.89937836808, 13916.0191096416],
      [2.14e-9, 4.00445200772, 5230.807466803],
      [1.84e-9, 5.59805976614, 6283.14316029419],
      [1.84e-9, 2.85275392124, 7238.6755916],
      [1.79e-9, 2.54259058252, 14314.1681130498],
      [2.36e-9, 5.58826125715, 6069.7767545534],
      [1.89e-9, 2.72689937708, 6062.6632075526],
      [1.84e-9, 6.04216273598, 6283.0085396886],
      [2.25e-9, 1.66128561344, 4732.0306273434],
      [2.3e-9, 3.62591335086, 6284.0561710596],
      [1.72e-9, 0.97566476085, 3930.2096962196],
      [1.62e-9, 2.19467339429, 18073.7049386502],
      [2.15e-9, 1.04672844028, 3496.032826134],
      [1.82e-9, 5.17782354566, 17253.04110768959],
      [1.67e-9, 2.17754938066, 6076.8903015542],
      [1.67e-9, 4.75672473773, 17267.26820169119],
      [1.49e-9, 0.80944185798, 709.9330485583],
      [1.49e-9, 0.17584214812, 9779.1086761254],
      [1.92e-9, 5.00680790235, 11015.1064773348],
      [1.41e-9, 4.38420380014, 4136.9104335162],
      [1.58e-9, 4.60969054283, 9623.6882766912],
      [1.33e-9, 3.30507062245, 154717.6098876827],
      [1.66e-9, 6.13191098325, 3.523118349],
      [1.81e-9, 1.60715321141, 7.1135470008],
      [1.5e-9, 5.28136702046, 13517.8701062334],
      [1.42e-9, 0.49788089569, 25158.6017197654],
      [1.24e-9, 6.03440459813, 9225.539273283],
      [1.24e-9, 0.99251562639, 65147.6197681377],
      [1.28e-9, 1.92032744711, 22483.84857449259],
      [1.24e-9, 3.99739675184, 4686.8894077068],
      [1.21e-9, 2.37814805239, 167283.7615876655],
      [1.23e-9, 5.6231511294, 5642.1982426092],
      [1.17e-9, 5.81755956156, 12569.6748183318],
      [1.57e-9, 3.40236948518, 16496.3613962024],
      [1.3e-9, 2.10499918142, 1589.0728952838],
      [1.16e-9, 0.55839966736, 5849.3641121146],
      [1.23e-9, 5.81645568991, 6282.0955289232],
      [1.1e-9, 0.42176497674, 6172.869528772],
      [1.5e-9, 4.26279600865, 3128.3887650958],
      [1.06e-9, 2.27436561182, 5429.8794682394],
      [1.14e-9, 1.52894564202, 12559.038152982],
      [1.21e-9, 0.39459045915, 12132.439962106],
      [1.04e-9, 2.41845930933, 426.598190876],
      [1.09e-9, 5.82786999856, 16858.4825329332],
      [1.02e-9, 4.4662648491, 23543.23050468179],
      [1e-9, 2.93812275274, 4535.0594369244],
      [9.7e-10, 3.97935904984, 6133.5126528568],
      [9.8e-10, 0.87616810121, 6525.8044539654],
      [1.1e-9, 6.22339014386, 12146.6670561076],
      [9.8e-10, 3.17344332543, 10440.2742926036],
      [9.6e-10, 2.44128701699, 3097.88382272579],
      [9.9e-10, 5.75642493267, 7342.4577801806],
      [9e-10, 0.18984343165, 13119.72110282519],
      [9.9e-10, 5.58884724219, 2388.8940204492],
      [9.1e-10, 6.04278320182, 20426.571092422],
      [8e-10, 1.29028142103, 5650.2921106782],
      [8.6e-10, 3.94529200528, 10454.5013866052],
      [8.5e-10, 1.92836879835, 29088.811415985],
      [7.6e-10, 2.70726317966, 143571.32428481648],
      [9.1e-10, 5.63859073351, 8827.3902698748],
      [7.6e-10, 1.80783856698, 28286.9904848612],
      [7.5e-10, 3.40858032804, 5481.2549188676],
      [7e-10, 4.53719487231, 17256.6315363414],
      [8.9e-10, 1.10064490942, 11769.8536931664],
      [6.6e-10, 2.78384937771, 536.8045120954],
      [6.8e-10, 3.88199295043, 17260.1546546904],
      [8.8e-10, 3.88075269535, 7477.522860216],
      [6.1e-10, 6.17558202197, 11087.2851259184],
      [6e-10, 4.34824715818, 6206.8097787158],
      [8.2e-10, 4.59843208943, 9388.0059094152],
      [7.9e-10, 1.63139280394, 4933.2084403326],
      [8.1e-10, 1.55550779371, 9380.9596727172],
      [7.8e-10, 4.20905757519, 5729.506447149],
      [5.8e-10, 5.76889633224, 3634.6210245184],
      [6e-10, 0.93813100594, 12721.572099417],
      [7.1e-10, 6.11408885148, 8662.240323563],
      [5.7e-10, 5.48112524468, 18319.5365848796],
      [7e-10, 0.01749174864, 14945.3161735544],
      [7.4e-10, 1.0997604582, 16460.33352952499],
      [5.6e-10, 1.63036186739, 15720.8387848784],
      [5.5e-10, 4.86788348404, 13095.8426650774],
      [6e-10, 5.93729841267, 12539.853380183],
      [5.4e-10, 0.22608242982, 15110.4661198662],
      [5.4e-10, 2.30250047594, 16062.1845261168],
      [6.4e-10, 2.13513754101, 7875.6718636242],
      [5.9e-10, 5.87963500139, 5331.3574437408],
      [5.8e-10, 2.30546168615, 955.5997416086],
      [4.9e-10, 1.93839278478, 5333.9002410216],
      [5.4e-10, 5.80331607119, 12043.574281889],
      [5.4e-10, 4.44671053809, 4701.1165017084],
      [4.9e-10, 0.30241161485, 6805.6532680852],
      [4.6e-10, 2.76898193028, 6709.6740408674],
      [4.6e-10, 3.98449608961, 98068.53671630539],
      [4.9e-10, 3.72022009896, 12323.4230960088],
      [4.5e-10, 3.30065998328, 22003.9146348698],
      [4.8e-10, 0.71071357303, 6303.4311693902],
      [6.1e-10, 1.66030429494, 6262.300454499],
      [4.7e-10, 1.26317154881, 11919.140866668],
      [5.1e-10, 1.08020906825, 10988.808157535],
      [4.5e-10, 0.89150445122, 51868.2486621788],
      [4.3e-10, 0.57756724285, 24356.7807886416],
      [4.3e-10, 1.61526242998, 6277.552925684],
      [4.5e-10, 2.96132920534, 8982.810669309],
      [4.3e-10, 5.74295325645, 11403.676995575],
      [5.5e-10, 3.14274403422, 33019.0211122046],
      [5.7e-10, 0.06379726305, 15671.0817594066],
      [4.1e-10, 2.53761820726, 6262.7205305926],
      [4e-10, 1.53130436944, 18451.07854656599],
      [5.2e-10, 1.71451922581, 1551.045222648],
      [5.5e-10, 0.89439119424, 11933.3679606696],
      [4.5e-10, 3.88495384656, 60530.4889857418],
      [4e-10, 4.75740908001, 38526.574350872],
      [4e-10, 3.77498297348, 26087.9031415742],
      [3.9e-10, 2.97113832621, 2118.7638603784],
      [4e-10, 3.36050962605, 10021.8372800994],
      [4.7e-10, 1.67051113434, 6303.8512454838],
      [5.2e-10, 5.21827368711, 77713.7714681205],
      [4.7e-10, 4.26356628717, 21424.4666443034],
      [3.7e-10, 1.66712389942, 6819.8803620868],
      [3.7e-10, 0.65746800933, 12029.3471878874],
      [3.5e-10, 3.36255650927, 24072.9214697764],
      [3.6e-10, 0.11087914947, 10344.2950653858],
      [4e-10, 4.14725582115, 2787.0430238574],
      [3.5e-10, 5.93650887012, 31570.7996493912],
      [3.6e-10, 2.15108874765, 30774.5016425748],
      [3.6e-10, 1.75078825382, 16207.886271502],
      [3.4e-10, 2.75708224536, 12139.5535091068],
      [3.4e-10, 6.168913788, 24491.4257925834],
      [3.4e-10, 2.31528650443, 55798.4583583984],
      [3.2e-10, 4.21446357042, 15664.03552270859],
      [3.4e-10, 3.19783054699, 32217.2001810808],
      [3.9e-10, 1.24979117796, 6418.1409300268],
      [3.8e-10, 5.89832942685, 640.8776073822],
      [3.3e-10, 4.80200120107, 16723.350142595],
      [3.2e-10, 1.72442327688, 27433.88921587499],
      [3.5e-10, 4.44608896525, 18202.21671665939],
      [3.1e-10, 4.5279073128, 6702.5604938666],
      [3.4e-10, 3.96287980676, 18216.443810661],
      [3e-10, 5.06259854444, 226858.23855437007],
      [3.4e-10, 1.43910280005, 49515.382508407],
      [3e-10, 0.29303163371, 13521.7514415914],
      [2.9e-10, 2.0263384022, 11609.8625440122],
      [3e-10, 2.5492323024, 9924.8104215106],
      [3.2e-10, 4.91793198558, 11300.5842213564],
      [3e-10, 0.23284423547, 23581.2581773176],
      [2.9e-10, 1.62807736495, 639.897286314],
      [2.8e-10, 3.84568936822, 2699.7348193176],
      [2.9e-10, 1.83149729794, 29822.7832363242],
      [3.3e-10, 4.60320094415, 19004.6479494084],
      [2.7e-10, 1.86151121799, 6288.5987742988],
      [3e-10, 4.4649407224, 36147.4098773004],
      [2.8e-10, 5.19684492912, 5863.5912061162],
      [3.5e-10, 4.52695674113, 36949.2308084242],
      [2.7e-10, 3.52528177609, 10770.8932562618],
      [2.6e-10, 1.48499438453, 11080.1715789176],
      [3.5e-10, 2.82154380962, 19402.7969528166],
      [2.5e-10, 2.46339998836, 6279.4854213396],
      [2.6e-10, 4.97688894643, 16737.5772365966],
      [2.7e-10, 0.408271125, 12964.300703391],
      [2.9e-10, 4.15148654061, 45892.73043315699],
      [2.6e-10, 4.56404104286, 17796.9591667858],
      [2.5e-10, 2.89309528854, 6286.6662786432],
      [2.6e-10, 4.82914580957, 1066.49547719],
      [3.1e-10, 3.93096113738, 29864.334027309],
      [2.4e-10, 6.14987193584, 18606.4989460002],
      [2.4e-10, 3.74225964547, 29026.48522950779],
      [2.5e-10, 5.70460621565, 27707.5424942948],
      [2.5e-10, 5.33928840652, 15141.390794312],
      [2.3e-10, 2.37624087345, 17996.0311682222],
      [2.6e-10, 1.34231351782, 18875.525869774],
      [2.2e-10, 5.5079162612, 6245.0481773556],
      [2.4e-10, 1.33998410121, 19800.9459562248],
      [2.3e-10, 0.2251228089, 6279.7894925736],
      [2.2e-10, 1.17576471775, 11925.2740926006],
      [2.2e-10, 3.5860360664, 6915.8595893046],
      [2.3e-10, 3.21621246666, 6286.3622074092],
      [2.9e-10, 2.09564449439, 15265.8865193004],
      [2.2e-10, 4.74660932338, 28230.18722269139],
      [2.1e-10, 2.30688751432, 5999.2165311262],
      [2.8e-10, 3.92087592807, 18208.349942592],
      [2.1e-10, 3.22643339385, 25934.1243310894],
      [2.1e-10, 3.04956726238, 6566.9351688566],
      [2.7e-10, 5.35645770522, 33794.5437235286],
      [2.5e-10, 5.91542362188, 6489.2613984286],
      [2e-10, 1.52296293311, 135.0650800354],
      [1.9e-10, 1.78134428631, 156137.47598479927],
      [1.9e-10, 0.34388684087, 5327.4761083828],
      [2.6e-10, 3.41701003233, 25287.7237993998],
      [1.9e-10, 2.86664271911, 18422.62935909819],
      [1.9e-10, 4.71432851499, 77690.75950573849],
      [1.9e-10, 2.54227398241, 77736.78343050249],
      [2e-10, 5.91915117116, 48739.859897083]
    ],
    "2": [
      [0.00004359385, 5.78455133808, 6283.0758499914],
      [0.00000123633, 5.57935427994, 12566.1516999828],
      [1.2342e-7, 3.14159265359, 0],
      [8.792e-8, 3.62777893099, 77713.7714681205],
      [5.689e-8, 1.86958905084, 5573.1428014331],
      [3.302e-8, 5.47034879713, 18849.2275499742],
      [1.471e-8, 4.47964125007, 5507.5532386674],
      [1.013e-8, 2.81323115556, 5223.6939198022],
      [8.54e-9, 3.107765669, 1577.3435424478],
      [1.102e-8, 2.84173992403, 161000.6857376741],
      [6.48e-9, 5.47348203398, 775.522611324],
      [6.08e-9, 1.37894173533, 6438.4962494256],
      [4.99e-9, 4.4164924225, 6286.5989683404],
      [4.16e-9, 0.90332697974, 10977.078804699],
      [4.04e-9, 3.2056726953, 5088.6288397668],
      [3.51e-9, 1.81081728907, 5486.777843175],
      [4.66e-9, 3.65086758149, 7084.8967811152],
      [4.58e-9, 5.38585314743, 149854.4001348079],
      [3.04e-9, 3.51015066341, 796.2980068164],
      [2.66e-9, 6.17413982699, 6836.6452528338],
      [2.81e-9, 1.8387467254, 4694.0029547076],
      [2.62e-9, 1.41420110644, 2146.1654164752],
      [2.64e-9, 3.14103683911, 71430.69561812909],
      [3.19e-9, 5.35037932146, 3154.6870848956],
      [2.38e-9, 2.17695432424, 155.4203994342],
      [2.29e-9, 4.7596958807, 7234.794256242],
      [2.91e-9, 4.61776401638, 4690.4798363586],
      [2.11e-9, 0.21864885298, 4705.7323075436],
      [2.04e-9, 4.22895113488, 1349.8674096588],
      [1.95e-9, 4.58550676556, 529.6909650946],
      [2.55e-9, 2.81442711144, 1748.016413067],
      [1.82e-9, 5.70454011389, 6040.3472460174],
      [1.8e-9, 6.02147727878, 4292.3308329504],
      [1.86e-9, 1.58690991244, 6309.3741697912],
      [1.67e-9, 2.88802733052, 9437.762934887],
      [1.66e-9, 1.99990574734, 8031.0922630584],
      [1.6e-9, 0.04412738495, 2544.3144198834],
      [1.97e-9, 2.01089431842, 1194.4470102246],
      [1.65e-9, 5.78372596774, 83996.84731811189],
      [2.14e-9, 3.38300910371, 7632.9432596502],
      [1.4e-9, 0.36669664351, 10447.3878396044],
      [1.51e-9, 0.95519595275, 6127.6554505572],
      [1.36e-9, 1.48417295645, 2352.8661537718],
      [1.28e-9, 5.48057748834, 951.7184062506],
      [1.26e-9, 5.26866506592, 6279.5527316424],
      [1.27e-9, 3.77552907014, 6812.766815086],
      [1.03e-9, 4.95897533789, 398.1490034082],
      [1.04e-9, 0.70183576826, 1592.5960136328],
      [1.01e-9, 1.14481598642, 3894.1818295422],
      [1.31e-9, 0.76624310306, 553.5694028424],
      [1.09e-9, 5.41063597567, 6256.7775301916],
      [7.8e-10, 5.84775340741, 242.728603974],
      [9.7e-10, 1.94685257714, 11856.2186514245],
      [1e-9, 5.19725292131, 244287.60000722768],
      [7.6e-10, 0.70480774041, 8429.2412664666],
      [8e-10, 6.18430772683, 1059.3819301892],
      [6.8e-10, 5.29561709093, 14143.4952424306],
      [8.5e-10, 5.39487308005, 25132.3033999656],
      [5.5e-10, 5.16874637579, 7058.5984613154],
      [6.3e-10, 0.48494730699, 801.8209311238],
      [5.8e-10, 4.07254840265, 13367.9726311066],
      [5.1e-10, 3.89696552232, 12036.4607348882],
      [5.1e-10, 5.56335232286, 1990.745017041],
      [6e-10, 2.2504659671, 8635.9420037632],
      [4.9e-10, 5.58163417371, 6290.1893969922],
      [5.1e-10, 3.87240194908, 26.2983197998],
      [5.1e-10, 4.19300909995, 7860.4193924392],
      [4.1e-10, 3.97169191582, 10973.55568635],
      [4.1e-10, 3.5708091923, 7079.3738568078],
      [5.6e-10, 2.76959005761, 90955.5516944961],
      [4.2e-10, 1.91461189163, 7477.522860216],
      [4.2e-10, 0.42775891995, 10213.285546211],
      [4.2e-10, 1.06925480488, 709.9330485583],
      [3.8e-10, 6.17935925345, 9917.6968745098],
      [5e-10, 0.81691517401, 11506.7697697936],
      [5.3e-10, 1.45828359397, 233141.3144043615],
      [3.8e-10, 3.32444534628, 5643.1785636774],
      [4.7e-10, 6.21543665927, 6681.2248533996],
      [3.7e-10, 0.3635930998, 10177.2576795336],
      [4.5e-10, 5.29587706357, 10575.4066829418],
      [3.4e-10, 5.63446915337, 6525.8044539654],
      [3.4e-10, 5.36385158519, 4933.2084403326],
      [3.5e-10, 5.36152295839, 25158.6017197654],
      [4.2e-10, 5.08837645072, 11015.1064773348],
      [4.2e-10, 4.22496037505, 88860.05707098669],
      [3.9e-10, 1.99171699618, 6284.0561710596],
      [2.9e-10, 3.1908862817, 11926.2544136688],
      [2.9e-10, 0.14996158324, 12168.0026965746],
      [3e-10, 1.58346276808, 9779.1086761254],
      [2.6e-10, 4.16210340581, 12569.6748183318],
      [3.6e-10, 2.74684637873, 3738.761430108],
      [2.6e-10, 0.7282491532, 1589.0728952838],
      [3.1e-10, 5.34906371821, 143571.32428481648],
      [2.5e-10, 0.10240267494, 22483.84857449259],
      [3e-10, 3.47110495524, 14945.3161735544],
      [2.6e-10, 3.89359701125, 5753.3848848968],
      [2.4e-10, 1.18744224678, 4535.0594369244],
      [3.3e-10, 2.99317143244, 3930.2096962196],
      [2.4e-10, 1.57253767584, 6496.3749454294],
      [2.4e-10, 3.47434797542, 4136.9104335162],
      [2.2e-10, 3.91230073719, 6275.9623029906],
      [2.5e-10, 4.02978941287, 3128.3887650958],
      [2.3e-10, 1.07724492065, 12721.572099417],
      [2.1e-10, 1.89591807148, 16730.4636895958],
      [2.5e-10, 2.42198937013, 5729.506447149],
      [2e-10, 1.78163489101, 17789.845619785],
      [2.1e-10, 0.49258939822, 29088.811415985],
      [2.6e-10, 4.14947806747, 2388.8940204492],
      [2.7e-10, 2.54785812264, 3496.032826134],
      [2e-10, 4.29944129273, 16858.4825329332],
      [2.1e-10, 5.97796936723, 7.1135470008],
      [1.9e-10, 0.80292033311, 16062.1845261168],
      [2.4e-10, 4.89894141052, 17260.1546546904],
      [2.5e-10, 1.37003752175, 6282.0955289232],
      [2.2e-10, 4.92663152168, 18875.525869774],
      [2.3e-10, 5.68902059771, 16460.33352952499],
      [2.3e-10, 3.03021283729, 66567.48586525429],
      [1.6e-10, 3.89713736666, 5331.3574437408],
      [1.6e-10, 5.68562539832, 12559.038152982],
      [1.6e-10, 3.95085099736, 3097.88382272579],
      [1.6e-10, 3.99041783945, 6283.14316029419],
      [2e-10, 6.106439191, 167283.7615876655],
      [1.5e-10, 4.09775914607, 11712.9553182308],
      [1.6e-10, 5.717699407, 17298.1823273262],
      [1.6e-10, 3.28894009404, 5884.9268465832],
      [1.5e-10, 4.4256424368, 13517.8701062334],
      [1.6e-10, 4.4345208093, 6283.0085396886],
      [1.4e-10, 1.44384279999, 4164.311989613],
      [1.4e-10, 4.47380919159, 11790.6290886588],
      [1.4e-10, 4.77646531825, 7342.4577801806],
      [1.1e-10, 2.56768522896, 5481.2549188676],
      [1.1e-10, 1.514433322, 16200.7727245012],
      [1.1e-10, 0.88708889185, 21228.3920235458],
      [1.4e-10, 4.50116508534, 640.8776073822]
    ],
    "3": [
      [0.00000144595, 4.27319433901, 6283.0758499914],
      [6.729e-8, 3.91706261708, 12566.1516999828],
      [7.74e-9, 0, 0],
      [2.47e-9, 3.73021571217, 18849.2275499742],
      [3.6e-10, 2.8008140905, 6286.5989683404],
      [3.3e-10, 5.62990083112, 6127.6554505572],
      [1.8e-10, 3.72826142555, 6438.4962494256],
      [1.6e-10, 4.26011484232, 6525.8044539654],
      [1.4e-10, 3.47817116396, 6256.7775301916],
      [1.2e-10, 3.55747379482, 25132.3033999656],
      [1e-10, 4.43995693209, 4705.7323075436],
      [1e-10, 4.2804525547, 83996.84731811189],
      [9e-11, 5.36457057335, 6040.3472460174],
      [8e-11, 1.78458957263, 5507.5532386674],
      [9e-11, 0.4727519993, 6279.5527316424],
      [9e-11, 1.34741231639, 6309.3741697912],
      [9e-11, 0.77092900708, 5729.506447149],
      [7e-11, 3.50146897332, 7058.5984613154],
      [5e-11, 2.890710617, 775.522611324],
      [6e-11, 2.36514111314, 6836.6452528338]
    ],
    "4": [
      [3.858e-8, 2.56389016346, 6283.0758499914],
      [3.06e-9, 2.26911740541, 12566.1516999828],
      [5.3e-10, 3.44031471924, 5573.1428014331],
      [1.5e-10, 2.03136359366, 18849.2275499742],
      [1.3e-10, 2.05688873673, 77713.7714681205],
      [7e-11, 4.4121885448, 161000.6857376741],
      [4e-11, 5.33854414781, 6438.4962494256],
      [6e-11, 3.81514213664, 149854.4001348079],
      [4e-11, 4.26602478239, 6127.6554505572]
    ],
    "5": [
      [8.6e-10, 1.21805304895, 6283.0758499914],
      [1.2e-10, 0.65572878044, 12566.1516999828]
    ]
  },
  name: "earth"
};
},{}],3:[function(require,module,exports){
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.lightTime = lightTime;
exports.JulianYearToJDE = JulianYearToJDE;
exports.JDEToJulianYear = JDEToJulianYear;
exports.BesselianYearToJDE = BesselianYearToJDE;
exports.JDEToBesselianYear = JDEToBesselianYear;
exports.J2000Century = J2000Century;
exports.illuminated = illuminated;
exports.Coord = Coord;
exports.limb = limb;
exports.pmod = pmod;
exports.horner = horner;
exports.floorDiv = floorDiv;
exports.cmp = cmp;
exports.sincos = sincos;
exports.toRad = toRad;
exports.toDeg = toDeg;
exports.modf = modf;
exports.round = round;
exports.errorCode = errorCode;
/**
 * @copyright 2013 Sonia Keys
 * @copyright 2016 commenthol
 * @license MIT
 * @module base
 */
/**
 * Base: Functions and other definitions useful with multiple packages.
 *
 * Base contains various definitions and support functions useful in multiple
 * chapters.
 *
 * Bessellian and Julian Year
 *
 * Chapter 21, Precession actually contains these definitions.  They are moved
 * here because of their general utility.
 *
 * Chapter 22, Nutation contains the function for Julian centuries since J2000.
 *
 * Phase angle functions
 *
 * Two functions, Illuminated and Limb, concern the illumnated phase of a body
 * and are given in two chapters, 41 an 48.  They are collected here because
 * the identical functions apply in both chapters.
 *
 * General purpose math functions
 *
 * SmallAngle is recommended in chapter 17, p. 109.
 *
 * PMod addresses the issue on p. 7, chapter 1, in the section "Trigonometric
 * functions of large angles", but the function is not written to be specific
 * to angles and so has more general utility.
 *
 * Horner is described on p. 10, chapter 1.
 *
 * FloorDiv and FloorDiv64 are optimizations for the INT function described
 * on p. 60, chapter 7.
*/

// ---- constants ----

/** K is the Gaussian gravitational constant. */
var K = exports.K = 0.01720209895;
// K from ch 33, p. 228, for example

/** AU is one astronomical unit in km. */
var AU = exports.AU = 149597870;
// from Appendix I, p, 407.

/** SOblJ2000 sine obliquity at J2000. */
var SOblJ2000 = exports.SOblJ2000 = 0.397777156;
/** COblJ2000 cosine obliquity at J2000. */
var COblJ2000 = exports.COblJ2000 = 0.917482062;
// SOblJ2000, COblJ2000 from ch 33, p. 228, for example

/**
 * lightTime returns time for light to travel a given distance.
 * `dist` is distance in to earth in AU. √(x² + y² + z²)
 * Result in seconds of time.
 * @param {Number} dist - distance in to earth in AU
 * @returns {Number} time for light to travel a given distance in seconds
 */
function lightTime(dist) {
  // Formula given as (33.3) p. 224.
  return 0.0057755183 * dist;
}

// ---- julian ----

/**
 * Julian and Besselian years described in chapter 21, Precession.
 * T, Julian centuries since J2000 described in chapter 22, Nutation.
 */

/** JMod is the Julian date of the modified Julian date epoch. */
var JMod = exports.JMod = 2400000.5;

/** J2000 is the Julian date corresponding to January 1.5, year 2000. */
var J2000 = exports.J2000 = 2451545.0;

// Julian days of common epochs.
// B1900, B1950 from p. 133
/** Julian days of Julian epoch 1900 */
var J1900 = exports.J1900 = 2415020.0;
/** Julian days of Besselian epoch 1900 */
var B1900 = exports.B1900 = 2415020.3135;
/** Julian days of Besselian epoch 1950 */
var B1950 = exports.B1950 = 2433282.4235;

// JulianYear and other common periods
/** JulianYear in days */
var JulianYear = exports.JulianYear = 365.25; // days
/** JulianCentury in days */
var JulianCentury = exports.JulianCentury = 36525; // days
/** BesselianYear in days; equals mean tropical year */
var BesselianYear = exports.BesselianYear = 365.2421988; // days
/** Mean sidereal year */
var meanSiderealYear = exports.meanSiderealYear = 365.25636; // days

/**
 * JulianYearToJDE returns the Julian ephemeris day for a Julian year.
 * @param {Number} jy - Julian year
 * @returns {Number} jde - Julian ephemeris day
 */
function JulianYearToJDE(jy) {
  return J2000 + JulianYear * (jy - 2000);
}

/**
 * JDEToJulianYear returns a Julian year for a Julian ephemeris day.
 * @param {Number} jde - Julian ephemeris day
 * @returns {Number} jy - Julian year
 */
function JDEToJulianYear(jde) {
  return 2000 + (jde - J2000) / JulianYear;
}

/**
 * BesselianYearToJDE returns the Julian ephemeris day for a Besselian year.
 * @param {Number} by - Besselian year
 * @returns {Number} jde - Julian ephemeris day
 */
function BesselianYearToJDE(by) {
  return B1900 + BesselianYear * (by - 1900);
}

/**
 * JDEToBesselianYear returns the Besselian year for a Julian ephemeris day.
 * @param {Number} jde - Julian ephemeris day
 * @returns {Number} by - Besselian year
 */
function JDEToBesselianYear(jde) {
  return 1900 + (jde - B1900) / BesselianYear;
}

/**
 * J2000Century returns the number of Julian centuries since J2000.
 *
 * The quantity appears as T in a number of time series.
 * @param {Number} jde - Julian ephemeris day
 * @returns {Number} number of Julian centuries since J2000
 */
function J2000Century(jde) {
  // The formula is given in a number of places in the book, for example
  // (12.1) p. 87.
  // (22.1) p. 143.
  // (25.1) p. 163.
  return (jde - J2000) / JulianCentury;
}

// ---- phase ----

/**
 * illuminated returns the illuminated fraction of a body's disk.
 *
 * The illuminated body can be the Moon or a planet.
 *
 * @param {Number} i - phase angle in radians.
 * @returns {Number} illuminated fraction of a body's disk.
 */
function illuminated(i) {
  // (41.1) p. 283, also (48.1) p. 345.
  return (1 + Math.cos(i)) * 0.5;
}

/**
 * celestial coordinates in right ascension and declination
 * or ecliptic coordinates in longitude and latitude
 *
 * @param {number} ra - right ascension (or longitude)
 * @param {number} dec - declination (or latitude)
 * @param {number} [range] - distance
 * @param {number} [elongation] - elongation
 */
function Coord(ra /* lon */, dec /* lat */, range, elongation) {
  this._ra = ra || 0;
  this._dec = dec || 0;
  this.range = range;
  this.elongation = elongation;

  Object.defineProperties(this, {
    ra: {
      get: function get() {
        return this._ra;
      },
      set: function set(ra) {
        this._ra = ra;
      }
    },
    dec: {
      get: function get() {
        return this._dec;
      },
      set: function set(dec) {
        this._dec = dec;
      }
    },
    lon: {
      get: function get() {
        return this._ra;
      },
      set: function set(ra) {
        this._ra = ra;
      }
    },
    lat: {
      get: function get() {
        return this._dec;
      },
      set: function set(dec) {
        this._dec = dec;
      }
    }
  });
}

/**
 * Limb returns the position angle of the midpoint of an illuminated limb.
 *
 * The illuminated body can be the Moon or a planet.
 *
 * @param {base.Coord} equ - equatorial coordinates of the body `{ra, dec}` (in radians)
 * @param {base.Coord} appSun - apparent coordinates of the Sun `{ra, dec}` (In radians).
 * @returns {Number} position angle of the midpoint (in radians).
 */
function limb(equ, appSun) {
  var α = equ.ra;
  var δ = equ.dec;
  var α0 = appSun.ra;
  var δ0 = appSun.dec;
  // Mentioned in ch 41, p. 283.  Formula (48.5) p. 346
  var sδ = Math.sin(δ);
  var cδ = Math.cos(δ);
  var sδ0 = Math.sin(δ0);
  var cδ0 = Math.cos(δ0);
  var sα0α = Math.sin(α0 - α);
  var cα0α = Math.cos(α0 - α);
  var χ = Math.atan2(cδ0 * sα0α, sδ0 * cδ - cδ0 * sδ * cα0α);
  if (χ < 0) {
    χ += 2 * Math.PI;
  }
  return χ;
}

// ---- math ----

// In chapter 17, p. 109, Meeus recommends 10′.
/**
 * SmallAngle is threshold used by various routines for switching between
 * trigonometric functions and Pythagorean approximations.
 */
var SmallAngle = exports.SmallAngle = 10 * Math.PI / 180 / 60; // about .003 radians
/** cosine of SmallAngle */
var CosSmallAngle = exports.CosSmallAngle = Math.cos(SmallAngle); // about .999996

/**
 * pmod returns a positive floating-point x mod y.
 *
 * For a positive argument y, it returns a value in the range [0,y).
 *
 * @param {Number} x
 * @param {Number} y
 * @returns {Number} x % y - The result may not be useful if y is negative.
 */
function pmod(x, y) {
  var r = x % y;
  if (r < 0) {
    r += y;
  }
  return r;
}

/**
 * horner evaluates a polynomal with coefficients c at x.  The constant
 * term is c[0].
 * @param {Number} x
 * @param {Number|Number[]} c - coefficients
 * @returns {Number}
 */
function horner(x) {
  for (var _len = arguments.length, c = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
    c[_key - 1] = arguments[_key];
  }

  if (Array.isArray(c[0])) {
    c = c[0];
  }
  var i = c.length - 1;
  var y = c[i];
  while (i > 0) {
    i--;
    y = y * x + c[i];
  }
  return y;
}

/**
 * FloorDiv returns the integer floor of the fractional value (x / y).
 * @param {Number} x
 * @param {Number} y
 * @returns {Number} (int)
 */
function floorDiv(x, y) {
  var q = x / y;
  return Math.floor(q);
}

/**
 * Cmp compares two float64s and returns -1, 0, or 1 if a is <, ==, or > b,
 * respectively.
 * .
 * @param {Number} a
 * @param {Number} b
 * @returns {Number} comparison result
 */
function cmp(a, b) {
  if (a < b) return -1;
  if (a > b) return 1;
  return 0;
}

/**
 * shorthand function for Math.sin, Math.cos
 * @param {Number} ε
 * @returns {Number[]} [sin(ε), cos(ε)]
 */
function sincos(ε) {
  return [Math.sin(ε), Math.cos(ε)];
}

/**
 * Convert degrees to radians
 * @param  {Number} deg - Angle in degrees
 * @return {Number} Angle in radians
 */
function toRad(deg) {
  return Math.PI / 180.0 * deg;
}

/**
 * Convert radians to degrees
 * @param  {Number} rad - Angle in radians
 * @return {Number} Angle in degrees
 */
function toDeg(rad) {
  return 180.0 / Math.PI * rad;
}

/**
 * separate fix `i` from fraction `f`
 * @param {Number} float
 * @returns {Array} [i, f]
 *  {Number} i - (int) fix value
 *  {Number} f - (float) fractional portion; always > 1
 */
function modf(float) {
  var i = Math.trunc(float);
  var f = Math.abs(float - i);
  return [i, f];
}

/**
 * Rounds `float` value by precision
 * @param {Number} float - value to round
 * @param {Number} precision - (int) number of post decimal positions
 * @return {Number} rounded `float`
 */
function round(float, precision) {
  precision = precision == undefined ? 14 : precision; // eslint-disable-line eqeqeq
  return parseFloat(float.toFixed(precision), 10);
}

function errorCode(msg, code) {
  var err = new Error(msg);
  err.code = code;
  return err;
}

exports.default = {
  K: K,
  AU: AU,
  SOblJ2000: SOblJ2000,
  COblJ2000: COblJ2000,
  lightTime: lightTime,
  JMod: JMod,
  J2000: J2000,
  J1900: J1900,
  B1900: B1900,
  B1950: B1950,
  JulianYear: JulianYear,
  JulianCentury: JulianCentury,
  BesselianYear: BesselianYear,
  meanSiderealYear: meanSiderealYear,
  JulianYearToJDE: JulianYearToJDE,
  JDEToJulianYear: JDEToJulianYear,
  BesselianYearToJDE: BesselianYearToJDE,
  JDEToBesselianYear: JDEToBesselianYear,
  J2000Century: J2000Century,
  illuminated: illuminated,
  Coord: Coord,
  limb: limb,
  SmallAngle: SmallAngle,
  CosSmallAngle: CosSmallAngle,
  pmod: pmod,
  horner: horner,
  floorDiv: floorDiv,
  cmp: cmp,
  sincos: sincos,
  toRad: toRad,
  toDeg: toDeg,
  modf: modf,
  round: round,
  errorCode: errorCode
};
},{}],4:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.galactic0Lon1950 = exports.galacticLon0 = exports.galacticNorth1950 = exports.galacticNorth = exports.Galactic = exports.Horizontal = exports.Equatorial = exports.Ecliptic = undefined;

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @copyright 2013 Sonia Keys
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @copyright 2016 commenthol
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @license MIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @module coord
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      */
/**
 * Coord: Chapter 13, Transformation of Coordinates.
 *
 * Transforms in this package are provided in two forms, function and method.
 * The results of the two forms should be identical.
 *
 * The function forms pass all arguments and results as single values.  These
 * forms are best used when you are transforming a single pair of coordinates
 * and wish to avoid memory allocation.
 *
 * The method forms take and return pointers to structs.  These forms are best
 * used when you are transforming multiple coordinates and can reuse one or
 * more of the structs.  In this case reuse of structs will minimize
 * allocations, and the struct pointers will pass more efficiently on the
 * stack.  These methods transform their arguments, placing the result in
 * the receiver.  The receiver is then returned for convenience.
 *
 * A number of the functions take sine and cosine of the obliquity of the
 * ecliptic.  This becomes an advantage when you doing multiple transformations
 * with the same obliquity.  The efficiency of computing sine and cosine once
 * and reuse these values far outweighs the overhead of passing one number as
 * opposed to two.
 */

var _base = require('./base');

var _base2 = _interopRequireDefault(_base);

var _sexagesimal = require('./sexagesimal');

var _sexagesimal2 = _interopRequireDefault(_sexagesimal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

/**
* Ecliptic coordinates are referenced to the plane of the ecliptic.
*/
var Ecliptic = exports.Ecliptic = function () {
  /**
   * IMPORTANT: Longitudes are measured *positively* westwards
   * e.g. Washington D.C. +77°04; Vienna -16°23'
   * @param {Number} lon - Longitude (λ) in radians
   * @param {Number} lat - Latitude (β) in radians
   */
  function Ecliptic(lon, lat) {
    _classCallCheck(this, Ecliptic);

    if ((typeof lon === 'undefined' ? 'undefined' : _typeof(lon)) === 'object') {
      lat = lon.lat;
      lon = lon.lon;
    }
    this.lon = lon || 0;
    this.lat = lat || 0;
  }

  /**
   * converts ecliptic coordinates to equatorial coordinates.
   * @param {Number} ε - Obliquity
   * @returns {Equatorial}
   */


  _createClass(Ecliptic, [{
    key: 'toEquatorial',
    value: function toEquatorial(ε) {
      var _base$sincos = _base2.default.sincos(ε),
          _base$sincos2 = _slicedToArray(_base$sincos, 2),
          εsin = _base$sincos2[0],
          εcos = _base$sincos2[1];

      var _base$sincos3 = _base2.default.sincos(this.lat),
          _base$sincos4 = _slicedToArray(_base$sincos3, 2),
          sβ = _base$sincos4[0],
          cβ = _base$sincos4[1];

      var _base$sincos5 = _base2.default.sincos(this.lon),
          _base$sincos6 = _slicedToArray(_base$sincos5, 2),
          sλ = _base$sincos6[0],
          cλ = _base$sincos6[1];

      var ra = Math.atan2(sλ * εcos - sβ / cβ * εsin, cλ); // (13.3) p. 93
      if (ra < 0) {
        ra += 2 * Math.PI;
      }
      var dec = Math.asin(sβ * εcos + cβ * εsin * sλ); // (13.4) p. 93
      return new Equatorial(ra, dec);
    }
  }]);

  return Ecliptic;
}();

/**
 * Equatorial coordinates are referenced to the Earth's rotational axis.
 */


var Equatorial = exports.Equatorial = function () {
  /**
   * @param {Number} ra - (float) Right ascension (α) in radians
   * @param {Number} dec - (float) Declination (δ) in radians
   */
  function Equatorial() {
    var ra = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
    var dec = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;

    _classCallCheck(this, Equatorial);

    this.ra = ra;
    this.dec = dec;
  }

  /**
   * EqToEcl converts equatorial coordinates to ecliptic coordinates.
   * @param {Number} ε - Obliquity
   * @returns {Ecliptic}
   */


  _createClass(Equatorial, [{
    key: 'toEcliptic',
    value: function toEcliptic(ε) {
      var _base$sincos7 = _base2.default.sincos(ε),
          _base$sincos8 = _slicedToArray(_base$sincos7, 2),
          εsin = _base$sincos8[0],
          εcos = _base$sincos8[1];

      var _base$sincos9 = _base2.default.sincos(this.ra),
          _base$sincos10 = _slicedToArray(_base$sincos9, 2),
          sα = _base$sincos10[0],
          cα = _base$sincos10[1];

      var _base$sincos11 = _base2.default.sincos(this.dec),
          _base$sincos12 = _slicedToArray(_base$sincos11, 2),
          sδ = _base$sincos12[0],
          cδ = _base$sincos12[1];

      var lon = Math.atan2(sα * εcos + sδ / cδ * εsin, cα); // (13.1) p. 93
      var lat = Math.asin(sδ * εcos - cδ * εsin * sα); // (13.2) p. 93
      return new Ecliptic(lon, lat);
    }

    /**
     * EqToHz computes Horizontal coordinates from equatorial coordinates.
     *
     * Argument g is the location of the observer on the Earth.  Argument st
     * is the sidereal time at Greenwich.
     *
     * Sidereal time must be consistent with the equatorial coordinates.
     * If coordinates are apparent, sidereal time must be apparent as well.
     *
     * @param {Equatorial} eq - equatorial coordinates (right ascension, declination)
     * @param {globe.Coord} g - coordinates of observer on Earth
     * @param {Number} st - sidereal time at Greenwich at time of observation
     * @returns {Horizontal}
     */

  }, {
    key: 'toHorizontal',
    value: function toHorizontal(g, st) {
      var H = new _sexagesimal2.default.Time(st).rad() - g.lon - this.ra;

      var _base$sincos13 = _base2.default.sincos(H),
          _base$sincos14 = _slicedToArray(_base$sincos13, 2),
          sH = _base$sincos14[0],
          cH = _base$sincos14[1];

      var _base$sincos15 = _base2.default.sincos(g.lat),
          _base$sincos16 = _slicedToArray(_base$sincos15, 2),
          sφ = _base$sincos16[0],
          cφ = _base$sincos16[1];

      var _base$sincos17 = _base2.default.sincos(this.dec),
          _base$sincos18 = _slicedToArray(_base$sincos17, 2),
          sδ = _base$sincos18[0],
          cδ = _base$sincos18[1];

      var azimuth = Math.atan2(sH, cH * sφ - sδ / cδ * cφ); // (13.5) p. 93
      var altitude = Math.asin(sφ * sδ + cφ * cδ * cH); // (13.6) p. 93
      return new Horizontal(azimuth, altitude);
    }

    /**
     * EqToGal converts equatorial coordinates to galactic coordinates.
     *
     * Equatorial coordinates must be referred to the standard equinox of B1950.0.
     * For conversion to B1950, see package precess and utility functions in
     * package "common".
     *
     * @param {Equatorial} eq
     * @returns {Galactic}
     */

  }, {
    key: 'toGalactic',
    value: function toGalactic() {
      var _base$sincos19 = _base2.default.sincos(galacticNorth1950.ra - this.ra),
          _base$sincos20 = _slicedToArray(_base$sincos19, 2),
          sdα = _base$sincos20[0],
          cdα = _base$sincos20[1];

      var _base$sincos21 = _base2.default.sincos(galacticNorth1950.dec),
          _base$sincos22 = _slicedToArray(_base$sincos21, 2),
          sgδ = _base$sincos22[0],
          cgδ = _base$sincos22[1];

      var _base$sincos23 = _base2.default.sincos(this.dec),
          _base$sincos24 = _slicedToArray(_base$sincos23, 2),
          sδ = _base$sincos24[0],
          cδ = _base$sincos24[1];

      var x = Math.atan2(sdα, cdα * sgδ - sδ / cδ * cgδ); // (13.7) p. 94
      // (galactic0Lon1950 + 1.5*math.Pi) = magic number of 303 deg
      var lon = (galactic0Lon1950 + 1.5 * Math.PI - x) % (2 * Math.PI); // (13.8) p. 94
      var lat = Math.asin(sδ * sgδ + cδ * cgδ * cdα);
      return new Galactic(lon, lat);
    }
  }]);

  return Equatorial;
}();

/**
 * Horizontal coordinates are referenced to the local horizon of an observer
 * on the surface of the Earth.
 * @param {Number} az - Azimuth (A) in radians
 * @param {Number} alt - Altitude (h) in radians
 */


var Horizontal = exports.Horizontal = function () {
  function Horizontal() {
    var az = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
    var alt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;

    _classCallCheck(this, Horizontal);

    this.az = az;
    this.alt = alt;
  }

  /**
   * transforms horizontal coordinates to equatorial coordinates.
   *
   * Sidereal time must be consistent with the equatorial coordinates.
   * If coordinates are apparent, sidereal time must be apparent as well.
   * @param {globe.Coord} g - coordinates of observer on Earth (lat, lon)
   * @param {Number} st - sidereal time at Greenwich at time of observation.
   * @returns {Equatorial} (right ascension, declination)
   */


  _createClass(Horizontal, [{
    key: 'toEquatorial',
    value: function toEquatorial(g, st) {
      var _base$sincos25 = _base2.default.sincos(this.az),
          _base$sincos26 = _slicedToArray(_base$sincos25, 2),
          sA = _base$sincos26[0],
          cA = _base$sincos26[1];

      var _base$sincos27 = _base2.default.sincos(this.alt),
          _base$sincos28 = _slicedToArray(_base$sincos27, 2),
          sh = _base$sincos28[0],
          ch = _base$sincos28[1];

      var _base$sincos29 = _base2.default.sincos(g.lat),
          _base$sincos30 = _slicedToArray(_base$sincos29, 2),
          sφ = _base$sincos30[0],
          cφ = _base$sincos30[1];

      var H = Math.atan2(sA, cA * sφ + sh / ch * cφ);
      var ra = _base2.default.pmod(new _sexagesimal2.default.Time(st).rad() - g.lon - H, 2 * Math.PI);
      var dec = Math.asin(sφ * sh - cφ * ch * cA);
      return new Equatorial(ra, dec);
    }
  }]);

  return Horizontal;
}();

/**
 * Galactic coordinates are referenced to the plane of the Milky Way.
 * @param {Number} lon - Longitude (l) in radians
 * @param {Number} lat - Latitude (b) in radians
 */


var Galactic = exports.Galactic = function () {
  function Galactic() {
    var lon = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
    var lat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;

    _classCallCheck(this, Galactic);

    this.lon = lon;
    this.lat = lat;
  }

  /**
   * GalToEq converts galactic coordinates to equatorial coordinates.
   *
   * Resulting equatorial coordinates will be referred to the standard equinox of
   * B1950.0.  For subsequent conversion to other epochs, see package precess and
   * utility functions in package meeus.
   *
   * @returns {Equatorial} (right ascension, declination)
   */


  _createClass(Galactic, [{
    key: 'toEquatorial',
    value: function toEquatorial() {
      // (-galactic0Lon1950 - math.Pi/2) = magic number of -123 deg
      var _base$sincos31 = _base2.default.sincos(this.lon - galactic0Lon1950 - Math.PI / 2),
          _base$sincos32 = _slicedToArray(_base$sincos31, 2),
          sdLon = _base$sincos32[0],
          cdLon = _base$sincos32[1];

      var _base$sincos33 = _base2.default.sincos(galacticNorth1950.dec),
          _base$sincos34 = _slicedToArray(_base$sincos33, 2),
          sgδ = _base$sincos34[0],
          cgδ = _base$sincos34[1];

      var _base$sincos35 = _base2.default.sincos(this.lat),
          _base$sincos36 = _slicedToArray(_base$sincos35, 2),
          sb = _base$sincos36[0],
          cb = _base$sincos36[1];

      var y = Math.atan2(sdLon, cdLon * sgδ - sb / cb * cgδ);
      // (galacticNorth1950.RA.Rad() - math.Pi) = magic number of 12.25 deg
      var ra = _base2.default.pmod(y + galacticNorth1950.ra - Math.PI, 2 * Math.PI);
      var dec = Math.asin(sb * sgδ + cb * cgδ * cdLon);
      return new Equatorial(ra, dec);
    }
  }]);

  return Galactic;
}();

/**
* equatorial coords for galactic north
* IAU B1950.0 coordinates of galactic North Pole
*/


var galacticNorth = exports.galacticNorth = new Equatorial(new _sexagesimal2.default.RA(12, 49, 0).rad(), 27.4 * Math.PI / 180);
var galacticNorth1950 = exports.galacticNorth1950 = galacticNorth;

/**
* Galactic Longitude 0°
* Meeus gives 33 as the origin of galactic longitudes relative to the
* ascending node of of the galactic equator.  33 + 90 = 123, the IAU
* value for origin relative to the equatorial pole.
*/
var galacticLon0 = exports.galacticLon0 = 33 * Math.PI / 180;
var galactic0Lon1950 = exports.galactic0Lon1950 = galacticLon0;

exports.default = {
  Ecliptic: Ecliptic,
  Equatorial: Equatorial,
  Horizontal: Horizontal,
  Galactic: Galactic,
  galacticNorth: galacticNorth,
  galacticNorth1950: galacticNorth1950,
  galacticLon0: galacticLon0,
  galactic0Lon1950: galactic0Lon1950
};
},{"./base":3,"./sexagesimal":13}],5:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /**
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @copyright 2013 Sonia Keys
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @copyright 2016 commenthol
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @license MIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @module deltat
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          */
/**
 * DeltaT: Chapter 10, Dynamical Time and Universal Time.
 *
 * This package uses no functions from the Chapter. Polynoms are from
 * <http://eclipse.gsfc.nasa.gov/SEcat5/deltatpoly.html>, data sets are from
 * <http://maia.usno.navy.mil/ser7/>
 *
 * Functions in this package compute ΔT for various ranges of dates.
 *
 * ΔT = TD - UT1
 *
 * TD = "Dynamical Time", which is related to:
 *   ET "Ephermis Time", an older term.
 *   TDB "Barycentric Dynamical Time", very close to TD.
 *   TDT "Terrestrial Dynamical Time", a more correct term.
 *   TT "Terrestrial Time", a newer and more correct term.
 *
 * UT = "Universal Time", which is related (if ambiguously) to GMT "Greenwich
 * Mean Time".
 *
 * Terrestrial Time is effectively equal to International Atomic Time (TAI)
 * plus 32.184 seconds exactly: TT = TAI + 32.184
 * The epoch designated "J2000.0" is specified as Julian date 2451545.0 TT,
 * or 2000 January 1, 12h TT. This epoch can also be expressed as
 * 2000 January 1, 11:59:27.816 TAI or 2000 January 1, 11:58:55.816 UTC.
 */

exports.deltaT = deltaT;

var _base = require('./base');

var _base2 = _interopRequireDefault(_base);

var _interpolation = require('./interpolation');

var _interpolation2 = _interopRequireDefault(_interpolation);

var _deltat = require('../data/deltat');

var _deltat2 = _interopRequireDefault(_deltat);

var _julian = require('./julian');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * deltaT returns the difference ΔT = TD - UT between Dynamical Time TD and
 * Univeral Time (GMT+12) in seconds
 *
 * Polynoms are from <http://eclipse.gsfc.nasa.gov/SEcat5/deltatpoly.html>
 * and <http://www.staff.science.uu.nl/~gent0113/deltat/deltat_old.htm>
 *
 * @param {Number} dyear - decimal year
 * @returns {Number} ΔT in seconds.
 */
function deltaT(dyear) {
  var ΔT = void 0;
  if (dyear < -500) {
    ΔT = _base2.default.horner((dyear - 1820) * 0.01, -20, 0, 32);
  } else if (dyear < 500) {
    ΔT = _base2.default.horner(dyear * 0.01, 10583.6, -1014.41, 33.78311, -5.952053, -0.1798452, 0.022174192, 0.0090316521);
  } else if (dyear < 1600) {
    ΔT = _base2.default.horner((dyear - 1000) * 0.01, 1574.2, -556.01, 71.23472, 0.319781, -0.8503463, -0.005050998, 0.0083572073);
  } else if (dyear < _deltat2.default.historic.first) {
    ΔT = _base2.default.horner(dyear - 1600, 120, -0.9808, -0.01532, 1 / 7129);
  } else if (dyear < _deltat2.default.data.first) {
    ΔT = interpolate(dyear, _deltat2.default.historic);
  } else if (dyear < _deltat2.default.data.last - 0.25) {
    // -0.25 ~= do not consider last 3 months in dataset
    ΔT = interpolateData(dyear, _deltat2.default.data);
  } else if (dyear < _deltat2.default.prediction.last) {
    ΔT = interpolate(dyear, _deltat2.default.prediction);
  } else if (dyear < 2050) {
    ΔT = _base2.default.horner((dyear - 2000) / 100, 62.92, 32.217, 55.89);
  } else if (dyear < 2150) {
    ΔT = _base2.default.horner((dyear - 1820) / 100, -205.72, 56.28, 32);
  } else {
    var u = (dyear - 1820) / 100;
    ΔT = -20 + 32 * u * u;
  }
  return ΔT;
}

/**
 * interpolation of dataset
 * @private
 * @param {Number} dyear - julian year
 * @returns {Number} ΔT in seconds.
 */
function interpolate(dyear, data) {
  var d3 = _interpolation2.default.len3ForInterpolateX(dyear, data.first, data.last, data.table);
  return d3.interpolateX(dyear);
}

/**
 * interpolation of dataset from finals2000A with is one entry per month
 * linear interpolation over whole dataset is inaccurate as points per month
 * are not equidistant. Therefore points are approximated using 2nd diff. interpolation
 * from current month using the following two points
 *
 * @private
 * @param {Number} dyear - julian year
 * @returns {Number} ΔT in seconds.
 */
function interpolateData(dyear, data) {
  var _data$firstYM = _slicedToArray(data.firstYM, 2),
      fyear = _data$firstYM[0],
      fmonth = _data$firstYM[1];

  var _monthOfYear = monthOfYear(dyear),
      year = _monthOfYear.year,
      month = _monthOfYear.month,
      first = _monthOfYear.first,
      last = _monthOfYear.last;

  var pos = 12 * (year - fyear) + (month - fmonth);
  var table = data.table.slice(pos, pos + 3);
  var d3 = new _interpolation2.default.Len3(first, last, table);
  return d3.interpolateX(dyear);
}

/**
* Get month of Year from fraction. Fraction differs at leap years.
* @private
* @param {Number} dyear - decimal year
* @return {Object} `{year: Number, month: Number, first: Number, last}`
*/
function monthOfYear(dyear) {
  if (!monthOfYear.data) {
    // memoize yearly fractions per month
    monthOfYear.data = { 0: [], 1: [] };
    for (var m = 0; m <= 12; m++) {
      monthOfYear.data[0][m] = new _julian.Calendar(1999, m, 1).toYear() - 1999; // non leap year
      monthOfYear.data[1][m] = new _julian.Calendar(2000, m, 1).toYear() - 2000; // leap year
    }
  }
  var year = dyear | 0;
  var f = dyear - year;
  var d = (0, _julian.LeapYearGregorian)(year) ? 1 : 0;
  var data = monthOfYear.data[d];

  var month = 12; // TODO loop could be improved
  while (month > 0 && data[month] > f) {
    month--;
  }
  var first = year + data[month];
  var last = month < 11 ? year + data[month + 2] : year + 1 + data[(month + 2) % 12];
  return { year: year, month: month, first: first, last: last };
}

exports.default = {
  deltaT: deltaT
};
},{"../data/deltat":1,"./base":3,"./interpolation":7,"./julian":8}],6:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Elements = undefined;

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

exports.reduceB1950ToJ2000 = reduceB1950ToJ2000;
exports.reduceB1950FK4ToJ2000FK5 = reduceB1950FK4ToJ2000FK5;

var _base = require('./base');

var _base2 = _interopRequireDefault(_base);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /**
                                                                                                                                                           * @copyright 2013 Sonia Keys
                                                                                                                                                           * @copyright 2016 commenthol
                                                                                                                                                           * @license MIT
                                                                                                                                                           * @module elementequinox
                                                                                                                                                           */
/**
 * Elementequinox: Chapter 24, Reduction of Ecliptical Elements
 * from one Equinox to another one.
 *
 * See package precess for the method EclipticPrecessor.ReduceElements and
 * associated example.  The method is described in this chapter but located
 * in package precess so that it can be a method of EclipticPrecessor.
 */

/**
 * Elements are the orbital elements of a solar system object which change
 * from one equinox to another.
 *
 * @param {Number} inc  - inclination
 * @param {Number} node - longitude of ascending node (Ω)
 * @param {Number} peri - argument of perihelion (ω)
 */
var Elements = exports.Elements = function Elements(inc, node, peri) {
  _classCallCheck(this, Elements);

  if ((typeof inc === 'undefined' ? 'undefined' : _typeof(inc)) === 'object') {
    node = inc.pode;
    peri = inc.peri;
    inc = inc.inc;
  }
  this.inc = inc || 0;
  this.node = node || 0;
  this.peri = peri || 0;
};

// (24.4) p. 161


var S = 0.0001139788;
var C = 0.9999999935;
/**
 * ReduceB1950ToJ2000 reduces orbital elements of a solar system body from
 * equinox B1950 to J2000.
 *
 * @param {Elements} eFrom
 * @returns {Elements} eTo
 */
function reduceB1950ToJ2000(eFrom) {
  var W = eFrom.node - 174.298782 * Math.PI / 180;

  var _base$sincos = _base2.default.sincos(eFrom.inc),
      _base$sincos2 = _slicedToArray(_base$sincos, 2),
      si = _base$sincos2[0],
      ci = _base$sincos2[1];

  var _base$sincos3 = _base2.default.sincos(W),
      _base$sincos4 = _slicedToArray(_base$sincos3, 2),
      sW = _base$sincos4[0],
      cW = _base$sincos4[1];

  var A = si * sW;
  var B = C * si * cW - S * ci;
  var eTo = new Elements();
  eTo.inc = Math.asin(Math.hypot(A, B));
  eTo.node = _base2.default.pmod(174.997194 * Math.PI / 180 + Math.atan2(A, B), 2 * Math.PI);
  eTo.peri = _base2.default.pmod(eFrom.peri + Math.atan2(-S * sW, C * si - S * ci * cW), 2 * Math.PI);
  return eTo;
}

var Lp = 4.50001688 * Math.PI / 180;
var L = 5.19856209 * Math.PI / 180;
var J = 0.00651966 * Math.PI / 180;

/**
 * ReduceB1950ToJ2000 reduces orbital elements of a solar system body from
 * equinox B1950 in the FK4 system to equinox J2000 in the FK5 system.
 *
 * @param {Elements} eFrom
 * @returns {Elements} eTo
 */
function reduceB1950FK4ToJ2000FK5(eFrom) {
  var W = L + eFrom.node;

  var _base$sincos5 = _base2.default.sincos(eFrom.inc),
      _base$sincos6 = _slicedToArray(_base$sincos5, 2),
      si = _base$sincos6[0],
      ci = _base$sincos6[1];

  var _base$sincos7 = _base2.default.sincos(J),
      _base$sincos8 = _slicedToArray(_base$sincos7, 2),
      sJ = _base$sincos8[0],
      cJ = _base$sincos8[1];

  var _base$sincos9 = _base2.default.sincos(W),
      _base$sincos10 = _slicedToArray(_base$sincos9, 2),
      sW = _base$sincos10[0],
      cW = _base$sincos10[1];

  var eTo = new Elements();
  eTo.inc = Math.acos(ci * cJ - si * sJ * cW);
  eTo.node = _base2.default.pmod(Math.atan2(si * sW, ci * sJ + si * cJ * cW) - Lp, 2 * Math.PI);
  eTo.peri = _base2.default.pmod(eFrom.peri + Math.atan2(sJ * sW, si * cJ + ci * sJ * cW), 2 * Math.PI);
  return eTo;
}

exports.default = {
  Elements: Elements,
  reduceB1950ToJ2000: reduceB1950ToJ2000,
  reduceB1950FK4ToJ2000FK5: reduceB1950FK4ToJ2000FK5
};
},{"./base":3}],7:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Len5 = exports.iterate = exports.Len3 = exports.errorNoConverge = exports.errorZeroOutside = exports.errorExtremumOutside = exports.errorNoExtremum = exports.errorNOutOfRange = exports.errorNoXRange = exports.errorNot5 = exports.errorNot4 = exports.errorNot3 = undefined;

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @copyright 2013 Sonia Keys
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @copyright 2016 commenthol
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @license MIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @module interpolation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      */
/**
 * Interp: Chapter 3, Interpolation.
 *
 * Len3 and Len5 types
 *
 * These types allow interpolation from a table of equidistant x values
 * and corresponding y values.  Since the x values are equidistant,
 * only the first and last values are supplied as arguments to the
 * constructors.  The interior x values are implicit.  All y values must be
 * supplied however.  They are passed as a slice, and the length of y is fixed.
 * For Len3 it must be 3 and for (Len5 it must be 5.0
 *
 * For these Len3 and Len5 functions, Meeus notes the importance of choosing
 * the 3 or 5 rows of a larger table that will minimize the interpolating
 * factor n.  He does not provide algorithms for doing this however.
 *
 * For an example of a selection function, see len3ForInterpolateX. This
 * was useful for computing Delta T.
 */


exports.len3ForInterpolateX = len3ForInterpolateX;
exports.len4Half = len4Half;
exports.lagrange = lagrange;
exports.lagrangePoly = lagrangePoly;
exports.linear = linear;

var _base = require('./base');

var _base2 = _interopRequireDefault(_base);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var int = Math.trunc;

/**
 * Error values returned by functions and methods in this package.
 * Defined here to help testing for specific errors.
 */
var errorNot3 = exports.errorNot3 = new Error('Argument y must be length 3');
var errorNot4 = exports.errorNot4 = new Error('Argument y must be length 4');
var errorNot5 = exports.errorNot5 = new Error('Argument y must be length 5');
var errorNoXRange = exports.errorNoXRange = new Error('Argument x3 (or x5) cannot equal x1');
var errorNOutOfRange = exports.errorNOutOfRange = new Error('Interpolating factor n must be in range -1 to 1');
var errorNoExtremum = exports.errorNoExtremum = new Error('No extremum in table');
var errorExtremumOutside = exports.errorExtremumOutside = new Error('Extremum falls outside of table');
var errorZeroOutside = exports.errorZeroOutside = new Error('Zero falls outside of table');
var errorNoConverge = exports.errorNoConverge = new Error('Failure to converge');

/**
 * Len3 allows second difference interpolation.
 */

var Len3 = exports.Len3 = function () {
  /**
   * NewLen3 prepares a Len3 object from a table of three rows of x and y values.
   *
   * X values must be equally spaced, so only the first and last are supplied.
   * X1 must not equal to x3.  Y must be a slice of three y values.
   *
   * @throws Error
   * @param {Number} x1 - is the x value corresponding to the first y value of the table.
   * @param {Number} x3 - is the x value corresponding to the last y value of the table.
   * @param {Number[]} y - is all y values in the table. y.length should be >= 3.0
   */
  function Len3(x1, x3, y) {
    _classCallCheck(this, Len3);

    if (y.length !== 3) {
      throw errorNot3;
    }
    if (x3 === x1) {
      throw errorNoXRange;
    }
    this.x1 = x1;
    this.x3 = x3;
    this.y = y;
    // differences. (3.1) p. 23
    this.a = y[1] - y[0];
    this.b = y[2] - y[1];
    this.c = this.b - this.a;
    // other intermediate values
    this.abSum = this.a + this.b;
    this.xSum = x3 + x1;
    this.xDiff = x3 - x1;
  }

  /**
   * InterpolateX interpolates for a given x value.
   */


  _createClass(Len3, [{
    key: 'interpolateX',
    value: function interpolateX(x) {
      var n = (2 * x - this.xSum) / this.xDiff;
      return this.interpolateN(n);
    }

    /**
     * InterpolateXStrict interpolates for a given x value,
     * restricting x to the range x1 to x3 given to the constructor NewLen3.
     */

  }, {
    key: 'interpolateXStrict',
    value: function interpolateXStrict(x) {
      var n = (2 * x - this.xSum) / this.xDiff;
      var y = this.interpolateNStrict(n, true);
      return y;
    }

    /**
     * InterpolateN interpolates for (a given interpolating factor n.
     *
     * This is interpolation formula (3.3)
     *
     * The interpolation factor n is x-x2 in units of the tabular x interval.
     * (See Meeus p. 24.)
     */

  }, {
    key: 'interpolateN',
    value: function interpolateN(n) {
      return this.y[1] + n * 0.5 * (this.abSum + n * this.c);
    }

    /**
     * InterpolateNStrict interpolates for (a given interpolating factor n.
     *
     * N is restricted to the range [-1..1] corresponding to the range x1 to x3
     * given to the constructor of Len3.
     */

  }, {
    key: 'interpolateNStrict',
    value: function interpolateNStrict(n) {
      if (n < -1 || n > 1) {
        throw errorNOutOfRange;
      }
      return this.interpolateN(n);
    }

    /**
     * Extremum returns the x and y values at the extremum.
     *
     * Results are restricted to the range of the table given to the constructor
     * new Len3.
     */

  }, {
    key: 'extremum',
    value: function extremum() {
      if (this.c === 0) {
        throw errorNoExtremum;
      }
      var n = this.abSum / (-2 * this.c); // (3.5), p. 25
      if (n < -1 || n > 1) {
        throw errorExtremumOutside;
      }
      var x = 0.5 * (this.xSum + this.xDiff * n);
      var y = this.y[1] - this.abSum * this.abSum / (8 * this.c); // (3.4), p. 25
      return [x, y];
    }

    /**
     * Len3Zero finds a zero of the quadratic function represented by the table.
     *
     * That is, it returns an x value that yields y=0.
     *
     * Argument strong switches between two strategies for the estimation step.
     * when iterating to converge on the zero.
     *
     * Strong=false specifies a quick and dirty estimate that works well
     * for gentle curves, but can work poorly or fail on more dramatic curves.
     *
     * Strong=true specifies a more sophisticated and thus somewhat more
     * expensive estimate.  However, if the curve has quick changes, This estimate
     * will converge more reliably and in fewer steps, making it a better choice.
     *
     * Results are restricted to the range of the table given to the constructor
     * NewLen3.
     */

  }, {
    key: 'zero',
    value: function zero(strong) {
      var _this = this;

      var f = void 0;
      if (strong) {
        // (3.7), p. 27
        f = function f(n0) {
          return n0 - (2 * _this.y[1] + n0 * (_this.abSum + _this.c * n0)) / (_this.abSum + 2 * _this.c * n0);
        };
      } else {
        // (3.6), p. 26
        f = function f(n0) {
          return -2 * _this.y[1] / (_this.abSum + _this.c * n0);
        };
      }

      var _iterate = iterate(0, f),
          _iterate2 = _slicedToArray(_iterate, 2),
          n0 = _iterate2[0],
          ok = _iterate2[1];

      if (!ok) {
        throw errorNoConverge;
      }
      if (n0 > 1 || n0 < -1) {
        throw errorZeroOutside;
      }
      return 0.5 * (this.xSum + this.xDiff * n0); // success
    }
  }]);

  return Len3;
}();

/**
 * Len3ForInterpolateX is a special purpose Len3 constructor.
 *
 * Like NewLen3, it takes a table of x and y values, but it is not limited
 * to tables of 3 rows.  An X value is also passed that represents the
 * interpolation target x value.  Len3ForInterpolateX will locate the
 * appropriate three rows of the table for interpolating for x, and initialize
 * the Len3 object for those rows.
 *
 * @param {Number} x - is the target for interpolation
 * @param {Number} x1 - is the x value corresponding to the first y value of the table.
 * @param {Number} xn - is the x value corresponding to the last y value of the table.
 * @param {Number[]} y - is all y values in the table.  y.length should be >= 3.0
 * @returns {Number} interpolation value
 */


function len3ForInterpolateX(x, x1, xN, y) {
  var y3 = y;
  if (y.length > 3) {
    var interval = (xN - x1) / (y.length - 1);
    if (interval === 0) {
      throw errorNoXRange;
    }
    var nearestX = int((x - x1) / interval + 0.5);
    if (nearestX < 1) {
      nearestX = 1;
    } else if (nearestX > y.length - 2) {
      nearestX = y.length - 2;
    }
    y3 = y.slice(nearestX - 1, nearestX + 2);
    xN = x1 + (nearestX + 1) * interval;
    x1 = x1 + (nearestX - 1) * interval;
  }
  return new Len3(x1, xN, y3);
}

/**
 * @private
 * @param {Number} n0
 * @param {Function} f
 * @returns {Array}
 *   {Number} n1
 *   {Boolean} ok - if `false` failure to converge
 */
var iterate = exports.iterate = function iterate(n0, f) {
  for (var limit = 0; limit < 50; limit++) {
    var n1 = f(n0);
    if (!isFinite(n1) || isNaN(n1)) {
      break; // failure to converge
    }
    if (Math.abs((n1 - n0) / n0) < 1e-15) {
      return [n1, true]; // success
    }
    n0 = n1;
  }
  return [0, false]; // failure to converge
};

/**
 * Len4Half interpolates a center value from a table of four rows.
 * @param {Number[]} y - 4 values
 * @returns {Number} interpolation result
 */
function len4Half(y) {
  if (y.length !== 4) {
    throw errorNot4;
  }
  // (3.12) p. 32
  return (9 * (y[1] + y[2]) - y[0] - y[3]) / 16;
}

/**
 * Len5 allows fourth Difference interpolation.
 */

var Len5 = exports.Len5 = function () {
  /**
   * NewLen5 prepares a Len5 object from a table of five rows of x and y values.
   *
   * X values must be equally spaced, so only the first and last are suppliethis.
   * X1 must not equal x5.  Y must be a slice of five y values.
   */
  function Len5(x1, x5, y) {
    _classCallCheck(this, Len5);

    if (y.length !== 5) {
      throw errorNot5;
    }
    if (x5 === x1) {
      throw errorNoXRange;
    }
    this.x1 = x1;
    this.x5 = x5;
    this.y = y;
    this.y3 = y[2];
    // differences
    this.a = y[1] - y[0];
    this.b = y[2] - y[1];
    this.c = y[3] - y[2];
    this.d = y[4] - y[3];

    this.e = this.b - this.a;
    this.f = this.c - this.b;
    this.g = this.d - this.c;

    this.h = this.f - this.e;
    this.j = this.g - this.f;

    this.k = this.j - this.h;
    // other intermediate values
    this.xSum = x5 + x1;
    this.xDiff = x5 - x1;
    this.interpCoeff = [// (3.8) p. 28
    this.y3, (this.b + this.c) / 2 - (this.h + this.j) / 12, this.f / 2 - this.k / 24, (this.h + this.j) / 12, this.k / 24];
  }

  /**
   * InterpolateX interpolates for (a given x value.
   */


  _createClass(Len5, [{
    key: 'interpolateX',
    value: function interpolateX(x) {
      var n = (4 * x - 2 * this.xSum) / this.xDiff;
      return this.interpolateN(n);
    }

    /**
     * InterpolateXStrict interpolates for a given x value,
     * restricting x to the range x1 to x5 given to the the constructor NewLen5.
     */

  }, {
    key: 'interpolateXStrict',
    value: function interpolateXStrict(x) {
      var n = (4 * x - 2 * this.xSum) / this.xDiff;
      var y = this.interpolateNStrict(n);
      return y;
    }

    /**
     * InterpolateN interpolates for (a given interpolating factor n.
     *
     * The interpolation factor n is x-x3 in units of the tabular x interval.
     * (See Meeus p. 28.)
     */

  }, {
    key: 'interpolateN',
    value: function interpolateN(n) {
      return _base2.default.horner.apply(_base2.default, [n].concat(_toConsumableArray(this.interpCoeff)));
    }

    /**
     * InterpolateNStrict interpolates for (a given interpolating factor n.
     *
     * N is restricted to the range [-1..1].  This is only half the range given
     * to the constructor NewLen5, but is the recommendation given on p. 31.0
     */

  }, {
    key: 'interpolateNStrict',
    value: function interpolateNStrict(n) {
      if (n < -1 || n > 1) {
        throw errorNOutOfRange;
      }
      return _base2.default.horner.apply(_base2.default, [n].concat(_toConsumableArray(this.interpCoeff)));
    }

    /**
     * Extremum returns the x and y values at the extremum.
     *
     * Results are restricted to the range of the table given to the constructor
     * NewLen5.  (Meeus actually recommends restricting the range to one unit of
     * the tabular interval, but that seems a little harsh.)
     */

  }, {
    key: 'extremum',
    value: function extremum() {
      // (3.9) p. 29
      var nCoeff = [6 * (this.b + this.c) - this.h - this.j, 0, 3 * (this.h + this.j), 2 * this.k];
      var den = this.k - 12 * this.f;
      if (den === 0) {
        throw errorExtremumOutside;
      }

      var _iterate3 = iterate(0, function (n0) {
        return _base2.default.horner.apply(_base2.default, [n0].concat(nCoeff)) / den;
      }),
          _iterate4 = _slicedToArray(_iterate3, 2),
          n0 = _iterate4[0],
          ok = _iterate4[1];

      if (!ok) {
        throw errorNoConverge;
      }
      if (n0 < -2 || n0 > 2) {
        throw errorExtremumOutside;
      }
      var x = 0.5 * this.xSum + 0.25 * this.xDiff * n0;
      var y = _base2.default.horner.apply(_base2.default, [n0].concat(_toConsumableArray(this.interpCoeff)));
      return [x, y];
    }

    /**
     * Len5Zero finds a zero of the quartic function represented by the table.
     *
     * That is, it returns an x value that yields y=0.
     *
     * Argument strong switches between two strategies for the estimation step.
     * when iterating to converge on the zero.
     *
     * Strong=false specifies a quick and dirty estimate that works well
     * for gentle curves, but can work poorly or fail on more dramatic curves.
     *
     * Strong=true specifies a more sophisticated and thus somewhat more
     * expensive estimate.  However, if the curve has quick changes, This estimate
     * will converge more reliably and in fewer steps, making it a better choice.
     *
     * Results are restricted to the range of the table given to the constructor
     * NewLen5.
     */

  }, {
    key: 'zero',
    value: function zero(strong) {
      var f = void 0;
      if (strong) {
        // (3.11), p. 29
        var M = this.k / 24;
        var N = (this.h + this.j) / 12;
        var P = this.f / 2 - M;
        var Q = (this.b + this.c) / 2 - N;
        var numCoeff = [this.y3, Q, P, N, M];
        var denCoeff = [Q, 2 * P, 3 * N, 4 * M];
        f = function f(n0) {
          return n0 - _base2.default.horner.apply(_base2.default, [n0].concat(numCoeff)) / _base2.default.horner.apply(_base2.default, [n0].concat(denCoeff));
        };
      } else {
        // (3.10), p. 29
        var _numCoeff = [-24 * this.y3, 0, this.k - 12 * this.f, -2 * (this.h + this.j), -this.k];
        var den = 12 * (this.b + this.c) - 2 * (this.h + this.j);
        f = function f(n0) {
          return _base2.default.horner.apply(_base2.default, [n0].concat(_numCoeff)) / den;
        };
      }

      var _iterate5 = iterate(0, f),
          _iterate6 = _slicedToArray(_iterate5, 2),
          n0 = _iterate6[0],
          ok = _iterate6[1];

      if (!ok) {
        throw errorNoConverge;
      }
      if (n0 > 2 || n0 < -2) {
        throw errorZeroOutside;
      }
      var x = 0.5 * this.xSum + 0.25 * this.xDiff * n0;
      return x;
    }
  }]);

  return Len5;
}();

/**
 * Lagrange performs interpolation with unequally-spaced abscissae.
 *
 * Given a table of X and Y values, interpolate a new y value for argument x.
 *
 * X values in the table do not have to be equally spaced; they do not even
 * have to be in order. They must however, be distinct.
 *
 * @param {Number} x - x-value of interpolation
 * @param {Array} table - `[[x0, y0], ... [xN, yN]]` of x, y values
 * @returns {Number} interpolation result `y` of `x`
 */


function lagrange(x, table) {
  // method of BASIC program, p. 33.0
  var sum = 0;
  table.forEach(function (ti, i) {
    var xi = ti[0];
    var prod = 1.0;
    table.forEach(function (tj, j) {
      if (i !== j) {
        var xj = tj[0];
        prod *= (x - xj) / (xi - xj);
      }
    });
    sum += ti[1] * prod;
  });
  return sum;
}

/**
 * LagrangePoly uses the formula of Lagrange to produce an interpolating
 * polynomial.
 *
 * X values in the table do not have to be equally spaced; they do not even
 * have to be in order.  They must however, be distinct.
 *
 * The returned polynomial will be of degree n-1 where n is the number of rows
 * in the table.  It can be evaluated for x using base.horner.
 *
 * @param {Array} table - `[[x0, y0], ... [xN, yN]]`
 * @returns {Array} - polynomial array
 */
function lagrangePoly(table) {
  // Method not fully described by Meeus, but needed for (numerical solution
  // to Example 3.g.
  var sum = new Array(table.length).fill(0);
  var prod = new Array(table.length).fill(0);
  var last = table.length - 1;

  var _loop = function _loop(i) {
    var xi = table[i][0] || table[i].x || 0;
    var yi = table[i][1] || table[i].y || 0;
    prod[last] = 1;
    var den = 1.0;
    var n = last;
    for (var j = 0; j < table.length; j++) {
      if (i !== j) {
        var xj = table[j][0] || table[j].x || 0;
        prod[n - 1] = prod[n] * -xj;
        for (var k = n; k < last; k++) {
          prod[k] -= prod[k + 1] * xj;
        }
        n--;
        den *= xi - xj;
      }
    }
    prod.forEach(function (pj, j) {
      sum[j] += yi * pj / den;
    });
  };

  for (var i = 0; i < table.length; i++) {
    _loop(i);
  }
  return sum;
}

/**
 * Linear Interpolation of x
 */
function linear(x, x1, xN, y) {
  var interval = (xN - x1) / (y.length - 1);
  if (interval === 0) {
    throw errorNoXRange;
  }
  var nearestX = Math.floor((x - x1) / interval);
  if (nearestX < 0) {
    nearestX = 0;
  } else if (nearestX > y.length - 2) {
    nearestX = y.length - 2;
  }
  var y2 = y.slice(nearestX, nearestX + 2);
  var x01 = x1 + nearestX * interval;
  return y2[0] + (y[1] - y[0]) * (x - x01) / interval;
}

exports.default = {
  errorNot3: errorNot3,
  errorNot4: errorNot4,
  errorNot5: errorNot5,
  errorNoXRange: errorNoXRange,
  errorNOutOfRange: errorNOutOfRange,
  errorNoExtremum: errorNoExtremum,
  errorExtremumOutside: errorExtremumOutside,
  errorZeroOutside: errorZeroOutside,
  errorNoConverge: errorNoConverge,
  Len3: Len3,
  len3ForInterpolateX: len3ForInterpolateX,
  iterate: iterate,
  len4Half: len4Half,
  Len5: Len5,
  lagrange: lagrange,
  lagrangePoly: lagrangePoly,
  linear: linear
};
},{"./base":3}],8:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.CalendarGregorian = exports.CalendarJulian = exports.Calendar = exports.GREGORIAN0JD = undefined;

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @copyright 2013 Sonia Keys
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @copyright 2016 commenthol
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @license MIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @module julian
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      */
/**
 * Julian: Chapter 7, Julian day.
 */

exports.CalendarToJD = CalendarToJD;
exports.CalendarGregorianToJD = CalendarGregorianToJD;
exports.CalendarJulianToJD = CalendarJulianToJD;
exports.LeapYearJulian = LeapYearJulian;
exports.LeapYearGregorian = LeapYearGregorian;
exports.JDToCalendar = JDToCalendar;
exports.JDToCalendarGregorian = JDToCalendarGregorian;
exports.JDToCalendarJulian = JDToCalendarJulian;
exports.isJDCalendarGregorian = isJDCalendarGregorian;
exports.isCalendarGregorian = isCalendarGregorian;
exports.JDToDate = JDToDate;
exports.DateToJD = DateToJD;
exports.JDEToDate = JDEToDate;
exports.DateToJDE = DateToJDE;
exports.MJDToJD = MJDToJD;
exports.JDToMJD = JDToMJD;
exports.DayOfWeek = DayOfWeek;
exports.DayOfYearGregorian = DayOfYearGregorian;
exports.DayOfYearJulian = DayOfYearJulian;
exports.DayOfYear = DayOfYear;
exports.DayOfYearToCalendar = DayOfYearToCalendar;
exports.DayOfYearToCalendarGregorian = DayOfYearToCalendarGregorian;
exports.DayOfYearToCalendarJulian = DayOfYearToCalendarJulian;

var _base = require('./base');

var _base2 = _interopRequireDefault(_base);

var _sexagesimal = require('./sexagesimal');

var _sexagesimal2 = _interopRequireDefault(_sexagesimal);

var _deltat = require('./deltat');

var _deltat2 = _interopRequireDefault(_deltat);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var int = Math.trunc;

/** 1582-10-05 Julian Date is 1st Gregorian Date (1582-10-15) */
var GREGORIAN0JD = exports.GREGORIAN0JD = 2299160.5;

var DAYS_OF_YEAR = [0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
var SECS_OF_DAY = 86400; // 24 * 60 * 60

/**
 * Base class for CalendarJulian and CalendarGregorian
 * Respects the start of the Gregorian Calendar at `GREGORIAN0JD`
 */

var Calendar = exports.Calendar = function () {
  /**
   * @param {number|Date} year - If `Date` is given then year, month, day is taken from that. Shortcut to `new Calendar().fromDate(date)`
   * @param {number} month
   * @param {number} day
   */
  function Calendar(year) {
    var month = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
    var day = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;

    _classCallCheck(this, Calendar);

    this.year = year;
    this.month = month;
    this.day = day;
    if (year instanceof Date) {
      this.fromDate(year);
    }
  }

  _createClass(Calendar, [{
    key: 'getDate',
    value: function getDate() {
      return {
        year: this.year,
        month: this.month,
        day: Math.floor(this.day)
      };
    }
  }, {
    key: 'getTime',
    value: function getTime() {
      var t = new _sexagesimal2.default.Time(this.day * SECS_OF_DAY);

      var _t$toHMS = t.toHMS(),
          _t$toHMS2 = _slicedToArray(_t$toHMS, 4),
          neg = _t$toHMS2[0],
          h = _t$toHMS2[1],
          m = _t$toHMS2[2],
          _s = _t$toHMS2[3]; // eslint-disable-line no-unused-vars


      var _base$modf = _base2.default.modf(_s),
          _base$modf2 = _slicedToArray(_base$modf, 2),
          s = _base$modf2[0],
          ms = _base$modf2[1];

      ms = Math.trunc(ms * 1000);
      return {
        hour: h % 24,
        minute: m,
        second: s,
        millisecond: ms
      };
    }
  }, {
    key: 'toISOString',
    value: function toISOString() {
      var _getDate = this.getDate(),
          year = _getDate.year,
          month = _getDate.month,
          day = _getDate.day;

      var _getTime = this.getTime(),
          hour = _getTime.hour,
          minute = _getTime.minute,
          second = _getTime.second,
          millisecond = _getTime.millisecond;

      return pad(year, 4) + '-' + pad(month) + '-' + pad(day) + 'T' + (pad(hour) + ':' + pad(minute) + ':' + pad(second) + '.' + pad(millisecond, 3) + 'Z');
    }
  }, {
    key: 'isGregorian',
    value: function isGregorian() {
      return isCalendarGregorian(this.year, this.month, this.day);
    }

    /**
     * Note: Take care for dates < GREGORIAN0JD as `date` is always within the
     * proleptic Gregorian Calender
     * @param {Date} date - proleptic Gregorian date
     */

  }, {
    key: 'fromDate',
    value: function fromDate(date) {
      this.year = date.getUTCFullYear();
      this.month = date.getUTCMonth() + 1;
      var day = date.getUTCDate();
      var hour = date.getUTCHours();
      var minute = date.getUTCMinutes();
      var second = date.getUTCSeconds();
      var ms = date.getMilliseconds();
      this.day = day + (hour + (minute + (second + ms / 1000) / 60) / 60) / 24;
      return this;
    }

    /**
     * Note: Take care for dates < GREGORIAN0JD as `date` is always within the
     * proleptic Gregorian Calender
     * @returns {Date} proleptic Gregorian date
     */

  }, {
    key: 'toDate',
    value: function toDate() {
      var _base$modf3 = _base2.default.modf(this.day),
          _base$modf4 = _slicedToArray(_base$modf3, 2),
          day = _base$modf4[0],
          fhour = _base$modf4[1];

      var _base$modf5 = _base2.default.modf(fhour * 24),
          _base$modf6 = _slicedToArray(_base$modf5, 2),
          hour = _base$modf6[0],
          fminute = _base$modf6[1];

      var _base$modf7 = _base2.default.modf(fminute * 60),
          _base$modf8 = _slicedToArray(_base$modf7, 2),
          minute = _base$modf8[0],
          fsecond = _base$modf8[1];

      var _base$modf9 = _base2.default.modf(fsecond * 60),
          _base$modf10 = _slicedToArray(_base$modf9, 2),
          second = _base$modf10[0],
          fms = _base$modf10[1];

      var date = new Date(Date.UTC(this.year, this.month - 1, day, hour, minute, second, Math.round(fms * 1000)));
      date.setUTCFullYear(this.year);
      return date;
    }

    /**
     * converts a calendar date to decimal year
     * @returns {number} decimal year
     */

  }, {
    key: 'toYear',
    value: function toYear() {
      var _base$modf11 = _base2.default.modf(this.day),
          _base$modf12 = _slicedToArray(_base$modf11, 2),
          d = _base$modf12[0],
          f = _base$modf12[1]; // eslint-disable-line no-unused-vars


      var n = this.dayOfYear() - 1 + f;
      var days = this.isLeapYear() ? 366 : 365;
      var decYear = this.year + n / days;
      return decYear;
    }

    /**
     * converts a decimal year to a calendar date
     * @param {number} decimal year
     */

  }, {
    key: 'fromYear',
    value: function fromYear(year) {
      var _base$modf13 = _base2.default.modf(year),
          _base$modf14 = _slicedToArray(_base$modf13, 2),
          y = _base$modf14[0],
          f = _base$modf14[1];

      this.year = y;
      var days = this.isLeapYear() ? 366 : 365;
      var dayOfYear = _base2.default.round(f * days, 5);
      var m = 12;
      while (m > 0 && DAYS_OF_YEAR[m] > dayOfYear) {
        m--;
      }
      this.month = m;
      this.day = 1 + dayOfYear - DAYS_OF_YEAR[this.month];
      return this;
    }
  }, {
    key: 'isLeapYear',
    value: function isLeapYear() {
      if (this.isGregorian()) {
        return LeapYearGregorian(this.year);
      } else {
        return LeapYearJulian(this.year);
      }
    }
  }, {
    key: 'toJD',
    value: function toJD() {
      return CalendarToJD(this.year, this.month, this.day, !this.isGregorian());
    }
  }, {
    key: 'fromJD',
    value: function fromJD(jd) {
      var isJulian = !isJDCalendarGregorian(jd);

      var _JDToCalendar = JDToCalendar(jd, isJulian),
          year = _JDToCalendar.year,
          month = _JDToCalendar.month,
          day = _JDToCalendar.day;

      this.year = year;
      this.month = month;
      this.day = day;
      return this;
    }
  }, {
    key: 'fromJDE',
    value: function fromJDE(jde) {
      this.fromJD(jde);
      var dT = _deltat2.default.deltaT(this.toYear()); // in seconds
      this.day -= dT / 86400;
      return this;
    }
  }, {
    key: 'toJDE',
    value: function toJDE() {
      var dT = _deltat2.default.deltaT(this.toYear()); // in seconds
      this.day += dT / 86400;
      return this.toJD();
    }

    /**
     * set date to midnight UTC
     */

  }, {
    key: 'midnight',
    value: function midnight() {
      this.day = Math.floor(this.day);
      return this;
    }

    /**
     * set date to noon UTC
     */

  }, {
    key: 'noon',
    value: function noon() {
      this.day = Math.floor(this.day) + 0.5;
      return this;
    }

    /**
     * @param {Boolean} td - if `true` calendar instance is in TD; date gets converted to UT
     *   true  - `UT = TD - ΔT`
     *   false - `TD = UT + ΔT`
     */

  }, {
    key: 'deltaT',
    value: function deltaT(td) {
      var dT = _deltat2.default.deltaT(this.toYear()); // in seconds
      if (td) {
        this.day -= dT / 86400;
      } else {
        this.day += dT / 86400;
      }
      return this;
    }
  }, {
    key: 'dayOfWeek',
    value: function dayOfWeek() {
      return DayOfWeek(this.toJD());
    }
  }, {
    key: 'dayOfYear',
    value: function dayOfYear() {
      if (this.isGregorian()) {
        return DayOfYearGregorian(this.year, this.month, this.day);
      } else {
        return DayOfYearJulian(this.year, this.month, this.day);
      }
    }
  }]);

  return Calendar;
}();

var CalendarJulian = exports.CalendarJulian = function (_Calendar) {
  _inherits(CalendarJulian, _Calendar);

  function CalendarJulian() {
    _classCallCheck(this, CalendarJulian);

    return _possibleConstructorReturn(this, (CalendarJulian.__proto__ || Object.getPrototypeOf(CalendarJulian)).apply(this, arguments));
  }

  _createClass(CalendarJulian, [{
    key: 'toJD',
    value: function toJD() {
      return CalendarJulianToJD(this.year, this.month, this.day);
    }
  }, {
    key: 'fromJD',
    value: function fromJD(jd) {
      var _JDToCalendarJulian = JDToCalendarJulian(jd),
          year = _JDToCalendarJulian.year,
          month = _JDToCalendarJulian.month,
          day = _JDToCalendarJulian.day;

      this.year = year;
      this.month = month;
      this.day = day;
      return this;
    }
  }, {
    key: 'isLeapYear',
    value: function isLeapYear() {
      return LeapYearJulian(this.year);
    }
  }, {
    key: 'dayOfYear',
    value: function dayOfYear() {
      return DayOfYearJulian(this.year, this.month, this.day);
    }

    /**
     * toGregorian converts a Julian calendar date to a year, month, and day
     * in the Gregorian calendar.
     * @returns {CalendarGregorian}
     */

  }, {
    key: 'toGregorian',
    value: function toGregorian() {
      var jd = this.toJD();
      return new CalendarGregorian().fromJD(jd);
    }
  }]);

  return CalendarJulian;
}(Calendar);

var CalendarGregorian = exports.CalendarGregorian = function (_Calendar2) {
  _inherits(CalendarGregorian, _Calendar2);

  function CalendarGregorian() {
    _classCallCheck(this, CalendarGregorian);

    return _possibleConstructorReturn(this, (CalendarGregorian.__proto__ || Object.getPrototypeOf(CalendarGregorian)).apply(this, arguments));
  }

  _createClass(CalendarGregorian, [{
    key: 'toJD',
    value: function toJD() {
      return CalendarGregorianToJD(this.year, this.month, this.day);
    }
  }, {
    key: 'fromJD',
    value: function fromJD(jd) {
      var _JDToCalendarGregoria = JDToCalendarGregorian(jd),
          year = _JDToCalendarGregoria.year,
          month = _JDToCalendarGregoria.month,
          day = _JDToCalendarGregoria.day;

      this.year = year;
      this.month = month;
      this.day = day;
      return this;
    }
  }, {
    key: 'isLeapYear',
    value: function isLeapYear() {
      return LeapYearGregorian(this.year);
    }
  }, {
    key: 'dayOfYear',
    value: function dayOfYear() {
      return DayOfYearGregorian(this.year, this.month, this.day);
    }

    /*
    * toJulian converts a Gregorian calendar date to a year, month, and day
    * in the Julian calendar.
    * @returns {CalendarJulian}
    */

  }, {
    key: 'toJulian',
    value: function toJulian() {
      var jd = this.toJD();
      return new CalendarJulian().fromJD(jd);
    }
  }]);

  return CalendarGregorian;
}(Calendar);

// -----------------------------------------------------------------------------

/**
 * base conversion from calendar date to julian day
 */


function CalendarToJD(y, m, d, isJulian) {
  var b = 0;
  if (m < 3) {
    y--;
    m += 12;
  }
  if (!isJulian) {
    var a = _base2.default.floorDiv(y, 100);
    b = 2 - a + _base2.default.floorDiv(a, 4);
  }
  // (7.1) p. 61
  var jd = _base2.default.floorDiv(36525 * int(y + 4716), 100) + (_base2.default.floorDiv(306 * (m + 1), 10) + b) + d - 1524.5;
  return jd;
}

/**
 * CalendarGregorianToJD converts a Gregorian year, month, and day of month
 * to Julian day.
 *
 * Negative years are valid, back to JD 0.  The result is not valid for
 * dates before JD 0.
 * @param {number} y - year (int)
 * @param {number} m - month (int)
 * @param {number} d - day (float)
 * @returns {number} jd - Julian day (float)
 */
function CalendarGregorianToJD(y, m, d) {
  return CalendarToJD(y, m, d, false);
}

/**
 * CalendarJulianToJD converts a Julian year, month, and day of month to Julian day.
 *
 * Negative years are valid, back to JD 0.  The result is not valid for
 * dates before JD 0.
 * @param {number} y - year (int)
 * @param {number} m - month (int)
 * @param {number} d - day (float)
 * @returns {number} jd - Julian day (float)
 */
function CalendarJulianToJD(y, m, d) {
  return CalendarToJD(y, m, d, true);
}

/**
 * LeapYearJulian returns true if year y in the Julian calendar is a leap year.
 * @param {number} y - year (int)
 * @returns {boolean} true if leap year in Julian Calendar
 */
function LeapYearJulian(y) {
  return y % 4 === 0;
}

/**
 * LeapYearGregorian returns true if year y in the Gregorian calendar is a leap year.
 * @param {number} y - year (int)
 * @returns {boolean} true if leap year in Gregorian Calendar
 */
function LeapYearGregorian(y) {
  return y % 4 === 0 && y % 100 !== 0 || y % 400 === 0;
}

/**
 * JDToCalendar returns the calendar date for the given jd.
 *
 * Note that this function returns a date in either the Julian or Gregorian
 * Calendar, as appropriate.
 * @param {number} jd - Julian day (float)
 * @param {boolean} isJulian - set true for Julian Calendar, otherwise Gregorian is used
 * @returns {object} `{ (int) year, (int) month, (float) day }`
 */
function JDToCalendar(jd, isJulian) {
  var _base$modf15 = _base2.default.modf(jd + 0.5),
      _base$modf16 = _slicedToArray(_base$modf15, 2),
      z = _base$modf16[0],
      f = _base$modf16[1];

  var a = z;
  if (!isJulian) {
    var α = _base2.default.floorDiv(z * 100 - 186721625, 3652425);
    a = z + 1 + α - _base2.default.floorDiv(α, 4);
  }
  var b = a + 1524;
  var c = _base2.default.floorDiv(b * 100 - 12210, 36525);
  var d = _base2.default.floorDiv(36525 * c, 100);
  var e = int(_base2.default.floorDiv((b - d) * 1e4, 306001));
  // compute return values
  var year = void 0;
  var month = void 0;
  var day = int(b - d) - _base2.default.floorDiv(306001 * e, 1e4) + f;
  if (e === 14 || e === 15) {
    month = e - 13;
  } else {
    month = e - 1;
  }
  if (month < 3) {
    year = int(c) - 4715;
  } else {
    year = int(c) - 4716;
  }
  return { year: year, month: month, day: day };
}

/**
 * JDToCalendarGregorian returns the calendar date for the given jd in the Gregorian Calendar.
 *
 * @param {number} jd - Julian day (float)
 * @returns {object} `{ (int) year, (int) month, (float) day }`
 */
function JDToCalendarGregorian(jd) {
  return JDToCalendar(jd, false);
}

/**
 * JDToCalendarJulian returns the calendar date for the given jd in the Julian Calendar.
 *
 * @param {number} jd - Julian day (float)
 * @returns {object} { (int) year, (int) month, (float) day }
 */
function JDToCalendarJulian(jd) {
  return JDToCalendar(jd, true);
}

/**
 * isJDCalendarGregorian tests if Julian day `jd` falls into the Gregorian calendar
 * @param {number} jd - Julian day (float)
 * @returns {boolean} true for Gregorian, false for Julian calendar
 */
function isJDCalendarGregorian(jd) {
  return jd >= GREGORIAN0JD;
}

/**
 * isCalendarGregorian tests if date falls into the Gregorian calendar
 * @param {number} year - julian/gregorian year
 * @param {number} [month] - month of julian/gregorian year
 * @param {number} [day] - day of julian/gregorian year
 * @returns {boolean} true for Gregorian, false for Julian calendar
 */
function isCalendarGregorian(year) {
  var month = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  var day = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;

  return year > 1582 || year === 1582 && month > 10 || year === 1582 && month === 10 && day >= 15;
}

/**
 * JDToDate converts a Julian day `jd` to a Date Object (Gregorian Calendar)
 *
 * Note: Javascript uses the the ISO-8601 calendar, which is a proleptic Gregorian
 * calendar, i.e. it acts as if this calendar was always in effect, even before
 * its year of introduction in 1582. Therefore dates between 1582-10-05 and
 * 1582-10-14 exists.
 *
 * @param {number} jd - Julian day (float)
 * @returns {Date}
 */
function JDToDate(jd) {
  return new CalendarGregorian().fromJD(jd).toDate();
}

/**
 * DateToJD converts a proleptic Gregorian Date into a Julian day `jd`
 * @param {Date} date
 * @returns {number} jd - Julian day (float)
 */
function DateToJD(date) {
  return new CalendarGregorian().fromDate(date).toJD();
}

/**
 * JDEToDate converts a Julian ephemeris day `jde` to a Date Object (Gregorian Calendar)
 * To obtain "Universal Time" (UT) from "Dynamical Time" (TD) the correction ΔT (in seconds) gets applied
 * ```
 * UT = TD - ΔT
 * ```
 * If your use case does not require such accuracy converting `jde` using `JDToDate` is fine.
 *
 * Note: Javascript uses the the ISO-8601 calendar, which is a proleptic Gregorian
 * calendar, i.e. it acts as if this calendar was always in effect, even before
 * its year of introduction in 1582. Therefore dates between 1582-10-05 and
 * 1582-10-14 exists.
 *
 * @param {number} jde - Julian ephemeris day
 * @returns {Date} Javascript Date Object
 */
function JDEToDate(jde) {
  return new CalendarGregorian().fromJDE(jde).toDate();
}

/**
 * DateToJDE converts a Date Object (Gregorian Calendar) to a Julian ephemeris day `jde`
 * To obtain "Dynamical Time" (TD) from "Universal Time" (UT) the correction ΔT (in seconds) gets applied
 * ```
 * TD = UT + ΔT
 * ```
 * If your use case does not require such accuracy converting `Date` using `DateToJD` is fine.
 *
 * @param {Date} date - Javascript Date Object
 * @returns {number} jde - Julian ephemeris day (float)
 */
function DateToJDE(date) {
  return new CalendarGregorian().fromDate(date).toJDE();
}

/**
 * converts Modified Julian Day `mjd` to Julian Day `jd`
 * @param {Number} mjd - Modified Julian Day
 * @returns {Number} jd - Julian Day
 */
function MJDToJD(mjd) {
  return mjd - _base2.default.JMod;
}

/**
 * converts Julian Day `jd` to Modified Julian Day `mjd`
 * @param {Number} jd - Julian Day
 * @returns {Number} mjd - Modified Julian Day
 */
function JDToMJD(jd) {
  return jd + _base2.default.JMod;
}

/**
 * DayOfWeek determines the day of the week for a given JD.
 *
 * The value returned is an integer in the range 0 to 6, where 0 represents
 * Sunday.  This is the same convention followed in the time package of the
 * Javascript standard library.
 * @param {number} jd - Julian day (float)
 * @returns {number} (int) 0 == sunday; ...; 6 == saturday
 */
function DayOfWeek(jd) {
  return int(jd + 1.5) % 7;
}

/**
 * DayOfYearGregorian computes the day number within the year of the Gregorian
 * calendar.
 * @param {number} y - year (int)
 * @param {number} m - month (int)
 * @param {number} d - day (float)
 * @returns {number} day of year
 */
function DayOfYearGregorian(y, m, d) {
  return DayOfYear(y, m, int(d), LeapYearGregorian(y));
}

/**
 * DayOfYearJulian computes the day number within the year of the Julian
 * calendar.
 * @param {number} y - year (int)
 * @param {number} m - month (int)
 * @param {number} d - day (float)
 * @returns {number} day of year
 */
function DayOfYearJulian(y, m, d) {
  return DayOfYear(y, m, int(d), LeapYearJulian(y));
}

/**
 * DayOfYear computes the day number within the year.
 *
 * This form of the function is not specific to the Julian or Gregorian
 * calendar, but you must tell it whether the year is a leap year.
 * @param {number} y - year (int)
 * @param {number} m - month (int)
 * @param {number} d - day (float)
 * @param {boolean} leap - set `true` if `y` is leap year
 * @returns {number} day of year
 */
function DayOfYear(y, m, d, leap) {
  var k = 0;
  if (leap && m > 1) {
    k = 1;
  }
  return k + DAYS_OF_YEAR[m] + int(d);
}

/**
 * DayOfYearToCalendar returns the calendar month and day for a given
 * day of year and leap year status.
 * @param {number} n - day of year (int)
 * @param {boolean} leap - set `true` if `y` is leap year
 * @returns {object} `{ (int) month, (float) day }`
 */
function DayOfYearToCalendar(n, leap) {
  var month = void 0;
  var k = 0;
  if (leap) {
    k = 1;
  }
  for (month = 1; month <= 12; month++) {
    if (k + DAYS_OF_YEAR[month] > n) {
      month = month - 1;
      break;
    }
  }
  var day = n - k - DAYS_OF_YEAR[month];
  return { month: month, day: day };
}

/**
 * DayOfYearToCalendarGregorian returns the calendar month and day for a given
 * day of year.
 * @param {number} year
 * @param {number} n - day of year (int)
 * @returns {CalendarGregorian} { (int) year, (int) month, (float) day }
 */
function DayOfYearToCalendarGregorian(year, n) {
  var _DayOfYearToCalendar = DayOfYearToCalendar(n, LeapYearGregorian(year)),
      month = _DayOfYearToCalendar.month,
      day = _DayOfYearToCalendar.day;

  return new CalendarGregorian(year, month, day);
}

/**
 * DayOfYearToCalendarJulian returns the calendar month and day for a given
 * day of year.
 * @param {number} year
 * @param {number} n - day of year (int)
 * @returns {CalendarJulian} { (int) year, (int) month, (float) day }
 */
function DayOfYearToCalendarJulian(year, n) {
  var _DayOfYearToCalendar2 = DayOfYearToCalendar(n, LeapYearJulian(year)),
      month = _DayOfYearToCalendar2.month,
      day = _DayOfYearToCalendar2.day;

  return new CalendarJulian(year, month, day);
}

function pad(num, len) {
  len = len || 2;
  var neg = num < 0 ? '-' : '';
  num = Math.abs(num);
  var padded = '0000' + num;
  return neg + padded.substr(padded.length - len, len);
}

exports.default = {
  GREGORIAN0JD: GREGORIAN0JD,
  Calendar: Calendar,
  CalendarJulian: CalendarJulian,
  CalendarGregorian: CalendarGregorian,
  CalendarToJD: CalendarToJD,
  CalendarGregorianToJD: CalendarGregorianToJD,
  CalendarJulianToJD: CalendarJulianToJD,
  LeapYearJulian: LeapYearJulian,
  LeapYearGregorian: LeapYearGregorian,
  JDToCalendar: JDToCalendar,
  JDToCalendarGregorian: JDToCalendarGregorian,
  JDToCalendarJulian: JDToCalendarJulian,
  isJDCalendarGregorian: isJDCalendarGregorian,
  isCalendarGregorian: isCalendarGregorian,
  JDToDate: JDToDate,
  DateToJD: DateToJD,
  JDEToDate: JDEToDate,
  DateToJDE: DateToJDE,
  MJDToJD: MJDToJD,
  JDToMJD: JDToMJD,
  DayOfWeek: DayOfWeek,
  DayOfYearGregorian: DayOfYearGregorian,
  DayOfYearJulian: DayOfYearJulian,
  DayOfYear: DayOfYear,
  DayOfYearToCalendar: DayOfYearToCalendar,
  DayOfYearToCalendarGregorian: DayOfYearToCalendarGregorian,
  DayOfYearToCalendarJulian: DayOfYearToCalendarJulian
};
},{"./base":3,"./deltat":5,"./sexagesimal":13}],9:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.meanLunarMonth = undefined;

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @copyright 2013 Sonia Keys
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @copyright 2016 commenthol
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @license MIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @module moonphase
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      */
/**
 * Moonphase: Chapter 49, Phases of the Moon
 */

exports.meanNew = meanNew;
exports.meanFirst = meanFirst;
exports.meanFull = meanFull;
exports.meanLast = meanLast;
exports.newMoon = newMoon;
exports.first = first;
exports.full = full;
exports.last = last;

var _base = require('./base');

var _base2 = _interopRequireDefault(_base);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var sin = Math.sin,
    cos = Math.cos;

var ck = 1 / 1236.85;
var D2R = Math.PI / 180;

/**
 * mean synodial lunar month
 */
var meanLunarMonth = exports.meanLunarMonth = 29.530588861;

// (49.1) p. 349
function mean(T) {
  return _base2.default.horner(T, 2451550.09766, 29.530588861 / ck, 0.00015437, -0.00000015, 0.00000000073);
}

/** snap returns k at specified quarter q nearest year y. */
function snap(y, q) {
  var k = (y - 2000) * 12.3685; // (49.2) p. 350
  return Math.floor(k - q + 0.5) + q;
}

/**
 * MeanNew returns the jde of the mean New Moon nearest the given datthis.
 * The mean date is within 0.5 day of the true date of New Moon.
 *
 * @param {Number} year - decimal year
 * @returns {Number} jde
 */
function meanNew(year) {
  return mean(snap(year, 0) * ck);
}

/**
 * MeanFirst returns the jde of the mean First Quarter Moon nearest the given datthis.
 * The mean date is within 0.5 day of the true date of First Quarter Moon.
 *
 * @param {Number} year - decimal year
 * @returns {Number} jde
 */
function meanFirst(year) {
  return mean(snap(year, 0.25) * ck);
}

/**
 * MeanFull returns the jde of the mean Full Moon nearest the given datthis.
 * The mean date is within 0.5 day of the true date of Full Moon.
 *
 * @param {Number} year - decimal year
 * @returns {Number} jde
 */
function meanFull(year) {
  return mean(snap(year, 0.5) * ck);
}

/**
 * MeanLast returns the jde of the mean Last Quarter Moon nearest the given datthis.
 * The mean date is within 0.5 day of the true date of Last Quarter Moon.
 *
 * @param {Number} year - decimal year
 * @returns {Number} jde
 */
function meanLast(year) {
  return mean(snap(year, 0.75) * ck);
}

/**
 * New returns the jde of New Moon nearest the given date.
 *
 * @param {Number} year - decimal year
 * @returns {Number} jde
 */
function newMoon(year) {
  var m = new Mp(year, 0);
  return mean(m.T) + m.nfc(nc) + m.a();
}

/**
 * First returns the jde of First Quarter Moon nearest the given datthis.
 *
 * @param {Number} year - decimal year
 * @returns {Number} jde
 */
function first(year, month, day) {
  var m = new Mp(year, 0.25);
  return mean(m.T) + m.flc() + m.w() + m.a();
}

/**
 * Full returns the jde of Full Moon nearest the given datthis.
 *
 * @param {Number} year - decimal year
 * @returns {Number} jde
 */
function full(year, month, day) {
  var m = new Mp(year, 0.5);
  return mean(m.T) + m.nfc(fc) + m.a();
}

/**
 * Last returns the jde of Last Quarter Moon nearest the given datthis.
 *
 * @param {Number} year - decimal year
 * @returns {Number} jde
 */
function last(year, month, day) {
  var m = new Mp(year, 0.75);
  return mean(m.T) + m.flc() - m.w() + m.a();
}

var Mp = function () {
  function Mp(y, q) {
    _classCallCheck(this, Mp);

    this.A = new Array(14);
    var k = this.k = snap(y, q);
    var T = this.T = this.k * ck; // (49.3) p. 350
    this.E = _base2.default.horner(T, 1, -0.002516, -0.0000074);
    this.M = _base2.default.horner(T, 2.5534 * D2R, 29.1053567 * D2R / ck, -0.0000014 * D2R, -0.00000011 * D2R);
    this.M_ = _base2.default.horner(T, 201.5643 * D2R, 385.81693528 * D2R / ck, 0.0107582 * D2R, 0.00001238 * D2R, -0.000000058 * D2R);
    this.F = _base2.default.horner(T, 160.7108 * D2R, 390.67050284 * D2R / ck, -0.0016118 * D2R, -0.00000227 * D2R, 0.000000011 * D2R);
    this.Ω = _base2.default.horner(T, 124.7746 * D2R, -1.56375588 * D2R / ck, 0.0020672 * D2R, 0.00000215 * D2R);
    this.A[0] = 299.7 * D2R + 0.107408 * D2R * k - 0.009173 * T * T;
    this.A[1] = 251.88 * D2R + 0.016321 * D2R * k;
    this.A[2] = 251.83 * D2R + 26.651886 * D2R * k;
    this.A[3] = 349.42 * D2R + 36.412478 * D2R * k;
    this.A[4] = 84.66 * D2R + 18.206239 * D2R * k;
    this.A[5] = 141.74 * D2R + 53.303771 * D2R * k;
    this.A[6] = 207.17 * D2R + 2.453732 * D2R * k;
    this.A[7] = 154.84 * D2R + 7.30686 * D2R * k;
    this.A[8] = 34.52 * D2R + 27.261239 * D2R * k;
    this.A[9] = 207.19 * D2R + 0.121824 * D2R * k;
    this.A[10] = 291.34 * D2R + 1.844379 * D2R * k;
    this.A[11] = 161.72 * D2R + 24.198154 * D2R * k;
    this.A[12] = 239.56 * D2R + 25.513099 * D2R * k;
    this.A[13] = 331.55 * D2R + 3.592518 * D2R * k;
  }

  // new or full corrections


  _createClass(Mp, [{
    key: 'nfc',
    value: function nfc(c) {
      var M = this.M,
          M_ = this.M_,
          E = this.E,
          F = this.F,
          Ω = this.Ω;

      return c[0] * sin(M_) + c[1] * sin(M) * E + c[2] * sin(2 * M_) + c[3] * sin(2 * F) + c[4] * sin(M_ - M) * E + c[5] * sin(M_ + M) * E + c[6] * sin(2 * M) * E * E + c[7] * sin(M_ - 2 * F) + c[8] * sin(M_ + 2 * F) + c[9] * sin(2 * M_ + M) * E + c[10] * sin(3 * M_) + c[11] * sin(M + 2 * F) * E + c[12] * sin(M - 2 * F) * E + c[13] * sin(2 * M_ - M) * E + c[14] * sin(Ω) + c[15] * sin(M_ + 2 * M) + c[16] * sin(2 * (M_ - F)) + c[17] * sin(3 * M) + c[18] * sin(M_ + M - 2 * F) + c[19] * sin(2 * (M_ + F)) + c[20] * sin(M_ + M + 2 * F) + c[21] * sin(M_ - M + 2 * F) + c[22] * sin(M_ - M - 2 * F) + c[23] * sin(3 * M_ + M) + c[24] * sin(4 * M_);
    }

    // first or last corrections

  }, {
    key: 'flc',
    value: function flc() {
      var M = this.M,
          M_ = this.M_,
          E = this.E,
          F = this.F,
          Ω = this.Ω;

      return -0.62801 * sin(M_) + 0.17172 * sin(M) * E + -0.01183 * sin(M_ + M) * E + 0.00862 * sin(2 * M_) + 0.00804 * sin(2 * F) + 0.00454 * sin(M_ - M) * E + 0.00204 * sin(2 * M) * E * E + -0.0018 * sin(M_ - 2 * F) + -0.0007 * sin(M_ + 2 * F) + -0.0004 * sin(3 * M_) + -0.00034 * sin(2 * M_ - M) * E + 0.00032 * sin(M + 2 * F) * E + 0.00032 * sin(M - 2 * F) * E + -0.00028 * sin(M_ + 2 * M) * E * E + 0.00027 * sin(2 * M_ + M) * E + -0.00017 * sin(Ω) + -0.00005 * sin(M_ - M - 2 * F) + 0.00004 * sin(2 * M_ + 2 * F) + -0.00004 * sin(M_ + M + 2 * F) + 0.00004 * sin(M_ - 2 * M) + 0.00003 * sin(M_ + M - 2 * F) + 0.00003 * sin(3 * M) + 0.00002 * sin(2 * M_ - 2 * F) + 0.00002 * sin(M_ - M + 2 * F) + -0.00002 * sin(3 * M_ + M);
    }
  }, {
    key: 'w',
    value: function w() {
      var M = this.M,
          M_ = this.M_,
          E = this.E,
          F = this.F;

      return 0.00306 - 0.00038 * E * cos(M) + 0.00026 * cos(M_) - 0.00002 * (cos(M_ - M) - cos(M_ + M) - cos(2 * F));
    }

    // additional corrections

  }, {
    key: 'a',
    value: function a() {
      var _this = this;

      var a = 0;
      ac.forEach(function (c, i) {
        a += c * sin(_this.A[i]);
      });
      return a;
    }
  }]);

  return Mp;
}();

// new coefficients


var nc = [-0.4072, 0.17241, 0.01608, 0.01039, 0.00739, -0.00514, 0.00208, -0.00111, -0.00057, 0.00056, -0.00042, 0.00042, 0.00038, -0.00024, -0.00017, -0.00007, 0.00004, 0.00004, 0.00003, 0.00003, -0.00003, 0.00003, -0.00002, -0.00002, 0.00002];

// full coefficients
var fc = [-0.40614, 0.17302, 0.01614, 0.01043, 0.00734, -0.00515, 0.00209, -0.00111, -0.00057, 0.00056, -0.00042, 0.00042, 0.00038, -0.00024, -0.00017, -0.00007, 0.00004, 0.00004, 0.00003, 0.00003, -0.00003, 0.00003, -0.00002, -0.00002, 0.00002];

// additional corrections
var ac = [0.000325, 0.000165, 0.000164, 0.000126, 0.00011, 0.000062, 0.00006, 0.000056, 0.000047, 0.000042, 0.000040, 0.000037, 0.000035, 0.000023];

exports.default = {
  meanLunarMonth: meanLunarMonth,
  meanNew: meanNew,
  meanFirst: meanFirst,
  meanFull: meanFull,
  meanLast: meanLast,
  newMoon: newMoon,
  new: newMoon, // BACKWARDS-COMPATIBILITY
  first: first,
  full: full,
  last: last
};
},{"./base":3}],10:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /**
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @copyright 2013 Sonia Keys
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @copyright 2016 commenthol
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @license MIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @module nutation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          */
/**
 * Nutation: Chapter 22, Nutation and the Obliquity of the Ecliptic.
 */

exports.nutation = nutation;
exports.approxNutation = approxNutation;
exports.meanObliquity = meanObliquity;
exports.meanObliquityLaskar = meanObliquityLaskar;
exports.nutationInRA = nutationInRA;

var _base = require('./base');

var _base2 = _interopRequireDefault(_base);

var _sexagesimal = require('./sexagesimal');

var _sexagesimal2 = _interopRequireDefault(_sexagesimal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// Nutation: Chapter 22, Nutation and the Obliquity of the Ecliptic.

/**
 * Nutation returns nutation in longitude (Δψ) and nutation in obliquity (Δε)
 * for a given JDE.
 *
 * JDE = UT + ΔT, see package.
 *
 * Computation is by 1980 IAU theory, with terms < .0003″ neglected.
 *
 * Result units are radians.
 *
 * @param {number} jde - Julian ephemeris day
 * @return {number[]} [Δψ, Δε] - [longitude, obliquity] in radians
 */
function nutation(jde) {
  var T = _base2.default.J2000Century(jde);
  // Mean elongation of the Moon from the sun
  var D = _base2.default.horner(T, 297.85036, 445267.11148, -0.0019142, 1.0 / 189474) * Math.PI / 180;
  // Mean anomaly of the Sun (Earth)
  var M = _base2.default.horner(T, 357.52772, 35999.050340, -0.0001603, -1.0 / 300000) * Math.PI / 180;
  // Mean anomaly of the Moon
  var N = _base2.default.horner(T, 134.96298, 477198.867398, 0.0086972, 1.0 / 56250) * Math.PI / 180;
  // Moon's argument of latitude
  var F = _base2.default.horner(T, 93.27191, 483202.017538, -0.0036825, 1.0 / 327270) * Math.PI / 180;
  // Longitude of the ascending node of the Moon's mean orbit on the ecliptic, measured from mean equinox of date
  var Ω = _base2.default.horner(T, 125.04452, -1934.136261, 0.0020708, 1.0 / 450000) * Math.PI / 180;
  var Δψ = 0;
  var Δε = 0;
  // sum in reverse order to accumulate smaller terms first
  for (var i = table22A.length - 1; i >= 0; i--) {
    var row = table22A[i];
    var arg = row.d * D + row.m * M + row.n * N + row.f * F + row.ω * Ω;

    var _base$sincos = _base2.default.sincos(arg),
        _base$sincos2 = _slicedToArray(_base$sincos, 2),
        s = _base$sincos2[0],
        c = _base$sincos2[1];

    Δψ += s * (row.s0 + row.s1 * T);
    Δε += c * (row.c0 + row.c1 * T);
  }
  Δψ *= 0.0001 / 3600 * (Math.PI / 180);
  Δε *= 0.0001 / 3600 * (Math.PI / 180);
  return [Δψ, Δε]; // (Δψ, Δε float)
}
/**
 * ApproxNutation returns a fast approximation of nutation in longitude (Δψ)
 * and nutation in obliquity (Δε) for a given JDE.
 *
 * Accuracy is 0.5″ in Δψ, 0.1″ in Δε.
 *
 * Result units are radians.
 *
 * @param {number} jde - Julian ephemeris day
 * @return {number[]} [Δψ, Δε] - [longitude, obliquity] in radians
 */
function approxNutation(jde) {
  var T = (jde - _base2.default.J2000) / 36525;
  var Ω = (125.04452 - 1934.136261 * T) * Math.PI / 180;
  var L = (280.4665 + 36000.7698 * T) * Math.PI / 180;
  var N = (218.3165 + 481267.8813 * T) * Math.PI / 180;

  var _base$sincos3 = _base2.default.sincos(Ω),
      _base$sincos4 = _slicedToArray(_base$sincos3, 2),
      sΩ = _base$sincos4[0],
      cΩ = _base$sincos4[1];

  var _base$sincos5 = _base2.default.sincos(2 * L),
      _base$sincos6 = _slicedToArray(_base$sincos5, 2),
      s2L = _base$sincos6[0],
      c2L = _base$sincos6[1];

  var _base$sincos7 = _base2.default.sincos(2 * N),
      _base$sincos8 = _slicedToArray(_base$sincos7, 2),
      s2N = _base$sincos8[0],
      c2N = _base$sincos8[1];

  var _base$sincos9 = _base2.default.sincos(2 * Ω),
      _base$sincos10 = _slicedToArray(_base$sincos9, 2),
      s2Ω = _base$sincos10[0],
      c2Ω = _base$sincos10[1];

  var Δψ = (-17.2 * sΩ - 1.32 * s2L - 0.23 * s2N + 0.21 * s2Ω) / 3600 * (Math.PI / 180);
  var Δε = (9.2 * cΩ + 0.57 * c2L + 0.1 * c2N - 0.09 * c2Ω) / 3600 * (Math.PI / 180);
  return [Δψ, Δε]; // (Δψ, Δε float)
}

/**
 * MeanObliquity returns mean obliquity (ε₀) following the IAU 1980
 * polynomial.
 *
 * Accuracy is 1″ over the range 1000 to 3000 years and 10″ over the range
 * 0 to 4000 years.
 *
 * Result unit is radians.
 *
 * @param {number} jde - Julian ephemeris day
 * @return {number} mean obliquity (ε₀)
 */
function meanObliquity(jde) {
  // (22.2) p. 147
  return _base2.default.horner(_base2.default.J2000Century(jde), new _sexagesimal2.default.Angle(false, 23, 26, 21.448).rad(), -46.815 / 3600 * (Math.PI / 180), -0.00059 / 3600 * (Math.PI / 180), 0.001813 / 3600 * (Math.PI / 180));
}

/**
 * MeanObliquityLaskar returns mean obliquity (ε₀) following the Laskar
 * 1986 polynomial.
 *
 * Accuracy over the range 1000 to 3000 years is .01″.
 *
 * Accuracy over the valid date range of -8000 to +12000 years is
 * "a few seconds."
 *
 * Result unit is radians.
 *
 * @param {number} jde - Julian ephemeris day
 * @return {number} mean obliquity (ε₀)
 */
function meanObliquityLaskar(jde) {
  // (22.3) p. 147
  return _base2.default.horner(_base2.default.J2000Century(jde) * 0.01, new _sexagesimal2.default.Angle(false, 23, 26, 21.448).rad(), -4680.93 / 3600 * (Math.PI / 180), -1.55 / 3600 * (Math.PI / 180), 1999.25 / 3600 * (Math.PI / 180), -51.38 / 3600 * (Math.PI / 180), -249.67 / 3600 * (Math.PI / 180), -39.05 / 3600 * (Math.PI / 180), 7.12 / 3600 * (Math.PI / 180), 27.87 / 3600 * (Math.PI / 180), 5.79 / 3600 * (Math.PI / 180), 2.45 / 3600 * (Math.PI / 180));
}

/**
 * NutationInRA returns "nutation in right ascension" or "equation of the
 * equinoxes."
 *
 * Result is an angle in radians.
 *
 * @param {number} jde - Julian ephemeris day
 * @return {number} nutation in right ascension
 */
function nutationInRA(jde) {
  var _nutation = nutation(jde),
      _nutation2 = _slicedToArray(_nutation, 2),
      Δψ = _nutation2[0],
      Δε = _nutation2[1];

  var ε0 = meanObliquity(jde);
  return Δψ * Math.cos(ε0 + Δε);
}

var table22A = function () {
  var PROPS = 'd,m,n,f,ω,s0,s1,c0,c1'.split(',');
  var tab = [[0, 0, 0, 0, 1, -171996, -174.2, 92025, 8.9], [-2, 0, 0, 2, 2, -13187, -1.6, 5736, -3.1], [0, 0, 0, 2, 2, -2274, -0.2, 977, -0.5], [0, 0, 0, 0, 2, 2062, 0.2, -895, 0.5], [0, 1, 0, 0, 0, 1426, -3.4, 54, -0.1], [0, 0, 1, 0, 0, 712, 0.1, -7, 0], [-2, 1, 0, 2, 2, -517, 1.2, 224, -0.6], [0, 0, 0, 2, 1, -386, -0.4, 200, 0], [0, 0, 1, 2, 2, -301, 0, 129, -0.1], [-2, -1, 0, 2, 2, 217, -0.5, -95, 0.3], [-2, 0, 1, 0, 0, -158, 0, 0, 0], [-2, 0, 0, 2, 1, 129, 0.1, -70, 0], [0, 0, -1, 2, 2, 123, 0, -53, 0], [2, 0, 0, 0, 0, 63, 0, 0, 0], [0, 0, 1, 0, 1, 63, 0.1, -33, 0], [2, 0, -1, 2, 2, -59, 0, 26, 0], [0, 0, -1, 0, 1, -58, -0.1, 32, 0], [0, 0, 1, 2, 1, -51, 0, 27, 0], [-2, 0, 2, 0, 0, 48, 0, 0, 0], [0, 0, -2, 2, 1, 46, 0, -24, 0], [2, 0, 0, 2, 2, -38, 0, 16, 0], [0, 0, 2, 2, 2, -31, 0, 13, 0], [0, 0, 2, 0, 0, 29, 0, 0, 0], [-2, 0, 1, 2, 2, 29, 0, -12, 0], [0, 0, 0, 2, 0, 26, 0, 0, 0], [-2, 0, 0, 2, 0, -22, 0, 0, 0], [0, 0, -1, 2, 1, 21, 0, -10, 0], [0, 2, 0, 0, 0, 17, -0.1, 0, 0], [2, 0, -1, 0, 1, 16, 0, -8, 0], [-2, 2, 0, 2, 2, -16, 0.1, 7, 0], [0, 1, 0, 0, 1, -15, 0, 9, 0], [-2, 0, 1, 0, 1, -13, 0, 7, 0], [0, -1, 0, 0, 1, -12, 0, 6, 0], [0, 0, 2, -2, 0, 11, 0, 0, 0], [2, 0, -1, 2, 1, -10, 0, 5, 0], [2, 0, 1, 2, 2, -8, 0, 3, 0], [0, 1, 0, 2, 2, 7, 0, -3, 0], [-2, 1, 1, 0, 0, -7, 0, 0, 0], [0, -1, 0, 2, 2, -7, 0, 3, 0], [2, 0, 0, 2, 1, -7, 0, 3, 0], [2, 0, 1, 0, 0, 6, 0, 0, 0], [-2, 0, 2, 2, 2, 6, 0, -3, 0], [-2, 0, 1, 2, 1, 6, 0, -3, 0], [2, 0, -2, 0, 1, -6, 0, 3, 0], [2, 0, 0, 0, 1, -6, 0, 3, 0], [0, -1, 1, 0, 0, 5, 0, 0, 0], [-2, -1, 0, 2, 1, -5, 0, 3, 0], [-2, 0, 0, 0, 1, -5, 0, 3, 0], [0, 0, 2, 2, 1, -5, 0, 3, 0], [-2, 0, 2, 0, 1, 4, 0, 0, 0], [-2, 1, 0, 2, 1, 4, 0, 0, 0], [0, 0, 1, -2, 0, 4, 0, 0, 0], [-1, 0, 1, 0, 0, -4, 0, 0, 0], [-2, 1, 0, 0, 0, -4, 0, 0, 0], [1, 0, 0, 0, 0, -4, 0, 0, 0], [0, 0, 1, 2, 0, 3, 0, 0, 0], [0, 0, -2, 2, 2, -3, 0, 0, 0], [-1, -1, 1, 0, 0, -3, 0, 0, 0], [0, 1, 1, 0, 0, -3, 0, 0, 0], [0, -1, 1, 2, 2, -3, 0, 0, 0], [2, -1, -1, 2, 2, -3, 0, 0, 0], [0, 0, 3, 2, 2, -3, 0, 0, 0], [2, -1, 0, 2, 2, -3, 0, 0, 0]];

  return tab.map(function (row) {
    var o = {};
    PROPS.forEach(function (p, i) {
      o[p] = row[i];
    });
    return o;
  });
}();

exports.default = {
  nutation: nutation,
  approxNutation: approxNutation,
  meanObliquity: meanObliquity,
  meanObliquityLaskar: meanObliquityLaskar,
  nutationInRA: nutationInRA
};
},{"./base":3,"./sexagesimal":13}],11:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Planet = undefined;

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @copyright 2013 Sonia Keys
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @copyright 2016 commenthol
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @license MIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @module planetposition
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      */
/**
 * Planetposition: Chapter 32, Positions of the Planets.
 *
 * Incomplete:
 *
 * 1. The package does not implement algorithms that use appendix III,
 * but instead implements a full VSOP87 solution.  I do not have a copy
 * of the supplimentary disk with appendix III in machine readable form
 * and as the appendix is rather large, retyping it by hand is problematic.
 * The full VSOP87 data set on the other hand is freely downloadable from
 * the internet, so I implement here code that can use that data directly.
 *
 * 2. The formula for accuracy of results is not implemented.  It is
 * not needed for full VSOP87 solutions.
 *
 * 3. Polynomial expressions are not implemented.  Again, implementation
 * would involve typing rather large tables of numbers with associated
 * risk of typographical errors.
 */

exports.toFK5 = toFK5;

var _base = require('./base');

var _base2 = _interopRequireDefault(_base);

var _sexagesimal = require('./sexagesimal');

var _sexagesimal2 = _interopRequireDefault(_sexagesimal);

var _coord = require('./coord');

var _coord2 = _interopRequireDefault(_coord);

var _precess = require('./precess');

var _precess2 = _interopRequireDefault(_precess);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function sum(t, series) {
  var coeffs = [];
  Object.keys(series).forEach(function (x) {
    coeffs[x] = 0;
    var y = series[x].length - 1;
    for (y; y >= 0; y--) {
      var term = {
        a: series[x][y][0],
        b: series[x][y][1],
        c: series[x][y][2]
      };
      coeffs[x] += term.a * Math.cos(term.b + term.c * t);
    }
  });
  var res = _base2.default.horner(t, coeffs);
  return res;
}

var Planet = exports.Planet = function () {
  /**
   * VSOP87 representation of a Planet
   * @constructs Planet
   * @param {object} planet - planet data series
   * @example
   * ```js
   * // for use in browser
   * import {data} from 'astronomia'
   * const earth = new planetposition.Planet(data.vsop87Bearth)
   * ```
   */
  function Planet(planet) {
    _classCallCheck(this, Planet);

    if ((typeof planet === 'undefined' ? 'undefined' : _typeof(planet)) !== 'object') throw new TypeError('need planet vsop87 data');
    this.name = planet.name;
    this.series = planet;
  }

  /**
   * Position2000 returns ecliptic position of planets by full VSOP87 theory.
   *
   * @param {Number} jde - the date for which positions are desired.
   * @returns {base.Coord} Results are for the dynamical equinox and ecliptic J2000.
   *  {Number} lon - heliocentric longitude in radians.
   *  {Number} lat - heliocentric latitude in radians.
   *  {Number} range - heliocentric range in AU.
   */


  _createClass(Planet, [{
    key: 'position2000',
    value: function position2000(jde) {
      var T = _base2.default.J2000Century(jde);
      var τ = T * 0.1;
      var lon = _base2.default.pmod(sum(τ, this.series.L), 2 * Math.PI);
      var lat = sum(τ, this.series.B);
      var range = sum(τ, this.series.R);
      return new _base2.default.Coord(lon, lat, range);
    }

    /**
     * Position returns ecliptic position of planets at equinox and ecliptic of date.
     *
     * @param {Number} jde - the date for which positions are desired.
     * @returns {base.Coord} Results are positions consistent with those from Meeus's
     * Apendix III, that is, at equinox and ecliptic of date.
     *  {Number} lon - heliocentric longitude in radians.
     *  {Number} lat - heliocentric latitude in radians.
     *  {Number} range - heliocentric range in AU.
     */

  }, {
    key: 'position',
    value: function position(jde) {
      var _position = this.position2000(jde),
          lat = _position.lat,
          lon = _position.lon,
          range = _position.range;

      var eclFrom = new _coord2.default.Ecliptic(lon, lat);
      var epochFrom = 2000.0;
      var epochTo = _base2.default.JDEToJulianYear(jde);
      var eclTo = _precess2.default.eclipticPosition(eclFrom, epochFrom, epochTo, 0, 0);
      return new _base2.default.Coord(eclTo.lon, eclTo.lat, range);
    }
  }]);

  return Planet;
}();

/**
 * ToFK5 converts ecliptic longitude and latitude from dynamical frame to FK5.
 *
 * @param {Number} lon - ecliptic longitude in radians
 * @param {Number} lat - ecliptic latitude in radians
 * @param {Number} jde - Julian ephemeris day
 * @return {base.Coord}
 *    {Number} lon - FK5 longitude
 *    {Number} lat - FK5 latitude
 */


function toFK5(lon, lat, jde) {
  // formula 32.3, p. 219.
  var T = _base2.default.J2000Century(jde);
  // const Lp = lon - 1.397 * Math.PI / 180 * T - 0.00031 * Math.PI / 180 * T * T
  var Lp = lon - _sexagesimal2.default.angleFromDeg((1.397 + 0.00031 * T) * T);

  var _base$sincos = _base2.default.sincos(Lp),
      _base$sincos2 = _slicedToArray(_base$sincos, 2),
      sLp = _base$sincos2[0],
      cLp = _base$sincos2[1];
  // (32.3) p. 219


  var L5 = lon + _sexagesimal2.default.angleFromSec(-0.09033 + 0.03916 * (cLp + sLp) * Math.tan(lat));
  var B5 = lat + _sexagesimal2.default.angleFromSec(0.03916 * (cLp - sLp));
  return new _base2.default.Coord(L5, B5);
}

exports.default = {
  Planet: Planet,
  toFK5: toFK5
};
},{"./base":3,"./coord":4,"./precess":12,"./sexagesimal":13}],12:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.EclipticPrecessor = exports.Precessor = undefined;

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /**
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @copyright 2013 Sonia Keys
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @copyright 2016 commenthol
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @license MIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @module precess
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          */
/**
 * Precession: Chapter 21, Precession.
 *
 * Functions in this package take Julian epoch argurments rather than Julian
 * days.  Use base.JDEToJulianYear() to convert.
 *
 * Also in package base are some definitions related to the Besselian and
 * Julian Year.
 *
 * Partial:  Precession from FK4 not implemented.  Meeus gives no test cases.
 * It's a fair amount of code and data, representing significant chances for
 * errors.  And precession from FK4 would seem to be of little interest today.
 *
 * Proper motion units
 *
 * Meeus gives some example annual proper motions in units of seconds of
 * right ascension and seconds of declination.  To make units clear,
 * functions in this package take proper motions with argument types of
 * sexa.HourAngle and sexa.Angle respectively.  Error-prone conversions
 * can be avoided by using the constructors for these base types.
 *
 * For example, given an annual proper motion in right ascension of -0ˢ.03847,
 * rather than
 *
 * mra = -0.03847 / 13751 // as Meeus suggests
 *
 * or
 *
 * mra = -0.03847 * (15/3600) * (pi/180) // less magic
 *
 * use
 *
 * mra = new sexa.HourAngle(false, 0, 0, -0.03847)
 *
 * Unless otherwise indicated, functions in this library expect proper motions
 * to be annual proper motions, so the unit denominator is years.
 * (The code, following Meeus's example, technically treats it as Julian years.)
 */

exports.approxAnnualPrecession = approxAnnualPrecession;
exports.mn = mn;
exports.approxPosition = approxPosition;
exports.position = position;
exports.eclipticPosition = eclipticPosition;
exports.properMotion = properMotion;
exports.properMotion3D = properMotion3D;

var _base = require('./base');

var _base2 = _interopRequireDefault(_base);

var _coord = require('./coord');

var _coord2 = _interopRequireDefault(_coord);

var _elementequinox = require('./elementequinox');

var _elementequinox2 = _interopRequireDefault(_elementequinox);

var _nutation = require('./nutation');

var _nutation2 = _interopRequireDefault(_nutation);

var _sexagesimal = require('./sexagesimal');

var _sexagesimal2 = _interopRequireDefault(_sexagesimal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

/**
 * approxAnnualPrecession returns approximate annual precision in right
 * ascension and declination.
 *
 * The two epochs should be within a few hundred years.
 * The declinations should not be too close to the poles.
 *
 * @param {coord.Equatorial} eqFrom
 * @param {Number} epochFrom - use `base.JDEToJulianYear(year)` to get epoch
 * @param {Number} epochTo - use `base.JDEToJulianYear(year)` to get epoch
 * @returns {Array}
 *  {sexa.HourAngle} seconds of right ascension
 *  {sexa.Angle} seconds of Declination
 */
function approxAnnualPrecession(eqFrom, epochFrom, epochTo) {
  var _mn = mn(epochFrom, epochTo),
      _mn2 = _slicedToArray(_mn, 3),
      m = _mn2[0],
      na = _mn2[1],
      nd = _mn2[2];

  var _base$sincos = _base2.default.sincos(eqFrom.ra),
      _base$sincos2 = _slicedToArray(_base$sincos, 2),
      sa = _base$sincos2[0],
      ca = _base$sincos2[1];
  // (21.1) p. 132


  var Δαs = m + na * sa * Math.tan(eqFrom.dec); // seconds of RA
  var Δδs = nd * ca; // seconds of Dec
  var ra = new _sexagesimal2.default.HourAngle(false, 0, 0, Δαs).rad();
  var dec = new _sexagesimal2.default.Angle(false, 0, 0, Δδs).rad();
  return { ra: ra, dec: dec };
}

/**
 * @param {Number} epochFrom - use `base.JDEToJulianYear(year)` to get epoch
 * @param {Number} epochTo - use `base.JDEToJulianYear(year)` to get epoch
 */
function mn(epochFrom, epochTo) {
  var T = (epochTo - epochFrom) * 0.01;
  var m = 3.07496 + 0.00186 * T;
  var na = 1.33621 - 0.00057 * T;
  var nd = 20.0431 - 0.0085 * T;
  return [m, na, nd];
}

/**
 * ApproxPosition uses ApproxAnnualPrecession to compute a simple and quick
 * precession while still considering proper motion.
 *
 * @param {coord.Equatorial} eqFrom
 * @param {Number} epochFrom
 * @param {Number} epochTo
 * @param {Number} mα - in radians
 * @param {Number} mδ - in radians
 * @returns {coord.Equatorial} eqTo
 */
function approxPosition(eqFrom, epochFrom, epochTo, mα, mδ) {
  var _approxAnnualPrecessi = approxAnnualPrecession(eqFrom, epochFrom, epochTo),
      ra = _approxAnnualPrecessi.ra,
      dec = _approxAnnualPrecessi.dec;

  var dy = epochTo - epochFrom;
  var eqTo = new _coord2.default.Equatorial();
  eqTo.ra = eqFrom.ra + (ra + mα) * dy;
  eqTo.dec = eqFrom.dec + (dec + mδ) * dy;
  return eqTo;
}

// constants
var d = Math.PI / 180;
var s = d / 3600;

// coefficients from (21.2) p. 134
var ζT = [2306.2181 * s, 1.39656 * s, -0.000139 * s];
var zT = [2306.2181 * s, 1.39656 * s, -0.000139 * s];
var θT = [2004.3109 * s, -0.8533 * s, -0.000217 * s];
// coefficients from (21.3) p. 134
var ζt = [2306.2181 * s, 0.30188 * s, 0.017998 * s];
var zt = [2306.2181 * s, 1.09468 * s, 0.018203 * s];
var θt = [2004.3109 * s, -0.42665 * s, -0.041833 * s];

/**
 * Precessor represents precession from one epoch to another.
 *
 * Construct with NewPrecessor, then call method Precess.
 * After construction, Precess may be called multiple times to precess
 * different coordinates with the same initial and final epochs.
 */

var Precessor = exports.Precessor = function () {
  /**
   * constructs a Precessor object and initializes it to precess
   * coordinates from epochFrom to epochTo.
   * @param {Number} epochFrom
   * @param {Number} epochTo
   */
  function Precessor(epochFrom, epochTo) {
    _classCallCheck(this, Precessor);

    // (21.2) p. 134
    var ζCoeff = ζt;
    var zCoeff = zt;
    var θCoeff = θt;
    if (epochFrom !== 2000) {
      var T = (epochFrom - 2000) * 0.01;
      ζCoeff = [_base2.default.horner(T, ζT), 0.30188 * s - 0.000344 * s * T, 0.017998 * s];
      zCoeff = [_base2.default.horner(T, zT), 1.09468 * s + 0.000066 * s * T, 0.018203 * s];
      θCoeff = [_base2.default.horner(T, θT), -0.42665 * s - 0.000217 * s * T, -0.041833 * s];
    }
    var t = (epochTo - epochFrom) * 0.01;
    this.ζ = _base2.default.horner(t, ζCoeff) * t;
    this.z = _base2.default.horner(t, zCoeff) * t;
    var θ = _base2.default.horner(t, θCoeff) * t;
    this.sθ = Math.sin(θ);
    this.cθ = Math.cos(θ);
  }

  /**
   * Precess precesses coordinates eqFrom, leaving result in eqTo.
   *
   * @param {coord.Equatorial} eqFrom
   * @returns {coord.Equatorial} eqTo
   */


  _createClass(Precessor, [{
    key: 'precess',
    value: function precess(eqFrom) {
      // (21.4) p. 134
      var _base$sincos3 = _base2.default.sincos(eqFrom.dec),
          _base$sincos4 = _slicedToArray(_base$sincos3, 2),
          sδ = _base$sincos4[0],
          cδ = _base$sincos4[1];

      var _base$sincos5 = _base2.default.sincos(eqFrom.ra + this.ζ),
          _base$sincos6 = _slicedToArray(_base$sincos5, 2),
          sαζ = _base$sincos6[0],
          cαζ = _base$sincos6[1];

      var A = cδ * sαζ;
      var B = this.cθ * cδ * cαζ - this.sθ * sδ;
      var C = this.sθ * cδ * cαζ + this.cθ * sδ;
      var eqTo = new _coord2.default.Equatorial();
      eqTo.ra = Math.atan2(A, B) + this.z;
      if (C < _base2.default.CosSmallAngle) {
        eqTo.dec = Math.asin(C);
      } else {
        eqTo.dec = Math.acos(Math.hypot(A, B)); // near pole
      }
      return eqTo;
    }
  }]);

  return Precessor;
}();

/**
 * Position precesses equatorial coordinates from one epoch to another,
 * including proper motions.
 *
 * If proper motions are not to be considered or are not applicable, pass 0, 0
 * for mα, mδ
 *
 * Both eqFrom and eqTo must be non-nil, although they may point to the same
 * struct.  EqTo is returned for convenience.
 * @param {coord.Equatorial} eqFrom
 * @param {coord.Equatorial} eqTo
 * @param {Number} epochFrom
 * @param {Number} epochTo
 * @param {Number} mα - in radians
 * @param {Number} mδ - in radians
 * @returns {coord.Equatorial} [eqTo]
 */


function position(eqFrom, epochFrom, epochTo, mα, mδ) {
  var p = new Precessor(epochFrom, epochTo);
  var t = epochTo - epochFrom;
  var eqTo = new _coord2.default.Equatorial();
  eqTo.ra = eqFrom.ra + mα * t;
  eqTo.dec = eqFrom.dec + mδ * t;
  return p.precess(eqTo);
}

// coefficients from (21.5) p. 136
var ηT = [47.0029 * s, -0.06603 * s, 0.000598 * s];
var πT = [174.876384 * d, 3289.4789 * s, 0.60622 * s];
var pT = [5029.0966 * s, 2.22226 * s, -0.000042 * s];
var ηt = [47.0029 * s, -0.03302 * s, 0.000060 * s];
var πt = [174.876384 * d, -869.8089 * s, 0.03536 * s];
var pt = [5029.0966 * s, 1.11113 * s, -0.000006 * s];

/**
 * EclipticPrecessor represents precession from one epoch to another.
 *
 * Construct with NewEclipticPrecessor, then call method Precess.
 * After construction, Precess may be called multiple times to precess
 * different coordinates with the same initial and final epochs.
 */

var EclipticPrecessor = exports.EclipticPrecessor = function () {
  /**
   * constructs an EclipticPrecessor object and initializes
   * it to precess coordinates from epochFrom to epochTo.
   * @param {Number} epochFrom
   * @param {Number} epochTo
   */
  function EclipticPrecessor(epochFrom, epochTo) {
    _classCallCheck(this, EclipticPrecessor);

    // (21.5) p. 136
    var ηCoeff = ηt;
    var πCoeff = πt;
    var pCoeff = pt;
    if (epochFrom !== 2000) {
      var T = (epochFrom - 2000) * 0.01;
      ηCoeff = [_base2.default.horner(T, ηT), -0.03302 * s + 0.000598 * s * T, 0.000060 * s];
      πCoeff = [_base2.default.horner(T, πT), -869.8089 * s - 0.50491 * s * T, 0.03536 * s];
      pCoeff = [_base2.default.horner(T, pT), 1.11113 * s - 0.000042 * s * T, -0.000006 * s];
    }
    var t = (epochTo - epochFrom) * 0.01;
    this.π = _base2.default.horner(t, πCoeff);
    this.p = _base2.default.horner(t, pCoeff) * t;
    var η = _base2.default.horner(t, ηCoeff) * t;
    this.sη = Math.sin(η);
    this.cη = Math.cos(η);
  }

  /**
   * EclipticPrecess precesses coordinates eclFrom, leaving result in eclTo.
   *
   * The same struct may be used for eclFrom and eclTo.
   * EclTo is returned for convenience.
   * @param {coord.Ecliptic} eclFrom
   * @param {coord.Ecliptic} eclTo
   * @returns {coord.Ecliptic} [eclTo]
   */


  _createClass(EclipticPrecessor, [{
    key: 'precess',
    value: function precess(eclFrom) {
      // (21.7) p. 137
      var _base$sincos7 = _base2.default.sincos(eclFrom.lat),
          _base$sincos8 = _slicedToArray(_base$sincos7, 2),
          sβ = _base$sincos8[0],
          cβ = _base$sincos8[1];

      var _base$sincos9 = _base2.default.sincos(this.π - eclFrom.lon),
          _base$sincos10 = _slicedToArray(_base$sincos9, 2),
          sd = _base$sincos10[0],
          cd = _base$sincos10[1];

      var A = this.cη * cβ * sd - this.sη * sβ;
      var B = cβ * cd;
      var C = this.cη * sβ + this.sη * cβ * sd;
      var eclTo = new _coord2.default.Ecliptic();
      eclTo.lon = this.p + this.π - Math.atan2(A, B);
      if (C < _base2.default.CosSmallAngle) {
        eclTo.lat = Math.asin(C);
      } else {
        eclTo.lat = Math.acos(Math.hypot(A, B)); // near pole
      }
      return eclTo;
    }

    /**
     * ReduceElements reduces orbital elements of a solar system body from one
     * equinox to another.
     *
     * This function is described in chapter 24, but is located in this
     * package so it can be a method of EclipticPrecessor.
     *
     * @param {elementequinox.Elements} eFrom
     * @returns {elementequinox.Elements} eTo
     */

  }, {
    key: 'reduceElements',
    value: function reduceElements(eFrom) {
      var ψ = this.π + this.p;

      var _base$sincos11 = _base2.default.sincos(eFrom.inc),
          _base$sincos12 = _slicedToArray(_base$sincos11, 2),
          si = _base$sincos12[0],
          ci = _base$sincos12[1];

      var _base$sincos13 = _base2.default.sincos(eFrom.node - this.π),
          _base$sincos14 = _slicedToArray(_base$sincos13, 2),
          snp = _base$sincos14[0],
          cnp = _base$sincos14[1];

      var eTo = new _elementequinox2.default.Elements();
      // (24.1) p. 159
      eTo.inc = Math.acos(ci * this.cη + si * this.sη * cnp);
      // (24.2) p. 159
      eTo.node = Math.atan2(si * snp, this.cη * si * cnp - this.sη * ci) + ψ;
      // (24.3) p. 159
      eTo.peri = Math.atan2(-this.sη * snp, si * this.cη - ci * this.sη * cnp) + eFrom.peri;
      return eTo;
    }
  }]);

  return EclipticPrecessor;
}();

/**
 * eclipticPosition precesses ecliptic coordinates from one epoch to another,
 * including proper motions.
 * While eclFrom is given as ecliptic coordinates, proper motions mα, mδ are
 * still expected to be equatorial.  If proper motions are not to be considered
 * or are not applicable, pass 0, 0.
 * Both eclFrom and eclTo must be non-nil, although they may point to the same
 * struct.  EclTo is returned for convenience.
 *
 * @param {coord.Ecliptic} eclFrom,
 * @param {Number} epochFrom
 * @param {Number} epochTo
 * @param {sexa.HourAngle} mα
 * @param {sexa.Angle} mδ
 * @returns {coord.Ecliptic} eclTo
 */


function eclipticPosition(eclFrom, epochFrom, epochTo, mα, mδ) {
  var p = new EclipticPrecessor(epochFrom, epochTo);

  if (mα !== 0 || mδ !== 0) {
    var _properMotion = properMotion(mα.rad(), mδ.rad(), epochFrom, eclFrom),
        lon = _properMotion.lon,
        lat = _properMotion.lat;

    var t = epochTo - epochFrom;
    eclFrom.lon += lon * t;
    eclFrom.lat += lat * t;
  }
  return p.precess(eclFrom);
}

/**
 * @param {Number} mα - anual proper motion (ra)
 * @param {Number} mδ - anual proper motion (dec)
 * @param {Number} epoch
 * @param {coord.Ecliptic} ecl
 * @returns {Number[]} [mλ, mβ]
 */
function properMotion(mα, mδ, epoch, ecl) {
  var ε = _nutation2.default.meanObliquity(_base2.default.JulianYearToJDE(epoch));

  var _base$sincos15 = _base2.default.sincos(ε),
      _base$sincos16 = _slicedToArray(_base$sincos15, 2),
      εsin = _base$sincos16[0],
      εcos = _base$sincos16[1];

  var _ecl$toEquatorial = ecl.toEquatorial(ε),
      ra = _ecl$toEquatorial.ra,
      dec = _ecl$toEquatorial.dec;

  var _base$sincos17 = _base2.default.sincos(ra),
      _base$sincos18 = _slicedToArray(_base$sincos17, 2),
      sα = _base$sincos18[0],
      cα = _base$sincos18[1];

  var _base$sincos19 = _base2.default.sincos(dec),
      _base$sincos20 = _slicedToArray(_base$sincos19, 2),
      sδ = _base$sincos20[0],
      cδ = _base$sincos20[1];

  var cβ = Math.cos(ecl.lat);
  var lon = (mδ * εsin * cα + mα * cδ * (εcos * cδ + εsin * sδ * sα)) / (cβ * cβ);
  var lat = (mδ * (εcos * cδ + εsin * sδ * sα) - mα * εsin * cα * cδ) / cβ;
  return new _coord2.default.Ecliptic(lon, lat);
}

/**
 * ProperMotion3D takes the 3D equatorial coordinates of an object
 * at one epoch and computes its coordinates at a new epoch, considering
 * proper motion and radial velocity.
 *
 * Radial distance (r) must be in parsecs, radial velocitiy (mr) in
 * parsecs per year.
 *
 * Both eqFrom and eqTo must be non-nil, although they may point to the same
 * struct.  EqTo is returned for convenience.
 *
 * @param {coord.Equatorial} eqFrom,
 * @param {Number} epochFrom
 * @param {Number} r
 * @param {Number} mr
 * @param {sexa.HourAngle} mα
 * @param {sexa.Angle} mδ
 * @returns {coord.Equatorial} eqTo
 */
function properMotion3D(eqFrom, epochFrom, epochTo, r, mr, mα, mδ) {
  var _base$sincos21 = _base2.default.sincos(eqFrom.ra),
      _base$sincos22 = _slicedToArray(_base$sincos21, 2),
      sα = _base$sincos22[0],
      cα = _base$sincos22[1];

  var _base$sincos23 = _base2.default.sincos(eqFrom.dec),
      _base$sincos24 = _slicedToArray(_base$sincos23, 2),
      sδ = _base$sincos24[0],
      cδ = _base$sincos24[1];

  var x = r * cδ * cα;
  var y = r * cδ * sα;
  var z = r * sδ;
  var mrr = mr / r;
  var zmδ = z * mδ.rad();
  var mx = x * mrr - zmδ * cα - y * mα.rad();
  var my = y * mrr - zmδ * sα + x * mα.rad();
  var mz = z * mrr + r * mδ.rad() * cδ;
  var t = epochTo - epochFrom;
  var xp = x + t * mx;
  var yp = y + t * my;
  var zp = z + t * mz;
  var eqTo = new _coord2.default.Equatorial();
  eqTo.ra = Math.atan2(yp, xp);
  eqTo.dec = Math.atan2(zp, Math.hypot(xp, yp));
  return eqTo;
}

exports.default = {
  approxAnnualPrecession: approxAnnualPrecession,
  mn: mn,
  approxPosition: approxPosition,
  Precessor: Precessor,
  position: position,
  EclipticPrecessor: EclipticPrecessor,
  eclipticPosition: eclipticPosition,
  properMotion: properMotion,
  properMotion3D: properMotion3D
};
},{"./base":3,"./coord":4,"./elementequinox":6,"./nutation":10,"./sexagesimal":13}],13:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

exports.DMSToDeg = DMSToDeg;
exports.degToDMS = degToDMS;

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

/**
 * @copyright 2013 Sonia Keys
 * @copyright 2016 commenthol
 * @license MIT
 * @module sexagesimal
 */
/**
 * Sexagesimal functions
 */

/**
 * Angle represents a general purpose angle.
 * Unit is radians.
 */
var Angle = exports.Angle = function () {
  /**
  * constructs a new Angle value from sign, degree, minute, and second
  * components.
  * __One argument__
  * @param {Number} angle - (float) angle in radians
  * __Four arguments__
  * @param {Boolean} neg - sign, true if negative (required to attribute -0°30')
  * @param {Number} d - (int) degree
  * @param {Number} m - (int) minute
  * @param {Number} s - (float) second
  */
  function Angle(neg, d, m, s) {
    _classCallCheck(this, Angle);

    if (arguments.length === 1) {
      this.angle = neg;
    } else {
      this.setDMS(neg, d, m, s);
    }
  }

  /**
   * SetDMS sets the value of an FAngle from sign, degree, minute, and second
   * components.
   * The receiver is returned as a convenience.
   * @param {Boolean} neg - sign, true if negative
   * @param {Number} d - (int) degree
   * @param {Number} m - (int) minute
   * @param {Number} s - (float) second
   * @returns {Angle}
   */


  _createClass(Angle, [{
    key: 'setDMS',
    value: function setDMS() {
      var neg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
      var d = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
      var m = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
      var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.0;

      this.angle = DMSToDeg(neg, d, m, s) * Math.PI / 180;
      return this;
    }

    /**
     * sets angle
     * @param {Number} angle - (float) angle in radians
     * @returns {Angle}
     */

  }, {
    key: 'setAngle',
    value: function setAngle(rad) {
      this.angle = rad;
      return this;
    }

    /**
     * Rad returns the angle in radians.
     * @returns {Number} angle in radians
     */

  }, {
    key: 'rad',
    value: function rad() {
      return this.angle;
    }

    /**
     * Deg returns the angle in degrees.
     * @returns {Number} angle in degree
     */

  }, {
    key: 'deg',
    value: function deg() {
      return this.angle * 180 / Math.PI;
    }

    /**
     * toDMS converts to parsed sexagesimal angle component.
     */

  }, {
    key: 'toDMS',
    value: function toDMS() {
      return degToDMS(this.deg());
    }

    /**
     * Print angle in degree using `d°m´s.ss″`
     * @param {Number} precision - precision of `s.ss`
     * @returns {String}
     */

  }, {
    key: 'toString',
    value: function toString(precision) {
      var _toDMS = this.toDMS(),
          _toDMS2 = _slicedToArray(_toDMS, 4),
          neg = _toDMS2[0],
          d = _toDMS2[1],
          m = _toDMS2[2],
          s = _toDMS2[3];

      s = round(s, precision).toString().replace(/^0\./, '.');
      var str = (neg ? '-' : '') + (d + '°') + (m + '′') + (s + '″');
      return str;
    }

    /**
     * Print angle in degree using `d°.ff`
     * @param {Number} precision - precision of `.ff`
     * @returns {String}
     */

  }, {
    key: 'toDegString',
    value: function toDegString(precision) {
      var _modf = modf(this.deg()),
          _modf2 = _slicedToArray(_modf, 2),
          i = _modf2[0],
          s = _modf2[1];

      s = round(s, precision).toString().replace(/^0\./, '.');
      var str = i + '°' + s;
      return str;
    }
  }]);

  return Angle;
}();

/**
 * HourAngle represents an angle corresponding to angular rotation of
 * the Earth in a specified time.
 *
 * Unit is radians.
 */


var HourAngle = exports.HourAngle = function (_Angle) {
  _inherits(HourAngle, _Angle);

  function HourAngle() {
    _classCallCheck(this, HourAngle);

    return _possibleConstructorReturn(this, (HourAngle.__proto__ || Object.getPrototypeOf(HourAngle)).apply(this, arguments));
  }

  _createClass(HourAngle, [{
    key: 'setDMS',

    /**
    * NewHourAngle constructs a new HourAngle value from sign, hour, minute,
    * and second components.
    * @param {Boolean} neg
    * @param {Number} h - (int)
    * @param {Number} m - (int)
    * @param {Number} s - (float)
    */
    // constructor (neg, h, m, s) {
    // super(neg, h, m, s)
    // }

    /**
     * SetDMS sets the value of an FAngle from sign, degree, minute, and second
     * components.
     * The receiver is returned as a convenience.
     * @param {Boolean} neg - sign, true if negative
     * @param {Number} h - (int) hour
     * @param {Number} m - (int) minute
     * @param {Number} s - (float) second
     * @returns {Angle}
     */
    value: function setDMS() {
      var neg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
      var h = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
      var m = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
      var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.0;

      this.angle = DMSToDeg(neg, h, m, s) * 15 * Math.PI / 180;
      return this;
    }

    /**
     * Hour returns the hour angle as hours of time.
     * @returns hour angle
     */

  }, {
    key: 'hour',
    value: function hour() {
      return this.angle * 12 / Math.PI; // 12 = 180 / 15
    }
  }, {
    key: 'deg',
    value: function deg() {
      return this.hour();
    }

    /**
     * Print angle in `HʰMᵐs.ssˢ`
     * @param {Number} precision - precision of `s.ss`
     * @returns {String}
     */

  }, {
    key: 'toString',
    value: function toString(precision) {
      var _toDMS3 = this.toDMS(),
          _toDMS4 = _slicedToArray(_toDMS3, 4),
          neg = _toDMS4[0],
          h = _toDMS4[1],
          m = _toDMS4[2],
          s = _toDMS4[3];

      s = round(s, precision).toString().replace(/^0\./, '.');
      var str = (neg ? '-' : '') + (h + 'ʰ') + (m + 'ᵐ') + (s + 'ˢ');
      return str;
    }
  }]);

  return HourAngle;
}(Angle);

/**
 * DMSToDeg converts from parsed sexagesimal angle components to decimal
 * degrees.
 * @param {Boolean} neg - sign, true if negative
 * @param {Number} d - (int) degree
 * @param {Number} m - (int) minute
 * @param {Number} s - (float) second
 * @returns {Number} angle in degree
 */


function DMSToDeg(neg, d, m, s) {
  s = ((d * 60 + m) * 60 + s) / 3600;
  if (neg) {
    return -s;
  }
  return s;
}

/**
 * DegToDMS converts from decimal degrees to parsed sexagesimal angle component.
 * @param {Number} deg - angle in degree
 * @returns {Array} [neg, d, m, s]
 *  {Boolean} neg - sign, true if negative
 *  {Number} d - (int) degree
 *  {Number} m - (int) minute
 *  {Number} s - (float) second
 */
function degToDMS(deg) {
  var neg = deg < 0;
  deg = Math.abs(deg);

  var _modf3 = modf(deg % 360),
      _modf4 = _slicedToArray(_modf3, 2),
      d = _modf4[0],
      s = _modf4[1];

  var _modf5 = modf(s * 60),
      _modf6 = _slicedToArray(_modf5, 2),
      m = _modf6[0],
      s1 = _modf6[1];

  s = round(s1 * 60); // may introduce an error < 1e13
  return [neg, d, m, s];
}

/**
 * TODO
 */

var RA = exports.RA = function (_HourAngle) {
  _inherits(RA, _HourAngle);

  /**
   * constructs a new RA value from hour, minute, and second components.
   * Negative values are not supported, RA wraps values larger than 24
   * to the range [0,24) hours.
   * @param {Number} h - (int) hour
   * @param {Number} m - (int) minute
   * @param {Number} s - (float) second
   */
  function RA() {
    var h = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
    var m = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
    var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;

    _classCallCheck(this, RA);

    var _this2 = _possibleConstructorReturn(this, (RA.__proto__ || Object.getPrototypeOf(RA)).call(this));

    var args = [].slice.call(arguments);
    if (args.length === 1) {
      _this2.angle = h;
    } else {
      var hr = DMSToDeg(false, h, m, s) % 24;
      _this2.angle = hr * 15 * Math.PI / 180;
    }
    return _this2;
  }

  _createClass(RA, [{
    key: 'hour',
    value: function hour() {
      var h = this.angle * 12 / Math.PI;
      return (24 + h % 24) % 24;
    }
  }]);

  return RA;
}(HourAngle);

/**
 * Time Angle
 * Unit is time in seconds.
 */


var Time = exports.Time = function () {
  /**
   * @param {Boolean} neg - set `true` if negative
   * @param {Number} h - (int) hour
   * @param {Number} m - (int) minute
   * @param {Number} s - (float) second
   */
  function Time(neg, h, m, s) {
    _classCallCheck(this, Time);

    if (arguments.length === 1) {
      this.time = neg;
    } else {
      this.setHMS(neg, h, m, s);
    }
  }

  _createClass(Time, [{
    key: 'setHMS',
    value: function setHMS() {
      var neg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
      var h = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
      var m = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
      var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;

      s += (h * 60 + m) * 60;
      if (neg) {
        s = -s;
      }
      this.time = s;
    }

    /**
     * @returns {Number} time in seconds.
     */

  }, {
    key: 'sec',
    value: function sec() {
      return this.time;
    }

    /**
     * @returns {Number} time in minutes.
     */

  }, {
    key: 'min',
    value: function min() {
      return this.time / 60;
    }

    /**
     * @returns {Number} time in hours.
     */

  }, {
    key: 'hour',
    value: function hour() {
      return this.time / 3600;
    }

    /**
     * @returns {Number} time in days.
     */

  }, {
    key: 'day',
    value: function day() {
      return this.time / 3600 / 24;
    }

    /**
     * @returns {Number} time in radians, where 1 day = 2 Pi radians.
     */

  }, {
    key: 'rad',
    value: function rad() {
      return this.time * Math.PI / 12 / 3600;
    }

    /**
     * convert time to HMS
     * @returns {Array} [neg, h, m, s]
     *  {Boolean} neg - sign, true if negative
     *  {Number} h - (int) hour
     *  {Number} m - (int) minute
     *  {Number} s - (float) second
     */

  }, {
    key: 'toHMS',
    value: function toHMS() {
      var t = this.time;
      var neg = t < 0;
      t = neg ? -t : t;
      var h = Math.trunc(t / 3600);
      t = t - h * 3600;
      var m = Math.trunc(t / 60);
      var s = t - m * 60;
      return [neg, h, m, s];
    }

    /**
     * Print time using `HʰMᵐsˢ.ss`
     * @param {Number} precision - precision of `.ss`
     * @returns {String}
     */

  }, {
    key: 'toString',
    value: function toString(precision) {
      var _toHMS = this.toHMS(),
          _toHMS2 = _slicedToArray(_toHMS, 4),
          neg = _toHMS2[0],
          h = _toHMS2[1],
          m = _toHMS2[2],
          s = _toHMS2[3];

      var _modf7 = modf(s),
          _modf8 = _slicedToArray(_modf7, 2),
          si = _modf8[0],
          sf = _modf8[1];

      if (precision === 0) {
        si = round(s, 0);
        sf = 0;
      } else {
        sf = round(sf, precision).toString().substr(1);
      }
      var str = (neg ? '-' : '') + (h + 'ʰ') + (m + 'ᵐ') + (si + 'ˢ') + (sf || '');
      return str;
    }
  }]);

  return Time;
}();

// units


var angleFromDeg = exports.angleFromDeg = function angleFromDeg(deg) {
  return deg * Math.PI / 180;
};
var angleFromMin = exports.angleFromMin = function angleFromMin(min) {
  return min / 60 * Math.PI / 180;
};
var angleFromSec = exports.angleFromSec = function angleFromSec(sec) {
  return sec / 3600 * Math.PI / 180;
};
var degFromAngle = exports.degFromAngle = function degFromAngle(angle) {
  return angle * 180 / Math.PI;
};
var secFromAngle = exports.secFromAngle = function secFromAngle(angle) {
  return angle * 3600 * 180 / Math.PI;
};
var secFromHourAngle = exports.secFromHourAngle = function secFromHourAngle(ha) {
  return ha * 240 * 180 / Math.PI;
};

/**
 * separate fix `i` from fraction `f`
 * @private
 * @param {Number} float
 * @returns {Array} [i, f]
 *  {Number} i - (int) fix value
 *  {Number} f - (float) fractional portion; always > 1
 */
function modf(float) {
  var i = Math.trunc(float);
  var f = Math.abs(float - i);
  return [i, f];
}

/**
 * Rounds `float` value by precision
 * @private
 * @param {Number} float - value to round
 * @param {Number} precision - (int) number of post decimal positions
 * @return {Number} rounded `float`
 */
function round(float, precision) {
  precision = precision === undefined ? 10 : precision;
  return parseFloat(float.toFixed(precision), 10);
}

exports.default = {
  Angle: Angle,
  HourAngle: HourAngle,
  DMSToDeg: DMSToDeg,
  degToDMS: degToDMS,
  RA: RA,
  Time: Time,
  angleFromDeg: angleFromDeg,
  angleFromMin: angleFromMin,
  angleFromSec: angleFromSec,
  degFromAngle: degFromAngle,
  secFromAngle: secFromAngle,
  secFromHourAngle: secFromHourAngle
};
},{}],14:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /**
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @copyright 2013 Sonia Keys
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @copyright 2016 commenthol
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @license MIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * @module solar
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          */
/**
 * Solar: Chapter 25, Solar Coordinates.
 *
 * Partial implementation:
 *
 * 1. Higher accuracy positions are not computed with Appendix III but with
 * full VSOP87 as implemented in package planetposition.
 *
 * 2. Higher accuracy correction for aberration (using the formula for
 * variation Δλ on p. 168) is not implemented.  Results for example 25.b
 * already match the full VSOP87 values on p. 165 even with the low accuracy
 * correction for aberration, thus there are no more significant digits that
 * would check a more accurate result.  Also the size of the formula presents
 * significant chance of typographical error.
 */

exports.trueLongitude = trueLongitude;
exports.meanAnomaly = meanAnomaly;
exports.eccentricity = eccentricity;
exports.radius = radius;
exports.apparentLongitude = apparentLongitude;
exports.true2000 = true2000;
exports.trueEquatorial = trueEquatorial;
exports.apparentEquatorial = apparentEquatorial;
exports.trueVSOP87 = trueVSOP87;
exports.apparentVSOP87 = apparentVSOP87;
exports.apparentEquatorialVSOP87 = apparentEquatorialVSOP87;
exports.aberration = aberration;

var _base = require('./base');

var _base2 = _interopRequireDefault(_base);

var _coord = require('./coord');

var _coord2 = _interopRequireDefault(_coord);

var _nutation = require('./nutation');

var _nutation2 = _interopRequireDefault(_nutation);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * True returns true geometric longitude and anomaly of the sun referenced to the mean equinox of date.
 *
 * @param {Number} T - number of Julian centuries since J2000. See base.J2000Century.
 * @returns {Object}
 *   {Number} lon = true geometric longitude, ☉, in radians
 *   {Number} ano = true anomaly in radians
 */
function trueLongitude(T) {
  // (25.2) p. 163
  var L0 = _base2.default.horner(T, 280.46646, 36000.76983, 0.0003032) * Math.PI / 180;
  var m = meanAnomaly(T);
  var C = (_base2.default.horner(T, 1.914602, -0.004817, -0.000014) * Math.sin(m) + (0.019993 - 0.000101 * T) * Math.sin(2 * m) + 0.000289 * Math.sin(3 * m)) * Math.PI / 180;
  var lon = _base2.default.pmod(L0 + C, 2 * Math.PI);
  var ano = _base2.default.pmod(m + C, 2 * Math.PI);
  return { lon: lon, ano: ano };
}

/**
 * meanAnomaly returns the mean anomaly of Earth at the given T.
 *
 * @param {Number} T - number of Julian centuries since J2000. See base.J2000Century.
 * @returns {Number} Result is in radians and is not normalized to the range 0..2π.
 */
function meanAnomaly(T) {
  // (25.3) p. 163
  return _base2.default.horner(T, 357.52911, 35999.05029, -0.0001537) * Math.PI / 180;
}

/**
 * eccentricity returns eccentricity of the Earth's orbit around the sun.
 *
 * @param {Number} T - number of Julian centuries since J2000. See base.J2000Century.
 * @returns {Number} eccentricity of the Earth's orbit around the sun.
 */
function eccentricity(T) {
  // (25.4) p. 163
  return _base2.default.horner(T, 0.016708634, -0.000042037, -0.0000001267);
}

/**
 * Radius returns the Sun-Earth distance in AU.
 *
 * @param {Number} T - number of Julian centuries since J2000. See base.J2000Century.
 * @returns {Number} Sun-Earth distance in AU
 */
function radius(T) {
  var _trueLongitude = trueLongitude(T),
      lon = _trueLongitude.lon,
      ano = _trueLongitude.ano; // eslint-disable-line


  var e = eccentricity(T);
  // (25.5) p. 164
  return 1.000001018 * (1 - e * e) / (1 + e * Math.cos(ano));
}

/**
 * ApparentLongitude returns apparent longitude of the Sun referenced to the true equinox of date.
 * Result includes correction for nutation and aberration.  Unit is radians.
 *
 * @param {Number} T - number of Julian centuries since J2000. See base.J2000Century.
 * @returns {Number} apparent longitude of the Sun referenced to the true equinox of date.
 */
function apparentLongitude(T) {
  var Ω = node(T);

  var _trueLongitude2 = trueLongitude(T),
      lon = _trueLongitude2.lon,
      ano = _trueLongitude2.ano; // eslint-disable-line


  return lon - 0.00569 * Math.PI / 180 - 0.00478 * Math.PI / 180 * Math.sin(Ω);
}

/**
 * @private
 */
function node(T) {
  return 125.04 * Math.PI / 180 - 1934.136 * Math.PI / 180 * T;
}

/**
 * true2000 returns true geometric longitude and anomaly of the sun referenced to equinox J2000.
 * Results are accurate to .01 degree for years 1900 to 2100.
 *
 * @param {Number} T - number of Julian centuries since J2000. See base.J2000Century.
 * @returns {Object}
 *   {Number} lon - true geometric longitude, ☉, in radians
 *   {Number} ano - true anomaly in radians
 */
function true2000(T) {
  var _trueLongitude3 = trueLongitude(T),
      lon = _trueLongitude3.lon,
      ano = _trueLongitude3.ano;

  lon -= 0.01397 * Math.PI / 180 * T * 100;
  return { lon: lon, ano: ano };
}

/**
 * trueEquatorial returns the true geometric position of the Sun as equatorial coordinates.
 *
 * @param {Number} jde - Julian ephemeris day
 * @returns {base.Coord}
 *   {Number} ra - right ascension in radians
 *   {Number} dec - declination in radians
 */
function trueEquatorial(jde) {
  var _trueLongitude4 = trueLongitude(_base2.default.J2000Century(jde)),
      lon = _trueLongitude4.lon,
      ano = _trueLongitude4.ano; // eslint-disable-line


  var ε = _nutation2.default.meanObliquity(jde);

  var _base$sincos = _base2.default.sincos(lon),
      _base$sincos2 = _slicedToArray(_base$sincos, 2),
      ss = _base$sincos2[0],
      cs = _base$sincos2[1];

  var _base$sincos3 = _base2.default.sincos(ε),
      _base$sincos4 = _slicedToArray(_base$sincos3, 2),
      sε = _base$sincos4[0],
      cε = _base$sincos4[1];
  // (25.6, 25.7) p. 165


  var ra = Math.atan2(cε * ss, cs);
  var dec = sε * ss;
  return new _base2.default.Coord(ra, dec);
}

/**
 * apparentEquatorial returns the apparent position of the Sun as equatorial coordinates.
 *
 * @param {Number} jde - Julian ephemeris day
 * @returns {base.Coord}
 *   {Number} ra - right ascension in radians
 *   {Number} dec - declination in radians
 */
function apparentEquatorial(jde) {
  var T = _base2.default.J2000Century(jde);
  var λ = apparentLongitude(T);
  var ε = _nutation2.default.meanObliquity(jde);

  var _base$sincos5 = _base2.default.sincos(λ),
      _base$sincos6 = _slicedToArray(_base$sincos5, 2),
      sλ = _base$sincos6[0],
      cλ = _base$sincos6[1];
  // (25.8) p. 165


  var _base$sincos7 = _base2.default.sincos(ε + 0.00256 * Math.PI / 180 * Math.cos(node(T))),
      _base$sincos8 = _slicedToArray(_base$sincos7, 2),
      sε = _base$sincos8[0],
      cε = _base$sincos8[1];

  var ra = Math.atan2(cε * sλ, cλ);
  var dec = Math.asin(sε * sλ);
  return new _base2.default.Coord(ra, dec);
}

/**
 * trueVSOP87 returns the true geometric position of the sun as ecliptic coordinates.
 *
 * Result computed by full VSOP87 theory.  Result is at equator and equinox
 * of date in the FK5 frame.  It does not include nutation or aberration.
 *
 * @param {planetposition.Planet} planet
 * @param {Number} jde - Julian ephemeris day
 * @returns {Object}
 *   {Number} lon - ecliptic longitude in radians
 *   {Number} lat - ecliptic latitude in radians
 *   {Number} range - range in AU
 */
function trueVSOP87(planet, jde) {
  var _planet$position = planet.position(jde),
      lon = _planet$position.lon,
      lat = _planet$position.lat,
      range = _planet$position.range;

  var s = lon + Math.PI;
  // FK5 correction.
  var λp = _base2.default.horner(_base2.default.J2000Century(jde), s, -1.397 * Math.PI / 180, -0.00031 * Math.PI / 180);

  var _base$sincos9 = _base2.default.sincos(λp),
      _base$sincos10 = _slicedToArray(_base$sincos9, 2),
      sλp = _base$sincos10[0],
      cλp = _base$sincos10[1];

  var Δβ = 0.03916 / 3600 * Math.PI / 180 * (cλp - sλp);
  // (25.9) p. 166
  lon = _base2.default.pmod(s - 0.09033 / 3600 * Math.PI / 180, 2 * Math.PI);
  lat = Δβ - lat;
  return new _base2.default.Coord(lon, lat, range);
}

/**
 * apparentVSOP87 returns the apparent position of the sun as ecliptic coordinates.
 *
 * Result computed by VSOP87, at equator and equinox of date in the FK5 frame,
 * and includes effects of nutation and aberration.
 *
 * @param {planetposition.Planet} planet
 * @param {Number} jde - Julian ephemeris day
 * @returns {base.Coord}
 *   {Number} lon - ecliptic longitude in radians
 *   {Number} lat - ecliptic latitude in radians
 *   {Number} range - range in AU
 */
function apparentVSOP87(planet, jde) {
  // note: see duplicated code in ApparentEquatorialVSOP87.
  var _trueVSOP = trueVSOP87(planet, jde),
      lon = _trueVSOP.lon,
      lat = _trueVSOP.lat,
      range = _trueVSOP.range;

  var Δψ = _nutation2.default.nutation(jde)[0];
  var a = aberration(range);
  lon = lon + Δψ + a;
  return new _base2.default.Coord(lon, lat, range);
}

/**
 * apparentEquatorialVSOP87 returns the apparent position of the sun as equatorial coordinates.
 *
 * Result computed by VSOP87, at equator and equinox of date in the FK5 frame,
 * and includes effects of nutation and aberration.
 *
 * @param {planetposition.Planet} planet
 * @param {Number} jde - Julian ephemeris day
 * @returns
 *   {Number} ra - right ascension in radians
 *   {Number} dec - declination in radians
 *   {Number} range - range in AU
 */
function apparentEquatorialVSOP87(planet, jde) {
  // note: duplicate code from ApparentVSOP87 so we can keep Δε.
  // see also duplicate code in time.E().
  var _trueVSOP2 = trueVSOP87(planet, jde),
      lon = _trueVSOP2.lon,
      lat = _trueVSOP2.lat,
      range = _trueVSOP2.range;

  var _nutation$nutation = _nutation2.default.nutation(jde),
      _nutation$nutation2 = _slicedToArray(_nutation$nutation, 2),
      Δψ = _nutation$nutation2[0],
      Δε = _nutation$nutation2[1];

  var a = aberration(range);
  var λ = lon + Δψ + a;
  var ε = _nutation2.default.meanObliquity(jde) + Δε;

  var _toEquatorial = new _coord2.default.Ecliptic(λ, lat).toEquatorial(ε),
      ra = _toEquatorial.ra,
      dec = _toEquatorial.dec;

  return new _base2.default.Coord(ra, dec, range);
}

/**
 * Low precision formula.  The high precision formula is not implemented
 * because the low precision formula already gives position results to the
 * accuracy given on p. 165.  The high precision formula represents lots
 * of typing with associated chance of typos, and no way to test the result.
 * @param {Number} range
 * @returns {Number} aberation
 */
function aberration(range) {
  // (25.10) p. 167
  return -20.4898 / 3600 * Math.PI / 180 / range;
}

exports.default = {
  trueLongitude: trueLongitude,
  true: trueLongitude, // BACKWARDS-COMPATIBILITY
  meanAnomaly: meanAnomaly,
  eccentricity: eccentricity,
  radius: radius,
  apparentLongitude: apparentLongitude,
  true2000: true2000,
  trueEquatorial: trueEquatorial,
  apparentEquatorial: apparentEquatorial,
  trueVSOP87: trueVSOP87,
  apparentVSOP87: apparentVSOP87,
  apparentEquatorialVSOP87: apparentEquatorialVSOP87,
  aberration: aberration
};
},{"./base":3,"./coord":4,"./nutation":10}],15:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.march = march;
exports.june = june;
exports.september = september;
exports.december = december;
exports.march2 = march2;
exports.june2 = june2;
exports.september2 = september2;
exports.december2 = december2;
exports.longitude = longitude;

var _base = require('./base');

var _base2 = _interopRequireDefault(_base);

var _solar = require('./solar');

var _solar2 = _interopRequireDefault(_solar);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * @copyright 2013 Sonia Keys
 * @copyright 2016 commenthol
 * @license MIT
 * @module solstice
 */
/**
 * Solstice: Chapter 27: Equinoxes and Solstices.
 */

var abs = Math.abs,
    cos = Math.cos,
    sin = Math.sin;

var D2R = Math.PI / 180;

// table 27.a - for years from -1000 to +1000
var mc0 = [1721139.29189, 365242.13740, 0.06134, 0.00111, -0.00071];
var jc0 = [1721233.25401, 365241.72562, -0.05323, 0.00907, 0.00025];
var sc0 = [1721325.70455, 365242.49558, -0.11677, -0.00297, 0.00074];
var dc0 = [1721414.39987, 365242.88257, -0.00769, -0.00933, -0.00006];

// table 27.b - for years from +1000 to +3000
var mc2 = [2451623.80984, 365242.37404, 0.05169, -0.00411, -0.00057];
var jc2 = [2451716.56767, 365241.62603, 0.00325, 0.00888, -0.00030];
var sc2 = [2451810.21715, 365242.01767, -0.11575, 0.00337, 0.00078];
var dc2 = [2451900.05952, 365242.74049, -0.06223, -0.00823, 0.00032];

// table 27.c
var terms = function () {
  var term = [[485, 324.96, 1934.136], [203, 337.23, 32964.467], [199, 342.08, 20.186], [182, 27.85, 445267.112], [156, 73.14, 45036.886], [136, 171.52, 22518.443], [77, 222.54, 65928.934], [74, 296.72, 3034.906], [70, 243.58, 9037.513], [58, 119.81, 33718.147], [52, 297.17, 150.678], [50, 21.02, 2281.226], [45, 247.54, 29929.562], [44, 325.15, 31555.956], [29, 60.93, 4443.417], [18, 155.12, 67555.328], [17, 288.79, 4562.452], [16, 198.04, 62894.029], [14, 199.76, 31436.921], [12, 95.39, 14577.848], [12, 287.11, 31931.756], [12, 320.81, 34777.259], [9, 227.73, 1222.114], [8, 15.45, 16859.074]];
  return term.map(function (t) {
    return {
      a: t[0],
      b: t[1],
      c: t[2]
    };
  });
}();

/**
 * March returns the JDE of the March equinox for the given year.
 *
 * Results are valid for the years -1000 to +3000.
 *
 * Accuracy is within one minute of time for the years 1951-2050.
 * @param {Number} y - (int) year
 * @returns {Number} JDE
 */
function march(y) {
  if (y < 1000) {
    return eq(y, mc0);
  }
  return eq(y - 2000, mc2);
}

/**
 * June returns the JDE of the June solstice for the given year.
 *
 * Results are valid for the years -1000 to +3000.
 *
 * Accuracy is within one minute of time for the years 1951-2050.
 * @param {Number} y - (int) year
 * @returns {Number} JDE
 */
function june(y) {
  if (y < 1000) {
    return eq(y, jc0);
  }
  return eq(y - 2000, jc2);
}

/**
 * September returns the JDE of the September equinox for the given year.
 *
 * Results are valid for the years -1000 to +3000.
 *
 * Accuracy is within one minute of time for the years 1951-2050.
 * @param {Number} y - (int) year
 * @returns {Number} JDE
 */
function september(y) {
  if (y < 1000) {
    return eq(y, sc0);
  }
  return eq(y - 2000, sc2);
}

/**
 * December returns the JDE of the December solstice for a given year.
 *
 * Results are valid for the years -1000 to +3000.
 *
 * Accuracy is within one minute of time for the years 1951-2050.
 * @param {Number} y - (int) year
 * @returns {Number} JDE
 */
function december(y) {
  if (y < 1000) {
    return eq(y, dc0);
  }
  return eq(y - 2000, dc2);
}

/**
 * Fast calculation of solstices/ equinoxes
 * Accuracy is within one minute of time for the years 1951-2050.
 *
 * @param {Number} y - (int) year
 * @param {Array} c - term from table 27.a / 27.b
 * @returns {Number} JDE
 */
function eq(y, c) {
  var J0 = _base2.default.horner(y * 0.001, c);
  var T = _base2.default.J2000Century(J0);
  var W = 35999.373 * D2R * T - 2.47 * D2R;
  var Δλ = 1 + 0.0334 * cos(W) + 0.0007 * cos(2 * W);
  var S = 0;
  for (var i = terms.length - 1; i >= 0; i--) {
    var t = terms[i];
    S += t.a * cos((t.b + t.c * T) * D2R);
  }
  return J0 + 0.00001 * S / Δλ;
}

/**
 * March2 returns a more accurate JDE of the March equinox.
 *
 * Result is accurate to one second of time.
 *
 * @param {Number} year - (int) year
 * @param {planetposition.Planet} planet - must be a V87Planet object representing Earth, obtained with
 * the package planetposition
 * @returns {Number} JDE
 */
function march2(year, planet) {
  return longitude(year, planet, 0);
}

/**
 * June2 returns a more accurate JDE of the June solstice.
 *
 * Result is accurate to one second of time.
 *
 * @param {Number} year - (int) year
 * @param {planetposition.Planet} planet - must be a V87Planet object representing Earth, obtained with
 * the package planetposition
 * @returns {Number} JDE
 */
function june2(year, planet) {
  return longitude(year, planet, Math.PI / 2);
}

/**
 * September2 returns a more accurate JDE of the September equinox.
 *
 * Result is accurate to one second of time.
 *
 * @param {Number} year - (int) year
 * @param {planetposition.Planet} planet - must be a V87Planet object representing Earth, obtained with
 * the package planetposition
 * @returns {Number} JDE
 */
function september2(year, planet) {
  return longitude(year, planet, Math.PI);
}

/**
 * December2 returns a more accurate JDE of the December solstice.
 *
 * Result is accurate to one second of time.
 *
 * @param {Number} year - (int) year
 * @param {planetposition.Planet} planet - must be a V87Planet object representing Earth, obtained with
 * the package planetposition
 * @returns {Number} JDE
 */
function december2(year, planet) {
  return longitude(year, planet, Math.PI * 3 / 2);
}

/**
 * Longitude returns the JDE for a given `year`, VSOP87 Planet `planet` at a
 * given geocentric solar longitude `lon`
 * @param {Number} year - (int)
 * @param {planetposition.Planet} planet
 * @param {Number} lon - geocentric solar longitude in radians
 * @returns {Number} JDE
 */
function longitude(year, planet, lon) {
  var c = void 0;
  var ct = void 0;

  if (year < 1000) {
    ct = [mc0, jc0, sc0, dc0];
  } else {
    ct = [mc2, jc2, sc2, dc2];
    year -= 2000;
  }

  lon = lon % (Math.PI * 2);

  if (lon < Math.PI / 2) {
    c = ct[0];
  } else if (lon < Math.PI) {
    c = ct[1];
  } else if (lon < Math.PI * 3 / 2) {
    c = ct[2];
  } else {
    c = ct[3];
  }

  return eq2(year, planet, lon, c);
}

/**
  * Accurate calculation of solstices/ equinoxes
  * Result is accurate to one second of time.
  *
  * @param {Number} year - (int) year
  * @param {planetposition.Planet} planet - vsop87 planet
  * @param {Number} lon - longitude in radians
  * @param {Array} c - term from table 27.a / 27.b
  * @returns {Number} JDE
  */
function eq2(year, planet, lon, c) {
  var J0 = _base2.default.horner(year * 0.001, c);

  for (;;) {
    var a = _solar2.default.apparentVSOP87(planet, J0);
    var _c = 58 * sin(lon - a.lon); // (27.1) p. 180
    J0 += _c;
    if (abs(_c) < 0.000005) {
      break;
    }
  }

  return J0;
}

exports.default = {
  march: march,
  june: june,
  september: september,
  december: december,
  march2: march2,
  june2: june2,
  september2: september2,
  december2: december2,
  longitude: longitude
};
},{"./base":3,"./solar":14}],16:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @copyright 2016 commenthol
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * @license MIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      */

// import {base, solstice, solar, moonphase, planetposition, julian, data} from 'astronomia' // TODO waiting for tree-shaking that works...


var _base = require('astronomia/lib/base');

var _base2 = _interopRequireDefault(_base);

var _solstice = require('astronomia/lib/solstice');

var _solstice2 = _interopRequireDefault(_solstice);

var _solar = require('astronomia/lib/solar');

var _solar2 = _interopRequireDefault(_solar);

var _moonphase = require('astronomia/lib/moonphase');

var _moonphase2 = _interopRequireDefault(_moonphase);

var _planetposition = require('astronomia/lib/planetposition');

var _planetposition2 = _interopRequireDefault(_planetposition);

var _julian = require('astronomia/lib/julian');

var _julian2 = _interopRequireDefault(_julian);

var _vsop87Bearth = require('astronomia/data/vsop87Bearth');

var _vsop87Bearth2 = _interopRequireDefault(_vsop87Bearth);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var earth = new _planetposition2.default.Planet(_vsop87Bearth2.default);
var lunarOffset = _moonphase2.default.meanLunarMonth / 2;
var p = 180 / Math.PI;

// Start of Chinese Calendar in 2636 BCE by Chalmers
var epochY = -2636;
var epoch = new _julian2.default.CalendarGregorian(epochY, 2, 15).toJDE();

function toYear(jde) {
  return new _julian2.default.CalendarGregorian().fromJDE(jde).toYear();
}

// prevent rounding errors
function toFixed(val, e) {
  return parseFloat(val.toFixed(e), 10);
}

var CalendarChinese = function () {
  /**
   * constructor
   *
   * @param {Number|Array|Object} cycle - chinese 60 year cicle; if `{Array}` than `[cycle, year, ..., day]`
   * @param {Number} year - chinese year of cycle
   * @param {Number} month - chinese month
   * @param {Number} leap - `true` if leap month
   * @param {Number} day - chinese day
   */
  function CalendarChinese(cycle, year, month, leap, day) {
    _classCallCheck(this, CalendarChinese);

    this.set(cycle, year, month, leap, day);

    this._epochY = epochY;
    this._epoch = epoch;
    this._cache = { // cache for results
      lon: {},
      sue: {},
      ny: {}
    };
  }

  /**
   * set a new chinese date
   *
   * @param {Number|Array|Object} cycle - chinese 60 year cicle; if `{Array}` than `[cycle, year, ..., day]`
   * @param {Number} year - chinese year of cycle
   * @param {Number} month - chinese month
   * @param {Number} leap - `true` if leap month
   * @param {Number} day - chinese day
   */


  _createClass(CalendarChinese, [{
    key: 'set',
    value: function set(cycle, year, month, leap, day) {
      if (cycle instanceof CalendarChinese) {
        this.cycle = cycle.cycle;
        this.year = cycle.year;
        this.month = cycle.month;
        this.leap = cycle.leap;
        this.day = cycle.day;
      } else if (Array.isArray(cycle)) {
        this.cycle = cycle[0];
        this.year = cycle[1];
        this.month = cycle[2];
        this.leap = cycle[3];
        this.day = cycle[4];
      } else {
        this.cycle = cycle;
        this.year = year;
        this.month = month;
        this.leap = leap;
        this.day = day;
      }
    }

    /**
     * returns chinese date
     * @returns {Array}
     */

  }, {
    key: 'get',
    value: function get() {
      return [this.cycle, this.year, this.month, this.leap, this.day];
    }

    /**
     * get Gregorian year from Epoch / Cycle
     * @return {Number} year
     */

  }, {
    key: 'yearFromEpochCycle',
    value: function yearFromEpochCycle() {
      return this._epochY + (this.cycle - 1) * 60 + (this.year - 1);
    }

    /**
     * convert gregorian date to chinese calendar date
     *
     * @param {Number} year - (int) year in Gregorian or Julian Calendar
     * @param {Number} month - (int)
     * @param {Number} day - needs to be in correct (chinese) timezone
     * @return {Object} this
     */

  }, {
    key: 'fromGregorian',
    value: function fromGregorian(year, month, day) {
      var j = this.midnight(new _julian2.default.CalendarGregorian(year, month, day).toJDE());
      if (month === 1 && day <= 20) year--; // chinese new year never starts before 20/01
      this._from(j, year);
      return this;
    }

    /**
     * convert date to chinese calendar date
     *
     * @param {Date} date - javascript date object
     * @return {Object} this
     */

  }, {
    key: 'fromDate',
    value: function fromDate(date) {
      var j = this.midnight(new _julian2.default.CalendarGregorian().fromDate(date).toJDE());
      this._from(j, date.getFullYear());
      return this;
    }

    /**
     * convert JDE to chinese calendar date
     *
     * @param {Number} jde - date in JDE
     * @return {Object} this
     */

  }, {
    key: 'fromJDE',
    value: function fromJDE(jde) {
      var j = this.midnight(jde);
      var gc = new _julian2.default.CalendarGregorian().fromJDE(j);
      if (gc.month === 1 && gc.day < 20) gc.year--; // chinese new year never starts before 20/01
      this._from(j, gc.year);
      return this;
    }

    /**
     * common conversion from JDE, year to chinese date
     *
     * @private
     * @param {Number} j - date in JDE
     * @param {Number} year - gregorian year
     */

  }, {
    key: '_from',
    value: function _from(j, year) {
      var ny = this.newYear(year);
      if (ny > j) {
        ny = this.newYear(year - 1);
      }
      var nm = this.previousNewMoon(j);
      if (nm < ny) {
        nm = ny;
      }

      var years = 1.5 + (ny - this._epoch) / _base2.default.BesselianYear;
      this.cycle = 1 + Math.trunc((years - 1) / 60);
      this.year = 1 + Math.trunc((years - 1) % 60);

      this.month = this.inMajorSolarTerm(nm).term;
      var m = Math.round((nm - ny) / _moonphase2.default.meanLunarMonth);
      if (m === 0) {
        this.month = 1;
        this.leap = false;
      } else {
        this.leap = this.isLeapMonth(nm);
      }

      if (m > this.month) {
        this.month = m;
      } else if (this.leap) {
        this.month--;
      }

      this.day = 1 + Math.trunc(toFixed(j, 3) - toFixed(nm, 3));
    }

    /**
     * convert chinese date to gregorian date
     *
     * @param {Number} [gyear] - (int) gregorian year
     * @return {Object} date in gregorian (preleptic) calendar; Timezone is Standard Chinese / Bejing Time
     *   {Number} year - (int)
     *   {Number} month - (int)
     *   {Number} day - (int)
     */

  }, {
    key: 'toGregorian',
    value: function toGregorian(gyear) {
      var jde = this.toJDE(gyear);
      var gc = new _julian2.default.CalendarGregorian().fromJDE(jde + 0.5); // add 0.5 as day get truncated
      return {
        year: gc.year,
        month: gc.month,
        day: Math.trunc(gc.day)
      };
    }

    /**
     * convert chinese date to Date
     *
     * @param {Number} [gyear] - (int) gregorian year
     * @return {Date} javascript date object in gregorian (preleptic) calendar
     */

  }, {
    key: 'toDate',
    value: function toDate(gyear) {
      var jde = this.toJDE(gyear);
      return new _julian2.default.CalendarGregorian().fromJDE(toFixed(jde, 4)).toDate();
    }

    /**
     * convert chinese date to JDE
     *
     * @param {Number} [gyear] - (int) gregorian year
     * @return {Number} date in JDE
     */

  }, {
    key: 'toJDE',
    value: function toJDE(gyear) {
      var years = gyear || this.yearFromEpochCycle();
      var ny = this.newYear(years);
      var nm = ny;
      if (this.month > 1) {
        nm = this.previousNewMoon(ny + this.month * 29);
        var st = this.inMajorSolarTerm(nm).term;
        var lm = this.isLeapMonth(nm);

        if (st > this.month) {
          nm = this.previousNewMoon(nm - 1);
        } else if (st < this.month || lm && !this.leap) {
          nm = this.nextNewMoon(nm + 1);
        }
      }
      if (this.leap) {
        nm = this.nextNewMoon(nm + 1);
      }
      var jde = nm + this.day - 1;
      return jde;
    }

    /**
     * timeshift to UTC
     *
     * @param {CalendarGregorian} gcal - gregorian calendar date
     * @return {Number} timeshift in fraction of day
     */

  }, {
    key: 'timeshiftUTC',
    value: function timeshiftUTC(gcal) {
      if (gcal.toYear() >= 1929) {
        return 8 / 24; // +8:00:00h Standard China time zone (120° East)
      }
      return 1397 / 180 / 24; // +7:45:40h Beijing (116°25´ East)
    }

    /**
     * time/date at midnight - truncate `jde` to actual day
     *
     * @param {Number} jde - julian ephemeris day
     * @return {Number} truncated jde
     */

  }, {
    key: 'midnight',
    value: function midnight(jde) {
      var gcal = new _julian2.default.CalendarGregorian().fromJDE(jde);
      var ts = 0.5 - this.timeshiftUTC(gcal);
      var mn = Math.trunc(gcal.toJD() - ts) + ts;
      mn = gcal.fromJD(mn).toJDE();
      if (toFixed(jde, 5) === toFixed(mn, 5) + 1) {
        return jde;
      }
      return mn;
    }

    /**
     * get major solar term `Z1...Z12` for a given date in JDE
     *
     * @param {Number} jde - date of new moon
     * @returns {Number} major solar term part of that month
     */

  }, {
    key: 'inMajorSolarTerm',
    value: function inMajorSolarTerm(jde) {
      var lon = this._cache.lon[jde] || _solar2.default.apparentVSOP87(earth, jde).lon;
      this._cache.lon[jde] = lon;
      var lonDeg = lon * p - 1e-13;
      var term = (2 + Math.floor(lonDeg / 30)) % 12 + 1;
      return { term: term, lon: lonDeg };
    }

    /**
     * Test if date `jde` is inside a leap month
     * `jde` and previous new moon need to have the same major solar term
     *
     * @param {Number} jde - date of new moon
     * @returns {Boolean} `true` if previous new moon falls into same solar term
     */

  }, {
    key: 'isLeapMonth',
    value: function isLeapMonth(jde) {
      var t1 = this.inMajorSolarTerm(jde);
      var next = this.nextNewMoon(this.midnight(jde + lunarOffset));
      var t2 = this.inMajorSolarTerm(next);
      var r = t1.term === t2.term;
      return r;
    }

    /**
     * next new moon since `jde`
     *
     * @param {Number} jde - date in julian ephemeris days
     * @return {Number} jde at midnight
     */

  }, {
    key: 'nextNewMoon',
    value: function nextNewMoon(jde) {
      var nm = this.midnight(_moonphase2.default.newMoon(toYear(jde)));
      var cnt = 0;
      while (nm < jde && cnt++ < 4) {
        nm = this.midnight(_moonphase2.default.newMoon(toYear(jde + cnt * lunarOffset)));
      }
      return nm;
    }

    /**
     * next new moon since `jde`
     *
     * @param {Number} jde - date in julian ephemeris days
     * @return {Number} jde at midnight
     */

  }, {
    key: 'previousNewMoon',
    value: function previousNewMoon(jde) {
      var nm = this.midnight(_moonphase2.default.newMoon(toYear(jde)));
      var cnt = 0;
      while (nm > jde && cnt++ < 4) {
        nm = this.midnight(_moonphase2.default.newMoon(toYear(jde - cnt * lunarOffset)));
      }
      return nm;
    }

    /**
     * chinese new year for a given gregorian year
     *
     * @param {Number} gyear - gregorian year (int)
     * @param {Number} jde at midnight
     */

  }, {
    key: 'newYear',
    value: function newYear(gyear) {
      gyear = Math.trunc(gyear);
      if (this._cache.ny[gyear]) return this._cache.ny[gyear];

      var sue1 = this._cache.sue[gyear - 1] || _solstice2.default.december2(gyear - 1, earth);
      var sue2 = this._cache.sue[gyear] || _solstice2.default.december2(gyear, earth);
      this._cache.sue[gyear - 1] = sue1;
      this._cache.sue[gyear] = sue2;

      var m11n = this.previousNewMoon(this.midnight(sue2 + 1));
      var m12 = this.nextNewMoon(this.midnight(sue1 + 1));
      var m13 = this.nextNewMoon(this.midnight(m12 + lunarOffset));
      this.leapSui = Math.round((m11n - m12) / _moonphase2.default.meanLunarMonth) === 12;
      var ny = m13;

      if (this.leapSui && (this.isLeapMonth(m12) || this.isLeapMonth(m13))) {
        ny = this.nextNewMoon(this.midnight(m13 + _moonphase2.default.meanLunarMonth / 2));
      }
      this._cache.ny[gyear] = ny;
      return ny;
    }

    /**
     * get major solar term
     *
     * @param {Number} term - zhōngqì solar term Z1 .. Z12
     * @param {Number} [gyear] - (int) gregorian year
     * @returns {Number} jde at midnight
     */

  }, {
    key: 'majorSolarTerm',
    value: function majorSolarTerm(term, gyear) {
      return this.solarTerm(term * 2, gyear);
    }

    /**
     * get minor solar term
     *
     * @param {Number} term - jiéqì solar term J1 .. J12
     * @param {Number} [gyear] - (int) gregorian year
     * @returns {Number} jde at midnight
     */

  }, {
    key: 'minorSolarTerm',
    value: function minorSolarTerm(term, gyear) {
      return this.solarTerm(term * 2 - 1, gyear);
    }

    /**
     * get solar term from solar longitude
     *
     * @param {Number} term - jiéqì solar term 1 .. 24
     * @param {Number} [gyear] - (int) gregorian year
     * @returns {Number} jde at midnight
     */

  }, {
    key: 'solarTerm',
    value: function solarTerm(term, gyear) {
      if (gyear && term <= 3) gyear--;
      var years = gyear || this.yearFromEpochCycle();
      var lon = (term + 20) % 24 * 15 % 360;
      var st = _solstice2.default.longitude(years, earth, lon / p);
      st = this.midnight(st);
      return st;
    }

    /**
     * Qı̄ngmíng - Pure brightness Festival
     *
     * @param {Number} [gyear] - (int) gregorian year
     * @returns {Number} jde at midnight
     */

  }, {
    key: 'qingming',
    value: function qingming(gyear) {
      return this.solarTerm(5, gyear);
    }
  }]);

  return CalendarChinese;
}();

exports.default = CalendarChinese;
},{"astronomia/data/vsop87Bearth":2,"astronomia/lib/base":3,"astronomia/lib/julian":8,"astronomia/lib/moonphase":9,"astronomia/lib/planetposition":11,"astronomia/lib/solar":14,"astronomia/lib/solstice":15}],17:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _Chinese = require('./Chinese');

var _Chinese2 = _interopRequireDefault(_Chinese);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                * @copyright 2016 commenthol
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                * @license MIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                */

/**
 * @see http://law.e-gov.go.jp/htmldata/M19/M19CO051.html
 */
var UTC_DATES = [{ date: new Date('1888-02-11T15:00:00.000Z'), // 1888-02-12T00:00:00+0900
  shift: 9 / 24 // +9:00:00h (135° East) Japanese standard meridian
}];

/**
 * Note: I could not find details about the epoch(s) for the year zero of the
 * Japanese calendar dating before 1873. Therefore this calendar uses (wrongly)
 * the Chinese epoch.
 *
 * According to <https://en.wikipedia.org/wiki/History_of_Japan> the eras are:
 *
 * Yayoi  300 BC – 250 AD
 * Kofun  250 – 538
 * Asuka  538 – 710
 * Nara   710 – 794
 * Heian  794 – 1185
 * Kamakura   1185 – 1333
 * Kenmu Restoration  1333 – 1336
 * Muromachi 1336 – 1573
 * Azuchi–Momoyama 1568 – 1603
 * Edo  1603 – 1868
 * Meiji  1868 – 1912
 * Taishō 1912 – 1926
 * Shōwa  1926 – 1989
 * Heisei 1989 – present
 *
 * Unfortunately the linking from era to calendar era (especially to the Chinese
 * pre 1873 one) is unknown to me.
 */

var CalendarJapanese = function (_CalendarChinese) {
  _inherits(CalendarJapanese, _CalendarChinese);

  function CalendarJapanese() {
    _classCallCheck(this, CalendarJapanese);

    return _possibleConstructorReturn(this, (CalendarJapanese.__proto__ || Object.getPrototypeOf(CalendarJapanese)).apply(this, arguments));
  }

  _createClass(CalendarJapanese, [{
    key: 'timeshiftUTC',

    /**
     * timeshift to UTC
     *
     * @param {CalendarGregorian} gcal - gregorian calendar date
     * @return {Number} timeshift in fraction of day
     */
    value: function timeshiftUTC(gcal) {
      var date = gcal.toDate();
      for (var i in UTC_DATES) {
        if (date >= UTC_DATES[i].date) {
          return UTC_DATES[i].shift;
        }
      }
      return 4193 / 450 / 24; // +9:19:04h (139°46'E)
    }
  }]);

  return CalendarJapanese;
}(_Chinese2.default);

exports.default = CalendarJapanese;
},{"./Chinese":16}],18:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _julian = require('astronomia/lib/julian');

var _julian2 = _interopRequireDefault(_julian);

var _Chinese = require('./Chinese');

var _Chinese2 = _interopRequireDefault(_Chinese);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                * @copyright 2016 commenthol
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                * @license MIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                */

// import {julian} from 'astronomia' // TODO waiting for tree-shaking that works...


// Start of Korean Calendar in 2333 BCE (단군기원 http://ko.wikipedia.org/wiki/단기)
var epochY = -2333;
var epoch = new _julian2.default.CalendarGregorian(epochY, 1, 27).toJDE();

/**
 * change of timezone shifts during the last century
 * @see https://en.wikipedia.org/wiki/Time_in_South_Korea
 */
var UTC_DATES = [{ date: new Date('1961-10-09T15:00:00.000Z'), // 1961-10-10T00:00:00+0900
  shift: 9 / 24 }, // +9:00:00h (135° East)
{ date: new Date('1954-03-20T15:30:00.000Z'), // 1954-03-21T00:00:00+0830
  shift: 8.5 / 24 }, { date: new Date('1911-12-31T15:00:00.000Z'), // 1912-01-01T00:00:00+0900
  shift: 9 / 24 }, { date: new Date('1908-03-31T15:30:00.000Z'), // 1908-04-01T00:00:00+0830
  shift: 8.5 / 24 }];

var CalendarKorean = function (_CalendarChinese) {
  _inherits(CalendarKorean, _CalendarChinese);

  function CalendarKorean(cycle, year, month, leap, day) {
    _classCallCheck(this, CalendarKorean);

    var _this = _possibleConstructorReturn(this, (CalendarKorean.__proto__ || Object.getPrototypeOf(CalendarKorean)).call(this, cycle, year, month, leap, day));

    _this._epochY = epochY;
    _this._epoch = epoch;
    return _this;
  }

  /**
   * timeshift to UTC
   *
   * @param {CalendarGregorian} gcal - gregorian calendar date
   * @return {Number} timeshift in fraction of day
   */


  _createClass(CalendarKorean, [{
    key: 'timeshiftUTC',
    value: function timeshiftUTC(gcal) {
      var date = gcal.toDate();
      for (var i in UTC_DATES) {
        if (date >= UTC_DATES[i].date) {
          return UTC_DATES[i].shift;
        }
      }
      return 3809 / 450 / 24; // +8:27:52h Seoul City Hall 126°58'E
    }
  }]);

  return CalendarKorean;
}(_Chinese2.default);

exports.default = CalendarKorean;
},{"./Chinese":16,"astronomia/lib/julian":8}],19:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _Chinese = require('./Chinese');

var _Chinese2 = _interopRequireDefault(_Chinese);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                * @copyright 2016 commenthol
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                * @license MIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                */

var CalendarVietnamese = function (_CalendarChinese) {
  _inherits(CalendarVietnamese, _CalendarChinese);

  function CalendarVietnamese() {
    _classCallCheck(this, CalendarVietnamese);

    return _possibleConstructorReturn(this, (CalendarVietnamese.__proto__ || Object.getPrototypeOf(CalendarVietnamese)).apply(this, arguments));
  }

  _createClass(CalendarVietnamese, [{
    key: 'timeshiftUTC',

    /**
     * timeshift to UTC
     *
     * @param {CalendarGregorian} gcal - gregorian calendar date
     * @return {Number} timeshift in fraction of day
     */
    value: function timeshiftUTC(gcal) {
      if (gcal.toYear() >= 1968) {
        return 7 / 24; // +7:00:00h
      }
      return 8 / 24; // +8:00:00h Standard China time zone (120° East)
    }
  }]);

  return CalendarVietnamese;
}(_Chinese2.default);

exports.default = CalendarVietnamese;
},{"./Chinese":16}],20:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _Chinese = require('./Chinese');

Object.defineProperty(exports, 'CalendarChinese', {
  enumerable: true,
  get: function get() {
    return _interopRequireDefault(_Chinese).default;
  }
});

var _Korean = require('./Korean');

Object.defineProperty(exports, 'CalendarKorean', {
  enumerable: true,
  get: function get() {
    return _interopRequireDefault(_Korean).default;
  }
});

var _Vietnamese = require('./Vietnamese');

Object.defineProperty(exports, 'CalendarVietnamese', {
  enumerable: true,
  get: function get() {
    return _interopRequireDefault(_Vietnamese).default;
  }
});

var _Japanese = require('./Japanese');

Object.defineProperty(exports, 'CalendarJapanese', {
  enumerable: true,
  get: function get() {
    return _interopRequireDefault(_Japanese).default;
  }
});

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
},{"./Chinese":16,"./Japanese":17,"./Korean":18,"./Vietnamese":19}],21:[function(require,module,exports){
/* global define */

// UMD Wrapper
;(function (root, factory) {
  'use strict'
  /* istanbul ignore next */
  if (typeof exports === 'object') {
    // CommonJS
    module.exports = factory()
  } else if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define(factory)
  } else {
    // Browser globals
    root.dateEaster = factory()
  }
})(this, function () {
  'use strict'

  var exports = {} // define the module

  /**
   * @private
   */
  function _toYear (year) {
    if (!year) {
      year = new Date().getFullYear()
    } else if (year instanceof Date) {
      year = year.getFullYear()
    } else if (typeof year === 'string') {
      year = parseInt(year, 10)
    }
    return year
  }

  function EasterDate (year, month, day) {
    this.year = year
    this.month = month
    this.day = day
  }

  EasterDate.prototype = {
    toString: function () {
      function pre (num, l) {
        l = l || 2
        var s = '0000' + num
        return s.substr(s.length - l, l)
      }
      return [pre(this.year, 4), pre(this.month), pre(this.day)].join('-')
    }
  }

  /**
   * from https://de.wikipedia.org/wiki/Gau%C3%9Fsche_Osterformel
   * ergänzte Formel
   */
  function _easter (year, julian, gregorian) {
    year = _toYear(year)

    var k = Math.floor(year / 100)
    var m = 15 + Math.floor((3 * k + 3) / 4) - Math.floor((8 * k + 13) / 25)
    var s = 2 - Math.floor((3 * k + 3) / 4)
    if (julian) {
      m = 15
      s = 0
    }
    var a = year % 19
    var d = (19 * a + m) % 30
    var r = Math.floor((d + a / 11) / 29)
    var og = 21 + d - r
    var sz = 7 - Math.floor(year + year / 4 + s) % 7
    var oe = 7 - (og - sz) % 7
    var os = og + oe
    if (gregorian) {
      os = os + Math.floor(year / 100) - Math.floor(year / 400) - 2
    }
    //                      1   2   3   4   5   6   7   8
    var daysPerMonth = [0, 31, 28, 31, 30, 31, 30, 31, 31]
    var day = os
    var month
    for (month = 3; month < 8; month++) {
      if (day <= daysPerMonth[month]) {
        break
      }
      day -= daysPerMonth[month]
    }

    return new EasterDate(year, month, day)
  }

  /**
   * calculate easter sunday in the gregorian calendar
   * @param {Date|Number} year
   */
  function gregorianEaster (year) {
    return _easter(year)
  }
  exports.gregorianEaster = gregorianEaster

  /**
   * calculate easter sunday in the gregorian calendar (Shortcut for
   * `gregorianEaster`)
   * @param {Date|Number} year
   */
  exports.easter = gregorianEaster

  /**
   * calculate easter sunday in the julian calendar
   * @param {Date|Number} year
   * @param {Boolean} [gregorian] - if `true` then output is a date in the gregorian calendar
   */
  function julianEaster (year) {
    return _easter(year, true)
  }
  exports.julianEaster = julianEaster

  /**
   * Orthodox Easter in gregorian calender
   * @param {Date|Number} year
   */
  function orthodoxEaster (year) {
    return _easter(year, true, true)
  }
  exports.orthodoxEaster = orthodoxEaster

  return exports
})

},{}],22:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node 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.

var objectCreate = Object.create || objectCreatePolyfill
var objectKeys = Object.keys || objectKeysPolyfill
var bind = Function.prototype.bind || functionBindPolyfill

function EventEmitter() {
  if (!this._events || !Object.prototype.hasOwnProperty.call(this, '_events')) {
    this._events = objectCreate(null);
    this._eventsCount = 0;
  }

  this._maxListeners = this._maxListeners || undefined;
}
module.exports = EventEmitter;

// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;

EventEmitter.prototype._events = undefined;
EventEmitter.prototype._maxListeners = undefined;

// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
var defaultMaxListeners = 10;

var hasDefineProperty;
try {
  var o = {};
  if (Object.defineProperty) Object.defineProperty(o, 'x', { value: 0 });
  hasDefineProperty = o.x === 0;
} catch (err) { hasDefineProperty = false }
if (hasDefineProperty) {
  Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
    enumerable: true,
    get: function() {
      return defaultMaxListeners;
    },
    set: function(arg) {
      // check whether the input is a positive number (whose value is zero or
      // greater and not a NaN).
      if (typeof arg !== 'number' || arg < 0 || arg !== arg)
        throw new TypeError('"defaultMaxListeners" must be a positive number');
      defaultMaxListeners = arg;
    }
  });
} else {
  EventEmitter.defaultMaxListeners = defaultMaxListeners;
}

// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  if (typeof n !== 'number' || n < 0 || isNaN(n))
    throw new TypeError('"n" argument must be a positive number');
  this._maxListeners = n;
  return this;
};

function $getMaxListeners(that) {
  if (that._maxListeners === undefined)
    return EventEmitter.defaultMaxListeners;
  return that._maxListeners;
}

EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  return $getMaxListeners(this);
};

// These standalone emit* functions are used to optimize calling of event
// handlers for fast cases because emit() itself often has a variable number of
// arguments and can be deoptimized because of that. These functions always have
// the same number of arguments and thus do not get deoptimized, so the code
// inside them can execute faster.
function emitNone(handler, isFn, self) {
  if (isFn)
    handler.call(self);
  else {
    var len = handler.length;
    var listeners = arrayClone(handler, len);
    for (var i = 0; i < len; ++i)
      listeners[i].call(self);
  }
}
function emitOne(handler, isFn, self, arg1) {
  if (isFn)
    handler.call(self, arg1);
  else {
    var len = handler.length;
    var listeners = arrayClone(handler, len);
    for (var i = 0; i < len; ++i)
      listeners[i].call(self, arg1);
  }
}
function emitTwo(handler, isFn, self, arg1, arg2) {
  if (isFn)
    handler.call(self, arg1, arg2);
  else {
    var len = handler.length;
    var listeners = arrayClone(handler, len);
    for (var i = 0; i < len; ++i)
      listeners[i].call(self, arg1, arg2);
  }
}
function emitThree(handler, isFn, self, arg1, arg2, arg3) {
  if (isFn)
    handler.call(self, arg1, arg2, arg3);
  else {
    var len = handler.length;
    var listeners = arrayClone(handler, len);
    for (var i = 0; i < len; ++i)
      listeners[i].call(self, arg1, arg2, arg3);
  }
}

function emitMany(handler, isFn, self, args) {
  if (isFn)
    handler.apply(self, args);
  else {
    var len = handler.length;
    var listeners = arrayClone(handler, len);
    for (var i = 0; i < len; ++i)
      listeners[i].apply(self, args);
  }
}

EventEmitter.prototype.emit = function emit(type) {
  var er, handler, len, args, i, events;
  var doError = (type === 'error');

  events = this._events;
  if (events)
    doError = (doError && events.error == null);
  else if (!doError)
    return false;

  // If there is no 'error' event listener then throw.
  if (doError) {
    if (arguments.length > 1)
      er = arguments[1];
    if (er instanceof Error) {
      throw er; // Unhandled 'error' event
    } else {
      // At least give some kind of context to the user
      var err = new Error('Unhandled "error" event. (' + er + ')');
      err.context = er;
      throw err;
    }
    return false;
  }

  handler = events[type];

  if (!handler)
    return false;

  var isFn = typeof handler === 'function';
  len = arguments.length;
  switch (len) {
      // fast cases
    case 1:
      emitNone(handler, isFn, this);
      break;
    case 2:
      emitOne(handler, isFn, this, arguments[1]);
      break;
    case 3:
      emitTwo(handler, isFn, this, arguments[1], arguments[2]);
      break;
    case 4:
      emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]);
      break;
      // slower
    default:
      args = new Array(len - 1);
      for (i = 1; i < len; i++)
        args[i - 1] = arguments[i];
      emitMany(handler, isFn, this, args);
  }

  return true;
};

function _addListener(target, type, listener, prepend) {
  var m;
  var events;
  var existing;

  if (typeof listener !== 'function')
    throw new TypeError('"listener" argument must be a function');

  events = target._events;
  if (!events) {
    events = target._events = objectCreate(null);
    target._eventsCount = 0;
  } else {
    // To avoid recursion in the case that type === "newListener"! Before
    // adding it to the listeners, first emit "newListener".
    if (events.newListener) {
      target.emit('newListener', type,
          listener.listener ? listener.listener : listener);

      // Re-assign `events` because a newListener handler could have caused the
      // this._events to be assigned to a new object
      events = target._events;
    }
    existing = events[type];
  }

  if (!existing) {
    // Optimize the case of one listener. Don't need the extra array object.
    existing = events[type] = listener;
    ++target._eventsCount;
  } else {
    if (typeof existing === 'function') {
      // Adding the second element, need to change to array.
      existing = events[type] =
          prepend ? [listener, existing] : [existing, listener];
    } else {
      // If we've already got an array, just append.
      if (prepend) {
        existing.unshift(listener);
      } else {
        existing.push(listener);
      }
    }

    // Check for listener leak
    if (!existing.warned) {
      m = $getMaxListeners(target);
      if (m && m > 0 && existing.length > m) {
        existing.warned = true;
        var w = new Error('Possible EventEmitter memory leak detected. ' +
            existing.length + ' "' + String(type) + '" listeners ' +
            'added. Use emitter.setMaxListeners() to ' +
            'increase limit.');
        w.name = 'MaxListenersExceededWarning';
        w.emitter = target;
        w.type = type;
        w.count = existing.length;
        if (typeof console === 'object' && console.warn) {
          console.warn('%s: %s', w.name, w.message);
        }
      }
    }
  }

  return target;
}

EventEmitter.prototype.addListener = function addListener(type, listener) {
  return _addListener(this, type, listener, false);
};

EventEmitter.prototype.on = EventEmitter.prototype.addListener;

EventEmitter.prototype.prependListener =
    function prependListener(type, listener) {
      return _addListener(this, type, listener, true);
    };

function onceWrapper() {
  if (!this.fired) {
    this.target.removeListener(this.type, this.wrapFn);
    this.fired = true;
    switch (arguments.length) {
      case 0:
        return this.listener.call(this.target);
      case 1:
        return this.listener.call(this.target, arguments[0]);
      case 2:
        return this.listener.call(this.target, arguments[0], arguments[1]);
      case 3:
        return this.listener.call(this.target, arguments[0], arguments[1],
            arguments[2]);
      default:
        var args = new Array(arguments.length);
        for (var i = 0; i < args.length; ++i)
          args[i] = arguments[i];
        this.listener.apply(this.target, args);
    }
  }
}

function _onceWrap(target, type, listener) {
  var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
  var wrapped = bind.call(onceWrapper, state);
  wrapped.listener = listener;
  state.wrapFn = wrapped;
  return wrapped;
}

EventEmitter.prototype.once = function once(type, listener) {
  if (typeof listener !== 'function')
    throw new TypeError('"listener" argument must be a function');
  this.on(type, _onceWrap(this, type, listener));
  return this;
};

EventEmitter.prototype.prependOnceListener =
    function prependOnceListener(type, listener) {
      if (typeof listener !== 'function')
        throw new TypeError('"listener" argument must be a function');
      this.prependListener(type, _onceWrap(this, type, listener));
      return this;
    };

// Emits a 'removeListener' event if and only if the listener was removed.
EventEmitter.prototype.removeListener =
    function removeListener(type, listener) {
      var list, events, position, i, originalListener;

      if (typeof listener !== 'function')
        throw new TypeError('"listener" argument must be a function');

      events = this._events;
      if (!events)
        return this;

      list = events[type];
      if (!list)
        return this;

      if (list === listener || list.listener === listener) {
        if (--this._eventsCount === 0)
          this._events = objectCreate(null);
        else {
          delete events[type];
          if (events.removeListener)
            this.emit('removeListener', type, list.listener || listener);
        }
      } else if (typeof list !== 'function') {
        position = -1;

        for (i = list.length - 1; i >= 0; i--) {
          if (list[i] === listener || list[i].listener === listener) {
            originalListener = list[i].listener;
            position = i;
            break;
          }
        }

        if (position < 0)
          return this;

        if (position === 0)
          list.shift();
        else
          spliceOne(list, position);

        if (list.length === 1)
          events[type] = list[0];

        if (events.removeListener)
          this.emit('removeListener', type, originalListener || listener);
      }

      return this;
    };

EventEmitter.prototype.removeAllListeners =
    function removeAllListeners(type) {
      var listeners, events, i;

      events = this._events;
      if (!events)
        return this;

      // not listening for removeListener, no need to emit
      if (!events.removeListener) {
        if (arguments.length === 0) {
          this._events = objectCreate(null);
          this._eventsCount = 0;
        } else if (events[type]) {
          if (--this._eventsCount === 0)
            this._events = objectCreate(null);
          else
            delete events[type];
        }
        return this;
      }

      // emit removeListener for all listeners on all events
      if (arguments.length === 0) {
        var keys = objectKeys(events);
        var key;
        for (i = 0; i < keys.length; ++i) {
          key = keys[i];
          if (key === 'removeListener') continue;
          this.removeAllListeners(key);
        }
        this.removeAllListeners('removeListener');
        this._events = objectCreate(null);
        this._eventsCount = 0;
        return this;
      }

      listeners = events[type];

      if (typeof listeners === 'function') {
        this.removeListener(type, listeners);
      } else if (listeners) {
        // LIFO order
        for (i = listeners.length - 1; i >= 0; i--) {
          this.removeListener(type, listeners[i]);
        }
      }

      return this;
    };

function _listeners(target, type, unwrap) {
  var events = target._events;

  if (!events)
    return [];

  var evlistener = events[type];
  if (!evlistener)
    return [];

  if (typeof evlistener === 'function')
    return unwrap ? [evlistener.listener || evlistener] : [evlistener];

  return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
}

EventEmitter.prototype.listeners = function listeners(type) {
  return _listeners(this, type, true);
};

EventEmitter.prototype.rawListeners = function rawListeners(type) {
  return _listeners(this, type, false);
};

EventEmitter.listenerCount = function(emitter, type) {
  if (typeof emitter.listenerCount === 'function') {
    return emitter.listenerCount(type);
  } else {
    return listenerCount.call(emitter, type);
  }
};

EventEmitter.prototype.listenerCount = listenerCount;
function listenerCount(type) {
  var events = this._events;

  if (events) {
    var evlistener = events[type];

    if (typeof evlistener === 'function') {
      return 1;
    } else if (evlistener) {
      return evlistener.length;
    }
  }

  return 0;
}

EventEmitter.prototype.eventNames = function eventNames() {
  return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
};

// About 1.5x faster than the two-arg version of Array#splice().
function spliceOne(list, index) {
  for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)
    list[i] = list[k];
  list.pop();
}

function arrayClone(arr, n) {
  var copy = new Array(n);
  for (var i = 0; i < n; ++i)
    copy[i] = arr[i];
  return copy;
}

function unwrapListeners(arr) {
  var ret = new Array(arr.length);
  for (var i = 0; i < ret.length; ++i) {
    ret[i] = arr[i].listener || arr[i];
  }
  return ret;
}

function objectCreatePolyfill(proto) {
  var F = function() {};
  F.prototype = proto;
  return new F;
}
function objectKeysPolyfill(obj) {
  var keys = [];
  for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k)) {
    keys.push(k);
  }
  return k;
}
function functionBindPolyfill(context) {
  var fn = this;
  return function () {
    return fn.apply(context, arguments);
  };
}

},{}],23:[function(require,module,exports){
/*
 * Convert numbers to gematriya representation, and vice-versa.
 *
 * Licensed MIT.
 *
 * Copyright (c) 2014 Eyal Schachter

 * 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.
 */

(function(){
	var letters = {}, numbers = {
		'': 0,
		א: 1,
		ב: 2,
		ג: 3,
		ד: 4,
		ה: 5,
		ו: 6,
		ז: 7,
		ח: 8,
		ט: 9,
		י: 10,
		כ: 20,
		ל: 30,
		מ: 40,
		נ: 50,
		ס: 60,
		ע: 70,
		פ: 80,
		צ: 90,
		ק: 100,
		ר: 200,
		ש: 300,
		ת: 400,
		תק: 500,
		תר: 600,
		תש: 700,
		תת: 800,
		תתק: 900,
		תתר: 1000
	}, i;
	for (i in numbers) {
		letters[numbers[i]] = i;
	}

	function gematriya(num, limit) {
		if (typeof num !== 'number' && typeof num !== 'string') {
			throw new TypeError('non-number or string given to gematriya()');
		}
		var str = typeof num === 'string';
		if (str) {
			num = num.replace(/('|")/g,'');
		}
		num = num.toString().split('').reverse();
		if (!str && limit) {
			num = num.slice(0, limit);
		}

		num = num.map(function g(n,i){
			if (str) {
				return limit && numbers[n] < numbers[num[i - 1]] && numbers[n] < 100 ? numbers[n] * 1000 : numbers[n];
			} else {
				if (parseInt(n, 10) * Math.pow(10, i) > 1000) {
					return g(n, i-3);
				}
				return letters[parseInt(n, 10) * Math.pow(10, i)];
			}
		});

		if (str) {
			return num.reduce(function(o,t){
				return o + t;
			}, 0);
		} else {
			num = num.reverse().join('').replace(/יה/g,'טו').replace(/יו/g,'טז').split('');

			if (num.length === 1) {
				num.push("'");
			} else if (num.length > 1) {
				num.splice(-1, 0, '"');
			}

			return num.join('');
		}
	}

	if (typeof module !== 'undefined') {
		module.exports = gematriya;
	} else {
		window.gematriya = gematriya;
	}
})();

},{}],24:[function(require,module,exports){
/*
	Hebcal - A Jewish Calendar Generator
	Copyright (C) 1994-2004  Danny Sadinoff
	Portions Copyright (c) 2002 Michael J. Radwin. All Rights Reserved.

	https://github.com/hebcal/hebcal-js

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program. If not, see <http://www.gnu.org/licenses/>.

	Danny Sadinoff can be reached at danny@sadinoff.com

	Michael Radwin has made significant contributions as a result of
	maintaining hebcal.com.

	The JavaScript code was completely rewritten in 2014 by Eyal Schachter.
 */

// name, lat, long, Israel
var cities = {
	"Ashdod": [ 31.8, 34.633, true ],
	"Atlanta": [ 33.75, -84.383, false ],
	"Austin": [ 30.266, -97.75, false ],
	"Baghdad": [ 33.233, 44.366, false ],
	"Beer Sheva": [ 31.25, 34.783, true ],
	"Berlin": [ 52.516, 13.4, false ],
	"Baltimore": [ 39.283, -76.6, false ],
	"Bogota": [ 4.6, -74.083, false ],
	"Boston": [ 42.333, -71.066, false ],
	"Buenos Aires": [ -34.616, -58.4, false ],
	"Buffalo": [ 42.883, -78.866, false ],
	"Chicago": [ 41.833, -87.75, false ],
	"Cincinnati": [ 39.1, -84.516, false ],
	"Cleveland": [ 41.5, -81.683, false ],
	"Dallas": [ 32.783, -96.8, false ],
	"Denver": [ 39.733, -104.983, false ],
	"Detroit": [ 42.333, -83.033, false ],
	"Eilat": [ 29.55, 34.95, true ],
	"Gibraltar": [ 36.133, -5.35, false ],
	"Haifa": [ 32.816, 34.983, true ],
	"Hawaii": [ 19.5, -155.5, false ],
	"Houston": [ 29.766, -95.366, false ],
	"Jerusalem": [ 31.783, 35.233, true ],
	"Johannesburg": [ -26.166, 28.033, false ],
	"Kiev": [ 50.466, 30.483, false ],
	"La Paz": [ -16.5, -68.15, false ],
	"Livingston": [ 40.283, -74.3, false ],
	"London": [ 51.5, -0.166, false ],
	"Los Angeles": [ 34.066, -118.25, false ],
	"Miami": [ 25.766, -80.2, false ],
	"Melbourne": [ -37.866, 145.133, false ],
	"Mexico City": [ 19.4, -99.15, false ],
	"Montreal": [ 45.5, -73.6, false ],
	"Moscow": [ 55.75, 37.7, false ],
	"New York": [ 40.716, -74.016, false ],
	"Omaha": [ 41.266, -95.933, false ],
	"Ottawa": [ 45.7, -76.183, false ],
	"Panama City": [ 8.966, -79.533, false ],
	"Paris": [ 48.866, 2.333, false ],
	"Petach Tikvah": [ 32.083, 34.883, true ],
	"Philadelphia": [ 39.95, -75.166, false ],
	"Phoenix": [ 33.45, -112.066, false ],
	"Pittsburgh": [ 40.433, -80, false ],
	"Saint Louis": [ 38.633, -90.2, false ],
	"Saint Petersburg": [ 59.883, 30.25, false ],
	"San Francisco": [ 37.783, -122.416, false ],
	"Seattle": [ 47.6, -122.333, false ],
	"Sydney": [ -33.916, 151.283, false ],
	"Tel Aviv": [ 32.083, 34.766, true ],
	"Tiberias": [ 32.966, 35.533, true ],
	"Toronto": [ 43.633, -79.4, false ],
	"Vancouver": [ 49.266, -123.116, false ],
	"White Plains": [ 41.033, -73.75, false ],
	"Washington DC": [ 38.916, -77, false ]
};

function getCity(city) {
	city = city.split(/\s+/).map(function(w,i,c){
		if (c.join(' ').toLowerCase() === 'washington dc' && i === 1) { // special case
			return w.toUpperCase();
		}
		return w[0].toUpperCase() + w.slice(1).toLowerCase();
	}).join(' ');
	return cities[city] || [ 0, 0, false ];
}
exports.getCity = getCity;

function listCities() {
	return Object.keys(cities);
}
exports.listCities = listCities;

exports.addCity = function(city, info) {
	if (!Array.isArray(info)) {
		throw new TypeError('adding non-array city');
	}
	if (info.length == 5) {
		var i = info.slice();
		info = [];
		info[0] = (i[0] * 60 + i[1]) / 60;
		info[1] = (i[2] * 60 + i[3]) / 60;
		info[2] = i[4];
	}
	if (info.length != 3) {
		throw new TypeError('length of city array is not 3');
	}
	city = city.split(/\s+/).map(function(w){return w[0].toUpperCase() + w.slice(1).toLowerCase()}).join(' ');
	cities[city] = info;
};

exports.nearest = function(lat, lon) {
	if (Array.isArray(lat)) {
		lat = (lat[0] * 60 + lat[1]) / 60;
	}
	if (Array.isArray(lon)) {
		lon = (lon[0] * 60 + lon[1]) / 60;
	}
	if (typeof lat != 'number') {
		throw new TypeError('incorrect lat type passed to nearest()');
	}
	if (typeof lon != 'number') {
		throw new TypeError('incorrect long type passed to nearest()');
	}

	return listCities().map(function(city){
		var i = getCity(city);
		return {
			name: city,
			dist: Math.sqrt( Math.pow(Math.abs(i[0] - lat), 2) + Math.pow(Math.abs(i[1] - lon), 2) )
		};
	}).reduce(function(close,city){
		return close.dist < city.dist ? close : city;
	}).name;
};
},{}],25:[function(require,module,exports){
/*
	Hebcal - A Jewish Calendar Generator
	Copyright (C) 1994-2004  Danny Sadinoff
	Portions Copyright (c) 2002 Michael J. Radwin. All Rights Reserved.

	https://github.com/hebcal/hebcal-js

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program. If not, see <http://www.gnu.org/licenses/>.

	Danny Sadinoff can be reached at danny@sadinoff.com

	Michael Radwin has made significant contributions as a result of
	maintaining hebcal.com.

	The JavaScript code was completely rewritten in 2014 by Eyal Schachter.
 */
var gematriya = require('gematriya');

var charCodeAt = 'charCodeAt';

var months = exports.months = {
	NISAN   : 1,
	IYYAR   : 2,
	SIVAN   : 3,
	TAMUZ   : 4,
	AV      : 5,
	ELUL    : 6,
	TISHREI : 7,
	CHESHVAN: 8,
	KISLEV  : 9,
	TEVET   : 10,
	SHVAT   : 11,
	ADAR_I  : 12,
	ADAR_II : 13
};

var monthNames = [
	["", 0, ""],
	["Nisan", 0, "ניסן"],
	["Iyyar", 0, "אייר"],
	["Sivan", 0, "סיון"],
	["Tamuz", 0, "תמוז"],
	["Av", 0, "אב"],
	["Elul", 0, "אלול"],
	["Tishrei", 0, "תשרי"],
	["Cheshvan", 0, "חשון"],
	["Kislev", 0, "כסלו"],
	["Tevet", 0, "טבת"],
	["Sh'vat", 0, "שבט"]
];
exports.monthNames = [
	monthNames.concat([["Adar", 0, "אדר"],["Nisan", 0, "ניסן"]]),
	monthNames.concat([["Adar 1", 0, "אדר א'"],["Adar 2", 0, "אדר ב'"],["Nisan", 0, "ניסן"]])
];

exports.days = {
	SUN: 0,
	MON: 1,
	TUE: 2,
	WED: 3,
	THU: 4,
	FRI: 5,
	SAT: 6
};

exports.LANG = function(str, opts){
	return opts == 'h' && str[2] || (opts == 'a' && str[1] || str[0]);
};

function LEAP(x) {
	return (1 + x * 7) % 19 < 7;
}
exports.LEAP = LEAP;

exports.MONTH_CNT = function(x) {
	return 12 + LEAP(x); // boolean is cast to 1 or 0
};

exports.daysInMonth = function(month, year) {
	return 30 - (month == months.IYYAR ||
	month == months.TAMUZ ||
	month == months.ELUL ||
	month == months.TEVET ||
	month == months.ADAR_II ||
	(month == months.ADAR_I && !LEAP(year)) ||
	(month == months.CHESHVAN && !lngChesh(year)) ||
	(month == months.KISLEV && shrtKis(year)));
};

exports.monthNum = function(month) {
	return typeof month === 'number' ? month :
		month[charCodeAt](0) >= 1488 && month[charCodeAt](0) <= 1514 && /('|")/.test(month) ? gematriya(month) :
			month[charCodeAt](0) >= 48 && month[charCodeAt](0) <= 57 /* number */ ? parseInt(month, 10) : monthFromName(month);
};

exports.dayYearNum = function(str) {
	return typeof str === 'number' ? str :
		str[charCodeAt](0) >= 1488 && str[charCodeAt](0) <= 1514 ? gematriya(str, true) : parseInt(str, 10);
};

/* Days from sunday prior to start of Hebrew calendar to mean
   conjunction of Tishrei in Hebrew YEAR
 */
function hebElapsedDays(hYear){
	// borrowed from original JS
	var m_elapsed = 235 * Math.floor((hYear - 1) / 19) +
		12 * ((hYear - 1) % 19) +
		Math.floor(((((hYear - 1) % 19) * 7) + 1) / 19);

	var p_elapsed = 204 + (793 * (m_elapsed % 1080));

	var h_elapsed = 5 + (12 * m_elapsed) +
		793 * Math.floor(m_elapsed / 1080) +
		Math.floor(p_elapsed / 1080);

	var parts = (p_elapsed % 1080) + 1080 * (h_elapsed % 24);

	var day = 1 + 29 * m_elapsed + Math.floor(h_elapsed / 24);
	var alt_day = day + ((parts >= 19440) ||
		((2 == (day % 7)) && (parts >= 9924) && !(LEAP (hYear))) ||
		((1 == (day % 7)) && (parts >= 16789) && LEAP (hYear - 1)));

	return alt_day + ((alt_day % 7) === 0 ||
		(alt_day % 7) == 3 ||
		(alt_day % 7) == 5);
}
exports.hebElapsedDays = hebElapsedDays;

/* Number of days in the hebrew YEAR */
function daysInYear(year)
{
	return hebElapsedDays(year + 1) - hebElapsedDays(year);
}
exports.daysInYear = daysInYear;

/* true if Cheshvan is long in Hebrew YEAR */
function lngChesh(year) {
	return (daysInYear(year) % 10) == 5;
}
exports.lngChesh = lngChesh;

/* true if Kislev is short in Hebrew YEAR */
function shrtKis(year) {
	return (daysInYear(year) % 10) == 3;
}
exports.shrtKis = shrtKis;

function monthFromName(c) {
	/*
	the Hebrew months are unique to their second letter
	N         Nisan  (November?)
	I         Iyyar
	E        Elul
	C        Cheshvan
	K        Kislev
	1        1Adar
	2        2Adar
	Si Sh     Sivan, Shvat
	Ta Ti Te Tamuz, Tishrei, Tevet
	Av Ad    Av, Adar

	אב אד אי אל   אב אדר אייר אלול
	ח            חשון
	ט            טבת
	כ            כסלו
	נ            ניסן
	ס            סיון
	ש            שבט
	תמ תש        תמוז תשרי
	*/
	switch (c.toLowerCase()[0]) {
		case 'n':
		case 'נ':
			return (c.toLowerCase()[1] == 'o') ?    /* this catches "november" */
				0 : months.NISAN;
		case 'i':
			return months.IYYAR;
		case 'e':
			return months.ELUL;
		case 'c':
		case 'ח':
			return months.CHESHVAN;
		case 'k':
		case 'כ':
			return months.KISLEV;
		case 's':
			switch (c.toLowerCase()[1]) {
				case 'i':
					return months.SIVAN;
				case 'h':
					return months.SHVAT;
				default:
					return 0;
			}
		case 't':
			switch (c.toLowerCase()[1]) {
				case 'a':
					return months.TAMUZ;
				case 'i':
					return months.TISHREI;
				case 'e':
					return months.TEVET;
			}
			break;
		case 'a':
			switch (c.toLowerCase()[1]) {
				case 'v':
					return months.AV;
				case 'd':
					if (/(1|[^i]i|a|א)$/i.test(c)) {
						return months.ADAR_I;
					}
					return months.ADAR_II; // else assume sheini
			}
			break;
		case 'ס':
			return months.SIVAN;
		case 'ט':
			return months.TEVET;
		case 'ש':
			return months.SHVAT;
		case 'א':
			switch (c.toLowerCase()[1]) {
				case 'ב':
					return months.AV;
				case 'ד':
					if (/(1|[^i]i|a|א)$/i.test(c)) {
						return months.ADAR_I;
					}
					return months.ADAR_II; // else assume sheini
				case 'י':
					return months.IYYAR;
				case 'ל':
					return months.ELUL;
			}
			break;
		case 'ת':
			switch (c.toLowerCase()[1]) {
				case 'מ':
					return months.TAMUZ;
				case 'ש':
					return months.TISHREI;
			}
			break;
	}
	return 0;
};
exports.monthFromName = monthFromName;

/* Note: Applying this function to d+6 gives us the DAYNAME on or after an
 * absolute day d.  Similarly, applying it to d+3 gives the DAYNAME nearest to
 * absolute date d, applying it to d-1 gives the DAYNAME previous to absolute
 * date d, and applying it to d+7 gives the DAYNAME following absolute date d.

**/
exports.dayOnOrBefore = function(day_of_week, absdate) {
	return absdate - ((absdate - day_of_week) % 7);
};

exports.map = function(self, fun, thisp) {
	// originally written for http://github.com/Scimonster/localbrowse
	if (self === null || typeof fun != 'function') {
		throw new TypeError();
	}
	var t = Object(self);
	var res = {};
	for (var i in t) {
		if (t.hasOwnProperty(i)) {
			res[i] = fun.call(thisp, t[i], i, t);
		}
	}
	if (Array.isArray(self) || typeof self == 'string') { // came as an array, return an array
		var arr = [];
		for (i in res) {
			arr[Number(i)] = res[i];
		}
		res = filter(arr, true); // for...in isn't guaranteed to give any meaningful order
		if (typeof self == 'string') {
			res = res.join('');
		}
	}
	return res;
};

function filter(self, fun, thisp) {
	if (self === null) {
		throw new TypeError('self is null');
	}
	switch (typeof fun) {
		case 'function':
			break; // do nothing
		case 'string':
		case 'number':
			return self[fun]; // str/num is just the property
		case 'boolean':
			// boolean shortcuts to filter only truthy/falsy values
			if (fun) {
				fun = function (v) {
					return v;
				};
			} else {
				fun = function (v) {
					return !v;
				};
			}
			break;
		case 'object':
			var funOrig = fun; // save it
			if (fun instanceof RegExp) { // test the val against the regex
				fun = function (v) {
					return funOrig.test(v);
				};
				break;
			} else if (Array.isArray(fun)) { // keep these keys
				fun = function (v, k) {
					return funOrig.indexOf(k) > -1;
				};
				break;
			}
		default:
			throw new TypeError('fun is not a supported type');
	}
	var res = {};
	var t = Object(self);
	for (var i in t) {
		if (t.hasOwnProperty(i)) {
			var val = t[i]; // in case fun mutates it
			if (fun.call(thisp, val, i, t)) {
				// define property on res in the same manner as it was originally defined
				var props = Object.getOwnPropertyDescriptor(t, i);
				props.value = val;
				Object.defineProperty(res, i, props);
			}
		}
	}
	if (Array.isArray(self) || typeof self == 'string') { // came as an array, return an array
		var arr = [];
		for (i in res) {
			arr[Number(i)] = res[i];
		}
		res = arr.filter(function (v) {
			return v;
		}); // for...in isn't guaranteed to give any meaningful order
		// can't use c.filter(arr,true) here because that would infitely recurse
		if (typeof self == 'string') {
			res = res.join('');
		}
	}
	return res;
}
exports.filter = filter;

exports.range = function(start, end, step) {
	step = step || 1;
	if (step < 0) {
		step = 0 - step;
	}

	var arr = [], i = start;
	if (start < end) {
		for (; i <= end; i += step) {
			arr.push(i);
		}
	} else {
		for (; i >= end; i -= step) {
			arr.push(i);
		}
	}
	return arr;
};

},{"gematriya":23}],26:[function(require,module,exports){
/*
	Hebcal - A Jewish Calendar Generator
	Copyright (C) 1994-2004  Danny Sadinoff
	Portions Copyright (c) 2002 Michael J. Radwin. All Rights Reserved.

	https://github.com/hebcal/hebcal-js

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program. If not, see <http://www.gnu.org/licenses/>.

	Danny Sadinoff can be reached at danny@sadinoff.com

	Michael Radwin has made significant contributions as a result of
	maintaining hebcal.com.

	The JavaScript code was completely rewritten in 2014 by Eyal Schachter.
 */
var c = require('./common'),
	greg = require('./greg'),
	gematriya = require('gematriya');

var shas = [
	// sname, aname, hname, blatt
	[ "Berachot",       "Berachos",         "ברכות",         64  ],
	[ "Shabbat",        "Shabbos",          "שבת",          157 ],
	[ "Eruvin",         "Eruvin",           "עירובין",         105 ],
	[ "Pesachim",       0,                  "פסחים",         121 ],
	[ "Shekalim",       0,                  "שקלים",         22  ],
	[ "Yoma",           0,                  "יומא",           88  ],
	[ "Sukkah",         0,                  "סוכה",          56  ],
	[ "Beitzah",        0,                  "ביצה",          40  ],
	[ "Rosh Hashana",   0,                  "ראש השנה",      35  ],
	[ "Taanit",         "Taanis",           "תענית",          31  ],
	[ "Megillah",       0,                  "מגילה",          32  ],
	[ "Moed Katan",     0,                  "מועד קטן",       29  ],
	[ "Chagigah",       0,                  "חגיגה",          27  ],
	[ "Yevamot",        "Yevamos",          "יבמות",          122 ],
	[ "Ketubot",        "Kesubos",          "כתובות",         112 ],
	[ "Nedarim",        0,                  "נדרים",          91  ],
	[ "Nazir",          0,                  "נזיר",           66  ],
	[ "Sotah",          0,                  "סוטה",          49  ],
	[ "Gitin",          0,                  "גיטין",           90  ],
	[ "Kiddushin",      0,                  "קידושין",         82  ],
	[ "Baba Kamma",     0,                  "בבא קמא",      119 ],
	[ "Baba Metzia",    0,                  "בבא מציעא",     119 ],
	[ "Baba Batra",     "Baba Basra",       "בבא בתרא",     176 ],
	[ "Sanhedrin",      0,                  "סנהדרין",        113 ],
	[ "Makkot",         "Makkos",           "מכות",          24  ],
	[ "Shevuot",        "Shevuos",          "שבועות",        49  ],
	[ "Avodah Zarah",   0,                  "עבודה זרה",     76  ],
	[ "Horayot",        "Horayos",          "הוריות",         14  ],
	[ "Zevachim",       0,                  "זבחים",         120 ],
	[ "Menachot",       "Menachos",         "מנחות",         110 ],
	[ "Chullin",        0,                  "חולין",          142 ],
	[ "Bechorot",       "Bechoros",         "בכורות",         61  ],
	[ "Arachin",        0,                  "ערכין",          34  ],
	[ "Temurah",        0,                  "תמורה",         34  ],
	[ "Keritot",        "Kerisos",          "כריתות",         28  ],
	[ "Meilah",         0,                  "מעילה",         22  ],
	[ "Kinnim",         0,                  "קנים",          4   ],
	[ "Tamid",          0,                  "תמיד",          10  ],
	[ "Midot",          "Midos",            "מדות",          4   ],
	[ "Niddah",         0,                  "נדה",           73  ]
].map(function(m){
	return {name: m.slice(0,3), blatt: m[3]};
});

exports.dafyomi = function(gregdate) {
	var dafcnt = 40, cno, dno, osday, nsday, total, count, j, cday, blatt;

	if (!(gregdate instanceof Date)) {
		throw new TypeError('non-date given to dafyomi');
	}

	osday = greg.greg2abs(new Date(1923, 8, 11));
	nsday = greg.greg2abs(new Date(1975, 5, 24));
	cday = greg.greg2abs(gregdate);

	if (cday < osday) { // no cycle; dy didn't start yet
		return {name: [], blatt: 0};
	}
	if (cday >= nsday) { // "new" cycle
		cno = 8 + ( (cday - nsday) / 2711 );
		dno = (cday - nsday) % 2711;
	} else { // old cycle
		cno = 1 + ( (cday - osday) / 2702 );
		dno = (cday - osday) % 2702;
	}

	// Find the daf taking note that the cycle changed slightly after cycle 7.

	total = blatt = 0;
	count = -1;

	// Fix Shekalim for old cycles
	if (cno <= 7) {
		shas[4].blatt = 13;
	} else {
		shas[4].blatt = 22;
	}

	// Find the daf
	j = 0;
	while (j < dafcnt) {
		count++;
		total = total + shas[j].blatt - 1;
		if (dno < total) {
			blatt = (shas[j].blatt + 1) - (total - dno);
			// fiddle with the weird ones near the end
			switch (count) {
				case 36:
					blatt = blatt + 21;
					break;
				case 37:
					blatt = blatt + 24;
					break;
				case 38:
					blatt = blatt + 33;
					break;
				default:
					break;
			}
			// Bailout
			j = 1 + dafcnt;
		}
		j++;
	}

	return {name: shas[count].name, blatt: blatt};
};

exports.dafname = function(daf, o) {
	return c.LANG(daf.name, o) + ' ' + (o === 'h' ? gematriya(daf.blatt) : daf.blatt);
};

},{"./common":25,"./greg":27,"gematriya":23}],27:[function(require,module,exports){
/*
	Hebcal - A Jewish Calendar Generator
	Copyright (C) 1994-2004  Danny Sadinoff
	Portions Copyright (c) 2002 Michael J. Radwin. All Rights Reserved.

	https://github.com/hebcal/hebcal-js

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program. If not, see <http://www.gnu.org/licenses/>.

	Danny Sadinoff can be reached at danny@sadinoff.com

	Michael Radwin has made significant contributions as a result of
	maintaining hebcal.com.

	The JavaScript code was completely rewritten in 2014 by Eyal Schachter.
 */
var floor = Math.floor,
	t0t1 = [30, 31],
	tMonthLengths = [0, 31, 28, 31].concat(t0t1, t0t1, 31, t0t1, t0t1),
	monthLengths = [
		tMonthLengths.slice()
	];
tMonthLengths[2]++;
monthLengths.push(tMonthLengths);

exports.daysInMonth = function(month, year) { // 1 based months
	return monthLengths[+LEAP(year)][month];
};

exports.monthNames = [
	'',
	'January',
	'February',
	'March',
	'April',
	'May',
	'June',
	'July',
	'August',
	'September',
	'October',
	'November',
	'December'
];

exports.lookupMonthNum = function(month) {
	return new Date(month + ' 1').getMonth() + 1;
};

function dayOfYear (date) {
	if (!date instanceof Date) {
		throw new TypeError('Argument to greg.dayOfYear not a Date');
	}
	var doy = date.getDate() + 31 * date.getMonth();
	if (date.getMonth() > 1) { // FEB
		doy -= floor((4 * (date.getMonth() + 1) + 23) / 10);
		if (LEAP(date.getFullYear())) {
			doy++;
		}
	}
	return doy;
}
exports.dayOfYear = dayOfYear;

function LEAP (year) {
	return !(year % 4) && ( !!(year % 100) || !(year % 400) );
}
exports.LEAP = LEAP;

exports.greg2abs = function(date) { // "absolute date"
	var year = date.getFullYear() - 1;
	return (dayOfYear(date) + // days this year
			365 * year + // + days in prior years
			( floor(year / 4) - // + Julian Leap years
			floor(year / 100) + // - century years
			floor(year / 400))); // + Gregorian leap years
};


/*
 * See the footnote on page 384 of ``Calendrical Calculations, Part II:
 * Three Historical Calendars'' by E. M. Reingold,  N. Dershowitz, and S. M.
 * Clamen, Software--Practice and Experience, Volume 23, Number 4
 * (April, 1993), pages 383-404 for an explanation.
 */
exports.abs2greg = function(theDate) {
// calculations copied from original JS code

	var d0 = theDate - 1;
	var n400 = floor(d0 / 146097);
	var d1 =  floor(d0 % 146097);
	var n100 =  floor(d1 / 36524);
	var d2 = d1 % 36524;
	var n4 =  floor(d2 / 1461);
	var d3 = d2 % 1461;
	var n1 =  floor(d3 / 365);

	var day = ((d3 % 365) + 1);
	var year = (400 * n400 + 100 * n100 + 4 * n4 + n1);

	if (4 == n100 || 4 == n1) {
		return new Date(year, 11, 31);
	}

	return new Date(new Date(++year, 0, day).setFullYear(year)); // new Date() is very smart
};
},{}],28:[function(require,module,exports){
/*
	Hebcal - A Jewish Calendar Generator
	Copyright (C) 1994-2004  Danny Sadinoff
	Portions Copyright (c) 2002 Michael J. Radwin. All Rights Reserved.

	https://github.com/hebcal/hebcal-js

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program. If not, see <http://www.gnu.org/licenses/>.

	Danny Sadinoff can be reached at danny@sadinoff.com

	Michael Radwin has made significant contributions as a result of
	maintaining hebcal.com.

	The JavaScript code was completely rewritten in 2014 by Eyal Schachter.
 */
var c = require('./common'),
	greg = require('./greg'),
	suncalc = require('suncalc'),
	cities = require('./cities'),
	gematriya = require('gematriya');

suncalc.addTime(-16.1, 'alot_hashachar', 0);
suncalc.addTime(-11.5, 'misheyakir', 0);
suncalc.addTime(-10.2, 'misheyakir_machmir', 0);
suncalc.addTime(-8.5, 0, 'tzeit');

// for minifying optimizations
var getFullYear = 'getFullYear',
	getMonth = 'getMonth',
	getDate = 'getDate',
	getTime = 'getTime',
	abs = 'abs',
	hour = 'hour',
	months = c.months,
	TISHREI = months.TISHREI,
	MONTH_CNT = c.MONTH_CNT,
	daysInMonth = c.daysInMonth,
	dayOnOrBefore = c.dayOnOrBefore,
	prototype = HDate.prototype;

function HDate(day, month, year) {
	var me = this;
	switch (arguments.length) {
		case 0:
			return new HDate(new Date());
		case 1:
			if (typeof day == 'undefined') {
				return new HDate();
			} else if (day instanceof Date) {
				// we were passed a Gregorian date, so convert it
				var d = abs2hebrew(greg.greg2abs(day));
				/*if (d.sunset() < day) {
					d = d.next();
				}*/
				return d;
			} else if (day instanceof HDate) {
				var d = new HDate(day[getDate](), day[getMonth](), day[getFullYear]());
				d.il = day.il;
				d.setLocation(d.lat, d.long);
				return d;
			} else if (typeof day == 'string') {
				switch (day.toLowerCase().trim()) {
					case 'today':
						return new HDate();
					case 'yesterday':
						return new HDate().prev();
					case 'tomorrow':
						return new HDate().next();
				}
				if (/\s/.test(day)) {
					var s = day.split(/\s+/);
					if (s.length == 2) {
						return new HDate(s[0], s[1]);
					} else if (s.length == 3) {
						return new HDate(s[0], s[1], s[2]);
					} else if (s.length == 4) { // should only be if s[1] is Adar
						if (/i/i.test(s[2])) { // Using I[I] syntax
							s[2] = s[2].length;
						} // otherwise using 1|2 syntax
						return new HDate(s[0], s[1] + s[2], s[3]);
					}
				}
			} else if (typeof day == 'number') { // absolute date
				return abs2hebrew(day);
			}
			throw new TypeError('HDate called with bad argument');
		case 2:
			return new HDate(day, month, (new HDate)[getFullYear]());
		case 3:
			me.day = me.month = 1;
			me.year = c.dayYearNum(year);

			me.setMonth(c.monthNum(month));
			me.setDate(c.dayYearNum(day));
			break;
		default:
			throw new TypeError('HDate called with bad arguments');
	}

	return me.setLocation.apply(me, HDate.defaultLocation);
}

HDate.defaultLocation = [0, 0];
Object.defineProperty(HDate, 'defaultCity', {
	enumerable: true,
	configurable: true,

	get: function() {
		return cities.nearest(HDate.defaultLocation[0], HDate.defaultLocation[1]);
	},
	set: function(city) {
		HDate.defaultLocation = cities.getCity(city).slice(0, 2);
	}
});

function fix(date) {
	fixMonth(date);
	fixDate(date);
}

function fixDate(date) {
	if (date.day < 1) {
		if (date.month == TISHREI) {
			date.year -= 1;
		}
		date.day += daysInMonth(date.month, date.year);
		date.month -= 1;
		fix(date);
	}
	if (date.day > daysInMonth(date.month, date.year)) {
		if (date.month == months.ELUL) {
			date.year += 1;
		}
		date.day -= daysInMonth(date.month, date.year);
		date.month += 1;
		fix(date);
	}
	fixMonth(date);
}

function fixMonth(date) {
	if (date.month == months.ADAR_II && !date.isLeapYear()) {
		date.month -= 1; // to Adar I
		fix(date);
	}
	if (date.month < 1) {
		date.month += MONTH_CNT(date.year);
		date.year -= 1;
		fix(date);
	}
	if (date.month > MONTH_CNT(date.year)) {
		date.month -= MONTH_CNT(date.year);
		date.year += 1;
		fix(date);
	}
}

prototype[getFullYear] = function() {
	return this.year;
};

prototype.isLeapYear = function() {
	return c.LEAP(this.year);
};

prototype[getMonth] = function() {
	return this.month;
};

prototype.getTishreiMonth = function() {
	var nummonths = MONTH_CNT(this[getFullYear]());
	return (this[getMonth]() + nummonths - 6) % nummonths || nummonths;
};

prototype.daysInMonth = function() {
	return daysInMonth(this[getMonth](), this[getFullYear]());
};

prototype[getDate] = function() {
	return this.day;
};

prototype.getDay = function() {
	return this.greg().getDay();
};

prototype.setFullYear = function(year) {
	this.year = year;
	fix(this);
	return this;
};

prototype.setMonth = function(month) {
	this.month = c.monthNum(month);
	fix(this);
	return this;
};

prototype.setTishreiMonth = function(month) {
	return this.setMonth((month + 6) % MONTH_CNT(this[getFullYear]()) || 13);
};

prototype.setDate = function(date) {
	this.day = date;
	fix(this);
	return this;
};

/* convert hebrew date to absolute date */
/* Absolute date of Hebrew DATE.
   The absolute date is the number of days elapsed since the (imaginary)
   Gregorian date Sunday, December 31, 1 BC. */
function hebrew2abs(d) {
	var m, tempabs = d[getDate](), year = d[getFullYear]();

	if (d[getMonth]() < TISHREI) {
		for (m = TISHREI; m <= MONTH_CNT(year); m++) {
			tempabs += daysInMonth(m, year);
		}

		for (m = months.NISAN; m < d[getMonth](); m++) {
			tempabs += daysInMonth(m, year);
		}
	} else {
		for (m = TISHREI; m < d[getMonth](); m++) {
			tempabs += daysInMonth(m, year);
		}
	}

	return c.hebElapsedDays(year) - 1373429 + tempabs;
}

function abs2hebrew(d) {
	var mmap = [
		months.KISLEV, months.TEVET, months.SHVAT, months.ADAR_I, months.NISAN,
		months.IYYAR, months.SIVAN, months.TAMUZ, TISHREI, TISHREI, TISHREI, months.CHESHVAN
	], hebdate, gregdate, month, year;

	if (d >= 10555144) {
		throw new RangeError("parameter to abs2hebrew " + d + " out of range");
	}

	gregdate = greg.abs2greg(d);
	hebdate = new HDate(1, TISHREI, (year = 3760 + gregdate[getFullYear]()));

	while (d >= hebrew2abs(hebdate.setFullYear(year + 1))) {
		year++;
	}

	if (year > 4634 && year < 10666) {
		// optimize search
		month = mmap[gregdate[getMonth]()];
	} else {
		// we're outside the usual range, so assume nothing about Hebrew/Gregorian calendar drift...
		month = TISHREI;
	}

	while (d > hebrew2abs(hebdate = new HDate(daysInMonth(month, year), month, year))) {
		month = (month % MONTH_CNT(year)) + 1;
	}

	return hebdate.setLocation.apply(hebdate.setDate(d - hebrew2abs(hebdate.setDate(1)) + 1), HDate.defaultLocation);
}

prototype.greg = function() {
	return greg.abs2greg(hebrew2abs(this));
};

prototype.gregEve = function() {
	return this.prev().sunset();
};

prototype[abs] = function() {
	return hebrew2abs(this);
};

prototype.toString = function(o) {
	return c.LANG([this[getDate](), null, gematriya(this[getDate]())], o) + ' ' +
		this.getMonthName(o) + ' ' +
		c.LANG([this[getFullYear](), null, gematriya(this[getFullYear]())], o);
};

prototype.getMonthName = function(o) {
	return c.LANG(c.monthNames[+this.isLeapYear()][this[getMonth]()], o);
};

prototype.setCity = function(city) {
	return this.setLocation(cities.getCity(city));
};

prototype.setLocation = function(lat, lon) {
	if (typeof lat == 'object' && !Array.isArray(lat)) {
		lon = lat.long;
		lat = lat.lat;
	}
	if (Array.isArray(lat) && typeof lon == 'undefined') {
		lon = lat[1];
		lat = lat[0];
	}
	if (Array.isArray(lat)) {
		lat = (lat[0] * 60 + lat[1]) / 60;
	}
	if (Array.isArray(lon)) {
		lon = (lon[0] * 60 + lon[1]) / 60;
	}
	if (typeof lat != 'number') {
		throw new TypeError('incorrect lat type passed to HDate.setLocation()');
	}
	if (typeof lon != 'number') {
		throw new TypeError('incorrect long type passed to HDate.setLocation()');
	}

	this.lat = lat;
	this.long = lon;

	this.il = cities.getCity(cities.nearest(lat, lon))[2];

	return this;
};

function suntime(hdate) {
	// reset the date to midday before calling suncalc api
	// https://github.com/mourner/suncalc/issues/11
	var date = hdate.greg();
	return suncalc.getTimes(new Date(date.getFullYear(), date.getMonth(), date.getDate(), 12, 0, 0, 0, 0), hdate.lat, hdate.long);
}

prototype.sunrise = function() {
	return suntime(this).sunrise;
};

prototype.sunset = function() {
	return suntime(this).sunset;
};

prototype[hour] = function() {
	return (this.sunset() - this.sunrise()) / 12; // ms in hour
};

prototype.hourMins = function() {
	// hour in ms / (1000 ms in s * 60 s in m) = mins in halachic hour
	return this[hour]() / (1000 * 60);
};

prototype.nightHour = function() {
	return (this.sunrise() - this.gregEve()) / 12; // ms in hour
};

prototype.nightHourMins = function() {
	// hour in ms / (1000 ms in s * 60 s in m) = mins in halachic hour
	return this.nightHour() / (1000 * 60);
};

function hourOffset(hdate, hours) {
	return new Date(hdate.sunrise()[getTime]() + (hdate[hour]() * hours));
}

var zemanim = {
	chatzot: function(hdate) {
		return hourOffset(hdate, 6);
	},
	chatzot_night: function(hdate) {
		return new Date(hdate.sunrise()[getTime]() - (hdate.nightHour() * 6));
	},
	alot_hashachar: function(hdate) {
		return suntime(hdate).alot_hashachar;
	},
	alot_hashacher: function(hdate) {
		return suntime(hdate).alot_hashachar;
	},
	misheyakir: function(hdate) {
		return suntime(hdate).misheyakir;
	},
	misheyakir_machmir: function(hdate) {
		return suntime(hdate).misheyakir_machmir;
	},
	sof_zman_shma: function(hdate) { // Gra
		return hourOffset(hdate, 3);
	},
	sof_zman_tfilla: function(hdate) { // Gra
		return hourOffset(hdate, 4);
	},
	mincha_gedola: function(hdate) {
		return hourOffset(hdate, 6.5);
	},
	mincha_ketana: function(hdate) {
		return hourOffset(hdate, 9.5);
	},
	plag_hamincha: function(hdate) {
		return hourOffset(hdate, 10.75);
	},
	tzeit: function(hdate) {
		return suntime(hdate).tzeit;
	},
	neitz_hachama: function(hdate) {
		return hdate.sunrise();
	},
	shkiah: function(hdate) {
		return hdate.sunset();
	}
};

prototype.getZemanim = function() {
	return c.map(zemanim, function(z){
		return z(this);
	}, this);
};

HDate.addZeman = function(zeman, func) {
	zemanim[zeman] = func;
};

prototype.next = function() {
	return abs2hebrew(this.abs() + 1).setLocation(this.lat, this.long);
};

prototype.prev = function() {
	return abs2hebrew(this.abs() - 1).setLocation(this.lat, this.long);
};

prototype.isSameDate = function(other) {
	if (other instanceof HDate) {
		if (other[getFullYear]() == -1) {
			other = new HDate(other).setFullYear(this[getFullYear]());
		}
		return this[abs]() == other[abs]();
	}
	return false;
};

function onOrBefore(day, t, offset) {
	return new HDate(dayOnOrBefore(day, t[abs]() + offset)).setLocation(t.lat, t.long);
}

prototype.before = function(day) {
	return onOrBefore(day, this, -1);
};

prototype.onOrBefore = function(day) {
	return onOrBefore(day, this, 0);
};

prototype.nearest = function(day) {
	return onOrBefore(day, this, 3);
};

prototype.onOrAfter = function(day) {
	return onOrBefore(day, this, 6);
};

prototype.after = function(day) {
	return onOrBefore(day, this, 7);
};

module.exports = HDate;

},{"./cities":24,"./common":25,"./greg":27,"gematriya":23,"suncalc":32}],29:[function(require,module,exports){
/*
	Hebcal - A Jewish Calendar Generator
	Copyright (C) 1994-2004  Danny Sadinoff
	Portions Copyright (c) 2002 Michael J. Radwin. All Rights Reserved.

	https://github.com/hebcal/hebcal-js

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program. If not, see <http://www.gnu.org/licenses/>.

	Danny Sadinoff can be reached at danny@sadinoff.com

	Michael Radwin has made significant contributions as a result of
	maintaining hebcal.com.

	The JavaScript code was completely rewritten in 2014 by Eyal Schachter.
 */
var c = require('./common'),
	HDate = require('./hdate'),
	holidays = require('./holidays'),
	Sedra = require('./sedra'),
	dafyomi = require('./dafyomi'),
	cities = require('./cities'),
	greg = require('./greg'),
	EventEmitter = require('events').EventEmitter,
	gematriya = require('gematriya');

// for minifying optimizations
var defProp = Object.defineProperty,
	TE = TypeError,
	find = 'find',
	strings = 'strings',
	getYearObject = 'getYearObject',
	map = 'map',
	getDay = 'getDay',
	getMonth = 'getMonth',
	getFullYear = 'getFullYear',
	isLeapYear = 'isLeapYear',
	length = 'length',
	next = 'next',
	prev = 'prev',
	months = c.months,
	TISHREI = months.TISHREI,
	NISAN = months.NISAN,
	HebcalProto = Hebcal.prototype,
	MonthProto = Month.prototype,
	GregYearProto = GregYear.prototype,
	GregMonthProto = GregMonth.prototype,
	HDateProto = HDate.prototype;

function getset(g, s) {
	return {
		enumerable: true,
		configurable: true,

		get: g,
		set: s
	};
}

function extend(base, into) {
	for (var i in into) {
		base[i] = into[i];
	}
	return base;
}

// Main Hebcal function

function Hebcal(year, month) {
	var me = this; // whenever this is done, it is for optimizations.
	if (!year) {
		year = (new HDate())[getFullYear](); // this year;
	}
	if (typeof year !== 'number') {
		throw new TE('year to Hebcal() is not a number');
	}
	me.year = year;
	if (month) {
		if (typeof month == 'string') {
			month = c.monthFromName(month);
		}
		if (typeof month == 'number') {
			month = [month];
		}

		if (Array.isArray(month)) {
			me.months = month[map](function(i){
				var m = new Month(i, year);
				defProp(m, '__year', {
					configurable: true,
					writable: true,
					value: me
				});
				return m;
			});

			me.holidays = holidays.year(year);
		} else {
			throw new TE('month to Hebcal is not a valid type');
		}
	} else {
		return new Hebcal(year, c.range(1, c.MONTH_CNT(year)));
	}

	me[length] = c.daysInYear(year);

	defProp(me, 'il', getset(function() {
		return me[getMonth](1).il;
	}, function(il) {
		me.months.forEach(function(m){
			m.il = il;
		});
	}));

	defProp(me, 'lat', getset(function() {
		return me[getMonth](1).lat;
	}, function(lat) {
		me.months.forEach(function(m){
			m.lat = lat;
		});
	}));
	defProp(me, 'long', getset(function() {
		return me[getMonth](1).long;
	}, function(lon) {
		me.months.forEach(function(m){
			m.long = lon;
		});
	}));
}

HebcalProto[isLeapYear] = HDateProto[isLeapYear];

HebcalProto.setCity = function(city) {
	this.months.forEach(function(m){
		m.setCity(city);
	});
	return this;
};

HebcalProto.setLocation = function(lat, lon) {
	this.months.forEach(function(m){
		m.setLocation(lat, lon);
	});
	return this;
};

HebcalProto[next] = function() {
	return new Hebcal(this.year + 1);
};

HebcalProto[prev] = function() {
	return new Hebcal(this.year - 1);
};

HebcalProto[getMonth] = function(month) {
	var months = this.months;
	month = c.monthNum(month);
	if (month > this.months[length]) {
		return this[next]()[getMonth](month - months[length]);
	}
	return months[month > 0 ? month - 1 : months[length] + month];
};

HebcalProto[getDay] = function(day) {
	var me = this;
	if (day > me[length]) {
		return null;
	}
	if (day < 0) {
		return me[getDay](me[length] - day);
	}
	var rosh = me[find](29, months.ELUL)[0].abs() + 1 - me[find](1, NISAN)[0].abs(); // number of days between Nisan and Tishrei
	if (day <= rosh) {
		return me[getMonth](NISAN)[getDay](day);
	}
	return me[getMonth](TISHREI)[getDay](day - rosh);
};

HebcalProto.days = function() {
	return [].concat.apply([], this.months[map](function(m){
		return m.days;
	}));
};

HebcalProto[map] = function() {
	return [][map].apply(this.days(), arguments);
};

HebcalProto.filter = function() {
	return [].filter.apply(this.days(), arguments);
};

HebcalProto.addHoliday = function(holiday) {
	if (!(holiday instanceof holidays.Event)) {
		throw new TE('non-Event passed to addHoliday()');
	}
	this.holidays.add(holiday);
	return this;
};

HebcalProto.findParsha = function(parsha, o) {
	var langs = o ? [o] : ['s','a','h']; // FIXME: abstract this away somewhere
	var days = this.filter(function(d){
		return Math.max.apply(null, langs.map(function(l){
			return d.getSedra(l).indexOf(parsha) + 1;
		}));
	});
	return days[days[length] - 1];
};
HebcalProto.findSedra = HebcalProto.findParsha;

HebcalProto[find] = function find_f(day, month) {
	var me = this;
	if (arguments[length] === 1) {
		if (typeof day == 'string') {
			return find_f[strings].call(me, day);
		} else if (Array.isArray(day)) {
			return [].concat.apply([], day[map](function(d){
				return me[find][Array.isArray(d) ? 'apply' : 'call'](me, d);
			}));
		} else if (day instanceof HDate) {
			return me[find](day.getDate(), day[getMonth]());
		} else if (day instanceof Date) {
			return me[find](new HDate(day));
		}
	} else if (arguments[length] == 2) {
		if (month instanceof Month) {
			return month[find](day);
		} else if (Array.isArray(month)) {
			return [].concat.apply([], month[map](function(m){
				return me[find](day, m);
			}));
		} else if (typeof month == 'string') {
			return me[find](day, c.monthNum(month));
		} else if (typeof month == 'number') {
			return me[find](day, me[getMonth](month));
		}
	}
	return [];
};
HebcalProto[find][strings] = function strings(str) {
	var split = str.split(/\s+/), func = strings[str.replace(/\s/g, '_').toLowerCase()];
	if (!split[length]) {
		return [];
	} else if (func) {
		return func.call(this);
	}
	try {
		return this[find](new HDate(str));
	} catch(e) {
		return split[length] - 1 ? this[find].apply(this, split) : [];
	}
};
HebcalProto[find][strings].rosh_chodesh = function() {
	return this[find]('Rosh Chodesh', c.range(1, this.months[length]));
};
HebcalProto[find][strings].holidays = function() {
	return [].concat.apply([], this.holidays[map](function(h){
		return this[find](h.date);
	}, this));
};
HebcalProto[find][strings].omer = function() {
	return this[find](c.range(15+1, 15+49), NISAN);
};
HebcalProto[find][strings].today = function() {
	return this[find](new HDate());
};
HebcalProto[find][strings].yesterday = function() {
	return [this[find]('today')[0][prev]()];
};
HebcalProto[find][strings].tomorrow = function() {
	return [this[find]('today')[0][next]()];
};
HebcalProto[find][strings].pesach = function() {
	return this[find](c.range(15, 15+8-this.il), NISAN);
};
HebcalProto[find][strings].sukkot = function() {
	return this[find](c.range(15, 15+9-this.il), TISHREI);
};
HebcalProto[find][strings].succot = HebcalProto[find][strings].succos = HebcalProto[find][strings].sukkos = HebcalProto[find][strings].sukkot;
HebcalProto[find][strings].shavuot = function() {
	return this[find](c.range(6, 7-this.il), months.SIVAN);
};
HebcalProto[find][strings].shavuos = HebcalProto[find][strings].shavuot;
HebcalProto[find][strings].rosh_hashana = function() {
	return this[find](c.range(1, 2), TISHREI);
};
HebcalProto[find][strings].rosh_hashanah = HebcalProto[find][strings].rosh_hashana;

// Hebcal properties

Hebcal.addZeman = HDate.addZeman;

Hebcal.cities = cities;

Hebcal.range = c.range;

Hebcal.gematriya = gematriya;

Hebcal.holidays = c.filter(holidays, ['masks', 'Event']); // not year(), atzmaut()

Hebcal.parshiot = Sedra.parshiot;

Hebcal.LANGUAGE = c.LANG;

Hebcal[map] = c[map];

Hebcal.filter = c.filter;

defProp(Hebcal, 'defaultLocation', getset(function(){
	return HDate.defaultLocation;
}, function(loc){
	Hebcal.events.emit('locationChange', HDate.defaultLocation);
	HDate.defaultLocation = loc;
}));
defProp(Hebcal, 'defaultCity', getset(function(){
	return HDate.defaultCity;
}, function(city){
	Hebcal.defaultLocation = cities.getCity(city).slice(0, 2); // call the event
}));

defProp(Hebcal, 'candleLighting', getset(function(){
	return holidays.Event.candleLighting;
}, function(mins){
	holidays.Event.candleLighting = mins;
}));

defProp(Hebcal, 'havdalah', getset(function(){
	return holidays.Event.havdalah;
}, function(mins){
	holidays.Event.havdalah = mins;
}));

// Months

function Month(month, year) {
	var me = this;
	month = c.monthNum(month);
	if (typeof month != 'number') {
		throw new TE('month to Hebcal.Month is not a valid type');
	}
	if (typeof year != 'number') {
		throw new TE('year to Hebcal.Month is not a number');
	}
	me.month = month;
	me.year = year;

	me.days = c.range(1, c.daysInMonth(month, year))[map](function(i){
		var d = new HDate(i, month, year);
		defProp(d, '__month', {
			configurable: true,
			writable: true,
			value: me
		});
		return d;
	});

	me[length] = me.days[length];

	me.holidays = c.filter(holidays.year(year), function(h){
		return h[0].date[getMonth]() == month;
	});

	defProp(me, 'il', getset(function(){
		return me[getDay](1).il;
	}, function(il){
		me.days.forEach(function(d){
			d.il = il;
		});
	}));

	defProp(me, 'lat', getset(function(){
		return me[getDay](1).lat;
	}, function(lat){
		me.days.forEach(function(d){
			d.lat = lat;
		});
	}));
	defProp(me, 'long', getset(function(){
		return me[getDay](1).long;
	}, function(lon){
		me.days.forEach(function(d){
			d.long = lon;
		});
	}));

	return me;
};

Hebcal.Month = Month;

MonthProto[isLeapYear] = HDateProto[isLeapYear];

MonthProto[prev] = function() {
	var me = this, year = me[getYearObject]();
	if (me.month === 1) { // Nisan
		return year[getMonth](-1);
	} else if (me.month === TISHREI) {
		return year[prev]()[getMonth](months.ELUL);
	} else {
		return year[getMonth](me.month - 1);
	}
};

MonthProto[next] = function() {
	var me = this, year = me[getYearObject]();
	if (me.month === c.MONTH_CNT(me.year)) { // Adar
		return year[getMonth](1);
	} else if (me.month === months.ELUL) {
		return year[next]()[getMonth](TISHREI);
	} else {
		return year[getMonth](me.month + 1);
	}
};

MonthProto[getDay] = function(day) {
	var days = this.days;
	day = c.dayYearNum(day);
	if (day > days[length]) {
		return this[next]()[getDay](day - days[length]);
	}
	return days[day > 0 ? day - 1 : days[length] + day];
};

MonthProto[getYearObject] = function() {
	return this.__year || new Hebcal(this.year);
};

MonthProto.getName = function(o) {
	return c.LANG(c.monthNames[+this[isLeapYear]()][this.month], o);
};

MonthProto.rosh_chodesh = function() {
	var prevMonth = this[prev]();
	return prevMonth[length] == 30 ? [prevMonth[getDay](-1), this[getDay](1)] : [this[getDay](1)];
};

MonthProto.setCity = function(city) {
	this.days.forEach(function(d){
		d.setCity(city);
	});
	return this;
};

MonthProto.setLocation = function(lat, lon) {
	this.days.forEach(function(d){
		d.setLocation(lat, lon);
	});
	return this;
};

MonthProto[map] = function() {
	return [][map].apply(this.days, arguments);
};

MonthProto.molad = function() {
	var retMolad = {}, year, m_elapsed, p_elapsed, h_elapsed, parts, m_adj, toInt = parseInt;

    m_adj = this.month - 7;
	year = this.year - 1;
    if (m_adj < 0) {
		m_adj += c.MONTH_CNT(year + 1);
	}

    m_elapsed = toInt(m_adj +
        235 * (year / 19)/* +
        12 * (year % 19) +
        (((year % 19) * 7) + 1) / 19*/);

    p_elapsed = toInt(204 + (793 * (m_elapsed % 1080)));

    h_elapsed = toInt(5 + (12 * m_elapsed) +
        793 * (m_elapsed / 1080)/* +
        p_elapsed / 1080*/ -
        6);

    parts = toInt((p_elapsed % 1080) + 1080 * (h_elapsed % 24));

    retMolad.doy = new HDate(toInt(1 + 29 * m_elapsed + h_elapsed / 24)).getDay();
    retMolad.hour = Math.round(h_elapsed % 24);
    var chalakim = toInt(parts % 1080);
    retMolad.minutes = toInt(chalakim / 18);
    retMolad.chalakim = chalakim % 18;
    var day = this.prev().find.strings.shabbat_mevarchim._calc.call(this)[0].onOrAfter(retMolad.doy).greg();
    day.setHours(retMolad.hour);
    day.setMinutes(retMolad.minutes);
    day.setSeconds(retMolad.chalakim * 3.33);
    retMolad.day = day;

    return retMolad;
};

MonthProto[find] = function find_f(day) {
	var me = this;
	if (typeof day == 'number') {
		return [me[getDay](day)];
	} else if (typeof day == 'string') {
		return find_f[strings].call(me, day);
	} else if (Array.isArray(day)) {
		return [].concat.apply([], day[map](function(d){
			return me[find](d);
		}));
	} else if (day instanceof HDate && day[getFullYear]() == me.year && day[getMonth]() == me.month) {
		return me[find](day.getDate());
	} else if (day instanceof Date) {
		return me[find](new HDate(day));
	}
	return [];
};
MonthProto[find][strings] = function strings(str) {
	var func = strings[str.replace(/\s/g, '_').toLowerCase()];
	if (func) {
		return func.call(this);
	}
	try {
		return this[find](new HDate(str));
	} catch(e) {
		var num = c.dayYearNum(str);
		return num ? this[find](num) : [];
	}
};
MonthProto[find][strings].rosh_chodesh = function() {
	return this.rosh_chodesh();
};
MonthProto[find][strings].shabbat_mevarchim = function sm() {
	return this.month === months.ELUL ? [] : // No birchat hachodesh in Elul
		sm._calc.call(this);
};
MonthProto[find][strings].shabbat_mevarchim._calc = function() {
	return this[find](this[getDay](29).onOrBefore(c.days.SAT));
};
MonthProto[find][strings].shabbos_mevarchim = MonthProto[find][strings].shabbos_mevorchim = MonthProto[find][strings].shabbat_mevarchim;

// HDate days

Hebcal.HDate = HDate;

HDateProto.getMonthObject = function() {
	return this.__month || new Month(this[getMonth](), this[getFullYear]());
};

HDateProto[getYearObject] = function() {
	return this.getMonthObject()[getYearObject]();
};

(function(){
	var orig = {}; // slightly less overhead when using unaffiliated HDate()s
	[prev, next].forEach(function(func){
		orig[func] = HDateProto[func];
		HDateProto[func] = function() {
			var day = orig[func].call(this);
			if (!this.__month) {
				return day;
			}
			return this[getYearObject]()[find](day)[0];
		};
	});
})();

var _getCachedSedraYear = (function(){
	var __cache = {};

	return function(hd) {
		var sedraYear = __cache[hd[getFullYear]()];
		if (!sedraYear || (sedraYear.il != hd.il)) {
			sedraYear = __cache[hd[getFullYear]()] = new Sedra(hd[getFullYear](), hd.il);
		}
		return sedraYear;
	}
})();
HDateProto.getSedra =  function(o) {
	var sedraYear = _getCachedSedraYear(this);
	return sedraYear.get(this)[map](function(p){
		return c.LANG(p, o);
	});
};
HDateProto.getParsha = HDateProto.getSedra;

HDateProto.isSedra =  function() {
	var sedraYear = _getCachedSedraYear(this);
	return sedraYear.isParsha(this);
};
HDateProto.isParsha = HDateProto.isSedra;

HDateProto.holidays = function(all) {
	var me = this, days = me[getYearObject]().holidays[me];
	return days ? days.filter(function(h){
		return all ? true : !h.routine() && h.is(me);
	})[map](function(h){
		h.date.setLocation(me);
		return h;
	}) : [];
};

['candleLighting', 'havdalah'].forEach(function(prop){
	HDateProto[prop] = function(){
		var me = this, hd = me.holidays(true).filter(function(h){
			return h.is(me);
		});
		if (hd.length) {
			hd = c.filter(hd.map(function(h){
				return h[prop]();
			}), true);
		}
		return hd.length ? new Date(Math.max.apply(null, hd)) : null;
	};
});

HDateProto.omer = function() {
	var me = this, greg = me.greg().getTime(), year = me[getFullYear]();
	if (greg > new HDate(15, NISAN, year).greg().getTime() &&
		greg < new HDate( 6, months.SIVAN, year).greg().getTime()) {
		return me.abs() - new HDate(16, NISAN, year).abs() + 1;
	}
	return 0;
};

HDateProto.dafyomi = function(o) {
	return dafyomi.dafname(dafyomi.dafyomi(this.greg()), o);
};

HDateProto.tachanun = (function() {
	var NONE      = tachanun.NONE      = 0,
		MINCHA    = tachanun.MINCHA    = 1,
		SHACHARIT = tachanun.SHACHARIT = 2,
		ALL_CONGS = tachanun.ALL_CONGS = 4;

	var __cache = {
		all: {},
		some: {},
		yes_prev: {},
		il: {}
	};

	function tachanun() {
		var checkNext = !arguments[0], me = this;

		var year = me[getYearObject](), y = year.year;

		function mapAbs(arr) {
			return arr[map](function(d){
				return d.abs();
			});
		}

		var all, some, yes_prev;
		if (__cache.il[y] === me.il) {
			all = __cache.all[y];
			some = __cache.some[y];
			yes_prev = __cache.yes_prev[y];
		} else {
			all = __cache.all[y] = mapAbs(year[find]('Rosh Chodesh').concat(
				year[find](c.range(1, c.daysInMonth(NISAN, y)), NISAN), // all of Nisan
				year[find](15 + 33, NISAN), // Lag Baomer
				year[find](c.range(1, 8 - me.il), months.SIVAN), // Rosh Chodesh Sivan thru Isru Chag
				year[find]([9, 15], months.AV), // Tisha B'av and Tu B'av
				year[find](-1, months.ELUL), // Erev Rosh Hashanah
				year[find]([1, 2], TISHREI), // Rosh Hashanah
				year[find](c.range(9, 24 - me.il), TISHREI), // Erev Yom Kippur thru Isru Chag
				year[find](c.range(25, 33), months.KISLEV), // Chanukah
				year[find](15, months.SHVAT), // Tu B'shvat
				year[find]([14, 15], year[isLeapYear]() ? [months.ADAR_I, months.ADAR_II] : months.ADAR_I) // Purim/Shushan Purim + Katan
			));
			some = __cache.some[y] = mapAbs([].concat( // Don't care if it overlaps days in all, because all takes precedence
				year[find](c.range(1, 13), months.SIVAN), // Until 14 Sivan
				year[find](c.range(20, 31), TISHREI), // Until after Rosh Chodesh Cheshvan
				year[find](14, months.IYYAR), // Pesach Sheini
				holidays.atzmaut(y)[1].date || [], // Yom HaAtzma'ut, which changes based on day of week
				y >= 5727 ? year[find](29, months.IYYAR) : [] // Yom Yerushalayim
			));
			yes_prev = __cache.yes_prev[y] = mapAbs([].concat( // tachanun is said on the previous day at mincha
				year[find](-1, months.ELUL), // Erev Rosh Hashanah
				year[find](9, months.TISHREI), // Erev Yom Kippur
				year[find](14, months.IYYAR) // Pesach Sheini
			));
			__cache.il[y] = me.il;
		}

		all = all.indexOf(me.abs()) > -1;
		some = some.indexOf(me.abs()) > -1;
		yes_prev = yes_prev.indexOf(me.abs()+1) > -1;

		if (all) {
			return NONE;
		}
		var ret = (!some && ALL_CONGS) | (me[getDay]() != 6 && SHACHARIT);
		if (checkNext && !yes_prev) {
			ret |= ((me[next]().tachanun(true) & SHACHARIT) && MINCHA);
		} else {
			ret |= (me[getDay]() != 5 && MINCHA);
		}
		return ret == ALL_CONGS ? NONE : ret;
	}
	return tachanun;
})();

HDateProto.tachanun_uf = function(){
	var ret = this.tachanun();
	return {
		shacharit: !!(ret & this.tachanun.SHACHARIT),
		mincha: !!(ret & this.tachanun.MINCHA),
		all_congs: !!(ret & this.tachanun.ALL_CONGS)
	};
};

HDateProto.hallel = (function() {
	var NONE  = hallel.NONE  = 0,
		HALF  = hallel.HALF  = 1,
		WHOLE = hallel.WHOLE = 2;

	var __cache = {
		whole: {},
		half: {},
		il: {}
	};

	function hallel() {
		var me = this, year = me[getYearObject](), y = year.year;

		var whole = __cache.il[y] == me.il && __cache.whole[y] || (__cache.whole[y] = [].concat(
			year[find](c.range(25, 33), months.KISLEV), // Chanukah
			year[find]([15, me.il ? null : 16], NISAN), // First day(s) of Pesach
			year[find]('Shavuot'),
			year[find]('Sukkot'),
			holidays.atzmaut(y)[1].date || [], // Yom HaAtzma'ut, which changes based on day of week
			y >= 5727 ? year[find](29, months.IYYAR) : [] // Yom Yerushalayim
		)[map](function(d){
			return d.abs();
		}));
		var half = __cache.il[y] == me.il && __cache.half[y] || (__cache.half[y] = [].concat(
			year[find]('Rosh Chodesh').filter(function(rc){return rc[getMonth]() != TISHREI}), // Rosh Chodesh, but not Rosh Hashanah
			year[find](c.range(17 - me.il, 23 - me.il), NISAN) // Last six days of Pesach
		)[map](function(d){
			return d.abs();
		}));
		__cache.il[y] = me.il;

		return (whole.indexOf(me.abs()) > -1 && WHOLE) || (half.indexOf(me.abs()) > -1 && HALF) || NONE;
	}
	return hallel;
})();

// Events

(function(events){
	var refreshInterval, refresh, today = new HDate();

	defProp(events, 'refreshInterval', getset(function(){
		return refreshInterval;
	}, function(ms){
		if (refresh) {
			refresh = clearInterval(refresh);
		}
		refreshInterval = ms;
		if (ms) {
			refresh = setInterval(checkTimes, ms);
			if (refresh.unref) {
				refresh.unref(); // don't keep the process open
			}
		}
	}));

	events.beforeZeman = 1000 * 60 * 10; // 10 minutes

	function checkTimes() {
		var now = new HDate();

		if (!today.isSameDate(now)) {
			events.emit('dayChange');
			today = now;
		}

		function close(obj, compare) {
			return c.filter(c[map](obj, function(time){
				return time - nowGreg;
			}), function(time) {
				return time > 0 && time - compare < 0;
			});
		}

		var nowGreg = new Date(),
			almostTime = close(now.getZemanim(), events.beforeZeman),
			customTimes = close(events.customs, events.refreshInterval);

		for (var zeman in almostTime) {
			events.emit('almostZeman', zeman, almostTime[zeman]);
			if (almostTime[zeman] < events.refreshInterval) {
				events.emit('atZeman', zeman);
			}
		}
		for (var custom in customTimes) {
			events.emit('custom', custom);
		}
	}
	checkTimes();

	events.refreshInterval = 1000 * 60 * 5; // 5 minutes
	// set the interval

	events.customs = {};
})(Hebcal.events = new EventEmitter());

// Gregorian years

function GregYear(year, month) {
	var me = this;
	if (!year) {
		year = (new Date)[getFullYear]();
	}
	if (typeof year === 'string') {
		var d = new Date(year);
		month = year.indexOf(' ') + 1 || year.indexOf('-') + 1 || year.indexOf('/') + 1 ? d[getMonth]() + 1 : c.range(1, 12);
		// Check if a month was passed in the string. Can't just check for default January, because a real January might have been passed.
		return new GregYear(d[getFullYear](), month);
	}
	if (typeof year !== 'number') {
		throw new TE('year to Hebcal.GregYear() is not a number');
	}
	me.year = year;

	if (month) {
		if (typeof month === 'string') { // month name
			month = greg.lookupMonthName(month);
		}
		if (typeof month === 'number') {
			month = [month];
		}

		if (Array.isArray(month)) {
			me.months = month[map](function(i){
				var m = new GregMonth(i, year);
				defProp(m, '__year', {
					configurable: true,
					writable: true,
					value: me
				});
				return m;
			});
		} else {
			throw new TE('month to Hebcal.GregYear() is not a valid type');
		}
	} else {
		return new GregYear(year, c.range(1, 12));
	}

	me.hebyears = [].concat.apply([], me.months[map](function(m){
		return m.hebmonths[map](function(hm){
			return hm.year;
		});
	})).filter(function(val, i, arr){
		return arr.indexOf(val) === i; // keep unique values only
	});

	me.holidays = c.filter(holidays.year(me.hebyears[0]), function(h){
		return h[0].date.greg()[getFullYear]() === year && me.months.filter(function(m){ // don't keep ones that are out of bounds
			return m.month === h[0].date.greg()[getMonth]() + 1;
		})[length];
	});
	if (me.hebyears[1]) {
		extend(me.holidays, c.filter(holidays.year(me.hebyears[1]), function(h){
			return h[0].date.greg()[getFullYear]() === year && me.months.filter(function(m){ // don't keep ones that are out of bounds
				return m.month === h[0].date.greg()[getMonth]() + 1;
			})[length];
		}));
	}

	me[length] = 365 + greg.LEAP(year);

	defProp(me, 'il', getset(function() {
		return me[getMonth](1).il;
	}, function(il) {
		me.months.forEach(function(m){
			m.il = il;
		});
	}));

	defProp(me, 'lat', getset(function() {
		return me[getMonth](1).lat;
	}, function(lat) {
		me.months.forEach(function(m){
			m.lat = lat;
		});
	}));
	defProp(me, 'long', getset(function() {
		return me[getMonth](1).long;
	}, function(lon) {
		me.months.forEach(function(m){
			m.long = lon;
		});
	}));

	return me;
};

Hebcal.GregYear = GregYear;

GregYearProto[isLeapYear] = function() {
	return this[length] == 366;
};

GregYearProto.setCity = HebcalProto.setCity;
GregYearProto.setLocation = HebcalProto.setLocation;

GregYearProto[next] = function() {
	return new GregYear(this.year + 1);
};

GregYearProto[prev] = function() {
	return new GregYear(this.year - 1);
};

GregYearProto[getMonth] = function(month) {
	var months = this.months
	month = typeof month == 'number' ? month : greg.lookupMonthNum(month);
	if (month > months[length]) {
		return this[next]()[getMonth](month - months[length]);
	}
	return months[month > 0 ? month - 1 : months[length] + month];
};

extend(GregYearProto, {
	days: HebcalProto.days,
	map: HebcalProto[map],
	filter: HebcalProto.filter,
	addHoliday: HebcalProto.addHoliday,
});

/*GregYearProto.days = HebcalProto.days;
GregYearProto[map] = HebcalProto[map];
GregYearProto.filter = HebcalProto.filter;

GregYearProto.addHoliday = HebcalProto.addHoliday;*/

function GregMonth(month, year) {
	var me = this;
	if (typeof month == 'string') {
		month = greg.lookupMonthNum(month);
	}
	if (typeof month != 'number') {
		throw new TE('month to Hebcal.GregMonth is not a valid type');
	}
	if (typeof year != 'number') {
		throw new TE('year to Hebcal.GregMonth is not a number');
	}

	me.year = year;
	me.month = month;

	me.days = c.range(1, greg.daysInMonth(month, year))[map](function(i){
		var d = new HDate(new Date(year, month - 1, i));
		defProp(d, '__gregmonth', {
			configurable: true,
			writable: true,
			value: me
		});
		return d;
	});

	me[length] = me.days[length];

	me.hebmonths = [
		{month: me[getDay]( 1)[getMonth](), year: me[getDay]( 1)[getFullYear]()},
		{month: me[getDay](-1)[getMonth](), year: me[getDay](-1)[getFullYear]()}
	].filter(function(val, i, arr){
		return i === 0 || val.month != arr[0].month;
	});

	defProp(me, 'il', getset(function(){
		return me[getDay](1).il;
	}, function(il){
		me.days.forEach(function(d){
			d.il = il;
		});
	}));

	defProp(me, 'lat', getset(function(){
		return me[getDay](1).lat;
	}, function(lat){
		me.days.forEach(function(d){
			d.lat = lat;
		});
	}));
	defProp(me, 'long', getset(function(){
		return me[getDay](1).long;
	}, function(lon){
		me.days.forEach(function(d){
			d.long = lon;
		});
	}));

	return me;
};

Hebcal.GregMonth = GregMonth;

GregMonthProto[isLeapYear] = function() {
	return greg.LEAP(this.year);
};

GregMonthProto[prev] = function() {
	if (this.month === 1) {
		return this[getYearObject]()[prev]()[getMonth](-1);
	} else {
		return this[getYearObject]()[getMonth](this.month - 1);
	}
};

GregMonthProto[next] = function() {
	return this[getYearObject]()[getMonth](this.month + 1);
};

GregMonthProto[getDay] = function(day) {
	if (day > this.days[length]) {
		return this[next]()[getDay](day - this.days[length]);
	}
	return this.days[day > 0 ? day - 1 : this.days[length] + day];
};

GregMonthProto[getYearObject] = function() {
	return this.__year || new GregYear(this.year);
};

GregMonthProto.getName = function() {
	return greg.monthNames[this.month];
};

GregMonthProto.setCity = MonthProto.setCity;
GregMonthProto.setLocation = MonthProto.setLocation;

GregMonthProto[map] = MonthProto[map];

HDateProto.getGregMonthObject = function() {
	return this.__gregmonth || new GregMonth(this.greg()[getMonth]() + 1, this.greg()[getFullYear]());
};

HDateProto.getGregYearObject = function() {
	return this.getGregMonthObject()[getYearObject]();
};

module.exports = Hebcal;

},{"./cities":24,"./common":25,"./dafyomi":26,"./greg":27,"./hdate":28,"./holidays":30,"./sedra":31,"events":22,"gematriya":23}],30:[function(require,module,exports){
/*
	Hebcal - A Jewish Calendar Generator
	Copyright (C) 1994-2004  Danny Sadinoff
	Portions Copyright (c) 2002 Michael J. Radwin. All Rights Reserved.

	https://github.com/hebcal/hebcal-js

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program. If not, see <http://www.gnu.org/licenses/>.

	Danny Sadinoff can be reached at danny@sadinoff.com

	Michael Radwin has made significant contributions as a result of
	maintaining hebcal.com.

	The JavaScript code was completely rewritten in 2014 by Eyal Schachter.
 */
var c = require('./common'),
	HDate = require('./hdate'),
	gematriya = require('gematriya');

var __cache = {};

// for byte optimizations

var dayOnOrBefore = c.dayOnOrBefore,
	months = c.months,
	days = c.days,
	TISHREI = months.TISHREI,
	KISLEV = months.KISLEV,
	NISAN = months.NISAN,
	SAT = days.SAT,
	getDay = 'getDay',
	abs = 'abs',
	Shabbat = 'Shabbat',
	Shabbos = 'Shabbos';

function Chanukah(day) {
	return ['Chanukah: Candle ' + day, 0, 'חנוכה: נר ' + gematriya(day)];
}

function CHM(desc) {
	return [desc[0] + ' (CH"M)', desc[1] ? desc[1] + ' (CH"M)' : desc[1], desc[2] ? desc[2] + ' )חה"ם(' : desc[2]];
}

function Sukkot(day) {
	return ['Sukkot: ' + day, 'Succos: ' + day, 'סוכות יום ' + gematriya(day)];
}

function Pesach(day) {
	return ['Pesach: ' + day, 0, 'פסח יום ' + gematriya(day)];
}

var USER_EVENT          = 1,
	LIGHT_CANDLES       = 2,
	YOM_TOV_ENDS        = 4,
	CHUL_ONLY           = 8, // chutz l'aretz (Diaspora)
	IL_ONLY             = 16, // b'aretz (Israel)
	LIGHT_CANDLES_TZEIS = 32;

exports.masks = {
	USER_EVENT         : USER_EVENT,
	LIGHT_CANDLES      : LIGHT_CANDLES,
	YOM_TOV_ENDS       : YOM_TOV_ENDS,
	CHUL_ONLY          : CHUL_ONLY,
	IL_ONLY            : IL_ONLY,
	LIGHT_CANDLES_TZEIS: LIGHT_CANDLES_TZEIS
};

function Event(date, desc, mask) {
	var me = this;
	me.date = new HDate(date);
	me.desc = typeof desc != 'object' ? [desc] : desc;

	me.USER_EVENT          = !!( mask & USER_EVENT           );
	me.LIGHT_CANDLES       = !!( mask & LIGHT_CANDLES        );
	me.YOM_TOV_ENDS        = !!( mask & YOM_TOV_ENDS         );
	me.CHUL_ONLY           = !!( mask & CHUL_ONLY            );
	me.IL_ONLY             = !!( mask & IL_ONLY              );
	me.LIGHT_CANDLES_TZEIS = !!( mask & LIGHT_CANDLES_TZEIS  );
}

Event.prototype.is = function(date, il) {
	date = new HDate(date), myDate = this.date;
	if (arguments.length < 2) {
		//il = Event.isIL;
		il = date.il;
	}
	if (date.getDate() != myDate.getDate() || date.getMonth() != myDate.getMonth()) {
		return false;
	}
	if (date.getFullYear() != myDate.getFullYear()) {
		return false;
	}
	if (il && this.CHUL_ONLY || !il && this.IL_ONLY) {
		return false;
	}
	return true;
};

Event.prototype.masks = function() {
	var me = this;
	return (me.USER_EVENT          && USER_EVENT)    |
		   (me.LIGHT_CANDLES       && LIGHT_CANDLES) |
		   (me.YOM_TOV_ENDS        && YOM_TOV_ENDS)  |
		   (me.CHUL_ONLY           && CHUL_ONLY)     |
		   (me.IL_ONLY             && IL_ONLY)       |
		   (me.LIGHT_CANDLES_TZEIS && LIGHT_CANDLES_TZEIS);
};

Event.prototype.getDesc = function(o) {
	return c.LANG(this.desc, o);
};

Event.prototype.candleLighting = function() {
	var date = this.date;
	if (this.LIGHT_CANDLES) {
		return new Date(date.sunset() - (Event.candleLighting * 60 * 1000));
	} else if (this.LIGHT_CANDLES_TZEIS) {
		return date.getZemanim().tzeit;
	}
	return null;
};

Event.prototype.havdalah = function() {
	if (this.YOM_TOV_ENDS) {
		return new Date(this.date.sunset().getTime() + (Event.havdalah * 60 * 1000));
	}
	return null;
};

Event.prototype.routine = (function(){
	function routine(){
		return !!~routine.names.indexOf(this.getDesc('s'));
	}
	routine.names = [Shabbat, 'Erev ' + Shabbat];
	return routine;
})();

Event.isIL = false;

Event.candleLighting = 18;

Event.havdalah = 42;

exports.Event = Event;

exports.year = function(year) {
	if (__cache[year]) {
		return __cache[year];
	}

	var	RH = new HDate(1, TISHREI, year),
		pesach = new HDate(15, NISAN, year),
		tmpDate;

	var h = {};

	function add(ev) {
		if (Array.isArray(ev)) {
			ev.forEach(function(e){
				add(e);
			});
		} else {
			if (h[ev.date]) {
				h[ev.date].push(ev);
			} else {
				h[ev.date] = [ev];
			}
		}
	}

	Object.defineProperty(h, 'add', {value: add});

	add([ // standard holidays that don't shift based on year
		new Event(
			RH,
			['Rosh Hashana 1', 0, 'ראש השנה א\''],
			LIGHT_CANDLES_TZEIS
		), new Event(
			new HDate(2, TISHREI, year),
			['Rosh Hashana 2', 0, 'ראש השנה ב\''],
			YOM_TOV_ENDS
		), new Event(
			new HDate(3 + (RH[getDay]() == days.THU), TISHREI, year), // push off to SUN if RH is THU
			['Tzom Gedaliah', 0, 'צום גדליה'],
			0
		), new Event(
			new HDate(9, TISHREI, year),
			['Erev Yom Kippur', 0, 'ערב יום כיפור'],
			LIGHT_CANDLES
		), new Event( // first SAT after RH
			new HDate(dayOnOrBefore(SAT, 7 + RH[abs]())),
			[Shabbat + ' Shuva', Shabbos + ' Shuvah', 'שבת שובה'],
			0
		), new Event(
			new HDate(10, TISHREI, year),
			['Yom Kippur', 0, 'יום כיפור'],
			YOM_TOV_ENDS
		), new Event(
			new HDate(14, TISHREI, year),
			['Erev Sukkot', 'Erev Succos', 'ערב סוכות'],
			LIGHT_CANDLES
		), new Event(
			new HDate(15, TISHREI, year),
			Sukkot(1),
			LIGHT_CANDLES_TZEIS | CHUL_ONLY
		), new Event(
			new HDate(15, TISHREI, year),
			Sukkot(1),
			YOM_TOV_ENDS | IL_ONLY
		), new Event(
			new HDate(16, TISHREI, year),
			Sukkot(2),
			YOM_TOV_ENDS | CHUL_ONLY
		), new Event(
			new HDate(16, TISHREI, year),
			CHM(Sukkot(2)),
			IL_ONLY
		), new Event(
			new HDate(17, TISHREI, year),
			CHM(Sukkot(3)),
			0
		), new Event(
			new HDate(18, TISHREI, year),
			CHM(Sukkot(4)),
			0
		), new Event(
			new HDate(19, TISHREI, year),
			CHM(Sukkot(5)),
			0
		), new Event(
			new HDate(20, TISHREI, year),
			CHM(Sukkot(6)),
			0
		), new Event(
			new HDate(21, TISHREI, year),
			['Sukkot: 7 (Hoshana Raba)', 'Succos: 7 (Hoshana Raba)', 'סוכות יום ז\' )הושנע רבה('],
			LIGHT_CANDLES
		), new Event(
			new HDate(22, TISHREI, year),
			['Shmini Atzeret', 'Shmini Atzeres', 'שמיני עצרת'],
			LIGHT_CANDLES_TZEIS | CHUL_ONLY
		), new Event(
			new HDate(22, TISHREI, year),
			['Shmini Atzeret / Simchat Torah', 'Shmini Atzeres / Simchas Torah', 'שמיני עצרת / שמחת תורה'],
			YOM_TOV_ENDS | IL_ONLY
		), new Event(
			new HDate(23, TISHREI, year),
			['Simchat Torah', 'Simchas Torah', 'שמחת תורה'],
			YOM_TOV_ENDS | CHUL_ONLY
		), new Event(
			new HDate(24, KISLEV, year),
			['Erev Chanukah', 0, 'ערב חנוכה'],
			0
		), new Event(
			new HDate(25, KISLEV, year),
			Chanukah(1),
			0
		), new Event(
			new HDate(26, KISLEV, year),
			Chanukah(2),
			0
		), new Event(
			new HDate(27, KISLEV, year),
			Chanukah(3),
			0
		), new Event(
			new HDate(28, KISLEV, year),
			Chanukah(4),
			0
		), new Event(
			new HDate(29, KISLEV, year),
			Chanukah(5),
			0
		), new Event(
			new HDate(30, KISLEV, year), // yes, i know these are wrong
			Chanukah(6),
			0
		), new Event(
			new HDate(31, KISLEV, year), // HDate() corrects the month automatically
			Chanukah(7),
			0
		), new Event(
			new HDate(32, KISLEV, year),
			Chanukah(8),
			0
		), new Event(
			new HDate(15, months.SHVAT, year),
			["Tu B'Shvat", 0, 'ט"ו בשבט'],
			0
		), new Event(
			new HDate(dayOnOrBefore(SAT, pesach[abs]() - 43)),
			[Shabbat + ' Shekalim', Shabbos + ' Shekalim', 'שבת שקלים'],
			0
		), new Event(
			new HDate(dayOnOrBefore(SAT, pesach[abs]() - 30)),
			[Shabbat + ' Zachor', Shabbos + ' Zachor', 'שבת זכור'],
			0
		), new Event(
			new HDate(pesach[abs]() - (pesach[getDay]() == days.TUE ? 33 : 31)),
			["Ta'anit Esther", "Ta'anis Esther", 'תענית אסתר'],
			0
		), new Event(
			new HDate(13, months.ADAR_II, year),
			['Erev Purim', 0, 'ערב פורים'],
			0
		), new Event(
			new HDate(14, months.ADAR_II, year),
			['Purim', 0, 'פורים'],
			0
		), new Event(
			new HDate(15, months.ADAR_II, year),
			['Shushan Purim', 0, 'שושן פורים'],
			0
		), new Event(
			new HDate(dayOnOrBefore(SAT, pesach[abs]() - 14) - 7),
			[Shabbat + ' Parah', Shabbos + ' Parah', 'שבת פרה'],
			0
		), new Event(
			new HDate(dayOnOrBefore(SAT, pesach[abs]() - 14)),
			[Shabbat + ' Hachodesh', Shabbos + ' Hachodesh', 'שבת החודש'],
			0
		), new Event(
			new HDate(dayOnOrBefore(SAT, pesach[abs]() - 1)),
			[Shabbat + ' HaGadol', Shabbos + ' HaGadol', 'שבת הגדול'],
			0
		), new Event(
			// if the fast falls on Shabbat, move to Thursday
			pesach.prev()[getDay]() == SAT ? pesach.onOrBefore(days.THU) : new HDate(14, NISAN, year),
			["Ta'anit Bechorot", "Ta'anis Bechoros", 'תענית בכורות'],
			0
		), new Event(
			new HDate(14, NISAN, year),
			['Erev Pesach', 0, 'ערב פסח'],
			LIGHT_CANDLES
		), new Event(
			new HDate(15, NISAN, year),
			Pesach(1),
			LIGHT_CANDLES_TZEIS | CHUL_ONLY
		), new Event(
			new HDate(15, NISAN, year),
			Pesach(1),
			YOM_TOV_ENDS | IL_ONLY
		), new Event(
			new HDate(16, NISAN, year),
			Pesach(2),
			YOM_TOV_ENDS | CHUL_ONLY
		), new Event(
			new HDate(16, NISAN, year),
			CHM(Pesach(2)),
			IL_ONLY
		), new Event(
			new HDate(16, NISAN, year),
			['Start counting Omer', 0, 'התחלת ספירת העומר'],
			0
		), new Event(
			new HDate(17, NISAN, year),
			CHM(Pesach(3)),
			0
		), new Event(
			new HDate(18, NISAN, year),
			CHM(Pesach(4)),
			0
		), new Event(
			new HDate(19, NISAN, year),
			CHM(Pesach(5)),
			0
		), new Event(
			new HDate(20, NISAN, year),
			CHM(Pesach(6)),
			LIGHT_CANDLES
		), new Event(
			new HDate(21, NISAN, year),
			Pesach(7),
			LIGHT_CANDLES_TZEIS | CHUL_ONLY
		), new Event(
			new HDate(21, NISAN, year),
			Pesach(7),
			YOM_TOV_ENDS | IL_ONLY
		), new Event(
			new HDate(22, NISAN, year),
			Pesach(8),
			YOM_TOV_ENDS | CHUL_ONLY
		), new Event(
			new HDate(14, months.IYYAR, year),
			['Pesach Sheni', 0, 'פסח שני'],
			0
		), new Event(
			new HDate(18, months.IYYAR, year),
			["Lag B'Omer", 0, 'ל"ג בעומר'],
			0
		), new Event(
			new HDate(5, months.SIVAN, year),
			['Erev Shavuot', 'Erev Shavuos', 'ערב שבועות'],
			LIGHT_CANDLES
		), new Event(
			new HDate(6, months.SIVAN, year),
			['Shavuot 1', 'Shavuos 1', 'שבועות א\''],
			LIGHT_CANDLES_TZEIS | CHUL_ONLY
		), new Event(
			new HDate(6, months.SIVAN, year),
			['Shavuot', 'Shavuos', 'שבועות'],
			YOM_TOV_ENDS | IL_ONLY
		), new Event(
			new HDate(7, months.SIVAN, year),
			['Shavuot 2', 'Shavuos 2', 'שבועות ב\''],
			YOM_TOV_ENDS | CHUL_ONLY
		), new Event(
			new HDate(dayOnOrBefore(SAT, new HDate(1, TISHREI, year + 1)[abs]() - 4)),
			['Leil Selichot', 'Leil Selichos', 'ליל סליחות'],
			0
		), new Event(
			new HDate(29, months.ELUL, year),
			['Erev Rosh Hashana', 0, 'ערב ראש השנה'],
			LIGHT_CANDLES
		)
	]);

	tmpDate = new HDate(10, months.TEVET, year);
	if (tmpDate[getDay]() == SAT) {
		tmpDate = tmpDate.next();
	}
	add(new Event(
		tmpDate,
		["Asara B'Tevet", 0, 'עשרה בטבת'],
		0
	));

	if (c.LEAP(year)) {
		add(new Event(
			new HDate(14, months.ADAR_I, year),
			['Purim Katan', 0, 'פורים קטן'],
			0
		));

		add(new Event(
			new HDate(15, months.ADAR_I, year),
			['Shushan Purim Katan', 0, 'שושן פורים קטן'],
			0
		));
	}

	if (year >= 5711) { // Yom HaShoah first observed in 1951
		tmpDate = new HDate(27, NISAN, year);
		/* When the actual date of Yom Hashoah falls on a Friday, the
		 * state of Israel observes Yom Hashoah on the preceding
		 * Thursday. When it falls on a Sunday, Yom Hashoah is observed
		 * on the following Monday.
		 * http://www.ushmm.org/remembrance/dor/calendar/
		 */

		if (tmpDate[getDay]() == days.FRI) {
			tmpDate = tmpDate.prev();
		} else if (tmpDate[getDay]() == days.SUN) {
			tmpDate = tmpDate.next();
		}

		add(new Event(
			tmpDate,
			['Yom HaShoah', 0, 'יום השואה'],
			0
		));
	}

	add(atzmaut(year));

	if (year >= 5727) { // Yom Yerushalayim only celebrated after 1967
		add(new Event(
			new HDate(28, months.IYYAR, year),
			['Yom Yerushalayim', 0, 'יום ירושלים'],
			0
		));
	}

	tmpDate = new HDate(17, months.TAMUZ, year);
	if (tmpDate[getDay]() == SAT) {
		tmpDate = tmpDate.next();
	}
	add(new Event(
		tmpDate,
		["Shiva-Asar B'Tamuz", 0, "צום יז' בתמוז"],
		0
	));

	tmpDate = new HDate(9, months.AV, year);
	if (tmpDate[getDay]() == SAT) {
		tmpDate = tmpDate.next();
	}

	add(new Event(
		new HDate(dayOnOrBefore(SAT, tmpDate[abs]())),
		[Shabbat + ' Chazon', Shabbos + ' Chazon', 'שבת חזון'],
		0
	));

	add(new Event(
		tmpDate.prev(),
		["Erev Tish'a B'Av", 0, 'ערב תשעה באב'],
		0
	));

	add(new Event(
		tmpDate,
		["Tish'a B'Av", 0, 'תשעה באב'],
		0
	));

	add(new Event(
		new HDate(dayOnOrBefore(SAT, tmpDate[abs]() + 7)),
		[Shabbat + ' Nachamu', Shabbos + ' Nachamu', 'שבת נחמו'],
		0
	));

	for (var day = 6; day < c.daysInYear(year) + 7; day += 7) {
		add(new Event(
			new HDate(dayOnOrBefore(SAT, new HDate(1, TISHREI, year)[abs]() + day)),
			[Shabbat, Shabbos, 'שבת'],
			YOM_TOV_ENDS
		));

		add(new Event(
			new HDate(dayOnOrBefore(days.FRI, new HDate(1, TISHREI, year)[abs]() + day)),
			['Erev ' + Shabbat, 'Erev ' + Shabbos, 'ערב שבת'],
			LIGHT_CANDLES
		));
	}

	for (var month = 1; month <= c.MONTH_CNT(year); month++) {
		if ((month == NISAN ? c.daysInMonth(c.MONTH_CNT(year - 1), year - 1) :
				c.daysInMonth(month - 1, year)) == 30) {
			add(new Event(
				new HDate(1, month, year),
				['Rosh Chodesh 2', 0, "ראש חודש ב'"],
				0
			));

			add(new Event(
				new HDate(30, month - 1, year),
				['Rosh Chodesh 1', 0, "ראש חודש א'"],
				0
			));
		} else if (month !== TISHREI) {
			add(new Event(
				new HDate(1, month, year),
				['Rosh Chodesh', 0, 'ראש חודש'],
				0
			));
		}

		if (month == months.ELUL) {
			continue;
		}

		add(new Event(
			new HDate(29, month, year).onOrBefore(SAT),
			[Shabbat + ' Mevarchim', Shabbos + ' Mevorchim', 'שבת מברכים'],
			0
		));
	}

	return __cache[year] = h;
};

function atzmaut(year) {
	if (year >= 5708) { // Yom HaAtzma'ut only celebrated after 1948
		var tmpDate = new HDate(1, months.IYYAR, year), pesach = new HDate(15, NISAN, year);

		if (pesach[getDay]() == days.SUN) {
			tmpDate.setDate(2);
		} else if (pesach[getDay]() == SAT) {
			tmpDate.setDate(3);
		} else if (year < 5764) {
			tmpDate.setDate(4);
		} else if (pesach[getDay]() == days.TUE) {
			tmpDate.setDate(5);
		} else {
			tmpDate.setDate(4);
		}

		return [new Event(
			tmpDate,
			['Yom HaZikaron', 0, 'יום הזיכרון'],
			0
		), new Event(
			tmpDate.next(),
			["Yom HaAtzma'ut", 0, 'יום העצמאות'],
			0
		)];
	}
	return [];
}
exports.atzmaut = atzmaut;

},{"./common":25,"./hdate":28,"gematriya":23}],31:[function(require,module,exports){
/*
	Hebcal - A Jewish Calendar Generator
	Copyright (C) 1994-2004  Danny Sadinoff
	Portions Copyright (c) 2002 Michael J. Radwin. All Rights Reserved.

	https://github.com/hebcal/hebcal-js

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program. If not, see <http://www.gnu.org/licenses/>.

	Danny Sadinoff can be reached at danny@sadinoff.com

	Michael Radwin has made significant contributions as a result of
	maintaining hebcal.com.

	The JavaScript code was completely rewritten in 2014 by Eyal Schachter.
 */
/*
 * Many of the following algorithms were taken from hebrew calendar
 * routines by Maimonedes, from his Mishneh Torah, and implemented by
 *  Nachum Dershowitz                Department of Computer Science
 *  (217) 333-4219                   University of Illinois at Urbana-Champaign
 *  nachum@cs.uiuc.edu               1304 West Springfield Avenue
 *                                   Urbana, Illinois 61801
 *
 * The routines were included in the emacs 19 distribution.
 *
 */
var c = require('./common'), HDate = require('./hdate');

var concat = 'concat', range = c.range; // for client optimization

var INCOMPLETE = 0,
	REGULAR = 1,
	COMPLETE = 2;

function Sedra(hebYr, il) { // the Hebrew year
	il = !!il;
	var long_c = c.lngChesh(hebYr);
	var short_k = c.shrtKis(hebYr);
	var type;
	this.year = hebYr;
	if (long_c && !short_k) {
		type = COMPLETE;
	} else if (!long_c && short_k) {
		type = INCOMPLETE;
	} else {
		type = REGULAR;
	}

	var rosh_hashana = new HDate(1, c.months.TISHREI, hebYr).abs();
	var rosh_hashana_day = (rosh_hashana % 7) + 1;

	// find the first Saturday on or after Rosh Hashana
	this.first_saturday = c.dayOnOrBefore(6, rosh_hashana + 6);
	var leap = +c.LEAP(hebYr);
	this.type = type;
	this.rosh_hashana_day = rosh_hashana_day;
	this.leap = leap;
	this.il = il;

	var core = "" + leap + rosh_hashana_day + type;
	if (types[core]) {
		this.theSedraArray = types[core];
	} else {
		this.theSedraArray = types[core + (+il)]; // cast to num, then concat
	}

	if (!this.theSedraArray) {
		console.log(this);
		throw new TypeError("improper sedra year type calculated.");
	}
}

var parshiot = Sedra.parshiot = [
	[ 'Bereshit', 'Bereshis', 'בראשית' ], // 0
	[ 'Noach', 0, 'נח' ],
	[ 'Lech-Lecha', 0, 'לך-לך' ],
	[ 'Vayera', 0, 'וירא' ],
	[ 'Chayei Sara', 0, 'חיי שרה' ],
	[ 'Toldot', 'Toldos', 'תולדות' ],
	[ 'Vayetzei', 0, 'ויצא' ],
	[ 'Vayishlach', 0, 'וישלח' ],
	[ 'Vayeshev', 0, 'וישב' ],
	[ 'Miketz', 0, 'מקץ' ],
	[ 'Vayigash', 0, 'ויגש' ], // 10
	[ 'Vayechi', 0, 'ויחי' ],
	[ 'Shemot', 'Shemos', 'שמות' ],
	[ 'Vaera', 0, 'וארא' ],
	[ 'Bo', 0, 'בא' ],
	[ 'Beshalach', 0, 'בשלח' ],
	[ 'Yitro', 'Yisro', 'יתרו' ],
	[ 'Mishpatim', 0, 'משפטים' ],
	[ 'Terumah', 0, 'תרומה' ],
	[ 'Tetzaveh', 0, 'תצוה' ],
	[ 'Ki Tisa', 'Ki Sisa', 'כי תשא' ], // 20
	[ 'Vayakhel', 0, 'ויקהל' ],
	[ 'Pekudei', 0, 'פקודי' ],
	[ 'Vayikra', 0, 'ויקרא' ],
	[ 'Tzav', 0, 'צו' ],
	[ 'Shmini', 0, 'שמיני' ],
	[ 'Tazria', 0, 'תזריע' ],
	[ 'Metzora', 0, 'מצרע' ],
	[ 'Achrei Mot', 'Achrei Mos', 'אחרי מות' ],
	[ 'Kedoshim', 0, 'קדשים' ],
	[ 'Emor', 0, 'אמור' ], // 30
	[ 'Behar', 0, 'בהר' ],
	[ 'Bechukotai', 'Bechukosai', 'בחקתי' ],
	[ 'Bamidbar', 0, 'במדבר' ],
	[ 'Nasso', 0, 'נשא' ],
	[ 'Beha\'alotcha', 'Beha\'aloscha', 'בהעלתך' ],
	[ 'Sh\'lach', 0, 'שלח לך' ],
	[ 'Korach', 0, 'קורח' ],
	[ 'Chukat', 'Chukas', 'חקת' ],
	[ 'Balak', 0, 'בלק' ],
	[ 'Pinchas', 0, 'פינחס' ], // 40
	[ 'Matot', 'Matos', 'מטות' ],
	[ 'Masei', 0, 'מסעי' ],
	[ 'Devarim', 0, 'דברים' ],
	[ 'Vaetchanan', 'V\'eschanan', 'ואתחנן' ],
	[ 'Eikev', 0, 'עקב' ],
	[ 'Re\'eh', 0, 'ראה' ],
	[ 'Shoftim', 0, 'שופטים' ],
	[ 'Ki Teitzei', 'Ki Seitzei', 'כי תצא' ],
	[ 'Ki Tavo', 'Ki Savo', 'כי תבוא' ],
	[ 'Nitzavim', 0, 'נצבים' ], // 50
	[ 'Vayeilech', 0, 'וילך' ],
	[ 'Ha\'Azinu', 0, 'האזינו' ]
];


// parsha doubler/undoubler
function D(p) {
	return -p;
}

// these are wrapped to protect them from [].concat()
var RH = [[ 'Rosh Hashana', 0, 'ראש השנה' ]]; //0
var YK = [[ 'Yom Kippur', 0, 'יום כיפור' ]];  //1

var SUKKOT = [[ 'Sukkot', 'Succos', 'סוכות' ]];  //0
var CHMSUKOT = [[ 'Chol hamoed Sukkot', 'Chol hamoed Succos', 'חול המועד סוכות' ]];  //0
var SHMINI = [[ 'Shmini Atzeret', 'Shmini Atzeres', 'שמיני עצרת' ]];  //0
var EOY = [[ 'End-of-Year: Simchat-Torah, Sukkot', 'End-of-Year: Simchas-Torah, Succos', 'סופשנה: סוכות וסמחת תורה' ]];  //0

var PESACH = [[ 'Pesach', 0, 'פסח' ]]; //25
var CHMPESACH = [[ 'Chol hamoed Pesach', 0, 'חול המועד פסח' ]];  //25
var PESACH7 = [[ 'Second days of Pesach', 0, 'שביעי של פסח' ]]; //25

var SHAVUOT = [[ 'Shavuot', 'Shavuos', 'שבועות' ]]; //33



// The ordinary year types (keviot)

// names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel

var types = {

	/* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
	 * Kislev each have 29 days), and has Passover start on Tuesday. */
	//e.g. 5753
	'020' : [51, 52][concat](EOY, range(0, 20), D(21), 23, 24, PESACH, 25,
		D(26), D(28), 30, D(31), range(33, 40), D(41), range(43, 49), D(50)
	),

	/* Hebrew year that starts on Monday, is `complete' (Heshvan and
	 * Kislev each have 30 days), and has Passover start on Thursday. */
	//e.g. 5756
	'0220' : [51, 52][concat](EOY, range(0, 20), D(21), 23, 24, PESACH, 25, D(26), D(28),
		30, D(31), 33, SHAVUOT, range(34, 37), D(38), 40, D(41), range(43, 49), D(50)
	),

	/* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
	 * days and Kislev has 30 days), and has Passover start on Saturday. */
	//e.g. 5701
	'0510' : [52][concat](YK, EOY, range(0, 20), D(21), 23, 24, PESACH, PESACH,
		25, D(26), D(28), 30, D(31), range(33, 40), D(41), range(43, 50)
	),

	/* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
	 * days and Kislev has 30 days), and has Passover start on Saturday. */
	// e.g. 5745
	'0511' : [52][concat](YK, EOY, range(0, 20), D(21), 23, 24, PESACH,
		25, D(26), D(28), range(30, 40), D(41), range(43, 50)
	),

	/* Hebrew year that starts on Thursday, is `complete' (Heshvan and
	 * Kislev each have 30 days), and has Passover start on Sunday. */
	//e.g. 5754
	'052' : [52][concat](YK, CHMSUKOT, range(0, 24), PESACH7, 25, D(26),
		D(28), 30, D(31), range(33, 40), D(41), range(43, 50)
	),

	/* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev
	 * each have 29 days), and has Passover start on Sunday. */
	//e.g. 5761
	'070' : [][concat](RH, 52, SUKKOT, SHMINI, range(0, 20), D(21), 23, 24, PESACH7,
		25, D(26), D(28), 30, D(31), range(33, 40), D(41), range(43, 50)
	),


	/* Hebrew year that starts on Saturday, is `complete' (Heshvan and
	 * Kislev each have 30 days), and has Passover start on Tuesday. */
	//e.g. 5716
	'072' : [][concat](RH, 52, SUKKOT, SHMINI, range(0, 20), D(21), 23, 24, CHMPESACH, 25,
		D(26), D(28), 30, D(31), range(33, 40), D(41), range(43, 49), D(50)
	),


	/* --  The leap year types (keviot) -- */
	/* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
	 * Kislev each have 29 days), and has Passover start on Thursday. */
	//e.g. 5746
	'1200' : [51, 52][concat](CHMSUKOT, range(0, 27), CHMPESACH, range(28, 33),
		SHAVUOT, range(34, 37), D(38), 40, D(41), range(43, 49), D(50)
	),

	/* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
	 * Kislev each have 29 days), and has Passover start on Thursday. */
	//e.g. 5746
	'1201' : [51, 52][concat](CHMSUKOT, range(0, 27), CHMPESACH,
		range(28, 40), D(41), range(43, 49), D(50)
	),

	/* Hebrew year that starts on Monday, is `complete' (Heshvan and
	 * Kislev each have 30 days), and has Passover start on Saturday. */
	//e.g.5752
	'1220' : [51, 52][concat](CHMSUKOT, range(0, 27), PESACH,
		PESACH, range(28, 40), D(41), range(43, 50)
	),

	/* Hebrew year that starts on Monday, is `complete' (Heshvan and
	 * Kislev each have 30 days), and has Passover start on Saturday. */
	//e.g.5752
	'1221' : [51, 52][concat](CHMSUKOT, range(0, 27), PESACH, range(28, 50)),

	/* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and
	 * Kislev both have 29 days), and has Passover start on Sunday. */
	//e.g. 5768
	'150' : [52][concat](YK, CHMSUKOT, range(0, 28), PESACH7, range(29, 50)),

	/* Hebrew year that starts on Thursday, is `complete' (Heshvan and
	 * Kislev both have 30 days), and has Passover start on Tuesday. */
	//eg. 5771
	'152' : [52][concat](YK, CHMSUKOT, range(0, 28), CHMPESACH, range(29, 49), D(50)),

	/* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and
	 * Kislev each have 29 days), and has Passover start on Tuesday. */
	//e.g.5757
	'170' : [][concat](RH, 52, SUKKOT, SHMINI, range(0, 27), CHMPESACH,
		range(28, 40), D(41), range(43, 49), D(50)
	),

	/* Hebrew year that starts on Saturday, is `complete' (Heshvan and
	 * Kislev each have 30 days), and has Passover start on Thursday. */
	'1720' : [][concat](RH, 52, SUKKOT, SHMINI, range(0, 27), CHMPESACH, range(28, 33),
		SHAVUOT, range(34, 37), D(38), 40, D(41), range(43, 49), D(50)
	)
};

/* Hebrew year that starts on Monday, is `complete' (Heshvan and
 * Kislev each have 30 days), and has Passover start on Thursday. */
types['0221'] = types['020'];

/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29
 * days and Kislev has 30 days), and has Passover start on Thursday. */
//e.g. 5715
types['0310'] = types['0220'];

/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29
 * days and Kislev has 30 days), and has Passover start on Thursday. */
types['0311'] = types['020'];

/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29
 * days and Kislev has 30 days), and has Passover start on Saturday. */
// e.g. 5715
types['1310'] = types['1220'];
/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29
 * days and Kislev has 30 days), and has Passover start on Saturday. */
types['1311'] = types['1221'];

/* Hebrew year that starts on Saturday, is `complete' (Heshvan and
 * Kislev each have 30 days), and has Passover start on Thursday. */
types['1721'] = types['170'];


Sedra.prototype.get = function(hDate) {
	return abs(this, hDate.abs()).parsha;
};

Sedra.prototype.isParsha = function(hDate) {
	return !abs(this, hDate.abs()).chag;
};

// returns an array describing the parsha on the first Saturday on or after absdate
function abs(year, absDate) {

	// find the first saturday on or after today's date
	absDate = c.dayOnOrBefore(6, absDate + 6);

	var weekNum = (absDate - year.first_saturday) / 7;
	var index = year.theSedraArray[weekNum];

	if (undefined === index) {
		return abs(new Sedra(year.year + 1, year.il), absDate); // must be next year
	}
	if (typeof index == 'object') {
		// Shabbat has a chag. Return a description
		return {parsha: [index], chag: true};
	}
	if (index >= 0) {
		return {parsha: [parshiot[index]], chag: false};
	}

	index = D(index); // undouble the parsha
	return {parsha: [parshiot[index], parshiot[index + 1]], chag: false};
}

module.exports = Sedra;

},{"./common":25,"./hdate":28}],32:[function(require,module,exports){
/*
 (c) 2011-2015, Vladimir Agafonkin
 SunCalc is a JavaScript library for calculating sun/moon position and light phases.
 https://github.com/mourner/suncalc
*/

(function () { 'use strict';

// shortcuts for easier to read formulas

var PI   = Math.PI,
    sin  = Math.sin,
    cos  = Math.cos,
    tan  = Math.tan,
    asin = Math.asin,
    atan = Math.atan2,
    acos = Math.acos,
    rad  = PI / 180;

// sun calculations are based on http://aa.quae.nl/en/reken/zonpositie.html formulas


// date/time constants and conversions

var dayMs = 1000 * 60 * 60 * 24,
    J1970 = 2440588,
    J2000 = 2451545;

function toJulian(date) { return date.valueOf() / dayMs - 0.5 + J1970; }
function fromJulian(j)  { return new Date((j + 0.5 - J1970) * dayMs); }
function toDays(date)   { return toJulian(date) - J2000; }


// general calculations for position

var e = rad * 23.4397; // obliquity of the Earth

function rightAscension(l, b) { return atan(sin(l) * cos(e) - tan(b) * sin(e), cos(l)); }
function declination(l, b)    { return asin(sin(b) * cos(e) + cos(b) * sin(e) * sin(l)); }

function azimuth(H, phi, dec)  { return atan(sin(H), cos(H) * sin(phi) - tan(dec) * cos(phi)); }
function altitude(H, phi, dec) { return asin(sin(phi) * sin(dec) + cos(phi) * cos(dec) * cos(H)); }

function siderealTime(d, lw) { return rad * (280.16 + 360.9856235 * d) - lw; }

function astroRefraction(h) {
    if (h < 0) // the following formula works for positive altitudes only.
        h = 0; // if h = -0.08901179 a div/0 would occur.

    // formula 16.4 of "Astronomical Algorithms" 2nd edition by Jean Meeus (Willmann-Bell, Richmond) 1998.
    // 1.02 / tan(h + 10.26 / (h + 5.10)) h in degrees, result in arc minutes -> converted to rad:
    return 0.0002967 / Math.tan(h + 0.00312536 / (h + 0.08901179));
}

// general sun calculations

function solarMeanAnomaly(d) { return rad * (357.5291 + 0.98560028 * d); }

function eclipticLongitude(M) {

    var C = rad * (1.9148 * sin(M) + 0.02 * sin(2 * M) + 0.0003 * sin(3 * M)), // equation of center
        P = rad * 102.9372; // perihelion of the Earth

    return M + C + P + PI;
}

function sunCoords(d) {

    var M = solarMeanAnomaly(d),
        L = eclipticLongitude(M);

    return {
        dec: declination(L, 0),
        ra: rightAscension(L, 0)
    };
}


var SunCalc = {};


// calculates sun position for a given date and latitude/longitude

SunCalc.getPosition = function (date, lat, lng) {

    var lw  = rad * -lng,
        phi = rad * lat,
        d   = toDays(date),

        c  = sunCoords(d),
        H  = siderealTime(d, lw) - c.ra;

    return {
        azimuth: azimuth(H, phi, c.dec),
        altitude: altitude(H, phi, c.dec)
    };
};


// sun times configuration (angle, morning name, evening name)

var times = SunCalc.times = [
    [-0.833, 'sunrise',       'sunset'      ],
    [  -0.3, 'sunriseEnd',    'sunsetStart' ],
    [    -6, 'dawn',          'dusk'        ],
    [   -12, 'nauticalDawn',  'nauticalDusk'],
    [   -18, 'nightEnd',      'night'       ],
    [     6, 'goldenHourEnd', 'goldenHour'  ]
];

// adds a custom time to the times config

SunCalc.addTime = function (angle, riseName, setName) {
    times.push([angle, riseName, setName]);
};


// calculations for sun times

var J0 = 0.0009;

function julianCycle(d, lw) { return Math.round(d - J0 - lw / (2 * PI)); }

function approxTransit(Ht, lw, n) { return J0 + (Ht + lw) / (2 * PI) + n; }
function solarTransitJ(ds, M, L)  { return J2000 + ds + 0.0053 * sin(M) - 0.0069 * sin(2 * L); }

function hourAngle(h, phi, d) { return acos((sin(h) - sin(phi) * sin(d)) / (cos(phi) * cos(d))); }

// returns set time for the given sun altitude
function getSetJ(h, lw, phi, dec, n, M, L) {

    var w = hourAngle(h, phi, dec),
        a = approxTransit(w, lw, n);
    return solarTransitJ(a, M, L);
}


// calculates sun times for a given date and latitude/longitude

SunCalc.getTimes = function (date, lat, lng) {

    var lw = rad * -lng,
        phi = rad * lat,

        d = toDays(date),
        n = julianCycle(d, lw),
        ds = approxTransit(0, lw, n),

        M = solarMeanAnomaly(ds),
        L = eclipticLongitude(M),
        dec = declination(L, 0),

        Jnoon = solarTransitJ(ds, M, L),

        i, len, time, Jset, Jrise;


    var result = {
        solarNoon: fromJulian(Jnoon),
        nadir: fromJulian(Jnoon - 0.5)
    };

    for (i = 0, len = times.length; i < len; i += 1) {
        time = times[i];

        Jset = getSetJ(time[0] * rad, lw, phi, dec, n, M, L);
        Jrise = Jnoon - (Jset - Jnoon);

        result[time[1]] = fromJulian(Jrise);
        result[time[2]] = fromJulian(Jset);
    }

    return result;
};


// moon calculations, based on http://aa.quae.nl/en/reken/hemelpositie.html formulas

function moonCoords(d) { // geocentric ecliptic coordinates of the moon

    var L = rad * (218.316 + 13.176396 * d), // ecliptic longitude
        M = rad * (134.963 + 13.064993 * d), // mean anomaly
        F = rad * (93.272 + 13.229350 * d),  // mean distance

        l  = L + rad * 6.289 * sin(M), // longitude
        b  = rad * 5.128 * sin(F),     // latitude
        dt = 385001 - 20905 * cos(M);  // distance to the moon in km

    return {
        ra: rightAscension(l, b),
        dec: declination(l, b),
        dist: dt
    };
}

SunCalc.getMoonPosition = function (date, lat, lng) {

    var lw  = rad * -lng,
        phi = rad * lat,
        d   = toDays(date),

        c = moonCoords(d),
        H = siderealTime(d, lw) - c.ra,
        h = altitude(H, phi, c.dec),
        // formula 14.1 of "Astronomical Algorithms" 2nd edition by Jean Meeus (Willmann-Bell, Richmond) 1998.
        pa = atan(sin(H), tan(phi) * cos(c.dec) - sin(c.dec) * cos(H));

    h = h + astroRefraction(h); // altitude correction for refraction

    return {
        azimuth: azimuth(H, phi, c.dec),
        altitude: h,
        distance: c.dist,
        parallacticAngle: pa
    };
};


// calculations for illumination parameters of the moon,
// based on http://idlastro.gsfc.nasa.gov/ftp/pro/astro/mphase.pro formulas and
// Chapter 48 of "Astronomical Algorithms" 2nd edition by Jean Meeus (Willmann-Bell, Richmond) 1998.

SunCalc.getMoonIllumination = function (date) {

    var d = toDays(date || new Date()),
        s = sunCoords(d),
        m = moonCoords(d),

        sdist = 149598000, // distance from Earth to Sun in km

        phi = acos(sin(s.dec) * sin(m.dec) + cos(s.dec) * cos(m.dec) * cos(s.ra - m.ra)),
        inc = atan(sdist * sin(phi), m.dist - sdist * cos(phi)),
        angle = atan(cos(s.dec) * sin(s.ra - m.ra), sin(s.dec) * cos(m.dec) -
                cos(s.dec) * sin(m.dec) * cos(s.ra - m.ra));

    return {
        fraction: (1 + cos(inc)) / 2,
        phase: 0.5 + 0.5 * inc * (angle < 0 ? -1 : 1) / Math.PI,
        angle: angle
    };
};


function hoursLater(date, h) {
    return new Date(date.valueOf() + h * dayMs / 24);
}

// calculations for moon rise/set times are based on http://www.stargazing.net/kepler/moonrise.html article

SunCalc.getMoonTimes = function (date, lat, lng, inUTC) {
    var t = new Date(date);
    if (inUTC) t.setUTCHours(0, 0, 0, 0);
    else t.setHours(0, 0, 0, 0);

    var hc = 0.133 * rad,
        h0 = SunCalc.getMoonPosition(t, lat, lng).altitude - hc,
        h1, h2, rise, set, a, b, xe, ye, d, roots, x1, x2, dx;

    // go in 2-hour chunks, each time seeing if a 3-point quadratic curve crosses zero (which means rise or set)
    for (var i = 1; i <= 24; i += 2) {
        h1 = SunCalc.getMoonPosition(hoursLater(t, i), lat, lng).altitude - hc;
        h2 = SunCalc.getMoonPosition(hoursLater(t, i + 1), lat, lng).altitude - hc;

        a = (h0 + h2) / 2 - h1;
        b = (h2 - h0) / 2;
        xe = -b / (2 * a);
        ye = (a * xe + b) * xe + h1;
        d = b * b - 4 * a * h1;
        roots = 0;

        if (d >= 0) {
            dx = Math.sqrt(d) / (Math.abs(a) * 2);
            x1 = xe - dx;
            x2 = xe + dx;
            if (Math.abs(x1) <= 1) roots++;
            if (Math.abs(x2) <= 1) roots++;
            if (x1 < -1) x1 = x2;
        }

        if (roots === 1) {
            if (h0 < 0) rise = i + x1;
            else set = i + x1;

        } else if (roots === 2) {
            rise = i + (ye < 0 ? x2 : x1);
            set = i + (ye < 0 ? x1 : x2);
        }

        if (rise && set) break;

        h0 = h2;
    }

    var result = {};

    if (rise) result.rise = hoursLater(t, rise);
    if (set) result.set = hoursLater(t, set);

    if (!rise && !set) result[ye > 0 ? 'alwaysUp' : 'alwaysDown'] = true;

    return result;
};


// export as Node module / AMD module / browser variable
if (typeof exports === 'object' && typeof module !== 'undefined') module.exports = SunCalc;
else if (typeof define === 'function' && define.amd) define(SunCalc);
else window.SunCalc = SunCalc;

}());

},{}],33:[function(require,module,exports){
"use strict";

/**
 * Returns the number of saturdays in the month before the passed date.
 *
 * @param {Date} d
 * @return {number}
 */
function saturdaysBefore(d) {
  var i = new Date(d);
  var saturdays = 0;
  i.setDate(i.getDate() - 1);

  while (i.getMonth() === d.getMonth()) {
    if (i.getDay() === 6) {
      saturdays += 1;
    }

    i.setDate(i.getDate() - 1);
  }

  return saturdays;
}
/**
 * Dictionary of filters
 *
 * Each filter is a function that receives a Date and returns a boolean if the date matches the filter.
 */


var filters = {
  monday: function monday(d) {
    return d.getDay() === 1;
  },
  tuesday: function tuesday(d) {
    return d.getDay() === 2;
  },
  wednesday: function wednesday(d) {
    return d.getDay() === 3;
  },
  thursday: function thursday(d) {
    return d.getDay() === 4;
  },
  friday: function friday(d) {
    return d.getDay() === 5;
  },
  saturday: function saturday(d) {
    return d.getDay() === 6;
  },
  sunday: function sunday(d) {
    return d.getDay() === 0;
  },
  weekday: function weekday(d) {
    return d.getDay() !== 6 && d.getDay() !== 0;
  },
  weekend: function weekend(d) {
    return d.getDay() === 6 || d.getDay() === 0;
  },
  week1: function week1(d) {
    return saturdaysBefore(d) === 0;
  },
  week2: function week2(d) {
    return saturdaysBefore(d) === 1;
  },
  week3: function week3(d) {
    return saturdaysBefore(d) === 2;
  },
  week4: function week4(d) {
    return saturdaysBefore(d) === 3;
  },
  week5: function week5(d) {
    return saturdaysBefore(d) === 4;
  },
  week6: function week6(d) {
    return saturdaysBefore(d) === 5;
  },
  firstDayOfMonth: function firstDayOfMonth(d) {
    return d.getDate() === 1;
  },
  lastDayOfMonth: function lastDayOfMonth(d) {
    var next = new Date(d);
    next.setDate(next.getDate() + 1);
    return next.getDate() === 1;
  },
  leapDay: function leapDay(d) {
    return d.getMonth() === 1 && d.getDate() === 29;
  },
  pythagoras: function pythagoras(d) {
    return Math.pow(d.getFullYear() % 100, 2) === Math.pow(d.getDate(), 2) + Math.pow(d.getMonth() + 1, 2);
  },
  always: function always() {
    return true;
  },
  never: function never() {
    return false;
  }
};
/**
 * Lookup a filter by name
 *
 * @param {string} name
 * @return {function}
 * @throws {Error}
 */

function lookup(name) {
  var value = filters[name];

  if (value === undefined) {
    throw new Error("Unknown filter '".concat(name, "'"));
  }

  return value;
}

module.exports = {
  lookup: lookup
};

},{}],34:[function(require,module,exports){
"use strict";

var WhenzelSymbols = require('./symbols');

var WhenzelFilters = require('./filters');

var YEAR = 0,
    MONTH = 1,
    DAY = 2;
/**
 * Checks whether a date pattern is valid and throws exceptions if it isn't
 *
 * @param {string} pattern
 * @param {string} context
 *   Context in which the check is being performed, which will be added to the
 *   exception error message.
 * @throws {Error}
 */

function validateDatePattern(pattern) {
  var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  var matches = pattern.match(/^(\?\?\?\?|\d\d\d\d)-(\?\?|\d\d)-(\?\?|\d\d)$/);

  if (matches === null) {
    throw new Error("Invalid test pattern '".concat(pattern, "'").concat(context));
  }

  if (Number(matches[2]) < 1 || Number(matches[2]) > 12) {
    throw new Error("Invalid month in ISO date '".concat(pattern, "'").concat(context));
  }

  if (Number(matches[3]) < 1 || Number(matches[3]) > 31) {
    throw new Error("Invalid day in ISO date '".concat(pattern, "'").concat(context));
  }
}
/**
 * Replaces the parts of a parsed ISO date that contain wildcards to the
 * actual year, month or day of the passed date.
 *
 * @param {[string, string, string]} patternParts
 *  An array containing year, month and day from a parsed ISO date or wildcards.
 * @param {Date} date
 * @return {string}
 *  A date in ISO format (yyyy-mm-dd)
 */


function replaceWildcards(patternParts, date) {
  var isoDate = date.toISOString().substr(0, 'xxxx-xx-xx'.length);
  var dateParts = isoDate.split('-');
  var resultParts = ['', '', ''];
  resultParts[DAY] = patternParts[DAY] === '??' ? dateParts[DAY] : patternParts[DAY];
  resultParts[MONTH] = patternParts[MONTH] === '??' ? dateParts[MONTH] : patternParts[MONTH];
  resultParts[YEAR] = patternParts[YEAR] === '????' ? dateParts[YEAR] : patternParts[YEAR];
  return resultParts.join('-');
}
/**
 * Converts to date patterns into actual bounds relative to a date.
 *
 * Patterns with wildcards can specify bounds that roll over to the next or previous
 * year (e.g. ????-12-01 / ????-03-01) or month (????-??-30 / ????-??-05). This function
 * checks if the patterns roll over and modifies the patterns with wildcards to
 * actual lower and upper bound dates relative to the date being checked to allow for
 * straightforward testing.
 *
 * @param {string} patternFrom
 * @param {string} patternTo
 * @param {Date} date
 * @return {[string, string]}
 * @throws {Error}
 *  An array where the first element is the lower bound and the second is the upper bound.
 */


function buildBounds(patternFrom, patternTo, date) {
  var isoDate = date.toISOString().substr(0, 'xxxx-xx-xx'.length);
  var dateParts = isoDate.split('-');
  var fromParts = patternFrom.split('-');
  var toParts = patternTo.split('-');
  var monthRollover = fromParts[DAY] !== '??' && toParts[DAY] !== '??' && fromParts[DAY] > toParts[DAY];
  var yearRollover = fromParts[MONTH] !== '??' && toParts[MONTH] !== '??' && (fromParts[MONTH] > toParts[MONTH] || fromParts[MONTH] === toParts[MONTH] && monthRollover);
  var fromDate = new Date(date);
  var toDate = new Date(date);

  if (yearRollover) {
    if (dateParts[MONTH] < fromParts[MONTH] || dateParts[MONTH] === fromParts[MONTH] && fromParts[DAY] !== '??' && dateParts[DAY] < fromParts[DAY]) {
      fromDate.setFullYear(fromDate.getFullYear() - 1);
    } else {
      toDate.setFullYear(toDate.getFullYear() + 1);
    }
  } else if (monthRollover && fromParts[MONTH] === '??' && toParts[MONTH] === '??') {
    if (dateParts[DAY] < fromParts[DAY]) {
      fromDate.setMonth(fromDate.getMonth() - 1);
    } else {
      toDate.setMonth(toDate.getMonth() + 1);
    }
  }

  return [replaceWildcards(fromParts, fromDate), replaceWildcards(toParts, toDate)];
}
/**
 * Expands an expression by processing any symbols in it
 *
 * @param {string} expression
 * @param {Date} date
 * @return {string}
 * @throws {Error}
 */


function resolveExpression(expression, date) {
  if (expression.length < 2) {
    return expression;
  }

  if (expression[0] === '@') {
    var matches = expression.match(/^@([a-zA-Z0-9]+)\s*([+\-]\s*\d{1,3})?$/);

    if (matches === null) {
      throw new Error("Invalid expression: '".concat(expression, "'"));
    }

    var deltaSign = 1;
    var delta = 0;

    if (matches[2] !== undefined) {
      deltaSign = matches[2][0] === '-' ? -1 : 1;
      delta = Number(matches[2].substr(1));
    }

    return resolveSymbol(matches[1], date, deltaSign * delta);
  }

  return expression;
}
/**
 * Converts a symbolic date to a date pattern.
 *
 * Looks up the symbolic date in the table and converts it to a date pattern by applying
 * the specified delta.
 *
 * @param {string} name
 *  Name of the symbol
 * @param {Date} date
 * @param {Number} delta
 *  Number of days to deviate from the symbolic date
 * @return {string}
 * @throws {Error}
 */


function resolveSymbol(name, date, delta) {
  var pattern = WhenzelSymbols.lookup(name, date);

  if (delta !== 0) {
    var patternParts = pattern.split('-');
    var shiftedDate = new Date(date);

    if (patternParts[0] !== '????') {
      shiftedDate.setFullYear(Number(patternParts[0]));
    }

    if (patternParts[1] !== '??') {
      shiftedDate.setMonth(Number(patternParts[1]) - 1);
    }

    if (patternParts[2] !== '??') {
      shiftedDate.setDate(Number(patternParts[2]));
    }

    shiftedDate.setDate(shiftedDate.getDate() + delta);
    var isoDate = shiftedDate.toISOString().substr(0, 'xxxx-xx-xx'.length);
    var isoDateParts = isoDate.split('-');
    return [patternParts[0] === '????' ? patternParts[0] : isoDateParts[0], isoDateParts[1] === '??' ? patternParts[1] : isoDateParts[1], isoDateParts[2] === '??' ? patternParts[2] : isoDateParts[2]].join('-');
  }

  return pattern;
}
/**
 * Returns true if the date matches the date pattern
 *
 * @param {string} pattern
 * @param {Date} date
 * @return {boolean}
 * @throws {Error}
 */


function testDate(pattern) {
  var date = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Date();
  validateDatePattern(pattern);
  var re = new RegExp("^".concat(pattern, "$").replace(/\?/g, '\\d'));
  var isoDate = date.toISOString().substr(0, 'xxxx-xx-xx'.length);
  return isoDate.match(re) !== null;
}
/**
 * Returns true if a date is within a range defined by two date patterns
 *
 * @param {string} patternFrom
 * @param {string} patternTo
 * @param {Date} date
 * @return {boolean}
 * @throws {Error}
 */


function testDateRange(patternFrom, patternTo) {
  var date = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Date();
  validateDatePattern(patternFrom, ' on left side of date range');
  validateDatePattern(patternTo, ' on right side of date range');
  var bounds = buildBounds(patternFrom, patternTo, date);
  var isoDate = date.toISOString().substr(0, 'xxxx-xx-xx'.length);
  return isoDate >= bounds[0] && isoDate <= bounds[1];
}
/**
 * Returns true if a date matches a date selector pattern (date, symbolic date or date range)
 *
 * @param {string} pattern
 * @param {Date} date
 * @return {boolean}
 * @throws {Error}
 */


function dateSelector(pattern, date) {
  var rangeParts = pattern.split('/');

  if (rangeParts.length === 1) {
    return testDate(resolveExpression(pattern.trim(), date), date);
  } else {
    return testDateRange(resolveExpression(rangeParts[0].trim(), date), resolveExpression(rangeParts[1].trim(), date), date);
  }
}
/**
 * Returns true if date matches a selector pattern
 *
 * See README for pattern syntax.
 *
 * @param {string} pattern
 * @param {Date} date
 * @return {boolean}
 * @throws {Error}
 */


function test(pattern) {
  var date = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Date();
  var patternParts = pattern.match(/^([^#]*)?\s*(#.+)?$/);

  if (patternParts === null) {
    throw new Error("Invalid test pattern '".concat(pattern, "'"));
  }

  var selectors = [];

  if (patternParts[1] !== undefined) {
    selectors.push(function (d) {
      return dateSelector(patternParts[1].trim(), d);
    });
  }

  if (patternParts[2] !== undefined) {
    var filterSelectors = patternParts[2].trim().split(/\s+/);
    filterSelectors.forEach(function (filterSelector) {
      if (filterSelector.substr(0, 1) !== '#') {
        throw new Error("Unexpected '".concat(filterSelector, "' in pattern"));
      }

      var filter = WhenzelFilters.lookup(filterSelector.substr(1));
      selectors.push(function (d) {
        return filter(d);
      });
    });
  }

  return selectors.every(function (selector) {
    return selector(date);
  });
}

module.exports = {
  test: test
};

},{"./filters":33,"./symbols":38}],35:[function(require,module,exports){
"use strict";

var CalendarChinese = require('date-chinese').CalendarChinese;

function chineseNewYearPattern(date) {
  var cal = new CalendarChinese();
  var newYear = cal.fromJDE(cal.newYear(date.getFullYear())).toGregorian();
  var asDate = new Date(newYear.year, newYear.month - 1, newYear.day);
  return asDate.toISOString().substr(0, 'xxxx-xx-xx'.length);
}

module.exports = {
  chineseNewYear: chineseNewYearPattern
};

},{"date-chinese":20}],36:[function(require,module,exports){
"use strict";

var easter = require('date-easter');

function easterPattern(date) {
  return easter.easter(date.getFullYear()).toString();
}

module.exports = {
  easter: easterPattern
};

},{"date-easter":21}],37:[function(require,module,exports){
"use strict";

var Hebcal = require('hebcal');

function roshHashanahPattern(date) {
  var gdate = new Hebcal.GregYear(date.getFullYear());
  var newYear = gdate.hebyears[gdate.hebyears.length - 1];
  var gregorianDate = gdate.holidays["1 Tishrei ".concat(newYear)][0].date.greg();
  return gregorianDate.toISOString().substr(0, 'xxxx-xx-xx'.length);
}

function hanukkahStartPattern(date) {
  // If the reference date is in the first half of the year we're checking for
  // the start of Hannukah from the previous year
  var gdate = new Hebcal.GregYear(date.getMonth() < 5 ? date.getFullYear() - 1 : date.getFullYear());
  var newYear = gdate.hebyears[gdate.hebyears.length - 1];
  var gregorianDate = gdate.holidays["25 Kislev ".concat(newYear)][0].date.greg();
  return gregorianDate.toISOString().substr(0, 'xxxx-xx-xx'.length);
}

function hanukkahEndPattern(date) {
  // If the reference date is in the first half of the year we're checking for
  // the end of Hannukah from the previous year
  var gdate = new Hebcal.GregYear(date.getMonth() < 5 ? date.getFullYear() - 1 : date.getFullYear());
  var hyear = gdate.hebyears[gdate.hebyears.length - 1];
  var year = new Hebcal(hyear); // Hanukkah might end on 2 or 3 of Tevet depending on whether Kislev has 29 or 30 days

  var endDay = year.months[8].length === 30 ? 2 : 3;
  var gregorianDate = year.holidays["".concat(endDay, " Tevet ").concat(hyear)][0].date.greg();
  return gregorianDate.toISOString().substr(0, 'xxxx-xx-xx'.length);
}

module.exports = {
  roshHashanah: roshHashanahPattern,
  hanukkahStart: hanukkahStartPattern,
  hanukkahEnd: hanukkahEndPattern
};

},{"hebcal":29}],38:[function(require,module,exports){
"use strict";

var easter = require('./special-dates/easter').easter;

var chineseNewYear = require('./special-dates/chinese').chineseNewYear;

var hebrew = require('./special-dates/hebrew');
/**
 * Dictionary of symbols
 *
 * Each symbol is either a date pattern (string) or a function that receives a reference
 * date and returns the closest date pattern for that holiday / special date relative to it.
 */


var symbols = {
  christmasEve: '????-12-24',
  christmas: '????-12-25',
  boxingDay: '????-12-26',
  newYearsEve: '????-12-31',
  newYear: '????-01-01',
  halloween: '????-10-31',
  allSaintsDay: '????-11-01',
  aprilFools: '????-04-01',
  earthDay: '????-04-22',
  valentinesDay: '????-02-14',
  stPatrick: '????-03-17',
  laborDay: '????-05-01',
  piDay: '????-03-14',
  idm: '????-03-14',
  easter: easter,
  chineseNewYear: chineseNewYear,
  roshHashanah: hebrew.roshHashanah,
  hanukkahStart: hebrew.hanukkahStart,
  hanukkahEnd: hebrew.hanukkahEnd
};
/**
 * Lookup a symbol by name relative to a reference date being checked
 *
 * @param {string} name
 * @param {Date} date
 * @return {string}
 * @throws {Error}
 */

function lookup(name, date) {
  var value = symbols[name];

  if (value === undefined) {
    throw new Error("Unknown symbolic date '".concat(name, "'"));
  }

  if (typeof value === 'string') {
    return value;
  }

  if (typeof value === 'function') {
    return value(date);
  }

  throw new Error("Internal error. Symbol '".concat(name, "' has an invalid type."));
}

module.exports = {
  lookup: lookup
};

},{"./special-dates/chinese":35,"./special-dates/easter":36,"./special-dates/hebrew":37}]},{},[34])(34)
});
