hebcal-fixed
Version:
An easy to use, richly-featured, perpetual Jewish Calendar API
10 lines (8 loc) • 50.6 kB
JavaScript
/*
Hebcal - A Jewish Calendar Generator
https://github.com/hebcal/hebcal-js
Licensed GPLv3
*/
!function e(t,n,r){function a(o,s){if(!n[o]){if(!t[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:{}};t[o][0].call(c.exports,function(e){var n=t[o][1][e];return a(n||e)},c,c.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)a(r[o]);return a}({1:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function s(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,i,u,h;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],s(n))return!1;if(a(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),n.apply(this,i)}else if(o(n))for(i=Array.prototype.slice.call(arguments,1),h=n.slice(),r=h.length,u=0;u<r;u++)h[u].apply(this,i);return!0},r.prototype.addListener=function(e,t){var n;if(!a(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,a(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(n=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!a(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,i,s;if(!a(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],i=n.length,r=-1,n===t||a(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(s=i;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){r=s;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],a(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(a(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],2:[function(e,t,n){!function(){function e(e,t){if("number"!=typeof e&&"string"!=typeof e)throw new TypeError("non-number or string given to gematriya()");var n="string"==typeof e;return n&&(e=e.replace(/('|")/g,"")),e=e.toString().split("").reverse(),!n&&t&&(e=e.slice(0,t)),e=e.map(function i(o,s){return n?t&&a[o]<a[e[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?e.reduce(function(e,t){return e+t},0):(e=e.reverse().join("").replace(/יה/g,"טו").replace(/יו/g,"טז").split(""),1===e.length?e.push("'"):e.length>1&&e.splice(-1,0,'"'),e.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!==t?t.exports=e:window.gematriya=e}()},{}],3:[function(e,t,n){!function(){"use strict";function e(e){return e.valueOf()/M-.5+H}function r(e){return new Date((e+.5-H)*M)}function a(t){return e(t)-C}function i(e,t){return T(S(e)*L(D)-_(t)*S(D),L(e))}function o(e,t){return E(S(t)*L(D)+L(t)*S(D)*S(e))}function s(e,t,n){return T(S(e),L(e)*S(t)-_(n)*L(t))}function u(e,t,n){return E(S(t)*S(n)+L(t)*L(n)*L(e))}function h(e,t){return I*(280.16+360.9856235*e)-t}function c(e){return e<0&&(e=0),2967e-7/Math.tan(e+.00312536/(e+.08901179))}function f(e){return I*(357.5291+.98560028*e)}function l(e){return e+I*(1.9148*S(e)+.02*S(2*e)+3e-4*S(3*e))+102.9372*I+A}function m(e){var t=f(e),n=l(t);return{dec:o(n,0),ra:i(n,0)}}function y(e,t){return Math.round(e-k-t/(2*A))}function d(e,t,n){return k+(e+t)/(2*A)+n}function w(e,t,n){return C+e+.0053*S(t)-.0069*S(2*n)}function g(e,t,n){return N((S(e)-S(t)*S(n))/(L(t)*L(n)))}function v(e,t,n,r,a,i,o){return w(d(g(e,n,r),t,a),i,o)}function p(e){var t=I*(218.316+13.176396*e),n=I*(134.963+13.064993*e),r=I*(93.272+13.22935*e),a=t+6.289*I*S(n),s=5.128*I*S(r),u=385001-20905*L(n);return{ra:i(a,s),dec:o(a,s),dist:u}}function b(e,t){return new Date(e.valueOf()+t*M/24)}var A=Math.PI,S=Math.sin,L=Math.cos,_=Math.tan,E=Math.asin,T=Math.atan2,N=Math.acos,I=A/180,M=864e5,H=2440588,C=2451545,D=23.4397*I,O={};O.getPosition=function(e,t,n){var r=I*-n,i=I*t,o=a(e),c=m(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(e,t,n){Y.push([e,t,n])};var k=9e-4;O.getTimes=function(e,t,n){var i,s,u,h,c,m=I*-n,g=I*t,p=a(e),b=y(p,m),A=d(0,m,b),S=f(A),L=l(S),_=o(L,0),E=w(A,S,L),T={solarNoon:r(E),nadir:r(E-.5)};for(i=0,s=Y.length;i<s;i+=1)u=Y[i],h=v(u[0]*I,m,g,_,b,S,L),c=E-(h-E),T[u[1]]=r(c),T[u[2]]=r(h);return T},O.getMoonPosition=function(e,t,n){var r=I*-n,i=I*t,o=a(e),f=p(o),l=h(o,r)-f.ra,m=u(l,i,f.dec),y=T(S(l),_(i)*L(f.dec)-S(f.dec)*L(l));return m+=c(m),{azimuth:s(l,i,f.dec),altitude:m,distance:f.dist,parallacticAngle:y}},O.getMoonIllumination=function(e){var t=a(e||new Date),n=m(t),r=p(t),i=N(S(n.dec)*S(r.dec)+L(n.dec)*L(r.dec)*L(n.ra-r.ra)),o=T(149598e3*S(i),r.dist-149598e3*L(i)),s=T(L(n.dec)*S(n.ra-r.ra),S(n.dec)*L(r.dec)-L(n.dec)*S(r.dec)*L(n.ra-r.ra));return{fraction:(1+L(o))/2,phase:.5+.5*o*(s<0?-1:1)/Math.PI,angle:s}},O.getMoonTimes=function(e,t,n,r){var a=new Date(e);r?a.setUTCHours(0,0,0,0):a.setHours(0,0,0,0);for(var i,o,s,u,h,c,f,l,m,y,d,w,g,v=.133*I,p=O.getMoonPosition(a,t,n).altitude-v,A=1;A<=24&&(i=O.getMoonPosition(b(a,A),t,n).altitude-v,o=O.getMoonPosition(b(a,A+1),t,n).altitude-v,h=(p+o)/2-i,c=(o-p)/2,f=-c/(2*h),l=(h*f+c)*f+i,m=c*c-4*h*i,y=0,m>=0&&(g=Math.sqrt(m)/(2*Math.abs(h)),d=f-g,w=f+g,Math.abs(d)<=1&&y++,Math.abs(w)<=1&&y++,d<-1&&(d=w)),1===y?p<0?s=A+d:u=A+d:2===y&&(s=A+(l<0?w:d),u=A+(l<0?d:w)),!s||!u);A+=2)p=o;var S={};return s&&(S.rise=b(a,s)),u&&(S.set=b(a,u)),s||u||(S[l>0?"alwaysUp":"alwaysDown"]=!0),S},"object"==typeof n&&void 0!==t?t.exports=O:"function"==typeof define&&define.amd?define(O):window.SunCalc=O}()},{}],4:[function(e,t,n){function r(e){return e=e.split(/\s+/).map(function(e,t,n){return"washington dc"===n.join(" ").toLowerCase()&&1===t?e.toUpperCase():e[0].toUpperCase()+e.slice(1).toLowerCase()}).join(" "),i[e]||[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(e,t){if(!Array.isArray(t))throw new TypeError("adding non-array city");if(5==t.length){var n=t.slice();t=[],t[0]=(60*n[0]+n[1])/60,t[1]=(60*n[2]+n[3])/60,t[2]=n[4]}if(3!=t.length)throw new TypeError("length of city array is not 3");e=e.split(/\s+/).map(function(e){return e[0].toUpperCase()+e.slice(1).toLowerCase()}).join(" "),i[e]=t},n.nearest=function(e,t){if(Array.isArray(e)&&(e=(60*e[0]+e[1])/60),Array.isArray(t)&&(t=(60*t[0]+t[1])/60),"number"!=typeof e)throw new TypeError("incorrect lat type passed to nearest()");if("number"!=typeof t)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]-e),2)+Math.pow(Math.abs(a[1]-t),2))}}).reduce(function(e,t){return e.dist<t.dist?e:t}).name}},{}],5:[function(e,t,n){function r(){Hebcal.ready=!0,a=Hebcal.events.emit("ready")}window.Hebcal=e("..");var a=!1,i="undefined"!=typeof console&&(console.warn||console.log)||function(){};Hebcal.events.on("newListener",function(e){"ready"===e&&!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(e){i("Setting deprecated property Hebcal.onready; use Hebcal.events.on('ready', func) instead"),Hebcal.events.on("ready",e)}}),navigator.geolocation?(Hebcal.ready=!1,navigator.geolocation.getCurrentPosition(function(e){Hebcal.defaultLocation=[e.coords.latitude,e.coords.longitude],r()},r)):r()},{"..":10}],6:[function(e,t,n){function r(e){return(1+7*e)%19<7}function a(e){var t=235*Math.floor((e-1)/19)+(e-1)%19*12+Math.floor(((e-1)%19*7+1)/19),n=204+t%1080*793,a=5+12*t+793*Math.floor(t/1080)+Math.floor(n/1080),i=n%1080+a%24*1080,o=1+29*t+Math.floor(a/24),s=o+(i>=19440||2==o%7&&i>=9924&&!r(e)||1==o%7&&i>=16789&&r(e-1));return s+(s%7==0||s%7==3||s%7==5)}function i(e){return a(e+1)-a(e)}function o(e){return i(e)%10==5}function s(e){return i(e)%10==3}function u(e){switch(e.toLowerCase()[0]){case"n":case"נ":return"o"==e.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(e.toLowerCase()[1]){case"i":return f.SIVAN;case"h":return f.SHVAT;default:return 0}case"t":switch(e.toLowerCase()[1]){case"a":return f.TAMUZ;case"i":return f.TISHREI;case"e":return f.TEVET}break;case"a":switch(e.toLowerCase()[1]){case"v":return f.AV;case"d":return/(1|[^i]i|a|א)$/i.test(e)?f.ADAR_I:f.ADAR_II}break;case"ס":return f.SIVAN;case"ט":return f.TEVET;case"ש":return f.SHVAT;case"א":switch(e.toLowerCase()[1]){case"ב":return f.AV;case"ד":return/(1|[^i]i|a|א)$/i.test(e)?f.ADAR_I:f.ADAR_II;case"י":return f.IYYAR;case"ל":return f.ELUL}break;case"ת":switch(e.toLowerCase()[1]){case"מ":return f.TAMUZ;case"ש":return f.TISHREI}}return 0}function h(e,t,n){if(null===e)throw new TypeError("self is null");switch(typeof t){case"function":break;case"string":case"number":return e[t];case"boolean":t=t?function(e){return e}:function(e){return!e};break;case"object":var r=t;if(t instanceof RegExp){t=function(e){return r.test(e)};break}if(Array.isArray(t)){t=function(e,t){return r.indexOf(t)>-1};break}default:throw new TypeError("fun is not a supported type")}var a={},i=Object(e);for(var o in i)if(i.hasOwnProperty(o)){var s=i[o];if(t.call(n,s,o,i)){var u=Object.getOwnPropertyDescriptor(i,o);u.value=s,Object.defineProperty(a,o,u)}}if(Array.isArray(e)||"string"==typeof e){var h=[];for(o in a)h[Number(o)]=a[o];a=h.filter(function(e){return e}),"string"==typeof e&&(a=a.join(""))}return a}var c=e("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(e,t){return"h"==t&&e[2]||"a"==t&&e[1]||e[0]},n.LEAP=r,n.MONTH_CNT=function(e){return 12+r(e)},n.daysInMonth=function(e,t){return 30-(e==f.IYYAR||e==f.TAMUZ||e==f.ELUL||e==f.TEVET||e==f.ADAR_II||e==f.ADAR_I&&!r(t)||e==f.CHESHVAN&&!o(t)||e==f.KISLEV&&s(t))},n.monthNum=function(e){return"number"==typeof e?e:e.charCodeAt(0)>=1488&&e.charCodeAt(0)<=1514&&/('|")/.test(e)?c(e):e.charCodeAt(0)>=48&&e.charCodeAt(0)<=57?parseInt(e,10):u(e)},n.dayYearNum=function(e){return"number"==typeof e?e:e.charCodeAt(0)>=1488&&e.charCodeAt(0)<=1514?c(e,!0):parseInt(e,10)},n.hebElapsedDays=a,n.daysInYear=i,n.lngChesh=o,n.shrtKis=s,n.monthFromName=u,n.dayOnOrBefore=function(e,t){return t-(t-e)%7},n.map=function(e,t,n){if(null===e||"function"!=typeof t)throw new TypeError;var r=Object(e),a={};for(var i in r)r.hasOwnProperty(i)&&(a[i]=t.call(n,r[i],i,r));if(Array.isArray(e)||"string"==typeof e){var o=[];for(i in a)o[Number(i)]=a[i];a=h(o,!0),"string"==typeof e&&(a=a.join(""))}return a},n.filter=h,n.range=function(e,t,n){(n=n||1)<0&&(n=0-n);var r=[],a=e;if(e<t)for(;a<=t;a+=n)r.push(a);else for(;a>=t;a-=n)r.push(a);return r}},{gematriya:2}],7:[function(e,t,n){var r=e("./common"),a=e("./greg"),i=e("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(e){return{name:e.slice(0,3),blatt:e[3]}});n.dafyomi=function(e){var t,n,r,i,s,u,h,c,f;if(!(e 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(e))<r)return{name:[],blatt:0};for(c>=i?(t=8+(c-i)/2711,n=(c-i)%2711):(t=1+(c-r)/2702,n=(c-r)%2702),s=f=0,u=-1,o[4].blatt=t<=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(e,t){return r.LANG(e.name,t)+" "+("h"===t?i(e.blatt):e.blatt)}},{"./common":6,"./greg":8,gematriya:2}],8:[function(e,t,n){function r(e){if(!e instanceof Date)throw new TypeError("Argument to greg.dayOfYear not a Date");var t=e.getDate()+31*e.getMonth();return e.getMonth()>1&&(t-=i((4*(e.getMonth()+1)+23)/10),a(e.getFullYear())&&t++),t}function a(e){return!(e%4||!(e%100)&&e%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(e,t){return u[+a(t)][e]},n.monthNames=["","January","February","March","April","May","June","July","August","September","October","November","December"],n.lookupMonthNum=function(e){return new Date(e+" 1").getMonth()+1},n.dayOfYear=r,n.LEAP=a,n.greg2abs=function(e){var t=e.getFullYear()-1;return r(e)+365*t+(i(t/4)-i(t/100)+i(t/400))},n.abs2greg=function(e){var t=e-1,n=i(t/146097),r=i(t%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(e,t,n){function r(e,t,n){var a=this;switch(arguments.length){case 0:return new r(new Date);case 1:if(void 0===e)return new r;if(e instanceof Date){var i=u(m.greg2abs(e));return i}if(e instanceof r){var i=new r(e[p](),e[v](),e[g]());return i.il=e.il,i.setLocation(i.lat,i.long),i}if("string"==typeof e){switch(e.toLowerCase().trim()){case"today":return new r;case"yesterday":return(new r).prev();case"tomorrow":return(new r).next()}if(/\s/.test(e)){var o=e.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 e)return u(e);throw new TypeError("HDate called with bad argument");case 2:return new r(e,t,(new r)[g]());case 3:a.day=a.month=1,a.year=l.dayYearNum(n),a.setMonth(l.monthNum(t)),a.setDate(l.dayYearNum(e));break;default:throw new TypeError("HDate called with bad arguments")}return a.setLocation.apply(a,r.defaultLocation)}function a(e){o(e),i(e)}function i(e){e.day<1&&(e.month==_&&(e.year-=1),e.day+=T(e.month,e.year),e.month-=1,a(e)),e.day>T(e.month,e.year)&&(e.month==L.ELUL&&(e.year+=1),e.day-=T(e.month,e.year),e.month+=1,a(e)),o(e)}function o(e){e.month!=L.ADAR_II||e.isLeapYear()||(e.month-=1,a(e)),e.month<1&&(e.month+=E(e.year),e.year-=1,a(e)),e.month>E(e.year)&&(e.month-=E(e.year),e.year+=1,a(e))}function s(e){var t,n=e[p](),r=e[g]();if(e[v]()<_){for(t=_;t<=E(r);t++)n+=T(t,r);for(t=L.NISAN;t<e[v]();t++)n+=T(t,r)}else for(t=_;t<e[v]();t++)n+=T(t,r);return l.hebElapsedDays(r)-1373429+n}function u(e){var t,n,a,i,o=[L.KISLEV,L.TEVET,L.SHVAT,L.ADAR_I,L.NISAN,L.IYYAR,L.SIVAN,L.TAMUZ,_,_,_,L.CHESHVAN];if(e>=10555144)throw new RangeError("parameter to abs2hebrew "+e+" out of range");for(n=m.abs2greg(e),t=new r(1,_,i=3760+n[g]());e>=s(t.setFullYear(i+1));)i++;for(a=i>4634&&i<10666?o[n[v]()]:_;e>s(t=new r(T(a,i),a,i));)a=a%E(i)+1;return t.setLocation.apply(t.setDate(e-s(t.setDate(1))+1),r.defaultLocation)}function h(e){var t=e.greg();return y.getTimes(new Date(t.getFullYear(),t.getMonth(),t.getDate(),12,0,0,0,0),e.lat,e.long)}function c(e,t){return new Date(e.sunrise()[b]()+e[S]()*t)}function f(e,t,n){return new r(N(e,t[A]()+n))}var l=e("./common"),m=e("./greg"),y=e("suncalc"),d=e("./cities"),w=e("gematriya");y.addTime(-16.1,"alot_hashachar",0),y.addTime(-11.5,"misheyakir",0),y.addTime(-10.2,"misheyakir_machmir",0),y.addTime(-8.5,0,"tzeit"),y.addTime(-5.879999999999995,0,"tzeitstars");var g="getFullYear",v="getMonth",p="getDate",b="getTime",A="abs",S="hour",L=l.months,_=L.TISHREI,E=l.MONTH_CNT,T=l.daysInMonth,N=l.dayOnOrBefore,I=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(e){r.defaultLocation=d.getCity(e).slice(0,2)}}),I[g]=function(){return this.year},I.isLeapYear=function(){return l.LEAP(this.year)},I[v]=function(){return this.month},I.getTishreiMonth=function(){var e=E(this[g]());return(this[v]()+e-6)%e||e},I.daysInMonth=function(){return T(this[v](),this[g]())},I[p]=function(){return this.day},I.getDay=function(){return this.greg().getDay()},I.setFullYear=function(e){return this.year=e,a(this),this},I.setMonth=function(e){return this.month=l.monthNum(e),a(this),this},I.setTishreiMonth=function(e){return this.setMonth((e+6)%E(this[g]())||13)},I.setDate=function(e){return this.day=e,a(this),this},I.greg=function(){return m.abs2greg(s(this))},I.gregEve=function(){return this.prev().sunset()},I[A]=function(){return s(this)},I.toString=function(e){return l.LANG([this[p](),null,w(this[p]())],e)+" "+this.getMonthName(e)+" "+l.LANG([this[g](),null,w(this[g]())],e)},I.getMonthName=function(e){return l.LANG(l.monthNames[+this.isLeapYear()][this[v]()],e)},I.setCity=function(e){return this.setLocation(d.getCity(e))},I.setLocation=function(e,t){if("object"!=typeof e||Array.isArray(e)||(t=e.long,e=e.lat),Array.isArray(e)&&void 0===t&&(t=e[0],e=e[1]),Array.isArray(e)&&(e=(60*e[0]+e[1])/60),Array.isArray(t)&&(t=(60*t[0]+t[1])/60),"number"!=typeof e)throw new TypeError("incorrect lat type passed to HDate.setLocation()");if("number"!=typeof t)throw new TypeError("incorrect long type passed to HDate.setLocation()");return this.lat=e,this.long=t,this.il=d.getCity(d.nearest(e,t))[2],this},I.sunrise=function(){return h(this).sunrise},I.sunset=function(){return h(this).sunset},I[S]=function(){return(this.sunset()-this.sunrise())/12},I.hourMins=function(){return this[S]()/6e4},I.nightHour=function(){return(this.sunrise()-this.gregEve())/12},I.nightHourMins=function(){return this.nightHour()/6e4};var M={chatzot:function(e){return c(e,6)},chatzot_night:function(e){return new Date(e.sunrise()[b]()-6*e.nightHour())},alot_hashachar:function(e){return h(e).alot_hashachar},alot_hashacher:function(e){return h(e).alot_hashachar},misheyakir:function(e){return h(e).misheyakir},misheyakir_machmir:function(e){return h(e).misheyakir_machmir},sof_zman_shma:function(e){return c(e,3)},sof_zman_tfilla:function(e){return c(e,4)},mincha_gedola:function(e){return c(e,6.5)},mincha_ketana:function(e){return c(e,9.5)},plag_hamincha:function(e){return c(e,10.75)},tzeit:function(e){return h(e).tzeit},tzeitstars:function(e){return h(e).tzeitstars},neitz_hachama:function(e){return e.sunrise()},shkiah:function(e){return e.sunset()}};I.getZemanim=function(){return l.map(M,function(e){return e(this)},this)},r.addZeman=function(e,t){M[e]=t},I.next=function(){return u(this.abs()+1).setLocation(this.lat,this.long)},I.prev=function(){return u(this.abs()-1).setLocation(this.lat,this.long)},I.isSameDate=function(e){return e instanceof r&&(-1==e[g]()&&(e=new r(e).setFullYear(this[g]())),this[A]()==e[A]())},I.before=function(e){return f(e,this,-1)},I.onOrBefore=function(e){return f(e,this,0)},I.nearest=function(e){return f(e,this,3)},I.onOrAfter=function(e){return f(e,this,6)},I.after=function(e){return f(e,this,7)},t.exports=r},{"./cities":4,"./common":6,"./greg":8,gematriya:2,suncalc:3}],10:[function(e,t,n){function r(e,t){return{enumerable:!0,configurable:!0,get:e,set:t}}function a(e,t){for(var n in t)e[n]=t[n];return e}function i(e,t){var n=this;if(e||(e=(new c)[T]()),"number"!=typeof e)throw new p("year to Hebcal() is not a number");if(n.year=e,!t)return new i(e,h.range(1,h.MONTH_CNT(e)));if("string"==typeof t&&(t=h.monthFromName(t)),"number"==typeof t&&(t=[t]),!Array.isArray(t))throw new p("month to Hebcal is not a valid type");n.months=t[L](function(t){var r=new o(t,e);return v(r,"__year",{configurable:!0,writable:!0,value:n}),r}),n.holidays=f.year(e),n[I]=h.daysInYear(e),v(n,"il",r(function(){return n[E](1).il},function(e){n.months.forEach(function(t){t.il=e})})),v(n,"lat",r(function(){return n[E](1).lat},function(e){n.months.forEach(function(t){t.lat=e})})),v(n,"long",r(function(){return n[E](1).long},function(e){n.months.forEach(function(t){t.long=e})}))}function o(e,t){var n=this;if("number"!=typeof(e=h.monthNum(e)))throw new p("month to Hebcal.Month is not a valid type");if("number"!=typeof t)throw new p("year to Hebcal.Month is not a number");return n.month=e,n.year=t,n.days=h.range(1,h.daysInMonth(e,t))[L](function(r){var a=new c(r,e,t);return v(a,"__month",{configurable:!0,writable:!0,value:n}),a}),n[I]=n.days[I],n.holidays=h.filter(f.year(t),function(t){return t[0].date[E]()==e}),v(n,"il",r(function(){return n[_](1).il},function(e){n.days.forEach(function(t){t.il=e})})),v(n,"lat",r(function(){return n[_](1).lat},function(e){n.days.forEach(function(t){t.lat=e})})),v(n,"long",r(function(){return n[_](1).long},function(e){n.days.forEach(function(t){t.long=e})})),n}function s(e,t){var n=this;if(e||(e=(new Date)[T]()),"string"==typeof e){var i=new Date(e);return t=e.indexOf(" ")+1||e.indexOf("-")+1||e.indexOf("/")+1?i[E]()+1:h.range(1,12),new s(i[T](),t)}if("number"!=typeof e)throw new p("year to Hebcal.GregYear() is not a number");if(n.year=e,!t)return new s(e,h.range(1,12));if("string"==typeof t&&(t=d.lookupMonthName(t)),"number"==typeof t&&(t=[t]),!Array.isArray(t))throw new p("month to Hebcal.GregYear() is not a valid type");return n.months=t[L](function(t){var r=new u(t,e);return v(r,"__year",{configurable:!0,writable:!0,value:n}),r}),n.hebyears=[].concat.apply([],n.months[L](function(e){return e.hebmonths[L](function(e){return e.year})})).filter(function(e,t,n){return n.indexOf(e)===t}),n.holidays=h.filter(f.year(n.hebyears[0]),function(t){return t[0].date.greg()[T]()===e&&n.months.filter(function(e){return e.month===t[0].date.greg()[E]()+1})[I]}),n.hebyears[1]&&a(n.holidays,h.filter(f.year(n.hebyears[1]),function(t){return t[0].date.greg()[T]()===e&&n.months.filter(function(e){return e.month===t[0].date.greg()[E]()+1})[I]})),n[I]=365+d.LEAP(e),v(n,"il",r(function(){return n[E](1).il},function(e){n.months.forEach(function(t){t.il=e})})),v(n,"lat",r(function(){return n[E](1).lat},function(e){n.months.forEach(function(t){t.lat=e})})),v(n,"long",r(function(){return n[E](1).long},function(e){n.months.forEach(function(t){t.long=e})})),n}function u(e,t){var n=this;if("string"==typeof e&&(e=d.lookupMonthNum(e)),"number"!=typeof e)throw new p("month to Hebcal.GregMonth is not a valid type");if("number"!=typeof t)throw new p("year to Hebcal.GregMonth is not a number");return n.year=t,n.month=e,n.days=h.range(1,d.daysInMonth(e,t))[L](function(r){var a=new c(new Date(t,e-1,r));return v(a,"__gregmonth",{configurable:!0,writable:!0,value:n}),a}),n[I]=n.days[I],n.hebmonths=[{month:n[_](1)[E](),year:n[_](1)[T]()},{month:n[_](-1)[E](),year:n[_](-1)[T]()}].filter(function(e,t,n){return 0===t||e.month!=n[0].month}),v(n,"il",r(function(){return n[_](1).il},function(e){n.days.forEach(function(t){t.il=e})})),v(n,"lat",r(function(){return n[_](1).lat},function(e){n.days.forEach(function(t){t.lat=e})})),v(n,"long",r(function(){return n[_](1).long},function(e){n.days.forEach(function(t){t.long=e})})),n}var h=e("./common"),c=e("./hdate"),f=e("./holidays"),l=e("./sedra"),m=e("./dafyomi"),y=e("./cities"),d=e("./greg"),w=e("events").EventEmitter,g=e("gematriya"),v=Object.defineProperty,p=TypeError,b="find",A="strings",S="getYearObject",L="map",_="getDay",E="getMonth",T="getFullYear",N="isLeapYear",I="length",M="next",H="prev",C=h.months,D=C.TISHREI,O=C.NISAN,Y=i.prototype,k=o.prototype,R=s.prototype,V=u.prototype,P=c.prototype;Y[N]=P[N],Y.setCity=function(e){return this.months.forEach(function(t){t.setCity(e)}),this},Y.setLocation=function(e,t){return this.months.forEach(function(n){n.setLocation(e,t)}),this},Y[M]=function(){return new i(this.year+1)},Y[H]=function(){return new i(this.year-1)},Y[E]=function(e){var t=this.months;return e=h.monthNum(e),e>this.months[I]?this[M]()[E](e-t[I]):t[e>0?e-1:t[I]+e]},Y[_]=function(e){var t=this;if(e>t[I])return null;if(e<0)return t[_](t[I]-e);var n=t[b](29,C.ELUL)[0].abs()+1-t[b](1,O)[0].abs();return e<=n?t[E](O)[_](e):t[E](D)[_](e-n)},Y.days=function(){return[].concat.apply([],this.months[L](function(e){return e.days}))},Y[L]=function(){return[][L].apply(this.days(),arguments)},Y.filter=function(){return[].filter.apply(this.days(),arguments)},Y.addHoliday=function(e){if(!(e instanceof f.Event))throw new p("non-Event passed to addHoliday()");return this.holidays.add(e),this},Y.findParsha=function(e,t){var n=t?[t]:["s","a","h"],r=this.filter(function(t){return Math.max.apply(null,n.map(function(n){return t.getSedra(n).indexOf(e)+1}))});return r[r[I]-1]},Y.findSedra=Y.findParsha,Y[b]=function e(t,n){var r=this;if(1===arguments[I]){if("string"==typeof t)return e[A].call(r,t);if(Array.isArray(t))return[].concat.apply([],t[L](function(e){return r[b][Array.isArray(e)?"apply":"call"](r,e)}));if(t instanceof c)return r[b](t.getDate(),t[E]());if(t instanceof Date)return r[b](new c(t))}else if(2==arguments[I]){if(n instanceof o)return n[b](t);if(Array.isArray(n))return[].concat.apply([],n[L](function(e){return r[b](t,e)}));if("string"==typeof n)return r[b](t,h.monthNum(n));if("number"==typeof n)return r[b](t,r[E](n))}return[]},Y[b][A]=function e(t){var n=t.split(/\s+/),r=e[t.replace(/\s/g,"_").toLowerCase()];if(!n[I])return[];if(r)return r.call(this);try{return this[b](new c(t))}catch(e){return n[I]-1?this[b].apply(this,n):[]}},Y[b][A].rosh_chodesh=function(){return this[b]("Rosh Chodesh",h.range(1,this.months[I]))},Y[b][A].holidays=function(){return[].concat.apply([],this.holidays[L](function(e){return this[b](e.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][H]()]},Y[b][A].tomorrow=function(){return[this[b]("today")[0][M]()]},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),C.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=y,i.range=h.range,i.gematriya=g,i.holidays=h.filter(f,["masks","Event"]),i.parshiot=l.parshiot,i.LANGUAGE=h.LANG,i[L]=h[L],i.filter=h.filter,v(i,"defaultLocation",r(function(){return c.defaultLocation},function(e){i.events.emit("locationChange",c.defaultLocation),c.defaultLocation=e})),v(i,"defaultCity",r(function(){return c.defaultCity},function(e){i.defaultLocation=y.getCity(e).slice(0,2)})),v(i,"candleLighting",r(function(){return f.Event.candleLighting},function(e){f.Event.candleLighting=e})),v(i,"havdalah",r(function(){return f.Event.havdalah},function(e){f.Event.havdalah=e})),i.Month=o,k[N]=P[N],k[H]=function(){var e=this,t=e[S]();return 1===e.month?t[E](-1):e.month===D?t[H]()[E](C.ELUL):t[E](e.month-1)},k[M]=function(){var e=this,t=e[S]()
;return e.month===h.MONTH_CNT(e.year)?t[E](1):e.month===C.ELUL?t[M]()[E](D):t[E](e.month+1)},k[_]=function(e){var t=this.days;return e=h.dayYearNum(e),e>t[I]?this[M]()[_](e-t[I]):t[e>0?e-1:t[I]+e]},k[S]=function(){return this.__year||new i(this.year)},k.getName=function(e){return h.LANG(h.monthNames[+this[N]()][this.month],e)},k.rosh_chodesh=function(){var e=this[H]();return 30==e[I]?[e[_](-1),this[_](1)]:[this[_](1)]},k.setCity=function(e){return this.days.forEach(function(t){t.setCity(e)}),this},k.setLocation=function(e,t){return this.days.forEach(function(n){n.setLocation(e,t)}),this},k[L]=function(){return[][L].apply(this.days,arguments)},k.molad=function(){var e,t,n,r,a,i,o={},s=parseInt;i=this.month-7,e=this.year-1,i<0&&(i+=h.MONTH_CNT(e+1)),t=s(i+e/19*235),n=s(204+t%1080*793),r=s(5+12*t+t/1080*793-6),a=s(n%1080+r%24*1080),o.doy=new c(s(1+29*t+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 e(t){var n=this;return"number"==typeof t?[n[_](t)]:"string"==typeof t?e[A].call(n,t):Array.isArray(t)?[].concat.apply([],t[L](function(e){return n[b](e)})):t instanceof c&&t[T]()==n.year&&t[E]()==n.month?n[b](t.getDate()):t instanceof Date?n[b](new c(t)):[]},k[b][A]=function e(t){var n=e[t.replace(/\s/g,"_").toLowerCase()];if(n)return n.call(this);try{return this[b](new c(t))}catch(e){var r=h.dayYearNum(t);return r?this[b](r):[]}},k[b][A].rosh_chodesh=function(){return this.rosh_chodesh()},k[b][A].shabbat_mevarchim=function e(){return this.month===C.ELUL?[]:e._calc.call(this)},k[b][A].shabbat_mevarchim._calc=function(){return this[b](this[_](29).onOrBefore(h.days.SAT))},k[b][A].shabbos_mevarchim=k[b][A].shabbos_mevorchim=k[b][A].shabbat_mevarchim,i.HDate=c,P.getMonthObject=function(){return this.__month||new o(this[E](),this[T]())},P[S]=function(){return this.getMonthObject()[S]()},function(){var e={};[H,M].forEach(function(t){e[t]=P[t],P[t]=function(){var n=e[t].call(this);return this.__month?this[S]()[b](n)[0]:n}})}(),P.getSedra=function(){var e={};return function(t){var n=e[this[T]()];return n&&n.il==this.il||(n=e[this[T]()]=new l(this[T](),this.il)),n.get(this)[L](function(e){return h.LANG(e,t)})}}(),P.getParsha=P.getSedra,P.holidays=function(e){var t=this,n=t[S]().holidays[t];return n?n.filter(function(n){return!!e||!n.routine()&&n.is(t)})[L](function(e){return e.date.setLocation(t),e}):[]},["candleLighting","havdalah"].forEach(function(e){P[e]=function(){var t=this,n=t.holidays(!0).filter(function(e){return e.is(t)});return n.length&&(n=h.filter(n.map(function(t){return t[e]()}),!0)),n.length?new Date(Math.max.apply(null,n)):null}}),P.omer=function(){var e=this,t=e.greg().getTime(),n=e[T]();return t>new c(15,O,n).greg().getTime()&&t<new c(6,C.SIVAN,n).greg().getTime()?e.abs()-new c(16,O,n).abs()+1:0},P.dafyomi=function(e){return m.dafname(m.dafyomi(this.greg()),e)},P.tachanun=function(){function e(){function e(e){return e[L](function(e){return e.abs()})}var o,s,u,c=!arguments[0],l=this,m=l[S](),y=m.year;if(i.il[y]===l.il?(o=i.all[y],s=i.some[y],u=i.yes_prev[y]):(o=i.all[y]=e(m[b]("Rosh Chodesh").concat(m[b](h.range(1,h.daysInMonth(O,y)),O),m[b](48,O),m[b](h.range(1,8-l.il),C.SIVAN),m[b]([9,15],C.AV),m[b](-1,C.ELUL),m[b]([1,2],D),m[b](h.range(9,24-l.il),D),m[b](h.range(25,33),C.KISLEV),m[b](15,C.SHVAT),m[b]([14,15],m[N]()?[C.ADAR_I,C.ADAR_II]:C.ADAR_I))),s=i.some[y]=e([].concat(m[b](h.range(1,13),C.SIVAN),m[b](h.range(20,31),D),m[b](14,C.IYYAR),f.atzmaut(y)[1].date||[],y>=5727?m[b](29,C.IYYAR):[])),u=i.yes_prev[y]=e([].concat(m[b](-1,C.ELUL),m[b](9,C.TISHREI),m[b](14,C.IYYAR))),i.il[y]=l.il),o=o.indexOf(l.abs())>-1,s=s.indexOf(l.abs())>-1,u=u.indexOf(l.abs()+1)>-1,o)return t;var d=(!s&&a)|(6!=l[_]()&&r);return d|=c&&!u?l[M]().tachanun(!0)&r&&n:5!=l[_]()&&n,d==a?t:d}var t=e.NONE=0,n=e.MINCHA=1,r=e.SHACHARIT=2,a=e.ALL_CONGS=4,i={all:{},some:{},yes_prev:{},il:{}};return e}(),P.tachanun_uf=function(){var e=this.tachanun();return{shacharit:!!(e&this.tachanun.SHACHARIT),mincha:!!(e&this.tachanun.MINCHA),all_congs:!!(e&this.tachanun.ALL_CONGS)}},P.hallel=function(){function e(){var e=this,i=e[S](),o=i.year,s=a.il[o]==e.il&&a.whole[o]||(a.whole[o]=[].concat(i[b](h.range(25,33),C.KISLEV),i[b]([15,e.il?null:16],O),i[b]("Shavuot"),i[b]("Sukkot"),f.atzmaut(o)[1].date||[],o>=5727?i[b](29,C.IYYAR):[])[L](function(e){return e.abs()})),u=a.il[o]==e.il&&a.half[o]||(a.half[o]=[].concat(i[b]("Rosh Chodesh").filter(function(e){return e[E]()!=D}),i[b](h.range(17-e.il,23-e.il),O))[L](function(e){return e.abs()}));return a.il[o]=e.il,s.indexOf(e.abs())>-1&&r||u.indexOf(e.abs())>-1&&n||t}var t=e.NONE=0,n=e.HALF=1,r=e.WHOLE=2,a={whole:{},half:{},il:{}};return e}(),function(e){function t(){function t(e,t){return h.filter(h[L](e,function(e){return e-r}),function(e){return e>0&&e-t<0})}var n=new c;i.isSameDate(n)||(e.emit("dayChange"),i=n);var r=new Date,a=t(n.getZemanim(),e.beforeZeman),o=t(e.customs,e.refreshInterval);for(var s in a)e.emit("almostZeman",s,a[s]),a[s]<e.refreshInterval&&e.emit("atZeman",s);for(var u in o)e.emit("custom",u)}var n,a,i=new c;v(e,"refreshInterval",r(function(){return n},function(e){a&&(a=clearInterval(a)),n=e,e&&(a=setInterval(t,e),a.unref&&a.unref())})),e.beforeZeman=6e5,t(),e.refreshInterval=3e5,e.customs={}}(i.events=new w),i.GregYear=s,R[N]=function(){return 366==this[I]},R.setCity=Y.setCity,R.setLocation=Y.setLocation,R[M]=function(){return new s(this.year+1)},R[H]=function(){return new s(this.year-1)},R[E]=function(e){var t=this.months;return e="number"==typeof e?e:d.lookupMonthNum(e),e>t[I]?this[M]()[E](e-t[I]):t[e>0?e-1:t[I]+e]},a(R,{days:Y.days,map:Y[L],filter:Y.filter,addHoliday:Y.addHoliday}),i.GregMonth=u,V[N]=function(){return d.LEAP(this.year)},V[H]=function(){return 1===this.month?this[S]()[H]()[E](-1):this[S]()[E](this.month-1)},V[M]=function(){return this[S]()[E](this.month+1)},V[_]=function(e){return e>this.days[I]?this[M]()[_](e-this.days[I]):this.days[e>0?e-1:this.days[I]+e]},V[S]=function(){return this.__year||new s(this.year)},V.getName=function(){return d.monthNames[this.month]},V.setCity=k.setCity,V.setLocation=k.setLocation,V[L]=k[L],P.getGregMonthObject=function(){return this.__gregmonth||new u(this.greg()[E]()+1,this.greg()[T]())},P.getGregYearObject=function(){return this.getGregMonthObject()[S]()},t.exports=i},{"./cities":4,"./common":6,"./dafyomi":7,"./greg":8,"./hdate":9,"./holidays":11,"./sedra":12,events:1,gematriya:2}],11:[function(e,t,n){function r(e){return["Chanukah: Candle "+e,0,"חנוכה: נר "+f(e)]}function a(e){return[e[0]+' (CH"M)',e[1]?e[1]+' (CH"M)':e[1],e[2]?e[2]+' )חה"ם(':e[2]]}function i(e){return["Sukkot: "+e,"Succos: "+e,"סוכות יום "+f(e)]}function o(e){return["Pesach: "+e,0,"פסח יום "+f(e)]}function s(e,t,n){var r=this;r.date=new c(e),r.desc="object"!=typeof t?[t]:t,r.USER_EVENT=!!(n&_),r.LIGHT_CANDLES=!!(n&E),r.YOM_TOV_ENDS=!!(n&T),r.CHUL_ONLY=!!(n&N),r.IL_ONLY=!!(n&I),r.LIGHT_CANDLES_TZEIS=!!(n&M)}function u(e){if(e>=5708){var t=new c(1,y.IYYAR,e),n=new c(15,v,e);return n[b]()==d.SUN?t.setDate(2):n[b]()==p?t.setDate(3):e<5764?t.setDate(4):n[b]()==d.TUE?t.setDate(5):t.setDate(4),[new s(t,["Yom HaZikaron",0,"יום הזיכרון"],0),new s(t.next(),["Yom HaAtzma'ut",0,"יום העצמאות"],0)]}return[]}var h=e("./common"),c=e("./hdate"),f=e("gematriya"),l={},m=h.dayOnOrBefore,y=h.months,d=h.days,w=y.TISHREI,g=y.KISLEV,v=y.NISAN,p=d.SAT,b="getDay",A="abs",S="Shabbat",L="Shabbos",_=1,E=2,T=4,N=8,I=16,M=32;n.masks={USER_EVENT:_,LIGHT_CANDLES:E,YOM_TOV_ENDS:T,CHUL_ONLY:N,IL_ONLY:I,LIGHT_CANDLES_TZEIS:M},s.prototype.is=function(e,t){return e=new c(e),myDate=this.date,arguments.length<2&&(t=e.il),e.getDate()==myDate.getDate()&&e.getMonth()==myDate.getMonth()&&(e.getFullYear()==myDate.getFullYear()&&!(t&&this.CHUL_ONLY||!t&&this.IL_ONLY))},s.prototype.masks=function(){var e=this;return(e.USER_EVENT&&_)|(e.LIGHT_CANDLES&&E)|(e.YOM_TOV_ENDS&&T)|(e.CHUL_ONLY&&N)|(e.IL_ONLY&&I)|(e.LIGHT_CANDLES_TZEIS&&M)},s.prototype.getDesc=function(e){return h.LANG(this.desc,e)},s.prototype.candleLighting=function(){var e=this.date;return this.LIGHT_CANDLES?new Date(e.sunset()-60*s.candleLighting*1e3):this.LIGHT_CANDLES_TZEIS?e.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 e(){return!!~e.names.indexOf(this.getDesc("s"))}return e.names=[S,"Erev Shabbat"],e}(),s.isIL=!1,s.candleLighting=18,s.havdalah=42,n.Event=s,n.year=function(e){function t(e){Array.isArray(e)?e.forEach(function(e){t(e)}):H[e.date]?H[e.date].push(e):H[e.date]=[e]}if(l[e])return l[e];var n,f=new c(1,w,e),_=new c(15,v,e),H={};Object.defineProperty(H,"add",{value:t}),t([new s(f,["Rosh Hashana 1",0,"ראש השנה א'"],M),new s(new c(2,w,e),["Rosh Hashana 2",0,"ראש השנה ב'"],T),new s(new c(3+(f[b]()==d.THU),w,e),["Tzom Gedaliah",0,"צום גדליה"],0),new s(new c(9,w,e),["Erev Yom Kippur",0,"ערב יום כיפור"],E),new s(new c(m(p,7+f[A]())),["Shabbat Shuva","Shabbos Shuvah","שבת שובה"],0),new s(new c(10,w,e),["Yom Kippur",0,"יום כיפור"],T),new s(new c(14,w,e),["Erev Sukkot","Erev Succos","ערב סוכות"],E),new s(new c(15,w,e),i(1),M|N),new s(new c(15,w,e),i(1),T|I),new s(new c(16,w,e),i(2),T|N),new s(new c(16,w,e),a(i(2)),I),new s(new c(17,w,e),a(i(3)),0),new s(new c(18,w,e),a(i(4)),0),new s(new c(19,w,e),a(i(5)),0),new s(new c(20,w,e),a(i(6)),0),new s(new c(21,w,e),["Sukkot: 7 (Hoshana Raba)","Succos: 7 (Hoshana Raba)","סוכות יום ז' )הושנע רבה("],E),new s(new c(22,w,e),["Shmini Atzeret","Shmini Atzeres","שמיני עצרת"],M|N),new s(new c(22,w,e),["Shmini Atzeret / Simchat Torah","Shmini Atzeres / Simchas Torah","שמיני עצרת / שמחת תורה"],T|I),new s(new c(23,w,e),["Simchat Torah","Simchas Torah","שמחת תורה"],T|N),new s(new c(24,g,e),["Erev Chanukah",0,"ערב חנוכה"],0),new s(new c(25,g,e),r(1),0),new s(new c(26,g,e),r(2),0),new s(new c(27,g,e),r(3),0),new s(new c(28,g,e),r(4),0),new s(new c(29,g,e),r(5),0),new s(new c(30,g,e),r(6),0),new s(new c(31,g,e),r(7),0),new s(new c(32,g,e),r(8),0),new s(new c(15,y.SHVAT,e),["Tu B'Shvat",0,'ט"ו בשבט'],0),new s(new c(m(p,_[A]()-43)),["Shabbat Shekalim","Shabbos Shekalim","שבת שקלים"],0),new s(new c(m(p,_[A]()-30)),["Shabbat Zachor","Shabbos Zachor","שבת זכור"],0),new s(new c(_[A]()-(_[b]()==d.TUE?33:31)),["Ta'anit Esther","Ta'anis Esther","תענית אסתר"],0),new s(new c(13,y.ADAR_II,e),["Erev Purim",0,"ערב פורים"],0),new s(new c(14,y.ADAR_II,e),["Purim",0,"פורים"],0),new s(new c(15,y.ADAR_II,e),["Shushan Purim",0,"שושן פורים"],0),new s(new c(m(p,_[A]()-14)-7),["Shabbat Parah","Shabbos Parah","שבת פרה"],0),new s(new c(m(p,_[A]()-14)),["Shabbat Hachodesh","Shabbos Hachodesh","שבת החודש"],0),new s(new c(m(p,_[A]()-1)),["Shabbat HaGadol","Shabbos HaGadol","שבת הגדול"],0),new s(_.prev()[b]()==p?_.onOrBefore(d.THU):new c(14,v,e),["Ta'anit Bechorot","Ta'anis Bechoros","תענית בכורות"],0),new s(new c(14,v,e),["Erev Pesach",0,"ערב פסח"],E),new s(new c(15,v,e),o(1),M|N),new s(new c(15,v,e),o(1),T|I),new s(new c(16,v,e),o(2),T|N),new s(new c(16,v,e),a(o(2)),I),new s(new c(16,v,e),["Start counting Omer",0,"התחלת ספירת העומר"],0),new s(new c(17,v,e),a(o(3)),0),new s(new c(18,v,e),a(o(4)),0),new s(new c(19,v,e),a(o(5)),0),new s(new c(20,v,e),a(o(6)),E),new s(new c(21,v,e),o(7),M|N),new s(new c(21,v,e),o(7),T|I),new s(new c(22,v,e),o(8),T|N),new s(new c(14,y.IYYAR,e),["Pesach Sheni",0,"פסח שני"],0),new s(new c(18,y.IYYAR,e),["Lag B'Omer",0,'ל"ג בעומר'],0),new s(new c(5,y.SIVAN,e),["Erev Shavuot","Erev Shavuos","ערב שבועות"],E),new s(new c(6,y.SIVAN,e),["Shavuot 1","Shavuos 1","שבועות א'"],M|N),new s(new c(6,y.SIVAN,e),["Shavuot","Shavuos","שבועות"],T|I),new s(new c(7,y.SIVAN,e),["Shavuot 2","Shavuos 2","שבועות ב'"],T|N),new s(new c(m(p,new c(1,w,e+1)[A]()-4)),["Leil Selichot","Leil Selichos","ליל סליחות"],0),new s(new c(29,y.ELUL,e),["Erev Rosh Hashana",0,"ערב ראש השנה"],E)]),n=new c(10,y.TEVET,e),n[b]()==p&&(n=n.next()),t(new s(n,["Asara B'Tevet",0,"עשרה בטבת"],0)),h.LEAP(e)&&(t(new s(new c(14,y.ADAR_I,e),["Purim Katan",0,"פורים קטן"],0)),t(new s(new c(15,y.ADAR_I,e),["Shushan Purim Katan",0,"שושן פורים קטן"],0))),e>=5711&&(n=new c(27,v,e),n[b]()==d.FRI?n=n.prev():n[b]()==d.SUN&&(n=n.next()),t(new s(n,["Yom HaShoah",0,"יום השואה"],0))),t(u(e)),e>=5727&&t(new s(new c(29,y.IYYAR,e),["Yom Yerushalayim",0,"יום ירושלים"],0)),n=new c(17,y.TAMUZ,e),n[b]()==p&&(n=n.next()),t(new s(n,["Shiva-Asar B'Tamuz",0,"צום יז' בתמוז"],0)),n=new c(9,y.AV,e),n[b]()==p&&(n=n.next()),t(new s(new c(m(p,n[A]())),["Shabbat Chazon","Shabbos Chazon","שבת חזון"],0)),t(new s(n.prev(),["Erev Tish'a B'Av",0,"ערב תשעה באב"],0)),t(new s(n,["Tish'a B'Av",0,"תשעה באב"],0)),t(new s(new c(m(p,n[A]()+7)),["Shabbat Nachamu","Shabbos Nachamu","שבת נחמו"],0));for(var C=6;C<h.daysInYear(e);C+=7)t(new s(new c(m(p,new c(1,w,e)[A]()+C)),[S,L,"שבת"],T)),t(new s(new c(m(d.FRI,new c(1,w,e)[A]()+C)),["Erev Shabbat","Erev Shabbos","ערב שבת"],E));for(var D=1;D<=h.MONTH_CNT(e);D++)30==(D==v?h.daysInMonth(h.MONTH_CNT(e-1),e-1):h.daysInMonth(D-1,e))?(t(new s(new c(1,D,e),["Rosh Chodesh 2",0,"ראש חודש ב'"],0)),t(new s(new c(30,D-1,e),["Rosh Chodesh 1",0,"ראש חודש א'"],0))):D!==w&&t(new s(new c(1,D,e),["Rosh Chodesh",0,"ראש חודש"],0)),D!=y.ELUL&&t(new s(new c(29,D,e).onOrBefore(p),["Shabbat Mevarchim","Shabbos Mevorchim","שבת מברכים"],0));return l[e]=H},n.atzmaut=u},{"./common":6,"./hdate":9,gematriya:2}],12:[function(e,t,n){function r(e,t){t=!!t;var n,r=o.lngChesh(e),a=o.shrtKis(e);this.year=e,n=r&&!a?l:!r&&a?c:f;var i=new s(1,o.months.TISHREI,e).abs(),u=i%7+1;this.first_saturday=o.dayOnOrBefore(6,i+6);var h=+o.LEAP(e);this.type=n,this.rosh_hashana_day=u,this.leap=h,this.il=t;var m=""+h+u+n;if(_[m]?this.theSedraArray=_[m]:this.theSedraArray=_[m+ +t],!this.theSedraArray)throw console.log(this),new TypeError("improper sedra year type calculated.")}function a(e){return-e}function i(e,t){t=o.dayOnOrBefore(6,t+6);var n=(t-e.first_saturday)/7,s=e.theSedraArray[n];return void 0===s?i(new r(e.year+1,e.il),t):"object"==typeof s?[s]:s>=0?[m[s]]:(s=a(s),[m[s],m[s+1]])}var o=e("./common"),s=e("./hdate"),u="concat",h=o.range,c=0,f=1,l=2,m=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,"קורח"],["Chukat","Chukas","חקת"],["Balak",0,"בלק"],["Pinchas",0,"פינחס"],["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,"נצבים"],["Vayeilech",0,"וילך"],["Ha'Azinu",0,"האזינו"]],y=[["Rosh Hashana",0,"ראש השנה"]],d=[["Yom Kippur",0,"יום כיפור"]],w=[["Sukkot","Succos","סוכות"]],g=[["Chol hamoed Sukkot","Chol hamoed Succos","חול המועד סוכות"]],v=[["Shmini Atzeret","Shmini Atzeres","שמיני עצרת"]],p=[["End-of-Year: Simchat-Torah, Sukkot","End-of-Year: Simchas-Torah, Succos","סופשנה: סוכות וסמחת תורה"]],b=[["Pesach",0,"פסח"]],A=[["Chol hamoed Pesach",0,"חול המועד פסח"]],S=[["Second days of Pesach",0,"שביעי של פסח"]],L=[["Shavuot","Shavuos","שבועות"]],_={"020":[51,52][u](p,h(0,20),a(21),23,24,b,25,a(26),a(28),30,a(31),h(33,40),a(41),h(43,49),a(50)),"0220":[51,52][u](p,h(0,20),a(21),23,24,b,25,a(26),a(28),30,a(31),33,L,h(34,37),a(38),40,a(41),h(43,49),a(50)),"0510":[52][u](d,p,h(0,20),a(21),23,24,b,b,25,a(26),a(28),30,a(31),h(33,40),a(41),h(43,50)),"0511":[52][u](d,p,h(0,20),a(21),23,24,b,25,a(26),a(28),h(30,40),a(41),h(43,50)),"052":[52][u](d,g,h(0,24),S,25,a(26),a(28),30,a(31),h(33,40),a(41),h(43,50)),"070":[][u](y,52,w,v,h(0,20),a(21),23,24,S,25,a(26),a(28),30,a(31),h(33,40),a(41),h(43,50)),"072":[][u](y,52,w,v,h(0,20),a(21),23,24,A,25,a(26),a(28),30,a(31),h(33,40),a(41),h(43,49),a(50)),1200:[51,52][u](g,h(0,27),A,h(28,33),L,h(34,37),a(38),40,a(41),h(43,49),a(50)),1201:[51,52][u](g,h(0,27),A,h(28,40),a(41),h(43,49),a(50)),1220:[51,52][u](g,h(0,27),b,b,h(28,40),a(41),h(43,50)),1221:[51,52][u](g,h(0,27),b,h(28,50)),150:[52][u](d,g,h(0,28),S,h(29,50)),152:[52][u](d,g,h(0,28),A,h(29,49),a(50)),170:[][u](y,52,w,v,h(0,27),A,h(28,40),a(41),h(43,49),a(50)),1720:[][u](y,52,w,v,h(0,27),A,h(28,33),L,h(34,37),a(38),40,a(41),h(43,49),a(50))};_["0221"]=_["020"],_["0310"]=_["0220"],_["0311"]=_["020"],_[1310]=_[1220],_[1311]=_[1221],_[1721]=_[170],r.prototype.get=function(e){return i(this,e.abs())},t.exports=r},{"./common":6,"./hdate":9}]},{},[5]);
//# sourceMappingURL=client/hebcal.min.js.map