hebcal
Version:
An easy to use, richly-featured, perpetual Jewish Calendar API
9 lines (7 loc) • 53.4 kB
JavaScript
/*
Hebcal - A Jewish Calendar Generator
https://github.com/hebcal/hebcal-js
Licensed GPLv3
*/
!function(){function t(e,n,r){function a(o,s){if(!n[o]){if(!e[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(i)return i(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var c=n[o]={exports:{}};e[o][0].call(c.exports,function(t){return a(e[o][1][t]||t)},c,c.exports,t,e,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)a(r[o]);return a}return t}()({1:[function(t,e,n){function r(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=A(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}function a(t){return void 0===t._maxListeners?r.defaultMaxListeners:t._maxListeners}function i(t,e,n){if(e)t.call(n);else for(var r=t.length,a=w(t,r),i=0;i<r;++i)a[i].call(n)}function o(t,e,n,r){if(e)t.call(n,r);else for(var a=t.length,i=w(t,a),o=0;o<a;++o)i[o].call(n,r)}function s(t,e,n,r,a){if(e)t.call(n,r,a);else for(var i=t.length,o=w(t,i),s=0;s<i;++s)o[s].call(n,r,a)}function u(t,e,n,r,a,i){if(e)t.call(n,r,a,i);else for(var o=t.length,s=w(t,o),u=0;u<o;++u)s[u].call(n,r,a,i)}function h(t,e,n,r){if(e)t.apply(n,r);else for(var a=t.length,i=w(t,a),o=0;o<a;++o)i[o].apply(n,r)}function c(t,e,n,r){var i,o,s;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if(o=t._events,o?(o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),s=o[e]):(o=t._events=A(null),t._eventsCount=0),s){if("function"==typeof s?s=o[e]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),!s.warned&&(i=a(t))&&i>0&&s.length>i){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else s=o[e]=n,++t._eventsCount;return t}function f(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,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:for(var t=new Array(arguments.length),e=0;e<t.length;++e)t[e]=arguments[e];this.listener.apply(this.target,t)}}function l(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},a=S.call(f,r);return a.listener=n,r.wrapFn=a,a}function y(t,e,n){var r=t._events;if(!r)return[];var a=r[e];return a?"function"==typeof a?n?[a.listener||a]:[a]:n?g(a):w(a,a.length):[]}function m(t){var e=this._events;if(e){var n=e[t];if("function"==typeof n)return 1;if(n)return n.length}return 0}function d(t,e){for(var n=e,r=n+1,a=t.length;r<a;n+=1,r+=1)t[n]=t[r];t.pop()}function w(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function g(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}function p(t){var e=function(){};return e.prototype=t,new e}function v(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return n}function b(t){var e=this;return function(){return e.apply(t,arguments)}}var A=Object.create||p,L=Object.keys||v,S=Function.prototype.bind||b;e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0;var E,_=10;try{var T={};Object.defineProperty&&Object.defineProperty(T,"x",{value:0}),E=0===T.x}catch(t){E=!1}E?Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return _},set:function(t){if("number"!=typeof t||t<0||t!==t)throw new TypeError('"defaultMaxListeners" must be a positive number');_=t}}):r.defaultMaxListeners=_,r.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},r.prototype.getMaxListeners=function(){return a(this)},r.prototype.emit=function(t){var e,n,r,a,c,f,l="error"===t;if(f=this._events)l=l&&null==f.error;else if(!l)return!1;if(l){if(arguments.length>1&&(e=arguments[1]),e instanceof Error)throw e;var y=new Error('Unhandled "error" event. ('+e+")");throw y.context=e,y}if(!(n=f[t]))return!1;var m="function"==typeof n;switch(r=arguments.length){case 1:i(n,m,this);break;case 2:o(n,m,this,arguments[1]);break;case 3:s(n,m,this,arguments[1],arguments[2]);break;case 4:u(n,m,this,arguments[1],arguments[2],arguments[3]);break;default:for(a=new Array(r-1),c=1;c<r;c++)a[c-1]=arguments[c];h(n,m,this,a)}return!0},r.prototype.addListener=function(t,e){return c(this,t,e,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(t,e){return c(this,t,e,!0)},r.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,l(this,t,e)),this},r.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,l(this,t,e)),this},r.prototype.removeListener=function(t,e){var n,r,a,i,o;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=A(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(a=-1,i=n.length-1;i>=0;i--)if(n[i]===e||n[i].listener===e){o=n[i].listener,a=i;break}if(a<0)return this;0===a?n.shift():d(n,a),1===n.length&&(r[t]=n[0]),r.removeListener&&this.emit("removeListener",t,o||e)}return this},r.prototype.removeAllListeners=function(t){var e,n,r;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=A(null),this._eventsCount=0):n[t]&&(0==--this._eventsCount?this._events=A(null):delete n[t]),this;if(0===arguments.length){var a,i=L(n);for(r=0;r<i.length;++r)"removeListener"!==(a=i[r])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=A(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},r.prototype.listeners=function(t){return y(this,t,!0)},r.prototype.rawListeners=function(t){return y(this,t,!1)},r.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},r.prototype.listenerCount=m,r.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],2:[function(t,e,n){!function(){function t(t,e){if("number"!=typeof t&&"string"!=typeof t)throw new TypeError("non-number or string given to gematriya()");var n="string"==typeof t;return n&&(t=t.replace(/('|")/g,"")),t=t.toString().split("").reverse(),!n&&e&&(t=t.slice(0,e)),t=t.map(function i(o,s){return n?e&&a[o]<a[t[s-1]]&&a[o]<100?1e3*a[o]:a[o]:parseInt(o,10)*Math.pow(10,s)>1e3?i(o,s-3):r[parseInt(o,10)*Math.pow(10,s)]}),n?t.reduce(function(t,e){return t+e},0):(t=t.reverse().join("").replace(/יה/g,"טו").replace(/יו/g,"טז").split(""),1===t.length?t.push("'"):t.length>1&&t.splice(-1,0,'"'),t.join(""))}var n,r={},a={"":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,"תתר":1e3};for(n in a)r[a[n]]=n;void 0!==e?e.exports=t:window.gematriya=t}()},{}],3:[function(t,e,n){!function(){"use strict";function t(t){return t.valueOf()/I-.5+C}function r(t){return new Date((t+.5-C)*I)}function a(e){return t(e)-H}function i(t,e){return T(L(t)*S(D)-E(e)*L(D),S(t))}function o(t,e){return _(L(e)*S(D)+S(e)*L(D)*L(t))}function s(t,e,n){return T(L(t),S(t)*L(e)-E(n)*S(e))}function u(t,e,n){return _(L(e)*L(n)+S(e)*S(n)*S(t))}function h(t,e){return N*(280.16+360.9856235*t)-e}function c(t){return t<0&&(t=0),2967e-7/Math.tan(t+.00312536/(t+.08901179))}function f(t){return N*(357.5291+.98560028*t)}function l(t){return t+N*(1.9148*L(t)+.02*L(2*t)+3e-4*L(3*t))+102.9372*N+A}function y(t){var e=f(t),n=l(e);return{dec:o(n,0),ra:i(n,0)}}function m(t,e){return Math.round(t-k-e/(2*A))}function d(t,e,n){return k+(t+e)/(2*A)+n}function w(t,e,n){return H+t+.0053*L(e)-.0069*L(2*n)}function g(t,e,n){return M((L(t)-L(e)*L(n))/(S(e)*S(n)))}function p(t,e,n,r,a,i,o){return w(d(g(t,n,r),e,a),i,o)}function v(t){var e=N*(218.316+13.176396*t),n=N*(134.963+13.064993*t),r=N*(93.272+13.22935*t),a=e+6.289*N*L(n),s=5.128*N*L(r),u=385001-20905*S(n);return{ra:i(a,s),dec:o(a,s),dist:u}}function b(t,e){return new Date(t.valueOf()+e*I/24)}var A=Math.PI,L=Math.sin,S=Math.cos,E=Math.tan,_=Math.asin,T=Math.atan2,M=Math.acos,N=A/180,I=864e5,C=2440588,H=2451545,D=23.4397*N,O={};O.getPosition=function(t,e,n){var r=N*-n,i=N*e,o=a(t),c=y(o),f=h(o,r)-c.ra;return{azimuth:s(f,i,c.dec),altitude:u(f,i,c.dec)}};var Y=O.times=[[-.833,"sunrise","sunset"],[-.3,"sunriseEnd","sunsetStart"],[-6,"dawn","dusk"],[-12,"nauticalDawn","nauticalDusk"],[-18,"nightEnd","night"],[6,"goldenHourEnd","goldenHour"]];O.addTime=function(t,e,n){Y.push([t,e,n])};var k=9e-4;O.getTimes=function(t,e,n){var i,s,u,h,c,y=N*-n,g=N*e,v=a(t),b=m(v,y),A=d(0,y,b),L=f(A),S=l(L),E=o(S,0),_=w(A,L,S),T={solarNoon:r(_),nadir:r(_-.5)};for(i=0,s=Y.length;i<s;i+=1)u=Y[i],h=p(u[0]*N,y,g,E,b,L,S),c=_-(h-_),T[u[1]]=r(c),T[u[2]]=r(h);return T},O.getMoonPosition=function(t,e,n){var r=N*-n,i=N*e,o=a(t),f=v(o),l=h(o,r)-f.ra,y=u(l,i,f.dec),m=T(L(l),E(i)*S(f.dec)-L(f.dec)*S(l));return y+=c(y),{azimuth:s(l,i,f.dec),altitude:y,distance:f.dist,parallacticAngle:m}},O.getMoonIllumination=function(t){var e=a(t||new Date),n=y(e),r=v(e),i=M(L(n.dec)*L(r.dec)+S(n.dec)*S(r.dec)*S(n.ra-r.ra)),o=T(149598e3*L(i),r.dist-149598e3*S(i)),s=T(S(n.dec)*L(n.ra-r.ra),L(n.dec)*S(r.dec)-S(n.dec)*L(r.dec)*S(n.ra-r.ra));return{fraction:(1+S(o))/2,phase:.5+.5*o*(s<0?-1:1)/Math.PI,angle:s}},O.getMoonTimes=function(t,e,n,r){var a=new Date(t);r?a.setUTCHours(0,0,0,0):a.setHours(0,0,0,0);for(var i,o,s,u,h,c,f,l,y,m,d,w,g,p=.133*N,v=O.getMoonPosition(a,e,n).altitude-p,A=1;A<=24&&(i=O.getMoonPosition(b(a,A),e,n).altitude-p,o=O.getMoonPosition(b(a,A+1),e,n).altitude-p,h=(v+o)/2-i,c=(o-v)/2,f=-c/(2*h),l=(h*f+c)*f+i,y=c*c-4*h*i,m=0,y>=0&&(g=Math.sqrt(y)/(2*Math.abs(h)),d=f-g,w=f+g,Math.abs(d)<=1&&m++,Math.abs(w)<=1&&m++,d<-1&&(d=w)),1===m?v<0?s=A+d:u=A+d:2===m&&(s=A+(l<0?w:d),u=A+(l<0?d:w)),!s||!u);A+=2)v=o;var L={};return s&&(L.rise=b(a,s)),u&&(L.set=b(a,u)),s||u||(L[l>0?"alwaysUp":"alwaysDown"]=!0),L},"object"==typeof n&&void 0!==e?e.exports=O:"function"==typeof define&&define.amd?define(O):window.SunCalc=O}()},{}],4:[function(t,e,n){function r(t){return t=t.split(/\s+/).map(function(t,e,n){return"washington dc"===n.join(" ").toLowerCase()&&1===e?t.toUpperCase():t[0].toUpperCase()+t.slice(1).toLowerCase()}).join(" "),i[t]||[0,0,!1]}function a(){return Object.keys(i)}var i={Ashdod:[31.8,34.633,!0],Atlanta:[33.75,-84.383,!1],Austin:[30.266,-97.75,!1],Baghdad:[33.233,44.366,!1],"Beer Sheva":[31.25,34.783,!0],Berlin:[52.516,13.4,!1],Baltimore:[39.283,-76.6,!1],Bogota:[4.6,-74.083,!1],Boston:[42.333,-71.066,!1],"Buenos Aires":[-34.616,-58.4,!1],Buffalo:[42.883,-78.866,!1],Chicago:[41.833,-87.75,!1],Cincinnati:[39.1,-84.516,!1],Cleveland:[41.5,-81.683,!1],Dallas:[32.783,-96.8,!1],Denver:[39.733,-104.983,!1],Detroit:[42.333,-83.033,!1],Eilat:[29.55,34.95,!0],Gibraltar:[36.133,-5.35,!1],Haifa:[32.816,34.983,!0],Hawaii:[19.5,-155.5,!1],Houston:[29.766,-95.366,!1],Jerusalem:[31.783,35.233,!0],Johannesburg:[-26.166,28.033,!1],Kiev:[50.466,30.483,!1],"La Paz":[-16.5,-68.15,!1],Livingston:[40.283,-74.3,!1],London:[51.5,-.166,!1],"Los Angeles":[34.066,-118.25,!1],Miami:[25.766,-80.2,!1],Melbourne:[-37.866,145.133,!1],"Mexico City":[19.4,-99.15,!1],Montreal:[45.5,-73.6,!1],Moscow:[55.75,37.7,!1],"New York":[40.716,-74.016,!1],Omaha:[41.266,-95.933,!1],Ottawa:[45.7,-76.183,!1],"Panama City":[8.966,-79.533,!1],Paris:[48.866,2.333,!1],"Petach Tikvah":[32.083,34.883,!0],Philadelphia:[39.95,-75.166,!1],Phoenix:[33.45,-112.066,!1],Pittsburgh:[40.433,-80,!1],"Saint Louis":[38.633,-90.2,!1],"Saint Petersburg":[59.883,30.25,!1],"San Francisco":[37.783,-122.416,!1],Seattle:[47.6,-122.333,!1],Sydney:[-33.916,151.283,!1],"Tel Aviv":[32.083,34.766,!0],Tiberias:[32.966,35.533,!0],Toronto:[43.633,-79.4,!1],Vancouver:[49.266,-123.116,!1],"White Plains":[41.033,-73.75,!1],"Washington DC":[38.916,-77,!1]};n.getCity=r,n.listCities=a,n.addCity=function(t,e){if(!Array.isArray(e))throw new TypeError("adding non-array city");if(5==e.length){var n=e.slice();e=[],e[0]=(60*n[0]+n[1])/60,e[1]=(60*n[2]+n[3])/60,e[2]=n[4]}if(3!=e.length)throw new TypeError("length of city array is not 3");t=t.split(/\s+/).map(function(t){return t[0].toUpperCase()+t.slice(1).toLowerCase()}).join(" "),i[t]=e},n.nearest=function(t,e){if(Array.isArray(t)&&(t=(60*t[0]+t[1])/60),Array.isArray(e)&&(e=(60*e[0]+e[1])/60),"number"!=typeof t)throw new TypeError("incorrect lat type passed to nearest()");if("number"!=typeof e)throw new TypeError("incorrect long type passed to nearest()");return a().map(function(n){var a=r(n);return{name:n,dist:Math.sqrt(Math.pow(Math.abs(a[0]-t),2)+Math.pow(Math.abs(a[1]-e),2))}}).reduce(function(t,e){return t.dist<e.dist?t:e}).name}},{}],5:[function(t,e,n){function r(){Hebcal.ready=!0,a=Hebcal.events.emit("ready")}window.Hebcal=t("..");var a=!1,i="undefined"!=typeof console&&(console.warn||console.log)||function(){};Hebcal.events.on("newListener",function(t){"ready"===t&&!a&&Hebcal.ready&&r()}),Object.defineProperty(Hebcal,"onready",{configurable:!0,get:function(){return i("Getting deprecated property Hebcal.onready"),Hebcal.events.listeners("ready")[0]},set:function(t){i("Setting deprecated property Hebcal.onready; use Hebcal.events.on('ready', func) instead"),Hebcal.events.on("ready",t)}}),navigator.geolocation?(Hebcal.ready=!1,navigator.geolocation.getCurrentPosition(function(t){Hebcal.defaultLocation=[t.coords.latitude,t.coords.longitude],r()},r)):r()},{"..":10}],6:[function(t,e,n){function r(t){return(1+7*t)%19<7}function a(t){var e=235*Math.floor((t-1)/19)+(t-1)%19*12+Math.floor(((t-1)%19*7+1)/19),n=204+e%1080*793,a=5+12*e+793*Math.floor(e/1080)+Math.floor(n/1080),i=n%1080+a%24*1080,o=1+29*e+Math.floor(a/24),s=o+(i>=19440||2==o%7&&i>=9924&&!r(t)||1==o%7&&i>=16789&&r(t-1));return s+(s%7==0||s%7==3||s%7==5)}function i(t){return a(t+1)-a(t)}function o(t){return i(t)%10==5}function s(t){return i(t)%10==3}function u(t){switch(t.toLowerCase()[0]){case"n":case"נ":return"o"==t.toLowerCase()[1]?0:f.NISAN;case"i":return f.IYYAR;case"e":return f.ELUL;case"c":case"ח":return f.CHESHVAN;case"k":case"כ":return f.KISLEV;case"s":switch(t.toLowerCase()[1]){case"i":return f.SIVAN;case"h":return f.SHVAT;default:return 0}case"t":switch(t.toLowerCase()[1]){case"a":return f.TAMUZ;case"i":return f.TISHREI;case"e":return f.TEVET}break;case"a":switch(t.toLowerCase()[1]){case"v":return f.AV;case"d":return/(1|[^i]i|a|א)$/i.test(t)?f.ADAR_I:f.ADAR_II}break;case"ס":return f.SIVAN;case"ט":return f.TEVET;case"ש":return f.SHVAT;case"א":switch(t.toLowerCase()[1]){case"ב":return f.AV;case"ד":return/(1|[^i]i|a|א)$/i.test(t)?f.ADAR_I:f.ADAR_II;case"י":return f.IYYAR;case"ל":return f.ELUL}break;case"ת":switch(t.toLowerCase()[1]){case"מ":return f.TAMUZ;case"ש":return f.TISHREI}}return 0}function h(t,e,n){if(null===t)throw new TypeError("self is null");switch(typeof e){case"function":break;case"string":case"number":return t[e];case"boolean":e=e?function(t){return t}:function(t){return!t};break;case"object":var r=e;if(e instanceof RegExp){e=function(t){return r.test(t)};break}if(Array.isArray(e)){e=function(t,e){return r.indexOf(e)>-1};break}default:throw new TypeError("fun is not a supported type")}var a={},i=Object(t);for(var o in i)if(i.hasOwnProperty(o)){var s=i[o];if(e.call(n,s,o,i)){var u=Object.getOwnPropertyDescriptor(i,o);u.value=s,Object.defineProperty(a,o,u)}}if(Array.isArray(t)||"string"==typeof t){var h=[];for(o in a)h[Number(o)]=a[o];a=h.filter(function(t){return t}),"string"==typeof t&&(a=a.join(""))}return a}var c=t("gematriya"),f=n.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},l=[["",0,""],["Nisan",0,"ניסן"],["Iyyar",0,"אייר"],["Sivan",0,"סיון"],["Tamuz",0,"תמוז"],["Av",0,"אב"],["Elul",0,"אלול"],["Tishrei",0,"תשרי"],["Cheshvan",0,"חשון"],["Kislev",0,"כסלו"],["Tevet",0,"טבת"],["Sh'vat",0,"שבט"]];n.monthNames=[l.concat([["Adar",0,"אדר"],["Nisan",0,"ניסן"]]),l.concat([["Adar 1",0,"אדר א'"],["Adar 2",0,"אדר ב'"],["Nisan",0,"ניסן"]])],n.days={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6},n.LANG=function(t,e){return"h"==e&&t[2]||"a"==e&&t[1]||t[0]},n.LEAP=r,n.MONTH_CNT=function(t){return 12+r(t)},n.daysInMonth=function(t,e){return 30-(t==f.IYYAR||t==f.TAMUZ||t==f.ELUL||t==f.TEVET||t==f.ADAR_II||t==f.ADAR_I&&!r(e)||t==f.CHESHVAN&&!o(e)||t==f.KISLEV&&s(e))},n.monthNum=function(t){return"number"==typeof t?t:t.charCodeAt(0)>=1488&&t.charCodeAt(0)<=1514&&/('|")/.test(t)?c(t):t.charCodeAt(0)>=48&&t.charCodeAt(0)<=57?parseInt(t,10):u(t)},n.dayYearNum=function(t){return"number"==typeof t?t:t.charCodeAt(0)>=1488&&t.charCodeAt(0)<=1514?c(t,!0):parseInt(t,10)},n.hebElapsedDays=a,n.daysInYear=i,n.lngChesh=o,n.shrtKis=s,n.monthFromName=u,n.dayOnOrBefore=function(t,e){return e-(e-t)%7},n.map=function(t,e,n){if(null===t||"function"!=typeof e)throw new TypeError;var r=Object(t),a={};for(var i in r)r.hasOwnProperty(i)&&(a[i]=e.call(n,r[i],i,r));if(Array.isArray(t)||"string"==typeof t){var o=[];for(i in a)o[Number(i)]=a[i];a=h(o,!0),"string"==typeof t&&(a=a.join(""))}return a},n.filter=h,n.range=function(t,e,n){(n=n||1)<0&&(n=0-n);var r=[],a=t;if(t<e)for(;a<=e;a+=n)r.push(a);else for(;a>=e;a-=n)r.push(a);return r}},{gematriya:2}],7:[function(t,e,n){var r=t("./common"),a=t("./greg"),i=t("gematriya"),o=[["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(t){return{name:t.slice(0,3),blatt:t[3]}});n.dafyomi=function(t){var e,n,r,i,s,u,h,c,f;if(!(t instanceof Date))throw new TypeError("non-date given to dafyomi");if(r=a.greg2abs(new Date(1923,8,11)),i=a.greg2abs(new Date(1975,5,24)),(c=a.greg2abs(t))<r)return{name:[],blatt:0};for(c>=i?(e=8+(c-i)/2711,n=(c-i)%2711):(e=1+(c-r)/2702,n=(c-r)%2702),s=f=0,u=-1,o[4].blatt=e<=7?13:22,h=0;h<40;){if(u++,s=s+o[h].blatt-1,n<s){switch(f=o[h].blatt+1-(s-n),u){case 36:f+=21;break;case 37:f+=24;break;case 38:f+=33}h=41}h++}return{name:o[u].name,blatt:f}},n.dafname=function(t,e){return r.LANG(t.name,e)+" "+("h"===e?i(t.blatt):t.blatt)}},{"./common":6,"./greg":8,gematriya:2}],8:[function(t,e,n){function r(t){if(!t instanceof Date)throw new TypeError("Argument to greg.dayOfYear not a Date");var e=t.getDate()+31*t.getMonth();return t.getMonth()>1&&(e-=i((4*(t.getMonth()+1)+23)/10),a(t.getFullYear())&&e++),e}function a(t){return!(t%4||!(t%100)&&t%400)}var i=Math.floor,o=[30,31],s=[0,31,28,31].concat(o,o,31,o,o),u=[s.slice()];s[2]++,u.push(s),n.daysInMonth=function(t,e){return u[+a(e)][t]},n.monthNames=["","January","February","March","April","May","June","July","August","September","October","November","December"],n.lookupMonthNum=function(t){return new Date(t+" 1").getMonth()+1},n.dayOfYear=r,n.LEAP=a,n.greg2abs=function(t){var e=t.getFullYear()-1;return r(t)+365*e+(i(e/4)-i(e/100)+i(e/400))},n.abs2greg=function(t){var e=t-1,n=i(e/146097),r=i(e%146097),a=i(r/36524),o=r%36524,s=i(o/1461),u=o%1461,h=i(u/365),c=u%365+1,f=400*n+100*a+4*s+h;return 4==a||4==h?new Date(f,11,31):new Date(new Date(++f,0,c).setFullYear(f))}},{}],9:[function(t,e,n){function r(t,e,n){var a=this;switch(arguments.length){case 0:return new r(new Date);case 1:if(void 0===t)return new r;if(t instanceof Date){var i=u(y.greg2abs(t));return i}if(t instanceof r){var i=new r(t[v](),t[p](),t[g]());return i.il=t.il,i.setLocation(i.lat,i.long),i}if("string"==typeof t){switch(t.toLowerCase().trim()){case"today":return new r;case"yesterday":return(new r).prev();case"tomorrow":return(new r).next()}if(/\s/.test(t)){var o=t.split(/\s+/);if(2==o.length)return new r(o[0],o[1]);if(3==o.length)return new r(o[0],o[1],o[2]);if(4==o.length)return/i/i.test(o[2])&&(o[2]=o[2].length),new r(o[0],o[1]+o[2],o[3])}}else if("number"==typeof t)return u(t);throw new TypeError("HDate called with bad argument");case 2:return new r(t,e,(new r)[g]());case 3:a.day=a.month=1,a.year=l.dayYearNum(n),a.setMonth(l.monthNum(e)),a.setDate(l.dayYearNum(t));break;default:throw new TypeError("HDate called with bad arguments")}return a.setLocation.apply(a,r.defaultLocation)}function a(t){o(t),i(t)}function i(t){t.day<1&&(t.month==E&&(t.year-=1),t.day+=T(t.month,t.year),t.month-=1,a(t)),t.day>T(t.month,t.year)&&(t.month==S.ELUL&&(t.year+=1),t.day-=T(t.month,t.year),t.month+=1,a(t)),o(t)}function o(t){t.month!=S.ADAR_II||t.isLeapYear()||(t.month-=1,a(t)),t.month<1&&(t.month+=_(t.year),t.year-=1,a(t)),t.month>_(t.year)&&(t.month-=_(t.year),t.year+=1,a(t))}function s(t){var e,n=t[v](),r=t[g]();if(t[p]()<E){for(e=E;e<=_(r);e++)n+=T(e,r);for(e=S.NISAN;e<t[p]();e++)n+=T(e,r)}else for(e=E;e<t[p]();e++)n+=T(e,r);return l.hebElapsedDays(r)-1373429+n}function u(t){var e,n,a,i,o=[S.KISLEV,S.TEVET,S.SHVAT,S.ADAR_I,S.NISAN,S.IYYAR,S.SIVAN,S.TAMUZ,E,E,E,S.CHESHVAN];if(t>=10555144)throw new RangeError("parameter to abs2hebrew "+t+" out of range");for(n=y.abs2greg(t),e=new r(1,E,i=3760+n[g]());t>=s(e.setFullYear(i+1));)i++;for(a=i>4634&&i<10666?o[n[p]()]:E;t>s(e=new r(T(a,i),a,i));)a=a%_(i)+1;return e.setLocation.apply(e.setDate(t-s(e.setDate(1))+1),r.defaultLocation)}function h(t){var e=t.greg();return m.getTimes(new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0,0,0),t.lat,t.long)}function c(t,e){return new Date(t.sunrise()[b]()+t[L]()*e)}function f(t,e,n){return new r(M(t,e[A]()+n)).setLocation(e.lat,e.long)}var l=t("./common"),y=t("./greg"),m=t("suncalc"),d=t("./cities"),w=t("gematriya");m.addTime(-16.1,"alot_hashachar",0),m.addTime(-11.5,"misheyakir",0),m.addTime(-10.2,"misheyakir_machmir",0),m.addTime(-8.5,0,"tzeit");var g="getFullYear",p="getMonth",v="getDate",b="getTime",A="abs",L="hour",S=l.months,E=S.TISHREI,_=l.MONTH_CNT,T=l.daysInMonth,M=l.dayOnOrBefore,N=r.prototype;r.defaultLocation=[0,0],Object.defineProperty(r,"defaultCity",{enumerable:!0,configurable:!0,get:function(){return d.nearest(r.defaultLocation[0],r.defaultLocation[1])},set:function(t){r.defaultLocation=d.getCity(t).slice(0,2)}}),N[g]=function(){return this.year},N.isLeapYear=function(){return l.LEAP(this.year)},N[p]=function(){return this.month},N.getTishreiMonth=function(){var t=_(this[g]());return(this[p]()+t-6)%t||t},N.daysInMonth=function(){return T(this[p](),this[g]())},N[v]=function(){return this.day},N.getDay=function(){return this.greg().getDay()},N.setFullYear=function(t){return this.year=t,a(this),this},N.setMonth=function(t){return this.month=l.monthNum(t),a(this),this},N.setTishreiMonth=function(t){return this.setMonth((t+6)%_(this[g]())||13)},N.setDate=function(t){return this.day=t,a(this),this},N.greg=function(){return y.abs2greg(s(this))},N.gregEve=function(){return this.prev().sunset()},N[A]=function(){return s(this)},N.toString=function(t){return l.LANG([this[v](),null,w(this[v]())],t)+" "+this.getMonthName(t)+" "+l.LANG([this[g](),null,w(this[g]())],t)},N.getMonthName=function(t){return l.LANG(l.monthNames[+this.isLeapYear()][this[p]()],t)},N.setCity=function(t){return this.setLocation(d.getCity(t))},N.setLocation=function(t,e){if("object"!=typeof t||Array.isArray(t)||(e=t.long,t=t.lat),Array.isArray(t)&&void 0===e&&(e=t[1],t=t[0]),Array.isArray(t)&&(t=(60*t[0]+t[1])/60),Array.isArray(e)&&(e=(60*e[0]+e[1])/60),"number"!=typeof t)throw new TypeError("incorrect lat type passed to HDate.setLocation()");if("number"!=typeof e)throw new TypeError("incorrect long type passed to HDate.setLocation()");return this.lat=t,this.long=e,this.il=d.getCity(d.nearest(t,e))[2],this},N.sunrise=function(){return h(this).sunrise},N.sunset=function(){return h(this).sunset},N[L]=function(){return(this.sunset()-this.sunrise())/12},N.hourMins=function(){return this[L]()/6e4},N.nightHour=function(){return(this.sunrise()-this.gregEve())/12},N.nightHourMins=function(){return this.nightHour()/6e4};var I={chatzot:function(t){return c(t,6)},chatzot_night:function(t){return new Date(t.sunrise()[b]()-6*t.nightHour())},alot_hashachar:function(t){return h(t).alot_hashachar},alot_hashacher:function(t){return h(t).alot_hashachar},misheyakir:function(t){return h(t).misheyakir},misheyakir_machmir:function(t){return h(t).misheyakir_machmir},sof_zman_shma:function(t){return c(t,3)},sof_zman_tfilla:function(t){return c(t,4)},mincha_gedola:function(t){return c(t,6.5)},mincha_ketana:function(t){return c(t,9.5)},plag_hamincha:function(t){return c(t,10.75)},tzeit:function(t){return h(t).tzeit},neitz_hachama:function(t){return t.sunrise()},shkiah:function(t){return t.sunset()}};N.getZemanim=function(){return l.map(I,function(t){return t(this)},this)},r.addZeman=function(t,e){I[t]=e},N.next=function(){return u(this.abs()+1).setLocation(this.lat,this.long)},N.prev=function(){return u(this.abs()-1).setLocation(this.lat,this.long)},N.isSameDate=function(t){return t instanceof r&&(-1==t[g]()&&(t=new r(t).setFullYear(this[g]())),this[A]()==t[A]())},N.before=function(t){return f(t,this,-1)},N.onOrBefore=function(t){return f(t,this,0)},N.nearest=function(t){return f(t,this,3)},N.onOrAfter=function(t){return f(t,this,6)},N.after=function(t){return f(t,this,7)},e.exports=r},{"./cities":4,"./common":6,"./greg":8,gematriya:2,suncalc:3}],10:[function(t,e,n){function r(t,e){return{enumerable:!0,configurable:!0,get:t,set:e}}function a(t,e){for(var n in e)t[n]=e[n];return t}function i(t,e){var n=this;if(t||(t=(new c)[T]()),"number"!=typeof t)throw new v("year to Hebcal() is not a number");if(n.year=t,!e)return new i(t,h.range(1,h.MONTH_CNT(t)));if("string"==typeof e&&(e=h.monthFromName(e)),"number"==typeof e&&(e=[e]),!Array.isArray(e))throw new v("month to Hebcal is not a valid type");n.months=e[S](function(e){var r=new o(e,t);return p(r,"__year",{configurable:!0,writable:!0,value:n}),r}),n.holidays=f.year(t),n[N]=h.daysInYear(t),p(n,"il",r(function(){return n[_](1).il},function(t){n.months.forEach(function(e){e.il=t})})),p(n,"lat",r(function(){return n[_](1).lat},function(t){n.months.forEach(function(e){e.lat=t})})),p(n,"long",r(function(){return n[_](1).long},function(t){n.months.forEach(function(e){e.long=t})}))}function o(t,e){var n=this;if("number"!=typeof(t=h.monthNum(t)))throw new v("month to Hebcal.Month is not a valid type");if("number"!=typeof e)throw new v("year to Hebcal.Month is not a number");return n.month=t,n.year=e,n.days=h.range(1,h.daysInMonth(t,e))[S](function(r){var a=new c(r,t,e);return p(a,"__month",{configurable:!0,writable:!0,value:n}),a}),n[N]=n.days[N],n.holidays=h.filter(f.year(e),function(e){return e[0].date[_]()==t}),p(n,"il",r(function(){return n[E](1).il},function(t){n.days.forEach(function(e){e.il=t})})),p(n,"lat",r(function(){return n[E](1).lat},function(t){n.days.forEach(function(e){e.lat=t})})),p(n,"long",r(function(){return n[E](1).long},function(t){n.days.forEach(function(e){e.long=t})})),n}function s(t,e){var n=this;if(t||(t=(new Date)[T]()),"string"==typeof t){var i=new Date(t);return e=t.indexOf(" ")+1||t.indexOf("-")+1||t.indexOf("/")+1?i[_]()+1:h.range(1,12),new s(i[T](),e)}if("number"!=typeof t)throw new v("year to Hebcal.GregYear() is not a number");if(n.year=t,!e)return new s(t,h.range(1,12));if("string"==typeof e&&(e=d.lookupMonthName(e)),"number"==typeof e&&(e=[e]),!Array.isArray(e))throw new v("month to Hebcal.GregYear() is not a valid type");return n.months=e[S](function(e){var r=new u(e,t);return p(r,"__year",{configurable:!0,writable:!0,value:n}),r}),n.hebyears=[].concat.apply([],n.months[S](function(t){return t.hebmonths[S](function(t){return t.year})})).filter(function(t,e,n){return n.indexOf(t)===e}),n.holidays=h.filter(f.year(n.hebyears[0]),function(e){return e[0].date.greg()[T]()===t&&n.months.filter(function(t){return t.month===e[0].date.greg()[_]()+1})[N]}),n.hebyears[1]&&a(n.holidays,h.filter(f.year(n.hebyears[1]),function(e){return e[0].date.greg()[T]()===t&&n.months.filter(function(t){return t.month===e[0].date.greg()[_]()+1})[N]})),n[N]=365+d.LEAP(t),p(n,"il",r(function(){return n[_](1).il},function(t){n.months.forEach(function(e){e.il=t})})),p(n,"lat",r(function(){return n[_](1).lat},function(t){n.months.forEach(function(e){e.lat=t})})),p(n,"long",r(function(){return n[_](1).long},function(t){n.months.forEach(function(e){e.long=t})})),n}function u(t,e){var n=this;if("string"==typeof t&&(t=d.lookupMonthNum(t)),"number"!=typeof t)throw new v("month to Hebcal.GregMonth is not a valid type");if("number"!=typeof e)throw new v("year to Hebcal.GregMonth is not a number");return n.year=e,n.month=t,n.days=h.range(1,d.daysInMonth(t,e))[S](function(r){var a=new c(new Date(e,t-1,r));return p(a,"__gregmonth",{configurable:!0,writable:!0,value:n}),a}),n[N]=n.days[N],n.hebmonths=[{month:n[E](1)[_](),year:n[E](1)[T]()},{month:n[E](-1)[_](),year:n[E](-1)[T]()}].filter(function(t,e,n){return 0===e||t.month!=n[0].month}),p(n,"il",r(function(){return n[E](1).il},function(t){n.days.forEach(function(e){e.il=t})})),p(n,"lat",r(function(){return n[E](1).lat},function(t){n.days.forEach(function(e){e.lat=t})})),p(n,"long",r(function(){return n[E](1).long},function(t){n.days.forEach(function(e){e.long=t})})),n}var h=t("./common"),c=t("./hdate"),f=t("./holidays"),l=t("./sedra"),y=t("./dafyomi"),m=t("./cities"),d=t("./greg"),w=t("events").EventEmitter,g=t("gematriya"),p=Object.defineProperty,v=TypeError,b="find",A="strings",L="getYearObject",S="map",E="getDay",_="getMonth",T="getFullYear",M="isLeapYear",N="length",I="next",C="prev",H=h.months,D=H.TISHREI,O=H.NISAN,Y=i.prototype,k=o.prototype,R=s.prototype,P=u.prototype,V=c.prototype;Y[M]=V[M],Y.setCity=function(t){return this.months.forEach(function(e){e.setCity(t)}),this},Y.setLocation=function(t,e){return this.months.forEach(function(n){n.setLocation(t,e)}),this},Y[I]=function(){return new i(this.year+1)},Y[C]=function(){return new i(this.year-1)},Y[_]=function(t){var e=this.months;return t=h.monthNum(t),t>this.months[N]?this[I]()[_](t-e[N]):e[t>0?t-1:e[N]+t]},Y[E]=function(t){var e=this;if(t>e[N])return null;if(t<0)return e[E](e[N]-t);var n=e[b](29,H.ELUL)[0].abs()+1-e[b](1,O)[0].abs();return t<=n?e[_](O)[E](t):e[_](D)[E](t-n)},Y.days=function(){return[].concat.apply([],this.months[S](function(t){return t.days}))},Y[S]=function(){return[][S].apply(this.days(),arguments)},Y.filter=function(){return[].filter.apply(this.days(),arguments)},Y.addHoliday=function(t){if(!(t instanceof f.Event))throw new v("non-Event passed to addHoliday()");return this.holidays.add(t),this},Y.findParsha=function(t,e){
var n=e?[e]:["s","a","h"],r=this.filter(function(e){return Math.max.apply(null,n.map(function(n){return e.getSedra(n).indexOf(t)+1}))});return r[r[N]-1]},Y.findSedra=Y.findParsha,Y[b]=function t(e,n){var r=this;if(1===arguments[N]){if("string"==typeof e)return t[A].call(r,e);if(Array.isArray(e))return[].concat.apply([],e[S](function(t){return r[b][Array.isArray(t)?"apply":"call"](r,t)}));if(e instanceof c)return r[b](e.getDate(),e[_]());if(e instanceof Date)return r[b](new c(e))}else if(2==arguments[N]){if(n instanceof o)return n[b](e);if(Array.isArray(n))return[].concat.apply([],n[S](function(t){return r[b](e,t)}));if("string"==typeof n)return r[b](e,h.monthNum(n));if("number"==typeof n)return r[b](e,r[_](n))}return[]},Y[b][A]=function t(e){var n=e.split(/\s+/),r=t[e.replace(/\s/g,"_").toLowerCase()];if(!n[N])return[];if(r)return r.call(this);try{return this[b](new c(e))}catch(t){return n[N]-1?this[b].apply(this,n):[]}},Y[b][A].rosh_chodesh=function(){return this[b]("Rosh Chodesh",h.range(1,this.months[N]))},Y[b][A].holidays=function(){return[].concat.apply([],this.holidays[S](function(t){return this[b](t.date)},this))},Y[b][A].omer=function(){return this[b](h.range(16,64),O)},Y[b][A].today=function(){return this[b](new c)},Y[b][A].yesterday=function(){return[this[b]("today")[0][C]()]},Y[b][A].tomorrow=function(){return[this[b]("today")[0][I]()]},Y[b][A].pesach=function(){return this[b](h.range(15,23-this.il),O)},Y[b][A].sukkot=function(){return this[b](h.range(15,24-this.il),D)},Y[b][A].succot=Y[b][A].succos=Y[b][A].sukkos=Y[b][A].sukkot,Y[b][A].shavuot=function(){return this[b](h.range(6,7-this.il),H.SIVAN)},Y[b][A].shavuos=Y[b][A].shavuot,Y[b][A].rosh_hashana=function(){return this[b](h.range(1,2),D)},Y[b][A].rosh_hashanah=Y[b][A].rosh_hashana,i.addZeman=c.addZeman,i.cities=m,i.range=h.range,i.gematriya=g,i.holidays=h.filter(f,["masks","Event"]),i.parshiot=l.parshiot,i.LANGUAGE=h.LANG,i[S]=h[S],i.filter=h.filter,p(i,"defaultLocation",r(function(){return c.defaultLocation},function(t){i.events.emit("locationChange",c.defaultLocation),c.defaultLocation=t})),p(i,"defaultCity",r(function(){return c.defaultCity},function(t){i.defaultLocation=m.getCity(t).slice(0,2)})),p(i,"candleLighting",r(function(){return f.Event.candleLighting},function(t){f.Event.candleLighting=t})),p(i,"havdalah",r(function(){return f.Event.havdalah},function(t){f.Event.havdalah=t})),i.Month=o,k[M]=V[M],k[C]=function(){var t=this,e=t[L]();return 1===t.month?e[_](-1):t.month===D?e[C]()[_](H.ELUL):e[_](t.month-1)},k[I]=function(){var t=this,e=t[L]();return t.month===h.MONTH_CNT(t.year)?e[_](1):t.month===H.ELUL?e[I]()[_](D):e[_](t.month+1)},k[E]=function(t){var e=this.days;return t=h.dayYearNum(t),t>e[N]?this[I]()[E](t-e[N]):e[t>0?t-1:e[N]+t]},k[L]=function(){return this.__year||new i(this.year)},k.getName=function(t){return h.LANG(h.monthNames[+this[M]()][this.month],t)},k.rosh_chodesh=function(){var t=this[C]();return 30==t[N]?[t[E](-1),this[E](1)]:[this[E](1)]},k.setCity=function(t){return this.days.forEach(function(e){e.setCity(t)}),this},k.setLocation=function(t,e){return this.days.forEach(function(n){n.setLocation(t,e)}),this},k[S]=function(){return[][S].apply(this.days,arguments)},k.molad=function(){var t,e,n,r,a,i,o={},s=parseInt;i=this.month-7,t=this.year-1,i<0&&(i+=h.MONTH_CNT(t+1)),e=s(i+t/19*235),n=s(204+e%1080*793),r=s(5+12*e+e/1080*793-6),a=s(n%1080+r%24*1080),o.doy=new c(s(1+29*e+r/24)).getDay(),o.hour=Math.round(r%24);var u=s(a%1080);o.minutes=s(u/18),o.chalakim=u%18;var f=this.prev().find.strings.shabbat_mevarchim._calc.call(this)[0].onOrAfter(o.doy).greg();return f.setHours(o.hour),f.setMinutes(o.minutes),f.setSeconds(3.33*o.chalakim),o.day=f,o},k[b]=function t(e){var n=this;return"number"==typeof e?[n[E](e)]:"string"==typeof e?t[A].call(n,e):Array.isArray(e)?[].concat.apply([],e[S](function(t){return n[b](t)})):e instanceof c&&e[T]()==n.year&&e[_]()==n.month?n[b](e.getDate()):e instanceof Date?n[b](new c(e)):[]},k[b][A]=function t(e){var n=t[e.replace(/\s/g,"_").toLowerCase()];if(n)return n.call(this);try{return this[b](new c(e))}catch(t){var r=h.dayYearNum(e);return r?this[b](r):[]}},k[b][A].rosh_chodesh=function(){return this.rosh_chodesh()},k[b][A].shabbat_mevarchim=function t(){return this.month===H.ELUL?[]:t._calc.call(this)},k[b][A].shabbat_mevarchim._calc=function(){return this[b](this[E](29).onOrBefore(h.days.SAT))},k[b][A].shabbos_mevarchim=k[b][A].shabbos_mevorchim=k[b][A].shabbat_mevarchim,i.HDate=c,V.getMonthObject=function(){return this.__month||new o(this[_](),this[T]())},V[L]=function(){return this.getMonthObject()[L]()},function(){var t={};[C,I].forEach(function(e){t[e]=V[e],V[e]=function(){var n=t[e].call(this);return this.__month?this[L]()[b](n)[0]:n}})}();var x=function(){var t={};return function(e){var n=t[e[T]()];return n&&n.il==e.il||(n=t[e[T]()]=new l(e[T](),e.il)),n}}();V.getSedra=function(t){return x(this).get(this)[S](function(e){return h.LANG(e,t)})},V.getParsha=V.getSedra,V.isSedra=function(){return x(this).isParsha(this)},V.isParsha=V.isSedra,V.holidays=function(t){var e=this,n=e[L]().holidays[e];return n?n.filter(function(n){return!!t||!n.routine()&&n.is(e)})[S](function(t){return t.date.setLocation(e),t}):[]},["candleLighting","havdalah"].forEach(function(t){V[t]=function(){var e=this,n=e.holidays(!0).filter(function(t){return t.is(e)});return n.length&&(n=h.filter(n.map(function(e){return e[t]()}),!0)),n.length?new Date(Math.max.apply(null,n)):null}}),V.omer=function(){var t=this,e=t.greg().getTime(),n=t[T]();return e>new c(15,O,n).greg().getTime()&&e<new c(6,H.SIVAN,n).greg().getTime()?t.abs()-new c(16,O,n).abs()+1:0},V.dafyomi=function(t){return y.dafname(y.dafyomi(this.greg()),t)},V.tachanun=function(){function t(){function t(t){return t[S](function(t){return t.abs()})}var o,s,u,c=!arguments[0],l=this,y=l[L](),m=y.year;if(i.il[m]===l.il?(o=i.all[m],s=i.some[m],u=i.yes_prev[m]):(o=i.all[m]=t(y[b]("Rosh Chodesh").concat(y[b](h.range(1,h.daysInMonth(O,m)),O),y[b](48,O),y[b](h.range(1,8-l.il),H.SIVAN),y[b]([9,15],H.AV),y[b](-1,H.ELUL),y[b]([1,2],D),y[b](h.range(9,24-l.il),D),y[b](h.range(25,33),H.KISLEV),y[b](15,H.SHVAT),y[b]([14,15],y[M]()?[H.ADAR_I,H.ADAR_II]:H.ADAR_I))),s=i.some[m]=t([].concat(y[b](h.range(1,13),H.SIVAN),y[b](h.range(20,31),D),y[b](14,H.IYYAR),f.atzmaut(m)[1].date||[],m>=5727?y[b](29,H.IYYAR):[])),u=i.yes_prev[m]=t([].concat(y[b](-1,H.ELUL),y[b](9,H.TISHREI),y[b](14,H.IYYAR))),i.il[m]=l.il),o=o.indexOf(l.abs())>-1,s=s.indexOf(l.abs())>-1,u=u.indexOf(l.abs()+1)>-1,o)return e;var d=(!s&&a)|(6!=l[E]()&&r);return d|=c&&!u?l[I]().tachanun(!0)&r&&n:5!=l[E]()&&n,d==a?e:d}var e=t.NONE=0,n=t.MINCHA=1,r=t.SHACHARIT=2,a=t.ALL_CONGS=4,i={all:{},some:{},yes_prev:{},il:{}};return t}(),V.tachanun_uf=function(){var t=this.tachanun();return{shacharit:!!(t&this.tachanun.SHACHARIT),mincha:!!(t&this.tachanun.MINCHA),all_congs:!!(t&this.tachanun.ALL_CONGS)}},V.hallel=function(){function t(){var t=this,i=t[L](),o=i.year,s=a.il[o]==t.il&&a.whole[o]||(a.whole[o]=[].concat(i[b](h.range(25,33),H.KISLEV),i[b]([15,t.il?null:16],O),i[b]("Shavuot"),i[b]("Sukkot"),f.atzmaut(o)[1].date||[],o>=5727?i[b](29,H.IYYAR):[])[S](function(t){return t.abs()})),u=a.il[o]==t.il&&a.half[o]||(a.half[o]=[].concat(i[b]("Rosh Chodesh").filter(function(t){return t[_]()!=D}),i[b](h.range(17-t.il,23-t.il),O))[S](function(t){return t.abs()}));return a.il[o]=t.il,s.indexOf(t.abs())>-1&&r||u.indexOf(t.abs())>-1&&n||e}var e=t.NONE=0,n=t.HALF=1,r=t.WHOLE=2,a={whole:{},half:{},il:{}};return t}(),function(t){function e(){function e(t,e){return h.filter(h[S](t,function(t){return t-r}),function(t){return t>0&&t-e<0})}var n=new c;i.isSameDate(n)||(t.emit("dayChange"),i=n);var r=new Date,a=e(n.getZemanim(),t.beforeZeman),o=e(t.customs,t.refreshInterval);for(var s in a)t.emit("almostZeman",s,a[s]),a[s]<t.refreshInterval&&t.emit("atZeman",s);for(var u in o)t.emit("custom",u)}var n,a,i=new c;p(t,"refreshInterval",r(function(){return n},function(t){a&&(a=clearInterval(a)),n=t,t&&(a=setInterval(e,t),a.unref&&a.unref())})),t.beforeZeman=6e5,e(),t.refreshInterval=3e5,t.customs={}}(i.events=new w),i.GregYear=s,R[M]=function(){return 366==this[N]},R.setCity=Y.setCity,R.setLocation=Y.setLocation,R[I]=function(){return new s(this.year+1)},R[C]=function(){return new s(this.year-1)},R[_]=function(t){var e=this.months;return t="number"==typeof t?t:d.lookupMonthNum(t),t>e[N]?this[I]()[_](t-e[N]):e[t>0?t-1:e[N]+t]},a(R,{days:Y.days,map:Y[S],filter:Y.filter,addHoliday:Y.addHoliday}),i.GregMonth=u,P[M]=function(){return d.LEAP(this.year)},P[C]=function(){return 1===this.month?this[L]()[C]()[_](-1):this[L]()[_](this.month-1)},P[I]=function(){return this[L]()[_](this.month+1)},P[E]=function(t){return t>this.days[N]?this[I]()[E](t-this.days[N]):this.days[t>0?t-1:this.days[N]+t]},P[L]=function(){return this.__year||new s(this.year)},P.getName=function(){return d.monthNames[this.month]},P.setCity=k.setCity,P.setLocation=k.setLocation,P[S]=k[S],V.getGregMonthObject=function(){return this.__gregmonth||new u(this.greg()[_]()+1,this.greg()[T]())},V.getGregYearObject=function(){return this.getGregMonthObject()[L]()},e.exports=i},{"./cities":4,"./common":6,"./dafyomi":7,"./greg":8,"./hdate":9,"./holidays":11,"./sedra":12,events:1,gematriya:2}],11:[function(t,e,n){function r(t){return["Chanukah: Candle "+t,0,"חנוכה: נר "+f(t)]}function a(t){return[t[0]+' (CH"M)',t[1]?t[1]+' (CH"M)':t[1],t[2]?t[2]+' )חוה"מ(':t[2]]}function i(t){return["Sukkot: "+t,"Succos: "+t,"סוכות יום "+f(t)]}function o(t){return["Pesach: "+t,0,"פסח יום "+f(t)]}function s(t,e,n){var r=this;r.date=new c(t),r.desc="object"!=typeof e?[e]:e,r.USER_EVENT=!!(n&E),r.LIGHT_CANDLES=!!(n&_),r.YOM_TOV_ENDS=!!(n&T),r.CHUL_ONLY=!!(n&M),r.IL_ONLY=!!(n&N),r.LIGHT_CANDLES_TZEIS=!!(n&I)}function u(t){if(t>=5708){var e=new c(1,m.IYYAR,t),n=new c(15,p,t);return n[b]()==d.SUN?e.setDate(2):n[b]()==v?e.setDate(3):t<5764?e.setDate(4):n[b]()==d.TUE?e.setDate(5):e.setDate(4),[new s(e,["Yom HaZikaron",0,"יום הזיכרון"],0),new s(e.next(),["Yom HaAtzma'ut",0,"יום העצמאות"],0)]}return[]}var h=t("./common"),c=t("./hdate"),f=t("gematriya"),l={},y=h.dayOnOrBefore,m=h.months,d=h.days,w=m.TISHREI,g=m.KISLEV,p=m.NISAN,v=d.SAT,b="getDay",A="abs",L="Shabbat",S="Shabbos",E=1,_=2,T=4,M=8,N=16,I=32;n.masks={USER_EVENT:E,LIGHT_CANDLES:_,YOM_TOV_ENDS:T,CHUL_ONLY:M,IL_ONLY:N,LIGHT_CANDLES_TZEIS:I},s.prototype.is=function(t,e){return t=new c(t),myDate=this.date,arguments.length<2&&(e=t.il),t.getDate()==myDate.getDate()&&t.getMonth()==myDate.getMonth()&&(t.getFullYear()==myDate.getFullYear()&&!(e&&this.CHUL_ONLY||!e&&this.IL_ONLY))},s.prototype.masks=function(){var t=this;return(t.USER_EVENT&&E)|(t.LIGHT_CANDLES&&_)|(t.YOM_TOV_ENDS&&T)|(t.CHUL_ONLY&&M)|(t.IL_ONLY&&N)|(t.LIGHT_CANDLES_TZEIS&&I)},s.prototype.getDesc=function(t){return h.LANG(this.desc,t)},s.prototype.candleLighting=function(){var t=this.date;return this.LIGHT_CANDLES?new Date(t.sunset()-60*s.candleLighting*1e3):this.LIGHT_CANDLES_TZEIS?t.getZemanim().tzeit:null},s.prototype.havdalah=function(){return this.YOM_TOV_ENDS?new Date(this.date.sunset().getTime()+60*s.havdalah*1e3):null},s.prototype.routine=function(){function t(){return!!~t.names.indexOf(this.getDesc("s"))}return t.names=[L,"Erev Shabbat"],t}(),s.isIL=!1,s.candleLighting=18,s.havdalah=42,n.Event=s,n.year=function(t){function e(t){Array.isArray(t)?t.forEach(function(t){e(t)}):C[t.date]?C[t.date].push(t):C[t.date]=[t]}if(l[t])return l[t];var n,f=new c(1,w,t),E=new c(15,p,t),C={};Object.defineProperty(C,"add",{value:e}),e([new s(f,["Rosh Hashana 1",0,"ראש השנה א'"],I),new s(new c(2,w,t),["Rosh Hashana 2",0,"ראש השנה ב'"],T),new s(new c(3+(f[b]()==d.THU),w,t),["Tzom Gedaliah",0,"צום גדליה"],0),new s(new c(9,w,t),["Erev Yom Kippur",0,"ערב יום כיפור"],_),new s(new c(y(v,7+f[A]())),["Shabbat Shuva","Shabbos Shuvah","שבת שובה"],0),new s(new c(10,w,t),["Yom Kippur",0,"יום כיפור"],T),new s(new c(14,w,t),["Erev Sukkot","Erev Succos","ערב סוכות"],_),new s(new c(15,w,t),i(1),I|M),new s(new c(15,w,t),i(1),T|N),new s(new c(16,w,t),i(2),T|M),new s(new c(16,w,t),a(i(2)),N),new s(new c(17,w,t),a(i(3)),0),new s(new c(18,w,t),a(i(4)),0),new s(new c(19,w,t),a(i(5)),0),new s(new c(20,w,t),a(i(6)),0),new s(new c(21,w,t),["Sukkot: 7 (Hoshana Raba)","Succos: 7 (Hoshana Raba)","סוכות יום ז' )הושענא רבה("],_),new s(new c(22,w,t),["Shmini Atzeret","Shmini Atzeres","שמיני עצרת"],I|M),new s(new c(22,w,t),["Shmini Atzeret / Simchat Torah","Shmini Atzeres / Simchas Torah","שמיני עצרת / שמחת תורה"],T|N),new s(new c(23,w,t),["Simchat Torah","Simchas Torah","שמחת תורה"],T|M),new s(new c(24,g,t),["Erev Chanukah",0,"ערב חנוכה"],0),new s(new c(25,g,t),r(1),0),new s(new c(26,g,t),r(2),0),new s(new c(27,g,t),r(3),0),new s(new c(28,g,t),r(4),0),new s(new c(29,g,t),r(5),0),new s(new c(30,g,t),r(6),0),new s(new c(31,g,t),r(7),0),new s(new c(32,g,t),r(8),0),new s(new c(15,m.SHVAT,t),["Tu B'Shvat",0,'ט"ו בשבט'],0),new s(new c(y(v,E[A]()-43)),["Shabbat Shekalim","Shabbos Shekalim","שבת שקלים"],0),new s(new c(y(v,E[A]()-30)),["Shabbat Zachor","Shabbos Zachor","שבת זכור"],0),new s(new c(E[A]()-(E[b]()==d.TUE?33:31)),["Ta'anit Esther","Ta'anis Esther","תענית אסתר"],0),new s(new c(13,m.ADAR_II,t),["Erev Purim",0,"ערב פורים"],0),new s(new c(14,m.ADAR_II,t),["Purim",0,"פורים"],0),new s(new c(15,m.ADAR_II,t),["Shushan Purim",0,"שושן פורים"],0),new s(new c(y(v,E[A]()-14)-7),["Shabbat Parah","Shabbos Parah","שבת פרה"],0),new s(new c(y(v,E[A]()-14)),["Shabbat Hachodesh","Shabbos Hachodesh","שבת החודש"],0),new s(new c(y(v,E[A]()-1)),["Shabbat HaGadol","Shabbos HaGadol","שבת הגדול"],0),new s(E.prev()[b]()==v?E.onOrBefore(d.THU):new c(14,p,t),["Ta'anit Bechorot","Ta'anis Bechoros","תענית בכורות"],0),new s(new c(14,p,t),["Erev Pesach",0,"ערב פסח"],_),new s(new c(15,p,t),o(1),I|M),new s(new c(15,p,t),o(1),T|N),new s(new c(16,p,t),o(2),T|M),new s(new c(16,p,t),a(o(2)),N),new s(new c(16,p,t),["Start counting Omer",0,"התחלת ספירת העומר"],0),new s(new c(17,p,t),a(o(3)),0),new s(new c(18,p,t),a(o(4)),0),new s(new c(19,p,t),a(o(5)),0),new s(new c(20,p,t),a(o(6)),_),new s(new c(21,p,t),o(7),I|M),new s(new c(21,p,t),o(7),T|N),new s(new c(22,p,t),o(8),T|M),new s(new c(14,m.IYYAR,t),["Pesach Sheni",0,"פסח שני"],0),new s(new c(18,m.IYYAR,t),["Lag B'Omer",0,'ל"ג בעומר'],0),new s(new c(5,m.SIVAN,t),["Erev Shavuot","Erev Shavuos","ערב שבועות"],_),new s(new c(6,m.SIVAN,t),["Shavuot 1","Shavuos 1","שבועות א'"],I|M),new s(new c(6,m.SIVAN,t),["Shavuot","Shavuos","שבועות"],T|N),new s(new c(7,m.SIVAN,t),["Shavuot 2","Shavuos 2","שבועות ב'"],T|M),new s(new c(y(v,new c(1,w,t+1)[A]()-4)),["Leil Selichot","Leil Selichos","ליל סליחות"],0),new s(new c(29,m.ELUL,t),["Erev Rosh Hashana",0,"ערב ראש השנה"],_)]),n=new c(10,m.TEVET,t),n[b]()==v&&(n=n.next()),e(new s(n,["Asara B'Tevet",0,"עשרה בטבת"],0)),h.LEAP(t)&&(e(new s(new c(14,m.ADAR_I,t),["Purim Katan",0,"פורים קטן"],0)),e(new s(new c(15,m.ADAR_I,t),["Shushan Purim Katan",0,"שושן פורים קטן"],0))),t>=5711&&(n=new c(27,p,t),n[b]()==d.FRI?n=n.prev():n[b]()==d.SUN&&(n=n.next()),e(new s(n,["Yom HaShoah",0,"יום השואה"],0))),e(u(t)),t>=5727&&e(new s(new c(28,m.IYYAR,t),["Yom Yerushalayim",0,"יום ירושלים"],0)),n=new c(17,m.TAMUZ,t),n[b]()==v&&(n=n.next()),e(new s(n,["Shiva-Asar B'Tamuz",0,"צום יז' בתמוז"],0)),n=new c(9,m.AV,t),n[b]()==v&&(n=n.next()),e(new s(new c(y(v,n[A]())),["Shabbat Chazon","Shabbos Chazon","שבת חזון"],0)),e(new s(n.prev(),["Erev Tish'a B'Av",0,"ערב תשעה באב"],0)),e(new s(n,["Tish'a B'Av",0,"תשעה באב"],0)),e(new s(new c(y(v,n[A]()+7)),["Shabbat Nachamu","Shabbos Nachamu","שבת נחמו"],0));for(var H=6;H<h.daysInYear(t)+7;H+=7)e(new s(new c(y(v,new c(1,w,t)[A]()+H)),[L,S,"שבת"],T)),e(new s(new c(y(d.FRI,new c(1,w,t)[A]()+H)),["Erev Shabbat","Erev Shabbos","ערב שבת"],_));for(var D=1;D<=h.MONTH_CNT(t);D++)30==(D==p?h.daysInMonth(h.MONTH_CNT(t-1),t-1):h.daysInMonth(D-1,t))?(e(new s(new c(1,D,t),["Rosh Chodesh 2",0,"ראש חודש ב'"],0)),e(new s(new c(30,D-1,t),["Rosh Chodesh 1",0,"ראש חודש א'"],0))):D!==w&&e(new s(new c(1,D,t),["Rosh Chodesh",0,"ראש חודש"],0)),D!=m.ELUL&&e(new s(new c(29,D,t).onOrBefore(v),["Shabbat Mevarchim","Shabbos Mevorchim","שבת מברכים"],0));return l[t]=C},n.atzmaut=u},{"./common":6,"./hdate":9,gematriya:2}],12:[function(t,e,n){function r(t,e){e=!!e;var n,r=o.lngChesh(t),a=o.shrtKis(t);this.year=t,n=r&&!a?l:!r&&a?c:f;var i=new s(1,o.months.TISHREI,t).abs(),u=i%7+1;this.first_saturday=o.dayOnOrBefore(6,i+6);var h=+o.LEAP(t);this.type=n,this.rosh_hashana_day=u,this.leap=h,this.il=e;var y=""+h+u+n;if(E[y]?this.theSedraArray=E[y]:this.theSedraArray=E[y+ +e],!this.theSedraArray)throw console.log(this),new TypeError("improper sedra year type calculated.")}function a(t){return-t}function i(t,e){e=o.dayOnOrBefore(6,e+6);var n=(e-t.first_saturday)/7,s=t.theSedraArray[n];return void 0===s?i(new r(t.year+1,t.il),e):"object"==typeof s?{parsha:[s],chag:!0}:s>=0?{parsha:[y[s]],chag:!1}:(s=a(s),{parsha:[y[s],y[s+1]],chag:!1})}var o=t("./common"),s=t("./hdate"),u="concat",h=o.range,c=0,f=1,l=2,y=r.parshiot=[["Bereshit","Bereshis","בראשית"],["Noach",0,"נח"],["Lech-Lecha",0,"לך-לך"],["Vayera",0,"וירא"],["Chayei Sara",0,"חיי שרה"],["Toldot","Toldos","תולדות"],["Vayetzei",0,"ויצא"],["Vayishlach",0,"וישלח"],["Vayeshev",0,"וישב"],["Miketz",0,"מקץ"],["Vayigash",0,"ויגש"],["Vayechi",0,"ויחי"],["Shemot","Shemos","שמות"],["Vaera",0,"וארא"],["Bo",0,"בא"],["Beshalach",0,"בשלח"],["Yitro","Yisro","יתרו"],["Mishpatim",0,"משפטים"],["Terumah",0,"תרומה"],["Tetzaveh",0,"תצוה"],["Ki Tisa","Ki Sisa","כי תשא"],["Vayakhel",0,"ויקהל"],["Pekudei",0,"פקודי"],["Vayikra",0,"ויקרא"],["Tzav",0,"צו"],["Shmini",0,"שמיני"],["Tazria",0,"תזריע"],["Metzora",0,"מצורע"],["Achrei Mot","Achrei Mos","אחרי מות"],["Kedoshim",0,"קדשים"],["Emor",0,"אמור"],["Behar",0,"בהר"],["Bechukotai","Bechukosai","בחקתי"],["Bamidbar",0,"במדבר"],["Nasso",0,"נשא"],["Beha'alotcha","Beha'aloscha","בהעלתך"],["Sh'lach",0,"שלח לך"],["Korach",0,"קורח"