You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
49 KiB
26 lines
49 KiB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("luxon")):"function"==typeof define&&define.amd?define(["luxon"],e):"object"==typeof exports?exports.rrule=e(require("luxon")):t.rrule=e(t.luxon)}("undefined"!=typeof self?self:this,function(n){return function(n){var r={};function i(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,i),e.l=!0,e.exports}return i.m=n,i.c=r,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1)}([function(t,e,n){"use strict";n.d(e,"f",function(){return r}),n.d(e,"e",function(){return i}),n.d(e,"d",function(){return o}),n.d(e,"j",function(){return a}),n.d(e,"k",function(){return s}),n.d(e,"m",function(){return u}),n.d(e,"h",function(){return c}),n.d(e,"l",function(){return h}),n.d(e,"i",function(){return d}),n.d(e,"a",function(){return y}),n.d(e,"b",function(){return l}),n.d(e,"g",function(){return f}),n.d(e,"c",function(){return b});var r=function(t){return null!=t},i=function(t){return"number"==typeof t},o=Array.isArray,a=function(t,e){void 0===e&&(e=t),1===arguments.length&&(e=t,t=0);for(var n=[],r=t;r<e;r++)n.push(r);return n},s=function(t,e){var n=0,r=[];if(o(t))for(;n<e;n++)r[n]=[].concat(t);else for(;n<e;n++)r[n]=t;return r},u=function(t){return o(t)?t:[t]};function c(t,e,n){void 0===n&&(n=" ");var r=String(t);return e>>=0,r.length>e?String(r):((e-=r.length)>n.length&&(n+=s(n,e/n.length)),n.slice(0,e)+String(r))}var h=function(t,e,n){var r=t.split(e);return n?r.slice(0,n).concat([r.slice(n).join(e)]):r},d=function(t,e){var n=t%e;return n*e<0?n+e:n},y=function(t,e){return{div:Math.floor(t/e),mod:d(t,e)}},l=function(t){return!r(t)||0===t.length},f=function(t){return!l(t)},b=function(t,e){return f(t)&&-1!==t.indexOf(e)}},function(t,e,n){"use strict";n.r(e);var r,i,x=n(0);(i=r||(r={})).MONTH_DAYS=[31,28,31,30,31,30,31,31,30,31,30,31],i.ONE_DAY=864e5,i.MAXYEAR=9999,i.ORDINAL_BASE=new Date(Date.UTC(1970,0,1)),i.PY_WEEKDAYS=[6,0,1,2,3,4,5],i.getYearDay=function(t){var e=new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate());return Math.ceil((e.valueOf()-new Date(t.getUTCFullYear(),0,1).valueOf())/i.ONE_DAY)+1},i.isLeapYear=function(t){return t%4==0&&t%100!=0||t%400==0},i.isDate=function(t){return t instanceof Date},i.isValidDate=function(t){return i.isDate(t)&&!isNaN(t.getTime())},i.tzOffset=function(t){return 60*t.getTimezoneOffset()*1e3},i.daysBetween=function(t,e){var n=t.getTime()-i.tzOffset(t)-(e.getTime()-i.tzOffset(e));return Math.round(n/i.ONE_DAY)},i.toOrdinal=function(t){return i.daysBetween(t,i.ORDINAL_BASE)},i.fromOrdinal=function(t){return new Date(i.ORDINAL_BASE.getTime()+t*i.ONE_DAY)},i.getMonthDays=function(t){var e=t.getUTCMonth();return 1===e&&i.isLeapYear(t.getUTCFullYear())?29:i.MONTH_DAYS[e]},i.getWeekday=function(t){return i.PY_WEEKDAYS[t.getUTCDay()]},i.monthRange=function(t,e){var n=new Date(Date.UTC(t,e,1));return[i.getWeekday(n),i.getMonthDays(n)]},i.combine=function(t,e){return e=e||t,new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},i.clone=function(t){return new Date(t.getTime())},i.cloneDates=function(t){for(var e=[],n=0;n<t.length;n++)e.push(i.clone(t[n]));return e},i.sort=function(t){t.sort(function(t,e){return t.getTime()-e.getTime()})},i.timeToUntilString=function(t,e){void 0===e&&(e=!0);var n=new Date(t);return[Object(x.h)(n.getUTCFullYear().toString(),4,"0"),Object(x.h)(n.getUTCMonth()+1,2,"0"),Object(x.h)(n.getUTCDate(),2,"0"),"T",Object(x.h)(n.getUTCHours(),2,"0"),Object(x.h)(n.getUTCMinutes(),2,"0"),Object(x.h)(n.getUTCSeconds(),2,"0"),e?"Z":""].join("")},i.untilStringToDate=function(t){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(t);if(!e)throw new Error("Invalid UNTIL value: "+t);return new Date(Date.UTC(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10),parseInt(e[5],10)||0,parseInt(e[6],10)||0,parseInt(e[7],10)||0))};var o,h,a,Y=r,c=function(){function t(t,e){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=t,this.args=e,"between"===t?(this.maxDate=e.inc?e.before:new Date(e.before.getTime()-1),this.minDate=e.inc?e.after:new Date(e.after.getTime()+1)):"before"===t?this.maxDate=e.inc?e.dt:new Date(e.dt.getTime()-1):"after"===t&&(this.minDate=e.inc?e.dt:new Date(e.dt.getTime()+1))}return t.prototype.accept=function(t){++this.total;var e=this.minDate&&t<this.minDate,n=this.maxDate&&t>this.maxDate;if("between"===this.method){if(e)return!0;if(n)return!1}else if("before"===this.method){if(n)return!1}else if("after"===this.method)return!!e||(this.add(t),!1);return this.add(t)},t.prototype.add=function(t){return this._result.push(t),!0},t.prototype.getValue=function(){var t=this._result;switch(this.method){case"all":case"between":return t;case"before":case"after":default:return t.length?t[t.length-1]:null}},t.prototype.clone=function(){return new t(this.method,this.args)},t}(),s=(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(i){function t(t,e,n){var r=i.call(this,t,e)||this;return r.iterator=n,r}return s(t,i),t.prototype.add=function(t){return!!this.iterator(t,this._result.length)&&(this._result.push(t),!0)},t}(c);function j(t){return t<h.HOURLY}(a=h||(h={}))[a.YEARLY=0]="YEARLY",a[a.MONTHLY=1]="MONTHLY",a[a.WEEKLY=2]="WEEKLY",a[a.DAILY=3]="DAILY",a[a.HOURLY=4]="HOURLY",a[a.MINUTELY=5]="MINUTELY",a[a.SECONDLY=6]="SECONDLY";var d,y=["MO","TU","WE","TH","FR","SA","SU"],l=function(){function e(t,e){if(0===e)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=e}return e.prototype.nth=function(t){return this.n===t?this:new e(this.weekday,t)},e.prototype.equals=function(t){return this.weekday===t.weekday&&this.n===t.n},e.prototype.toString=function(){var t=y[this.weekday];return this.n&&(t=(0<this.n?"+":"")+String(this.n)+t),t},e.prototype.getJsWeekday=function(){return 6===this.weekday?0:this.weekday+1},e}(),f=(d=function(t,e){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),E=function(){function t(t,e,n,r){this.hour=t,this.minute=e,this.second=n,this.millisecond=r||0}return t.prototype.getHours=function(){return this.hour},t.prototype.getMinutes=function(){return this.minute},t.prototype.getSeconds=function(){return this.second},t.prototype.getMilliseconds=function(){return this.millisecond},t.prototype.getTime=function(){return 1e3*(60*this.hour*60+60*this.minute+this.second)+this.millisecond},t}(),T=function(u){function t(t,e,n,r,i,o,a){var s=u.call(this,r,i,o,a)||this;return s.year=t,s.month=e,s.day=n,s}return f(t,u),t.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},t.prototype.getWeekday=function(){return r.getWeekday(new Date(this.getTime()))},t.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},t.prototype.getDay=function(){return this.day},t.prototype.getMonth=function(){return this.month},t.prototype.getYear=function(){return this.year},t.prototype.addYears=function(t){this.year+=t},t.prototype.addMonths=function(t){if(this.month+=t,12<this.month){var e=Math.floor(this.month/12),n=Object(x.i)(this.month,12);this.month=n,this.year+=e,0===this.month&&(this.month=12,--this.year)}},t.prototype.addWeekly=function(t,e){e>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-e))+7*t:this.day+=-(this.getWeekday()-e)+7*t,this.fixDay()},t.prototype.addDaily=function(t){this.day+=t,this.fixDay()},t.prototype.addHours=function(t,e,n){for(e&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var r=Object(x.a)(this.hour,24),i=r.div,o=r.mod;if(i&&(this.hour=o,this.addDaily(i)),Object(x.b)(n)||Object(x.c)(n,this.hour))break}},t.prototype.addMinutes=function(t,e,n,r){for(e&&(this.minute+=Math.floor((1439-(60*this.hour+this.minute))/t)*t);;){this.minute+=t;var i=Object(x.a)(this.minute,60),o=i.div,a=i.mod;if(o&&(this.minute=a,this.addHours(o,!1,n)),(Object(x.b)(n)||Object(x.c)(n,this.hour))&&(Object(x.b)(r)||Object(x.c)(r,this.minute)))break}},t.prototype.addSeconds=function(t,e,n,r,i){for(e&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/t)*t);;){this.second+=t;var o=Object(x.a)(this.second,60),a=o.div,s=o.mod;if(a&&(this.second=s,this.addMinutes(a,!1,n,r)),(Object(x.b)(n)||Object(x.c)(n,this.hour))&&(Object(x.b)(r)||Object(x.c)(r,this.minute))&&(Object(x.b)(i)||Object(x.c)(i,this.second)))break}},t.prototype.fixDay=function(){if(!(this.day<=28)){var t=r.monthRange(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,13===this.month&&(this.month=1,++this.year,this.year>r.MAXYEAR))return;t=r.monthRange(this.year,this.month-1)[1]}}},t.prototype.add=function(t,e){var n=t.freq,r=t.interval,i=t.wkst,o=t.byhour,a=t.byminute,s=t.bysecond;switch(n){case h.YEARLY:return this.addYears(r);case h.MONTHLY:return this.addMonths(r);case h.WEEKLY:return this.addWeekly(r,i);case h.DAILY:return this.addDaily(r);case h.HOURLY:return this.addHours(r,e,o);case h.MINUTELY:return this.addMinutes(r,e,o,a);case h.SECONDLY:return this.addSeconds(r,e,o,a,s)}},t}(E);function b(n){var r=[],t=Object.keys(n),i={};if(t.forEach(function(t){var e=n[t];i[t]=e,Object(x.c)(at,t)||r.push(t),Y.isDate(e)&&!Y.isValidDate(e)&&r.push(t)}),r.length)throw new Error("Invalid options: "+r.join(", "));return i}var p=function(){return(p=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function m(t){var e=t.split("\n").map(O).filter(function(t){return null!==t});return p({},e[0],e[1])}function w(t){var e={},n=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(t);if(!n)return e;n[0];var r=n[1],i=n[2];return r&&(e.tzid=r),e.dtstart=Y.untilStringToDate(i),e}function O(t){if(!(t=t.replace(/^\s+|\s+$/,"")).length)return null;var e=/^([A-Z]+?)[:;]/.exec(t.toUpperCase());if(!e)return v(t);e[0];var n=e[1];switch(n.toUpperCase()){case"RRULE":case"EXRULE":return v(t);case"DTSTART":return w(t);default:throw new Error("Unsupported RFC prop "+n+" in "+t)}}function v(u){var c=w(u.replace(/^RRULE:/i,""));return u.replace(/^(?:RRULE|EXRULE):/i,"").split(";").forEach(function(t){var e,n=t.split("="),r=n[0],i=n[1];switch(r.toUpperCase()){case"FREQ":c.freq=h[i.toUpperCase()];break;case"WKST":c.wkst=it[i.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var o=-1===(e=i).indexOf(",")?g(e):e.split(",").map(g),a=r.toLowerCase();c[a]=o;break;case"BYWEEKDAY":case"BYDAY":c.byweekday=i.split(",").map(function(t){if(2===t.length)return it[t];var e=t.match(/^([+-]?\d)([A-Z]{2})$/),n=Number(e[1]),r=e[2],i=it[r].weekday;return new l(i,n)});break;case"DTSTART":case"TZID":var s=w(u);c.tzid=s.tzid,c.dtstart=s.dtstart;break;case"UNTIL":c.until=Y.untilStringToDate(i);break;case"BYEASTER":c.byeaster=Number(i);break;default:throw new Error("Unknown RRULE property '"+r+"'")}}),c}function g(t){return/^[+-]?\d+$/.test(t)?Number(t):t}var k=n(2),D=function(){function t(t,e){this.date=t,this.tzid=e}return Object.defineProperty(t.prototype,"isUTC",{get:function(){return!this.tzid||"UTC"===this.tzid.toUpperCase()},enumerable:!0,configurable:!0}),t.prototype.toString=function(){var t=Y.timeToUntilString(this.date.getTime(),this.isUTC);return this.isUTC?":"+t:";TZID="+this.tzid+":"+t},t.prototype.getTime=function(){return this.date.getTime()},t.prototype.rezonedDate=function(){if(this.isUTC)return this.date;try{return k.DateTime.fromJSDate(this.date).setZone(this.tzid,{keepLocalTime:!0}).toJSDate()}catch(t){return t instanceof TypeError&&console.error("Using TZID without Luxon available is unsupported. Returned times are in UTC, not the requested time zone"),this.date}},t}();function S(t){for(var e=[],n="",r=Object.keys(t),i=Object.keys(ot),o=0;o<r.length;o++)if("tzid"!==r[o]&&Object(x.c)(i,r[o])){var a=r[o].toUpperCase(),s=t[r[o]],u="";if(Object(x.f)(s)&&(!Object(x.d)(s)||s.length)){switch(a){case"FREQ":u=st.FREQUENCIES[t.freq];break;case"WKST":u=Object(x.e)(s)?new l(s).toString():s.toString();break;case"BYWEEKDAY":a="BYDAY",u=Object(x.m)(s).map(function(t){return t instanceof l?t:Object(x.d)(t)?new l(t[0],t[1]):new l(t)}).toString();break;case"DTSTART":n=U(s,t.tzid);break;case"UNTIL":u=Y.timeToUntilString(s,!t.tzid);break;default:if(Object(x.d)(s)){for(var c=[],h=0;h<s.length;h++)c[h]=String(s[h]);u=c.toString()}else u=String(s)}u&&e.push([a,u])}}var d=e.map(function(t){return t[0]+"="+t[1].toString()}).join(";"),y="";return""!==d&&(y="RRULE:"+d),[n,y].filter(function(t){return!!t}).join("\n")}function U(t,e){return t?"DTSTART"+new D(new Date(t),e).toString():""}var L=function(){function t(){this.all=!1,this.before=[],this.after=[],this.between=[]}return t.prototype._cacheAdd=function(t,e,n){e&&(e=e instanceof Date?Y.clone(e):Y.cloneDates(e)),"all"===t?this.all=e:(n._value=e,this[t].push(n))},t.prototype._cacheGet=function(t,r){var e=!1,i=r?Object.keys(r):[],n=function(t){for(var e=0;e<i.length;e++){var n=i[e];if(String(r[n])!==String(t[n]))return!0}return!1},o=this[t];if("all"===t)e=this.all;else if(Object(x.d)(o))for(var a=0;a<o.length;a++){var s=o[a];if(!i.length||!n(s)){e=s._value;break}}if(!e&&this.all){var u=new c(t,r);for(a=0;a<this.all.length&&u.accept(this.all[a]);a++);e=u.getValue(),this._cacheAdd(t,e,r)}return Object(x.d)(e)?Y.cloneDates(e):e instanceof Date?Y.clone(e):e},t}(),_=Object(x.k)(1,31).concat(Object(x.k)(2,28),Object(x.k)(3,31),Object(x.k)(4,30),Object(x.k)(5,31),Object(x.k)(6,30),Object(x.k)(7,31),Object(x.k)(8,31),Object(x.k)(9,30),Object(x.k)(10,31),Object(x.k)(11,30),Object(x.k)(12,31),Object(x.k)(1,7)),M=Object(x.k)(1,31).concat(Object(x.k)(2,29),Object(x.k)(3,31),Object(x.k)(4,30),Object(x.k)(5,31),Object(x.k)(6,30),Object(x.k)(7,31),Object(x.k)(8,31),Object(x.k)(9,30),Object(x.k)(10,31),Object(x.k)(11,30),Object(x.k)(12,31),Object(x.k)(1,7)),R=Object(x.j)(1,29),A=Object(x.j)(1,30),N=Object(x.j)(1,31),C=Object(x.j)(1,32),I=C.concat(A,C,N,C,N,C,C,N,C,N,C,C.slice(0,7)),W=C.concat(R,C,N,C,N,C,C,N,C,N,C,C.slice(0,7)),H=Object(x.j)(-28,0),P=Object(x.j)(-29,0),q=Object(x.j)(-30,0),z=Object(x.j)(-31,0),F=z.concat(P,z,q,z,q,z,z,q,z,q,z,z.slice(0,7)),K=z.concat(H,z,q,z,q,z,z,q,z,q,z,z.slice(0,7)),B=[0,31,60,91,121,152,182,213,244,274,305,335,366],Z=[0,31,59,90,120,151,181,212,243,273,304,334,365],V=function(){for(var t=[],e=0;e<55;e++)t=t.concat(Object(x.j)(7));return t}(),X=function(){return(X=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function G(t,e){var n,r,i,o,a,s,u=new Date(Date.UTC(t,0,1)),c=Y.isLeapYear(t)?366:365,h=Y.isLeapYear(t+1)?366:365,d=Y.toOrdinal(u),y=Y.getWeekday(u),l=X({yearlen:c,nextyearlen:h,yearordinal:d,yearweekday:y},(n=t,r=Y.isLeapYear(n)?366:365,i=new Date(Date.UTC(n,0,1)),o=Y.getWeekday(i),365!==r?{mmask:M,mdaymask:I,nmdaymask:F,wdaymask:V.slice(o),mrange:B}:{mmask:_,mdaymask:W,nmdaymask:K,wdaymask:V.slice(o),mrange:Z}),{wnomask:null});if(Object(x.b)(e.byweekno))return l;l.wnomask=Object(x.k)(0,c+7);var f=a=Object(x.i)(7-y+e.wkst,7);s=4<=f?(f=0,l.yearlen+Object(x.i)(y-e.wkst,7)):c-f;for(var b=Math.floor(s/7),p=Object(x.i)(s,7),m=Math.floor(b+p/4),w=0;w<e.byweekno.length;w++){var O=e.byweekno[w];if(O<0&&(O+=m+1),0<O&&O<=m){var v=void 0;1<O?(v=f+7*(O-1),f!==a&&(v-=7-a)):v=f;for(var g=0;g<7&&(l.wnomask[v]=1,v++,l.wdaymask[v]!==e.wkst);g++);}}if(Object(x.c)(e.byweekno,1)){v=f+7*m;if(f!==a&&(v-=7-a),v<c)for(w=0;w<7&&(v+=l.wnomask[v]=1,l.wdaymask[v]!==e.wkst);w++);}if(f){var k=void 0;if(Object(x.c)(e.byweekno,-1))k=-1;else{var j=Y.getWeekday(new Date(Date.UTC(t-1,0,1))),E=Object(x.i)(7-j.valueOf()+e.wkst,7),T=Y.isLeapYear(t-1)?366:365,D=void 0;D=4<=E?(E=0,T+Object(x.i)(j-e.wkst,7)):c-f,k=Math.floor(52+Object(x.i)(D,7)/4)}if(Object(x.c)(e.byweekno,k))for(v=0;v<f;v++)l.wnomask[v]=1}return l}var J=function(){function t(t){this.options=t}return t.prototype.rebuild=function(t,e){var n=this.options;if(t!==this.lastyear&&(this.yearinfo=G(t,n)),Object(x.g)(n.bynweekday)&&(e!==this.lastmonth||t!==this.lastyear)){var r=this.yearinfo,i=r.yearlen,o=r.mrange,a=r.wdaymask;this.monthinfo=function(t,e,n,r,i,o){var a={lastyear:t,lastmonth:e,nwdaymask:[]},s=[];if(o.freq===st.YEARLY)if(Object(x.b)(o.bymonth))s=[[0,n]];else for(var u=0;u<o.bymonth.length;u++)e=o.bymonth[u],s.push(r.slice(e-1,e+1));else o.freq===st.MONTHLY&&(s=[r.slice(e-1,e+1)]);if(Object(x.b)(s))return a;for(a.nwdaymask=Object(x.k)(0,n),u=0;u<s.length;u++)for(var c=s[u],h=c[0],d=c[1]-1,y=0;y<o.bynweekday.length;y++){var l=void 0,f=o.bynweekday[y],b=f[0],p=f[1];p<0?(l=d+7*(p+1),l-=Object(x.i)(i[l]-b,7)):(l=h+7*(p-1),l+=Object(x.i)(7-i[l]+b,7)),h<=l&&l<=d&&(a.nwdaymask[l]=1)}return a}(t,e,i,o,a,n)}Object(x.f)(n.byeaster)&&(this.eastermask=function(t,e){void 0===e&&(e=0);var n=t%19,r=Math.floor(t/100),i=t%100,o=Math.floor(r/4),a=r%4,s=Math.floor((r+8)/25),u=Math.floor((r-s+1)/3),c=Math.floor(19*n+r-o-u+15)%30,h=Math.floor(i/4),d=i%4,y=Math.floor(32+2*a+2*h-c-d)%7,l=Math.floor((n+11*c+22*y)/451),f=Math.floor((c+y-7*l+114)/31),b=(c+y-7*l+114)%31+1,p=Date.UTC(t,f-1,b+e),m=Date.UTC(t,0,1);return[Math.ceil((p-m)/864e5)]}(t,n.byeaster))},Object.defineProperty(t.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!0,configurable:!0}),t.prototype.ydayset=function(){return[Object(x.j)(this.yearlen),0,this.yearlen]},t.prototype.mdayset=function(t,e,n){for(var r=this.mrange[e-1],i=this.mrange[e],o=Object(x.k)(null,this.yearlen),a=r;a<i;a++)o[a]=a;return[o,r,i]},t.prototype.wdayset=function(t,e,n){for(var r=Object(x.k)(null,this.yearlen+7),i=Y.toOrdinal(new Date(Date.UTC(t,e-1,n)))-this.yearordinal,o=i,a=0;a<7&&(r[i]=i,++i,this.wdaymask[i]!==this.options.wkst);a++);return[r,o,i]},t.prototype.ddayset=function(t,e,n){var r=Object(x.k)(null,this.yearlen),i=Y.toOrdinal(new Date(Date.UTC(t,e-1,n)))-this.yearordinal;return r[i]=i,[r,i,i+1]},t.prototype.htimeset=function(e,t,n,r){var i=this,o=[];return this.options.byminute.forEach(function(t){o=o.concat(i.mtimeset(e,t,n,r))}),Y.sort(o),o},t.prototype.mtimeset=function(e,n,t,r){var i=this.options.bysecond.map(function(t){return new E(e,n,t,r)});return Y.sort(i),i},t.prototype.stimeset=function(t,e,n,r){return[new E(t,e,n,r)]},t.prototype.getdayset=function(t){switch(t){case h.YEARLY:return this.ydayset.bind(this);case h.MONTHLY:return this.mdayset.bind(this);case h.WEEKLY:return this.wdayset.bind(this);case h.DAILY:default:return this.ddayset.bind(this)}},t.prototype.gettimeset=function(t){switch(t){case h.HOURLY:return this.htimeset.bind(this);case h.MINUTELY:return this.mtimeset.bind(this);case h.SECONDLY:return this.stimeset.bind(this)}},t}();function Q(t,e,n,r,i,o){for(var a=[],s=0;s<t.length;s++){var u=void 0,c=void 0,h=t[s];c=h<0?(u=Math.floor(h/e.length),Object(x.i)(h,e.length)):(u=Math.floor((h-1)/e.length),Object(x.i)(h-1,e.length));for(var d=[],y=n;y<r;y++){var l=o[y];Object(x.f)(l)&&d.push(l)}var f=void 0;f=u<0?d.slice(u)[0]:d[u];var b=e[c],p=Y.fromOrdinal(i.yearordinal+f),m=Y.combine(p,b);Object(x.c)(a,m)||a.push(m)}return Y.sort(a),a}function $(t,e){var n=e.dtstart,r=e.freq,i=e.until,o=e.bysetpos,a=T.fromDate(n),s=new J(e);s.rebuild(a.year,a.month);for(var u=function(t,e,n){var r=n.freq,i=n.byhour,o=n.byminute,a=n.bysecond;if(j(r))return function(t){var r=t.dtstart.getTime()%1e3;if(!j(t.freq))return[];var i=[];return t.byhour.forEach(function(n){t.byminute.forEach(function(e){t.bysecond.forEach(function(t){i.push(new E(n,e,t,r))})})}),i}(n);if(r>=st.HOURLY&&Object(x.g)(i)&&!Object(x.c)(i,e.hour)||r>=st.MINUTELY&&Object(x.g)(o)&&!Object(x.c)(o,e.minute)||r>=st.SECONDLY&&Object(x.g)(a)&&!Object(x.c)(a,e.second))return[];return t.gettimeset(r)(e.hour,e.minute,e.second,e.millisecond)}(s,a,e),c=e.count;;){var h=s.getdayset(r)(a.year,a.month,a.day),d=h[0],y=h[1],l=h[2],f=nt(d,y,l,s,e);if(Object(x.g)(o))for(var b=Q(o,u,y,l,s,d),p=0;p<b.length;p++){var m=b[p];if(i&&i<m)return et(t);if(n<=m){var w=tt(m,e);if(!t.accept(w))return et(t);if(c&&!--c)return et(t)}}else for(p=y;p<l;p++){var O=d[p];if(Object(x.f)(O))for(var v=Y.fromOrdinal(s.yearordinal+O),g=0;g<u.length;g++){var k=u[g];m=Y.combine(v,k);if(i&&i<m)return et(t);if(n<=m){w=tt(m,e);if(!t.accept(w))return et(t);if(c&&!--c)return et(t)}}}if(0===e.interval)return et(t);if(a.add(e,f),a.year>Y.MAXYEAR)return et(t);j(r)||(u=s.gettimeset(r)(a.hour,a.minute,a.second,0)),s.rebuild(a.year,a.month)}}function tt(t,e){return new D(t,e.tzid).rezonedDate()}function et(t){return t.getValue()}function nt(t,e,n,r,i){for(var o,a,s,u,c,h,d,y,l,f,b=!1,p=e;p<n;p++){var m=t[p];o=r,a=m,void 0,u=(s=i).bymonth,c=s.byweekno,h=s.byweekday,d=s.byeaster,y=s.bymonthday,l=s.bynmonthday,f=s.byyearday,(b=Object(x.g)(u)&&!Object(x.c)(u,o.mmask[a])||Object(x.g)(c)&&!o.wnomask[a]||Object(x.g)(h)&&!Object(x.c)(h,o.wdaymask[a])||Object(x.g)(o.nwdaymask)&&!o.nwdaymask[a]||null!==d&&!Object(x.c)(o.eastermask,a)||(Object(x.g)(y)||Object(x.g)(l))&&!Object(x.c)(y,o.mdaymask[a])&&!Object(x.c)(l,o.nmdaymask[a])||Object(x.g)(f)&&(a<o.yearlen&&!Object(x.c)(f,a+1)&&!Object(x.c)(f,-o.yearlen+a)||a>=o.yearlen&&!Object(x.c)(f,a+1-o.yearlen)&&!Object(x.c)(f,-o.nextyearlen+a-o.yearlen)))&&(t[m]=null)}return b}var rt=function(){return rt._nlp||(rt._nlp=n(3)),rt._nlp},it={MO:new l(0),TU:new l(1),WE:new l(2),TH:new l(3),FR:new l(4),SA:new l(5),SU:new l(6)},ot={freq:h.YEARLY,dtstart:null,interval:1,wkst:it.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},at=Object.keys(ot),st=function(){function e(t,e){void 0===t&&(t={}),void 0===e&&(e=!1),this._cache=e?null:new L,this.origOptions=b(t);var n=function(t){var e=b(t),n=Object.keys(t);if(at.forEach(function(t){Object(x.c)(n,t)&&Object(x.f)(e[t])||(e[t]=ot[t])}),Object(x.f)(e.byeaster)&&(e.freq=st.YEARLY),!Object(x.f)(e.freq)||!st.FREQUENCIES[e.freq])throw new Error("Invalid frequency: "+e.freq+" "+t.freq);if(e.dtstart||(e.dtstart=new Date((new Date).setMilliseconds(0))),Object(x.f)(e.wkst)?Object(x.e)(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=st.MO.weekday,Object(x.f)(e.bysetpos)){Object(x.e)(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var r=0;r<e.bysetpos.length;r++)if(0===(a=e.bysetpos[r])||!(-366<=a&&a<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}if(!(Boolean(e.byweekno)||Object(x.g)(e.byweekno)||Object(x.g)(e.byyearday)||Boolean(e.bymonthday)||Object(x.g)(e.bymonthday)||Object(x.f)(e.byweekday)||Object(x.f)(e.byeaster)))switch(e.freq){case st.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case st.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case st.WEEKLY:e.byweekday=[Y.getWeekday(e.dtstart)]}if(Object(x.f)(e.bymonth)&&!Object(x.d)(e.bymonth)&&(e.bymonth=[e.bymonth]),Object(x.f)(e.byyearday)&&!Object(x.d)(e.byyearday)&&Object(x.e)(e.byyearday)&&(e.byyearday=[e.byyearday]),Object(x.f)(e.bymonthday))if(Object(x.d)(e.bymonthday)){var i=[],o=[];for(r=0;r<e.bymonthday.length;r++){var a;0<(a=e.bymonthday[r])?i.push(a):a<0&&o.push(a)}e.bymonthday=i,e.bynmonthday=o}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);else e.bymonthday=[],e.bynmonthday=[];if(Object(x.f)(e.byweekno)&&!Object(x.d)(e.byweekno)&&(e.byweekno=[e.byweekno]),Object(x.f)(e.byweekday))if(Object(x.e)(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(e.byweekday instanceof l)!e.byweekday.n||e.freq>st.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{var s=[],u=[];for(r=0;r<e.byweekday.length;r++){var c=e.byweekday[r];if(Object(x.e)(c))s.push(c);else{var h=c;!h.n||e.freq>st.MONTHLY?s.push(h.weekday):u.push([h.weekday,h.n])}}e.byweekday=Object(x.g)(s)?s:null,e.bynweekday=Object(x.g)(u)?u:null}else e.bynweekday=null;return Object(x.f)(e.byhour)?Object(x.e)(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<st.HOURLY?[e.dtstart.getUTCHours()]:null,Object(x.f)(e.byminute)?Object(x.e)(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<st.MINUTELY?[e.dtstart.getUTCMinutes()]:null,Object(x.f)(e.bysecond)?Object(x.e)(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<st.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}(t).parsedOptions;this.options=n}return e.parseText=function(t,e){return rt().parseText(t,e)},e.fromText=function(t,e){return rt().fromText(t,e)},e.fromString=function(t){return new e(e.parseString(t)||void 0)},e.prototype._iter=function(t){return $(t,this.options)},e.prototype._cacheGet=function(t,e){return!!this._cache&&this._cache._cacheGet(t,e)},e.prototype._cacheAdd=function(t,e,n){if(this._cache)return this._cache._cacheAdd(t,e,n)},e.prototype.all=function(t){if(t)return this._iter(new u("all",{},t));var e=this._cacheGet("all");return!1===e&&(e=this._iter(new c("all",{})),this._cacheAdd("all",e)),e},e.prototype.between=function(t,e,n,r){if(void 0===n&&(n=!1),!Y.isValidDate(t)||!Y.isValidDate(e))throw new Error("Invalid date passed in to RRule.between");var i={before:e,after:t,inc:n};if(r)return this._iter(new u("between",i,r));var o=this._cacheGet("between",i);return!1===o&&(o=this._iter(new c("between",i)),this._cacheAdd("between",o,i)),o},e.prototype.before=function(t,e){if(void 0===e&&(e=!1),!Y.isValidDate(t))throw new Error("Invalid date passed in to RRule.before");var n={dt:t,inc:e},r=this._cacheGet("before",n);return!1===r&&(r=this._iter(new c("before",n)),this._cacheAdd("before",r,n)),r},e.prototype.after=function(t,e){if(void 0===e&&(e=!1),!Y.isValidDate(t))throw new Error("Invalid date passed in to RRule.after");var n={dt:t,inc:e},r=this._cacheGet("after",n);return!1===r&&(r=this._iter(new c("after",n)),this._cacheAdd("after",r,n)),r},e.prototype.count=function(){return this.all().length},e.prototype.toString=function(){return S(this.origOptions)},e.prototype.toText=function(t,e){return rt().toText(this,t,e)},e.prototype.isFullyConvertibleToText=function(){return rt().isFullyConvertible(this)},e.prototype.clone=function(){return new e(this.origOptions)},e.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],e.YEARLY=h.YEARLY,e.MONTHLY=h.MONTHLY,e.WEEKLY=h.WEEKLY,e.DAILY=h.DAILY,e.HOURLY=h.HOURLY,e.MINUTELY=h.MINUTELY,e.SECONDLY=h.SECONDLY,e.MO=it.MO,e.TU=it.TU,e.WE=it.WE,e.TH=it.TH,e.FR=it.FR,e.SA=it.SA,e.SU=it.SU,e.parseString=m,e.optionsToString=S,e}();var ut,ct=(ut=function(t,e){return(ut=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}ut(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ht=function(n){function t(t){void 0===t&&(t=!1);var e=n.call(this,{},t)||this;return e._rrule=[],e._rdate=[],e._exrule=[],e._exdate=[],e}return ct(t,n),t.prototype.tzid=function(t){if(void 0!==t&&(this._tzid=t),void 0!==this._tzid)return this._tzid;for(var e=0;e<this._rrule.length;e++){var n=this._rrule[e].origOptions.tzid;if(n)return n}},t.prototype._iter=function(t){return function(e,t,r,n,i,o){var a={},s=e.accept;function u(e,n){r.forEach(function(t){t.between(e,n,!0).forEach(function(t){a[Number(t)]=!0})})}i.forEach(function(t){var e=new D(t,o).rezonedDate();a[Number(e)]=!0}),e.accept=function(t){var e=Number(t);return!(!a[e]&&(u(new Date(e-1),new Date(e+1)),!a[e]))||(a[e]=!0,s.call(this,t))},"between"===e.method&&(u(e.args.after,e.args.before),e.accept=function(t){var e=Number(t);return!!a[e]||(a[e]=!0,s.call(this,t))});for(var c=0;c<n.length;c++){var h=new D(n[c],o).rezonedDate();if(!e.accept(new Date(h.getTime())))break}t.forEach(function(t){$(e,t.options)});var d=e._result;switch(Y.sort(d),e.method){case"all":case"between":return d;case"before":return d.length&&d[d.length-1]||null;case"after":default:return d.length&&d[0]||null}}(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},t.prototype.rrule=function(t){dt(t,this._rrule)},t.prototype.exrule=function(t){dt(t,this._exrule)},t.prototype.rdate=function(t){yt(t,this._rdate)},t.prototype.exdate=function(t){yt(t,this._exdate)},t.prototype.valueOf=function(){var e=[];return this._rrule.forEach(function(t){e=e.concat(t.toString().split("\n"))}),this._exrule.forEach(function(t){e=e.concat(t.toString().split("\n").map(function(t){return t.replace(/^RRULE:/,"EXRULE:")}).filter(function(t){return!/^DTSTART/.test(t)}))}),this._rdate.length&&e.push(lt("RDATE",this._rdate,this.tzid())),this._exdate.length&&e.push(lt("EXDATE",this._exdate,this.tzid())),e},t.prototype.toString=function(){return this.valueOf().join("\n")},t.prototype.clone=function(){var e=new t(!!this._cache);return this._rrule.forEach(function(t){return e.rrule(t.clone())}),this._exrule.forEach(function(t){return e.exrule(t.clone())}),this._rdate.forEach(function(t){return e.rdate(new Date(t.getTime()))}),this._exdate.forEach(function(t){return e.exdate(new Date(t.getTime()))}),e},t}(st);function dt(t,e){if(!(t instanceof st))throw new TypeError(String(t)+" is not RRule instance");Object(x.c)(e.map(String),String(t))||e.push(t)}function yt(t,e){if(!(t instanceof Date))throw new TypeError(String(t)+" is not Date instance");Object(x.c)(e.map(Number),Number(t))||(e.push(t),Y.sort(e))}function lt(t,e,n){var r=!n||"UTC"===n.toUpperCase();return""+(r?t+":":t+";TZID="+n+":")+e.map(function(t){return Y.timeToUntilString(t.valueOf(),r)}).join(",")}var ft=function(){return(ft=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},bt={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function pt(t,e){var s=[],u=[],c=[],h=[],n=w(t),r=n.dtstart,d=n.tzid;return function(t,e){void 0===e&&(e=!1);if(!(t=t&&t.trim()))throw new Error("Invalid empty string");if(!e)return t.split(/\s/);var n=t.split("\n"),r=0;for(;r<n.length;){var i=n[r]=n[r].replace(/\s+$/g,"");i?0<r&&" "===i[0]?(n[r-1]+=i.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}(t,e.unfold).forEach(function(t){if(t){var e=function(t){var e=function(t){if(-1===t.indexOf(":"))return{name:"RRULE",value:t};var e=Object(x.l)(t,":",1),n=e[0],r=e[1];return{name:n,value:r}}(t),n=e.name,r=e.value,i=n.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:r}}(t),n=e.name,r=e.parms,i=e.value;switch(n.toUpperCase()){case"RRULE":if(r.length)throw new Error("unsupported RRULE parm: "+r.join(","));s.push(m(t));break;case"RDATE":var o=/RDATE(?:;TZID=([^:=]+))?/i.exec(t),a=(o[0],o[1]);a&&!d&&(d=a),u=u.concat(Ot(i,r));break;case"EXRULE":if(r.length)throw new Error("unsupported EXRULE parm: "+r.join(","));c.push(m(i));break;case"EXDATE":h=h.concat(Ot(i,r));break;case"DTSTART":break;default:throw new Error("unsupported property: "+n)}}}),{dtstart:r,tzid:d,rrulevals:s,rdatevals:u,exrulevals:c,exdatevals:h}}function mt(t,e){return void 0===e&&(e={}),function(t,e){var n=pt(t,e),r=n.rrulevals,i=n.rdatevals,o=n.exrulevals,a=n.exdatevals,s=n.dtstart,u=n.tzid,c=!1===e.cache;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||1<r.length||i.length||o.length||a.length){var h=new ht(c);return h.tzid(u||void 0),r.forEach(function(t){h.rrule(new st(wt(t,s,u),c))}),i.forEach(function(t){h.rdate(t)}),o.forEach(function(t){h.exrule(new st(wt(t,s,u),c))}),a.forEach(function(t){h.exdate(t)}),e.compatible&&e.dtstart&&h.rdate(s),h}var d=r[0];return new st(wt(d,d.dtstart||e.dtstart||s,d.tzid||e.tzid||u),c)}(t,function(t){var e=[],n=Object.keys(t),r=Object.keys(bt);if(n.forEach(function(t){Object(x.c)(r,t)||e.push(t)}),e.length)throw new Error("Invalid options: "+e.join(", "));var i=ft({},t);return r.forEach(function(t){Object(x.c)(n,t)||(i[t]=bt[t])}),i}(e))}function wt(t,e,n){return ft({},t,{dtstart:e,tzid:n})}function Ot(t,e){return e.forEach(function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)}),t.split(",").map(function(t){return Y.untilStringToDate(t)})}n.d(e,"Frequency",function(){return h}),n.d(e,"Weekday",function(){return l}),n.d(e,"RRule",function(){return st}),n.d(e,"RRuleSet",function(){return ht}),n.d(e,"rrulestr",function(){return mt});
|
|
/*!
|
|
* rrule.js - Library for working with recurrence rules for calendar dates.
|
|
* https://github.com/jakubroztocil/rrule
|
|
*
|
|
* Copyright 2010, Jakub Roztocil and Lars Schoning
|
|
* Licenced under the BSD licence.
|
|
* https://github.com/jakubroztocil/rrule/blob/master/LICENCE
|
|
*
|
|
* Based on:
|
|
* python-dateutil - Extensions to the standard Python datetime module.
|
|
* Copyright (c) 2003-2011 - Gustavo Niemeyer <gustavo@niemeyer.net>
|
|
* Copyright (c) 2012 - Tomi Pieviläinen <tomi.pievilainen@iki.fi>
|
|
* https://github.com/jakubroztocil/rrule/blob/master/LICENCE
|
|
*
|
|
*/e.default=st},function(t,e){t.exports=n},function(t,e,n){"use strict";n.r(e);var d={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},y=n(1),u=n(0),r=function(t,e){return-1!==t.indexOf(e)},c=function(t){return t.toString()},i=function(){function n(t,e,n){if(void 0===e&&(e=c),void 0===n&&(n=d),this.text=[],this.language=n||d,this.gettext=e,this.rrule=t,this.options=t.options,this.origOptions=t.origOptions,this.origOptions.bymonthday){var r=[].concat(this.options.bymonthday),i=[].concat(this.options.bynmonthday);r.sort(function(t,e){return t-e}),i.sort(function(t,e){return e-t}),this.bymonthday=r.concat(i),this.bymonthday.length||(this.bymonthday=null)}if(Object(u.f)(this.origOptions.byweekday)){var o=Object(u.d)(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],a=String(o);this.byweekday={allWeeks:o.filter(function(t){return!t.n}),someWeeks:o.filter(function(t){return Boolean(t.n)}),isWeekdays:-1!==a.indexOf("MO")&&-1!==a.indexOf("TU")&&-1!==a.indexOf("WE")&&-1!==a.indexOf("TH")&&-1!==a.indexOf("FR")&&-1===a.indexOf("SA")&&-1===a.indexOf("SU"),isEveryDay:-1!==a.indexOf("MO")&&-1!==a.indexOf("TU")&&-1!==a.indexOf("WE")&&-1!==a.indexOf("TH")&&-1!==a.indexOf("FR")&&-1!==a.indexOf("SA")&&-1!==a.indexOf("SU")};var s=function(t,e){return t.weekday-e.weekday};this.byweekday.allWeeks.sort(s),this.byweekday.someWeeks.sort(s),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return n.isFullyConvertible=function(t){if(!(t.options.freq in n.IMPLEMENTED))return!1;if(t.origOptions.until&&t.origOptions.count)return!1;for(var e in t.origOptions){if(r(["dtstart","wkst","freq"],e))return!0;if(!r(n.IMPLEMENTED[t.options.freq],e))return!1}return!0},n.prototype.isFullyConvertible=function(){return n.isFullyConvertible(this.rrule)},n.prototype.toString=function(){var t=this.gettext;if(!(this.options.freq in n.IMPLEMENTED))return t("RRule error: Unable to fully convert this rrule to text");if(this.text=[t("every")],this[y.default.FREQUENCIES[this.options.freq]](),this.options.until){this.add(t("until"));var e=this.options.until;this.add(this.language.monthNames[e.getUTCMonth()]).add(e.getUTCDate()+",").add(e.getUTCFullYear().toString())}else this.options.count&&this.add(t("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?t("times"):t("time"));return this.isFullyConvertible()||this.add(t("(~ approximate)")),this.text.join("")},n.prototype.HOURLY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("hours"):t("hour"))},n.prototype.MINUTELY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add((this.plural(this.options.interval),t("minutes")))},n.prototype.DAILY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(this.plural(this.options.interval)?t("days"):t("day")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},n.prototype.WEEKLY=function(){var t=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?t("weeks"):t("week")),this.byweekday&&this.byweekday.isWeekdays?1===this.options.interval?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(t("on")).add(t("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?t("days"):t("day")):(1===this.options.interval&&this.add(t("week")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())},n.prototype.MONTHLY=function(){var t=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()).add(t("months")),this.plural(this.options.interval)&&this.add(t("in"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("months"):t("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(t("on")).add(t("weekdays")):this.byweekday&&this._byweekday()},n.prototype.YEARLY=function(){var t=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()),this.add(t("years"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("years"):t("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(t("on the")).add(this.list(this.options.byyearday,this.nth,t("and"))).add(t("day")),this.options.byweekno&&this.add(t("in")).add(this.plural(this.options.byweekno.length)?t("weeks"):t("week")).add(this.list(this.options.byweekno,void 0,t("and")))},n.prototype._bymonthday=function(){var t=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,t("or"))).add(t("the")).add(this.list(this.bymonthday,this.nth,t("or"))):this.add(t("on the")).add(this.list(this.bymonthday,this.nth,t("and")))},n.prototype._byweekday=function(){var t=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(t("and")),this.add(t("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,t("and"))))},n.prototype._byhour=function(){var t=this.gettext;this.add(t("at")).add(this.list(this.origOptions.byhour,void 0,t("and")))},n.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},n.prototype.nth=function(t){var e,n;t=parseInt(t.toString(),10);var r=this.gettext;if(-1===t)return r("last");switch(n=Math.abs(t)){case 1:case 21:case 31:e=n+r("st");break;case 2:case 22:e=n+r("nd");break;case 3:case 23:e=n+r("rd");break;default:e=n+r("th")}return t<0?e+" "+r("last"):e},n.prototype.monthtext=function(t){return this.language.monthNames[t-1]},n.prototype.weekdaytext=function(t){var e=Object(u.e)(t)?(t+1)%7:t.getJsWeekday();return(t.n?this.nth(t.n)+" ":"")+this.language.dayNames[e]},n.prototype.plural=function(t){return t%100!=1},n.prototype.add=function(t){return this.text.push(" "),this.text.push(t),this},n.prototype.list=function(t,e,n,r){void 0===r&&(r=","),Object(u.d)(t)||(t=[t]);e=e||function(t){return t.toString()};var i=this,o=function(t){return e&&e.call(i,t)};return n?function(t,e,n){for(var r="",i=0;i<t.length;i++)0!==i&&(i===t.length-1?r+=" "+n+" ":r+=e+" "),r+=t[i];return r}(t.map(o),r,n):t.map(o).join(r+" ")},n}(),l=function(){function t(t){this.done=!0,this.rules=t}return t.prototype.start=function(t){return this.text=t,this.done=!1,this.nextSymbol()},t.prototype.isDone=function(){return this.done&&null===this.symbol},t.prototype.nextSymbol=function(){var t,e;this.symbol=null,this.value=null;do{if(this.done)return!1;for(var n in t=null,this.rules){var r=this.rules[n].exec(this.text);r&&(null===t||r[0].length>t[0].length)&&(t=r,e=n)}if(null!=t&&(this.text=this.text.substr(t[0].length),""===this.text&&(this.done=!0)),null==t)return this.done=!0,this.symbol=null,void(this.value=null)}while("SKIP"===e);return this.symbol=e,this.value=t,!0},t.prototype.accept=function(t){if(this.symbol!==t)return!1;if(this.value){var e=this.value;return this.nextSymbol(),e}return this.nextSymbol(),!0},t.prototype.acceptNumber=function(){return this.accept("number")},t.prototype.expect=function(t){if(this.accept(t))return!0;throw new Error("expected "+t+" but found "+this.symbol)},t}();function o(t,e){void 0===e&&(e=d);var a={},s=new l(e.tokens);return s.start(t)?(function(){s.expect("every");var t=s.acceptNumber();t&&(a.interval=parseInt(t[0],10));if(s.isDone())throw new Error("Unexpected end");switch(s.symbol){case"day(s)":a.freq=y.default.DAILY,s.nextSymbol()&&(!function(){if(!s.accept("at"))return;do{var t=s.acceptNumber();if(!t)throw new Error("Unexpected symbol "+s.symbol+", expected hour");for(a.byhour=[parseInt(t[0],10)];s.accept("comma");){if(!(t=s.acceptNumber()))throw new Error("Unexpected symbol "+s.symbol+"; expected hour");a.byhour.push(parseInt(t[0],10))}}while(s.accept("comma")||s.accept("at"))}(),o());break;case"weekday(s)":a.freq=y.default.WEEKLY,a.byweekday=[y.default.MO,y.default.TU,y.default.WE,y.default.TH,y.default.FR],s.nextSymbol(),o();break;case"week(s)":a.freq=y.default.WEEKLY,s.nextSymbol()&&(i(),o());break;case"hour(s)":a.freq=y.default.HOURLY,s.nextSymbol()&&(i(),o());break;case"minute(s)":a.freq=y.default.MINUTELY,s.nextSymbol()&&(i(),o());break;case"month(s)":a.freq=y.default.MONTHLY,s.nextSymbol()&&(i(),o());break;case"year(s)":a.freq=y.default.YEARLY,s.nextSymbol()&&(i(),o());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":a.freq=y.default.WEEKLY;var e=s.symbol.substr(0,2).toUpperCase();if(a.byweekday=[y.default[e]],!s.nextSymbol())return;for(;s.accept("comma");){if(s.isDone())throw new Error("Unexpected end");var n=c();if(!n)throw new Error("Unexpected symbol "+s.symbol+", expected weekday");a.byweekday.push(y.default[n]),s.nextSymbol()}!function(){s.accept("on"),s.accept("the");var t=h();if(!t)return;a.bymonthday=[t],s.nextSymbol();for(;s.accept("comma");){if(!(t=h()))throw new Error("Unexpected symbol "+s.symbol+"; expected monthday");a.bymonthday.push(t),s.nextSymbol()}}(),o();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(a.freq=y.default.YEARLY,a.bymonth=[u()],!s.nextSymbol())return;for(;s.accept("comma");){if(s.isDone())throw new Error("Unexpected end");var r=u();if(!r)throw new Error("Unexpected symbol "+s.symbol+", expected month");a.bymonth.push(r),s.nextSymbol()}i(),o();break;default:throw new Error("Unknown symbol")}}(),a):null;function i(){var t=s.accept("on"),e=s.accept("the");if(t||e)do{var n=h(),r=c(),i=u();if(n)r?(s.nextSymbol(),a.byweekday||(a.byweekday=[]),a.byweekday.push(y.default[r].nth(n))):(a.bymonthday||(a.bymonthday=[]),a.bymonthday.push(n),s.accept("day(s)"));else if(r)s.nextSymbol(),a.byweekday||(a.byweekday=[]),a.byweekday.push(y.default[r]);else if("weekday(s)"===s.symbol)s.nextSymbol(),a.byweekday||(a.byweekday=[y.default.MO,y.default.TU,y.default.WE,y.default.TH,y.default.FR]);else if("week(s)"===s.symbol){s.nextSymbol();var o=s.acceptNumber();if(!o)throw new Error("Unexpected symbol "+s.symbol+", expected week number");for(a.byweekno=[parseInt(o[0],10)];s.accept("comma");){if(!(o=s.acceptNumber()))throw new Error("Unexpected symbol "+s.symbol+"; expected monthday");a.byweekno.push(parseInt(o[0],10))}}else{if(!i)return;s.nextSymbol(),a.bymonth||(a.bymonth=[]),a.bymonth.push(i)}}while(s.accept("comma")||s.accept("the")||s.accept("on"))}function u(){switch(s.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function c(){switch(s.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return s.symbol.substr(0,2).toUpperCase();default:return!1}}function h(){switch(s.symbol){case"last":return s.nextSymbol(),-1;case"first":return s.nextSymbol(),1;case"second":return s.nextSymbol(),s.accept("last")?-2:2;case"third":return s.nextSymbol(),s.accept("last")?-3:3;case"nth":var t=parseInt(s.value[1],10);if(t<-366||366<t)throw new Error("Nth out of range: "+t);return s.nextSymbol(),s.accept("last")?-t:t;default:return!1}}function o(){if("until"===s.symbol){var t=Date.parse(s.text);if(!t)throw new Error("Cannot parse until date:"+s.text);a.until=new Date(t)}else s.accept("for")&&(a.count=parseInt(s.value[0],10),s.expect("number"))}}n.d(e,"fromText",function(){return a}),n.d(e,"isFullyConvertible",function(){return f}),n.d(e,"toText",function(){return h}),n.d(e,"parseText",function(){return o});
|
|
/*!
|
|
* rrule.js - Library for working with recurrence rules for calendar dates.
|
|
* https://github.com/jakubroztocil/rrule
|
|
*
|
|
* Copyright 2010, Jakub Roztocil and Lars Schoning
|
|
* Licenced under the BSD licence.
|
|
* https://github.com/jakubroztocil/rrule/blob/master/LICENCE
|
|
*
|
|
*/
|
|
var a=function(t,e){return void 0===e&&(e=d),new y.default(o(t,e)||void 0)},s=["count","until","interval","byweekday","bymonthday","bymonth"];i.IMPLEMENTED=[],i.IMPLEMENTED[y.default.HOURLY]=s,i.IMPLEMENTED[y.default.MINUTELY]=s,i.IMPLEMENTED[y.default.DAILY]=["byhour"].concat(s),i.IMPLEMENTED[y.default.WEEKLY]=s,i.IMPLEMENTED[y.default.MONTHLY]=s,i.IMPLEMENTED[y.default.YEARLY]=["byweekno","byyearday"].concat(s);var h=function(t,e,n){return new i(t,e,n).toString()},f=i.isFullyConvertible}])}); |