Files
2025-10-22 22:13:54 +02:00

46 lines
191 KiB
JavaScript

/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
"use strict";var Af=Object.create;var Nr=Object.defineProperty;var Wf=Object.getOwnPropertyDescriptor;var $f=Object.getOwnPropertyNames;var Vf=Object.getPrototypeOf,jf=Object.prototype.hasOwnProperty;var Hf=(n,e,r)=>e in n?Nr(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r;var Gf=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),zf=(n,e)=>{for(var r in e)Nr(n,r,{get:e[r],enumerable:!0})},$o=(n,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of $f(e))!jf.call(n,o)&&o!==r&&Nr(n,o,{get:()=>e[o],enumerable:!(i=Wf(e,o))||i.enumerable});return n};var Ot=(n,e,r)=>(r=n!=null?Af(Vf(n)):{},$o(e||!n||!n.__esModule?Nr(r,"default",{value:n,enumerable:!0}):r,n)),Zf=n=>$o(Nr({},"__esModule",{value:!0}),n);var g=(n,e,r)=>Hf(n,typeof e!="symbol"?e+"":e,r);var xt=Gf((Ki,ur)=>{(function(n,e){typeof Ki=="object"&&typeof ur!="undefined"?ur.exports=e():typeof define=="function"&&define.amd?define(e):n.moment=e()})(Ki,function(){"use strict";var n;function e(){return n.apply(null,arguments)}function r(t){n=t}function i(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function o(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function l(t,s){return Object.prototype.hasOwnProperty.call(t,s)}function c(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var s;for(s in t)if(l(t,s))return!1;return!0}function d(t){return t===void 0}function m(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function h(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function y(t,s){var a=[],u,f=t.length;for(u=0;u<f;++u)a.push(s(t[u],u));return a}function w(t,s){for(var a in s)l(s,a)&&(t[a]=s[a]);return l(s,"toString")&&(t.toString=s.toString),l(s,"valueOf")&&(t.valueOf=s.valueOf),t}function _(t,s,a,u){return wo(t,s,a,u,!0).utc()}function x(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function b(t){return t._pf==null&&(t._pf=x()),t._pf}var D;Array.prototype.some?D=Array.prototype.some:D=function(t){var s=Object(this),a=s.length>>>0,u;for(u=0;u<a;u++)if(u in s&&t.call(this,s[u],u,s))return!0;return!1};function F(t){if(t._isValid==null){var s=b(t),a=D.call(s.parsedDateParts,function(f){return f!=null}),u=!isNaN(t._d.getTime())&&s.overflow<0&&!s.empty&&!s.invalidEra&&!s.invalidMonth&&!s.invalidWeekday&&!s.weekdayMismatch&&!s.nullInput&&!s.invalidFormat&&!s.userInvalidated&&(!s.meridiem||s.meridiem&&a);if(t._strict&&(u=u&&s.charsLeftOver===0&&s.unusedTokens.length===0&&s.bigHour===void 0),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=u;else return u}return t._isValid}function T(t){var s=_(NaN);return t!=null?w(b(s),t):b(s).userInvalidated=!0,s}var B=e.momentProperties=[],P=!1;function N(t,s){var a,u,f,p=B.length;if(d(s._isAMomentObject)||(t._isAMomentObject=s._isAMomentObject),d(s._i)||(t._i=s._i),d(s._f)||(t._f=s._f),d(s._l)||(t._l=s._l),d(s._strict)||(t._strict=s._strict),d(s._tzm)||(t._tzm=s._tzm),d(s._isUTC)||(t._isUTC=s._isUTC),d(s._offset)||(t._offset=s._offset),d(s._pf)||(t._pf=b(s)),d(s._locale)||(t._locale=s._locale),p>0)for(a=0;a<p;a++)u=B[a],f=s[u],d(f)||(t[u]=f);return t}function V(t){N(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),P===!1&&(P=!0,e.updateOffset(this),P=!1)}function I(t){return t instanceof V||t!=null&&t._isAMomentObject!=null}function be(t){e.suppressDeprecationWarnings===!1&&typeof console!="undefined"&&console.warn&&console.warn("Deprecation warning: "+t)}function q(t,s){var a=!0;return w(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,t),a){var u=[],f,p,v,L=arguments.length;for(p=0;p<L;p++){if(f="",typeof arguments[p]=="object"){f+=`
[`+p+"] ";for(v in arguments[0])l(arguments[0],v)&&(f+=v+": "+arguments[0][v]+", ");f=f.slice(0,-2)}else f=arguments[p];u.push(f)}be(t+`
Arguments: `+Array.prototype.slice.call(u).join("")+`
`+new Error().stack),a=!1}return s.apply(this,arguments)},s)}var j={};function ee(t,s){e.deprecationHandler!=null&&e.deprecationHandler(t,s),j[t]||(be(s),j[t]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function ie(t){return typeof Function!="undefined"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function E(t){var s,a;for(a in t)l(t,a)&&(s=t[a],ie(s)?this[a]=s:this["_"+a]=s);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function te(t,s){var a=w({},t),u;for(u in s)l(s,u)&&(o(t[u])&&o(s[u])?(a[u]={},w(a[u],t[u]),w(a[u],s[u])):s[u]!=null?a[u]=s[u]:delete a[u]);for(u in t)l(t,u)&&!l(s,u)&&o(t[u])&&(a[u]=w({},a[u]));return a}function le(t){t!=null&&this.set(t)}var C;Object.keys?C=Object.keys:C=function(t){var s,a=[];for(s in t)l(t,s)&&a.push(s);return a};var Je={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function H(t,s,a){var u=this._calendar[t]||this._calendar.sameElse;return ie(u)?u.call(s,a):u}function Ee(t,s,a){var u=""+Math.abs(t),f=s-u.length,p=t>=0;return(p?a?"+":"":"-")+Math.pow(10,Math.max(0,f)).toString().substr(1)+u}var Ri=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,un=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ei={},er={};function Q(t,s,a,u){var f=u;typeof u=="string"&&(f=function(){return this[u]()}),t&&(er[t]=f),s&&(er[s[0]]=function(){return Ee(f.apply(this,arguments),s[1],s[2])}),a&&(er[a]=function(){return this.localeData().ordinal(f.apply(this,arguments),t)})}function jl(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function Hl(t){var s=t.match(Ri),a,u;for(a=0,u=s.length;a<u;a++)er[s[a]]?s[a]=er[s[a]]:s[a]=jl(s[a]);return function(f){var p="",v;for(v=0;v<u;v++)p+=ie(s[v])?s[v].call(f,t):s[v];return p}}function dn(t,s){return t.isValid()?(s=Ks(s,t.localeData()),Ei[s]=Ei[s]||Hl(s),Ei[s](t)):t.localeData().invalidDate()}function Ks(t,s){var a=5;function u(f){return s.longDateFormat(f)||f}for(un.lastIndex=0;a>=0&&un.test(t);)t=t.replace(un,u),un.lastIndex=0,a-=1;return t}var Gl={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function zl(t){var s=this._longDateFormat[t],a=this._longDateFormat[t.toUpperCase()];return s||!a?s:(this._longDateFormat[t]=a.match(Ri).map(function(u){return u==="MMMM"||u==="MM"||u==="DD"||u==="dddd"?u.slice(1):u}).join(""),this._longDateFormat[t])}var Zl="Invalid date";function Jl(){return this._invalidDate}var ql="%d",Kl=/\d{1,2}/;function Xl(t){return this._ordinal.replace("%d",t)}var eu={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function tu(t,s,a,u){var f=this._relativeTime[a];return ie(f)?f(t,s,a,u):f.replace(/%d/i,t)}function ru(t,s){var a=this._relativeTime[t>0?"future":"past"];return ie(a)?a(s):a.replace(/%s/i,s)}var Fr={};function Ue(t,s){var a=t.toLowerCase();Fr[a]=Fr[a+"s"]=Fr[s]=t}function qe(t){return typeof t=="string"?Fr[t]||Fr[t.toLowerCase()]:void 0}function Ui(t){var s={},a,u;for(u in t)l(t,u)&&(a=qe(u),a&&(s[a]=t[u]));return s}var Xs={};function Ye(t,s){Xs[t]=s}function nu(t){var s=[],a;for(a in t)l(t,a)&&s.push({unit:a,priority:Xs[a]});return s.sort(function(u,f){return u.priority-f.priority}),s}function cn(t){return t%4===0&&t%100!==0||t%400===0}function Ke(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function W(t){var s=+t,a=0;return s!==0&&isFinite(s)&&(a=Ke(s)),a}function tr(t,s){return function(a){return a!=null?(eo(this,t,a),e.updateOffset(this,s),this):fn(this,t)}}function fn(t,s){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+s]():NaN}function eo(t,s,a){t.isValid()&&!isNaN(a)&&(s==="FullYear"&&cn(t.year())&&t.month()===1&&t.date()===29?(a=W(a),t._d["set"+(t._isUTC?"UTC":"")+s](a,t.month(),vn(a,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+s](a))}function iu(t){return t=qe(t),ie(this[t])?this[t]():this}function su(t,s){if(typeof t=="object"){t=Ui(t);var a=nu(t),u,f=a.length;for(u=0;u<f;u++)this[a[u].unit](t[a[u].unit])}else if(t=qe(t),ie(this[t]))return this[t](s);return this}var to=/\d/,je=/\d\d/,ro=/\d{3}/,Yi=/\d{4}/,mn=/[+-]?\d{6}/,fe=/\d\d?/,no=/\d\d\d\d?/,io=/\d\d\d\d\d\d?/,hn=/\d{1,3}/,Oi=/\d{1,4}/,pn=/[+-]?\d{1,6}/,rr=/\d+/,yn=/[+-]?\d+/,ou=/Z|[+-]\d\d:?\d\d/gi,gn=/Z|[+-]\d\d(?::?\d\d)?/gi,au=/[+-]?\d+(\.\d{1,3})?/,Mr=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,bn;bn={};function R(t,s,a){bn[t]=ie(s)?s:function(u,f){return u&&a?a:s}}function lu(t,s){return l(bn,t)?bn[t](s._strict,s._locale):new RegExp(uu(t))}function uu(t){return He(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(s,a,u,f,p){return a||u||f||p}))}function He(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var Qi={};function se(t,s){var a,u=s,f;for(typeof t=="string"&&(t=[t]),m(s)&&(u=function(p,v){v[s]=W(p)}),f=t.length,a=0;a<f;a++)Qi[t[a]]=u}function Rr(t,s){se(t,function(a,u,f,p){f._w=f._w||{},s(a,f._w,f,p)})}function du(t,s,a){s!=null&&l(Qi,t)&&Qi[t](s,a._a,a,t)}var Oe=0,ht=1,lt=2,De=3,st=4,pt=5,Wt=6,cu=7,fu=8;function mu(t,s){return(t%s+s)%s}var ve;Array.prototype.indexOf?ve=Array.prototype.indexOf:ve=function(t){var s;for(s=0;s<this.length;++s)if(this[s]===t)return s;return-1};function vn(t,s){if(isNaN(t)||isNaN(s))return NaN;var a=mu(s,12);return t+=(s-a)/12,a===1?cn(t)?29:28:31-a%7%2}Q("M",["MM",2],"Mo",function(){return this.month()+1}),Q("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),Q("MMMM",0,0,function(t){return this.localeData().months(this,t)}),Ue("month","M"),Ye("month",8),R("M",fe),R("MM",fe,je),R("MMM",function(t,s){return s.monthsShortRegex(t)}),R("MMMM",function(t,s){return s.monthsRegex(t)}),se(["M","MM"],function(t,s){s[ht]=W(t)-1}),se(["MMM","MMMM"],function(t,s,a,u){var f=a._locale.monthsParse(t,u,a._strict);f!=null?s[ht]=f:b(a).invalidMonth=t});var hu="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),so="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),oo=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,pu=Mr,yu=Mr;function gu(t,s){return t?i(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||oo).test(s)?"format":"standalone"][t.month()]:i(this._months)?this._months:this._months.standalone}function bu(t,s){return t?i(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[oo.test(s)?"format":"standalone"][t.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function vu(t,s,a){var u,f,p,v=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],u=0;u<12;++u)p=_([2e3,u]),this._shortMonthsParse[u]=this.monthsShort(p,"").toLocaleLowerCase(),this._longMonthsParse[u]=this.months(p,"").toLocaleLowerCase();return a?s==="MMM"?(f=ve.call(this._shortMonthsParse,v),f!==-1?f:null):(f=ve.call(this._longMonthsParse,v),f!==-1?f:null):s==="MMM"?(f=ve.call(this._shortMonthsParse,v),f!==-1?f:(f=ve.call(this._longMonthsParse,v),f!==-1?f:null)):(f=ve.call(this._longMonthsParse,v),f!==-1?f:(f=ve.call(this._shortMonthsParse,v),f!==-1?f:null))}function _u(t,s,a){var u,f,p;if(this._monthsParseExact)return vu.call(this,t,s,a);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),u=0;u<12;u++){if(f=_([2e3,u]),a&&!this._longMonthsParse[u]&&(this._longMonthsParse[u]=new RegExp("^"+this.months(f,"").replace(".","")+"$","i"),this._shortMonthsParse[u]=new RegExp("^"+this.monthsShort(f,"").replace(".","")+"$","i")),!a&&!this._monthsParse[u]&&(p="^"+this.months(f,"")+"|^"+this.monthsShort(f,""),this._monthsParse[u]=new RegExp(p.replace(".",""),"i")),a&&s==="MMMM"&&this._longMonthsParse[u].test(t))return u;if(a&&s==="MMM"&&this._shortMonthsParse[u].test(t))return u;if(!a&&this._monthsParse[u].test(t))return u}}function ao(t,s){var a;if(!t.isValid())return t;if(typeof s=="string"){if(/^\d+$/.test(s))s=W(s);else if(s=t.localeData().monthsParse(s),!m(s))return t}return a=Math.min(t.date(),vn(t.year(),s)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](s,a),t}function lo(t){return t!=null?(ao(this,t),e.updateOffset(this,!0),this):fn(this,"Month")}function wu(){return vn(this.year(),this.month())}function xu(t){return this._monthsParseExact?(l(this,"_monthsRegex")||uo.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(l(this,"_monthsShortRegex")||(this._monthsShortRegex=pu),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function ku(t){return this._monthsParseExact?(l(this,"_monthsRegex")||uo.call(this),t?this._monthsStrictRegex:this._monthsRegex):(l(this,"_monthsRegex")||(this._monthsRegex=yu),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function uo(){function t(v,L){return L.length-v.length}var s=[],a=[],u=[],f,p;for(f=0;f<12;f++)p=_([2e3,f]),s.push(this.monthsShort(p,"")),a.push(this.months(p,"")),u.push(this.months(p,"")),u.push(this.monthsShort(p,""));for(s.sort(t),a.sort(t),u.sort(t),f=0;f<12;f++)s[f]=He(s[f]),a[f]=He(a[f]);for(f=0;f<24;f++)u[f]=He(u[f]);this._monthsRegex=new RegExp("^("+u.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}Q("Y",0,0,function(){var t=this.year();return t<=9999?Ee(t,4):"+"+t}),Q(0,["YY",2],0,function(){return this.year()%100}),Q(0,["YYYY",4],0,"year"),Q(0,["YYYYY",5],0,"year"),Q(0,["YYYYYY",6,!0],0,"year"),Ue("year","y"),Ye("year",1),R("Y",yn),R("YY",fe,je),R("YYYY",Oi,Yi),R("YYYYY",pn,mn),R("YYYYYY",pn,mn),se(["YYYYY","YYYYYY"],Oe),se("YYYY",function(t,s){s[Oe]=t.length===2?e.parseTwoDigitYear(t):W(t)}),se("YY",function(t,s){s[Oe]=e.parseTwoDigitYear(t)}),se("Y",function(t,s){s[Oe]=parseInt(t,10)});function Er(t){return cn(t)?366:365}e.parseTwoDigitYear=function(t){return W(t)+(W(t)>68?1900:2e3)};var co=tr("FullYear",!0);function Du(){return cn(this.year())}function Su(t,s,a,u,f,p,v){var L;return t<100&&t>=0?(L=new Date(t+400,s,a,u,f,p,v),isFinite(L.getFullYear())&&L.setFullYear(t)):L=new Date(t,s,a,u,f,p,v),L}function Ur(t){var s,a;return t<100&&t>=0?(a=Array.prototype.slice.call(arguments),a[0]=t+400,s=new Date(Date.UTC.apply(null,a)),isFinite(s.getUTCFullYear())&&s.setUTCFullYear(t)):s=new Date(Date.UTC.apply(null,arguments)),s}function _n(t,s,a){var u=7+s-a,f=(7+Ur(t,0,u).getUTCDay()-s)%7;return-f+u-1}function fo(t,s,a,u,f){var p=(7+a-u)%7,v=_n(t,u,f),L=1+7*(s-1)+p+v,A,oe;return L<=0?(A=t-1,oe=Er(A)+L):L>Er(t)?(A=t+1,oe=L-Er(t)):(A=t,oe=L),{year:A,dayOfYear:oe}}function Yr(t,s,a){var u=_n(t.year(),s,a),f=Math.floor((t.dayOfYear()-u-1)/7)+1,p,v;return f<1?(v=t.year()-1,p=f+yt(v,s,a)):f>yt(t.year(),s,a)?(p=f-yt(t.year(),s,a),v=t.year()+1):(v=t.year(),p=f),{week:p,year:v}}function yt(t,s,a){var u=_n(t,s,a),f=_n(t+1,s,a);return(Er(t)-u+f)/7}Q("w",["ww",2],"wo","week"),Q("W",["WW",2],"Wo","isoWeek"),Ue("week","w"),Ue("isoWeek","W"),Ye("week",5),Ye("isoWeek",5),R("w",fe),R("ww",fe,je),R("W",fe),R("WW",fe,je),Rr(["w","ww","W","WW"],function(t,s,a,u){s[u.substr(0,1)]=W(t)});function Tu(t){return Yr(t,this._week.dow,this._week.doy).week}var Fu={dow:0,doy:6};function Mu(){return this._week.dow}function Ru(){return this._week.doy}function Eu(t){var s=this.localeData().week(this);return t==null?s:this.add((t-s)*7,"d")}function Uu(t){var s=Yr(this,1,4).week;return t==null?s:this.add((t-s)*7,"d")}Q("d",0,"do","day"),Q("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),Q("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),Q("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),Q("e",0,0,"weekday"),Q("E",0,0,"isoWeekday"),Ue("day","d"),Ue("weekday","e"),Ue("isoWeekday","E"),Ye("day",11),Ye("weekday",11),Ye("isoWeekday",11),R("d",fe),R("e",fe),R("E",fe),R("dd",function(t,s){return s.weekdaysMinRegex(t)}),R("ddd",function(t,s){return s.weekdaysShortRegex(t)}),R("dddd",function(t,s){return s.weekdaysRegex(t)}),Rr(["dd","ddd","dddd"],function(t,s,a,u){var f=a._locale.weekdaysParse(t,u,a._strict);f!=null?s.d=f:b(a).invalidWeekday=t}),Rr(["d","e","E"],function(t,s,a,u){s[u]=W(t)});function Yu(t,s){return typeof t!="string"?t:isNaN(t)?(t=s.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function Ou(t,s){return typeof t=="string"?s.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Li(t,s){return t.slice(s,7).concat(t.slice(0,s))}var Qu="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),mo="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Lu="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Nu=Mr,Cu=Mr,Bu=Mr;function Iu(t,s){var a=i(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(s)?"format":"standalone"];return t===!0?Li(a,this._week.dow):t?a[t.day()]:a}function Pu(t){return t===!0?Li(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Au(t){return t===!0?Li(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Wu(t,s,a){var u,f,p,v=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],u=0;u<7;++u)p=_([2e3,1]).day(u),this._minWeekdaysParse[u]=this.weekdaysMin(p,"").toLocaleLowerCase(),this._shortWeekdaysParse[u]=this.weekdaysShort(p,"").toLocaleLowerCase(),this._weekdaysParse[u]=this.weekdays(p,"").toLocaleLowerCase();return a?s==="dddd"?(f=ve.call(this._weekdaysParse,v),f!==-1?f:null):s==="ddd"?(f=ve.call(this._shortWeekdaysParse,v),f!==-1?f:null):(f=ve.call(this._minWeekdaysParse,v),f!==-1?f:null):s==="dddd"?(f=ve.call(this._weekdaysParse,v),f!==-1||(f=ve.call(this._shortWeekdaysParse,v),f!==-1)?f:(f=ve.call(this._minWeekdaysParse,v),f!==-1?f:null)):s==="ddd"?(f=ve.call(this._shortWeekdaysParse,v),f!==-1||(f=ve.call(this._weekdaysParse,v),f!==-1)?f:(f=ve.call(this._minWeekdaysParse,v),f!==-1?f:null)):(f=ve.call(this._minWeekdaysParse,v),f!==-1||(f=ve.call(this._weekdaysParse,v),f!==-1)?f:(f=ve.call(this._shortWeekdaysParse,v),f!==-1?f:null))}function $u(t,s,a){var u,f,p;if(this._weekdaysParseExact)return Wu.call(this,t,s,a);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),u=0;u<7;u++){if(f=_([2e3,1]).day(u),a&&!this._fullWeekdaysParse[u]&&(this._fullWeekdaysParse[u]=new RegExp("^"+this.weekdays(f,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[u]=new RegExp("^"+this.weekdaysShort(f,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[u]=new RegExp("^"+this.weekdaysMin(f,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[u]||(p="^"+this.weekdays(f,"")+"|^"+this.weekdaysShort(f,"")+"|^"+this.weekdaysMin(f,""),this._weekdaysParse[u]=new RegExp(p.replace(".",""),"i")),a&&s==="dddd"&&this._fullWeekdaysParse[u].test(t))return u;if(a&&s==="ddd"&&this._shortWeekdaysParse[u].test(t))return u;if(a&&s==="dd"&&this._minWeekdaysParse[u].test(t))return u;if(!a&&this._weekdaysParse[u].test(t))return u}}function Vu(t){if(!this.isValid())return t!=null?this:NaN;var s=this._isUTC?this._d.getUTCDay():this._d.getDay();return t!=null?(t=Yu(t,this.localeData()),this.add(t-s,"d")):s}function ju(t){if(!this.isValid())return t!=null?this:NaN;var s=(this.day()+7-this.localeData()._week.dow)%7;return t==null?s:this.add(t-s,"d")}function Hu(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var s=Ou(t,this.localeData());return this.day(this.day()%7?s:s-7)}else return this.day()||7}function Gu(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Ni.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=Nu),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function zu(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Ni.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Cu),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Zu(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Ni.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Bu),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ni(){function t(Ie,wt){return wt.length-Ie.length}var s=[],a=[],u=[],f=[],p,v,L,A,oe;for(p=0;p<7;p++)v=_([2e3,1]).day(p),L=He(this.weekdaysMin(v,"")),A=He(this.weekdaysShort(v,"")),oe=He(this.weekdays(v,"")),s.push(L),a.push(A),u.push(oe),f.push(L),f.push(A),f.push(oe);s.sort(t),a.sort(t),u.sort(t),f.sort(t),this._weekdaysRegex=new RegExp("^("+f.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Ci(){return this.hours()%12||12}function Ju(){return this.hours()||24}Q("H",["HH",2],0,"hour"),Q("h",["hh",2],0,Ci),Q("k",["kk",2],0,Ju),Q("hmm",0,0,function(){return""+Ci.apply(this)+Ee(this.minutes(),2)}),Q("hmmss",0,0,function(){return""+Ci.apply(this)+Ee(this.minutes(),2)+Ee(this.seconds(),2)}),Q("Hmm",0,0,function(){return""+this.hours()+Ee(this.minutes(),2)}),Q("Hmmss",0,0,function(){return""+this.hours()+Ee(this.minutes(),2)+Ee(this.seconds(),2)});function ho(t,s){Q(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),s)})}ho("a",!0),ho("A",!1),Ue("hour","h"),Ye("hour",13);function po(t,s){return s._meridiemParse}R("a",po),R("A",po),R("H",fe),R("h",fe),R("k",fe),R("HH",fe,je),R("hh",fe,je),R("kk",fe,je),R("hmm",no),R("hmmss",io),R("Hmm",no),R("Hmmss",io),se(["H","HH"],De),se(["k","kk"],function(t,s,a){var u=W(t);s[De]=u===24?0:u}),se(["a","A"],function(t,s,a){a._isPm=a._locale.isPM(t),a._meridiem=t}),se(["h","hh"],function(t,s,a){s[De]=W(t),b(a).bigHour=!0}),se("hmm",function(t,s,a){var u=t.length-2;s[De]=W(t.substr(0,u)),s[st]=W(t.substr(u)),b(a).bigHour=!0}),se("hmmss",function(t,s,a){var u=t.length-4,f=t.length-2;s[De]=W(t.substr(0,u)),s[st]=W(t.substr(u,2)),s[pt]=W(t.substr(f)),b(a).bigHour=!0}),se("Hmm",function(t,s,a){var u=t.length-2;s[De]=W(t.substr(0,u)),s[st]=W(t.substr(u))}),se("Hmmss",function(t,s,a){var u=t.length-4,f=t.length-2;s[De]=W(t.substr(0,u)),s[st]=W(t.substr(u,2)),s[pt]=W(t.substr(f))});function qu(t){return(t+"").toLowerCase().charAt(0)==="p"}var Ku=/[ap]\.?m?\.?/i,Xu=tr("Hours",!0);function ed(t,s,a){return t>11?a?"pm":"PM":a?"am":"AM"}var yo={calendar:Je,longDateFormat:Gl,invalidDate:Zl,ordinal:ql,dayOfMonthOrdinalParse:Kl,relativeTime:eu,months:hu,monthsShort:so,week:Fu,weekdays:Qu,weekdaysMin:Lu,weekdaysShort:mo,meridiemParse:Ku},pe={},Or={},Qr;function td(t,s){var a,u=Math.min(t.length,s.length);for(a=0;a<u;a+=1)if(t[a]!==s[a])return a;return u}function go(t){return t&&t.toLowerCase().replace("_","-")}function rd(t){for(var s=0,a,u,f,p;s<t.length;){for(p=go(t[s]).split("-"),a=p.length,u=go(t[s+1]),u=u?u.split("-"):null;a>0;){if(f=wn(p.slice(0,a).join("-")),f)return f;if(u&&u.length>=a&&td(p,u)>=a-1)break;a--}s++}return Qr}function nd(t){return t.match("^[^/\\\\]*$")!=null}function wn(t){var s=null,a;if(pe[t]===void 0&&typeof ur!="undefined"&&ur&&ur.exports&&nd(t))try{s=Qr._abbr,a=require,a("./locale/"+t),Et(s)}catch(u){pe[t]=null}return pe[t]}function Et(t,s){var a;return t&&(d(s)?a=gt(t):a=Bi(t,s),a?Qr=a:typeof console!="undefined"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Qr._abbr}function Bi(t,s){if(s!==null){var a,u=yo;if(s.abbr=t,pe[t]!=null)ee("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),u=pe[t]._config;else if(s.parentLocale!=null)if(pe[s.parentLocale]!=null)u=pe[s.parentLocale]._config;else if(a=wn(s.parentLocale),a!=null)u=a._config;else return Or[s.parentLocale]||(Or[s.parentLocale]=[]),Or[s.parentLocale].push({name:t,config:s}),null;return pe[t]=new le(te(u,s)),Or[t]&&Or[t].forEach(function(f){Bi(f.name,f.config)}),Et(t),pe[t]}else return delete pe[t],null}function id(t,s){if(s!=null){var a,u,f=yo;pe[t]!=null&&pe[t].parentLocale!=null?pe[t].set(te(pe[t]._config,s)):(u=wn(t),u!=null&&(f=u._config),s=te(f,s),u==null&&(s.abbr=t),a=new le(s),a.parentLocale=pe[t],pe[t]=a),Et(t)}else pe[t]!=null&&(pe[t].parentLocale!=null?(pe[t]=pe[t].parentLocale,t===Et()&&Et(t)):pe[t]!=null&&delete pe[t]);return pe[t]}function gt(t){var s;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Qr;if(!i(t)){if(s=wn(t),s)return s;t=[t]}return rd(t)}function sd(){return C(pe)}function Ii(t){var s,a=t._a;return a&&b(t).overflow===-2&&(s=a[ht]<0||a[ht]>11?ht:a[lt]<1||a[lt]>vn(a[Oe],a[ht])?lt:a[De]<0||a[De]>24||a[De]===24&&(a[st]!==0||a[pt]!==0||a[Wt]!==0)?De:a[st]<0||a[st]>59?st:a[pt]<0||a[pt]>59?pt:a[Wt]<0||a[Wt]>999?Wt:-1,b(t)._overflowDayOfYear&&(s<Oe||s>lt)&&(s=lt),b(t)._overflowWeeks&&s===-1&&(s=cu),b(t)._overflowWeekday&&s===-1&&(s=fu),b(t).overflow=s),t}var od=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ad=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ld=/Z|[+-]\d\d(?::?\d\d)?/,xn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Pi=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ud=/^\/?Date\((-?\d+)/i,dd=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,cd={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function bo(t){var s,a,u=t._i,f=od.exec(u)||ad.exec(u),p,v,L,A,oe=xn.length,Ie=Pi.length;if(f){for(b(t).iso=!0,s=0,a=oe;s<a;s++)if(xn[s][1].exec(f[1])){v=xn[s][0],p=xn[s][2]!==!1;break}if(v==null){t._isValid=!1;return}if(f[3]){for(s=0,a=Ie;s<a;s++)if(Pi[s][1].exec(f[3])){L=(f[2]||" ")+Pi[s][0];break}if(L==null){t._isValid=!1;return}}if(!p&&L!=null){t._isValid=!1;return}if(f[4])if(ld.exec(f[4]))A="Z";else{t._isValid=!1;return}t._f=v+(L||"")+(A||""),Wi(t)}else t._isValid=!1}function fd(t,s,a,u,f,p){var v=[md(t),so.indexOf(s),parseInt(a,10),parseInt(u,10),parseInt(f,10)];return p&&v.push(parseInt(p,10)),v}function md(t){var s=parseInt(t,10);return s<=49?2e3+s:s<=999?1900+s:s}function hd(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function pd(t,s,a){if(t){var u=mo.indexOf(t),f=new Date(s[0],s[1],s[2]).getDay();if(u!==f)return b(a).weekdayMismatch=!0,a._isValid=!1,!1}return!0}function yd(t,s,a){if(t)return cd[t];if(s)return 0;var u=parseInt(a,10),f=u%100,p=(u-f)/100;return p*60+f}function vo(t){var s=dd.exec(hd(t._i)),a;if(s){if(a=fd(s[4],s[3],s[2],s[5],s[6],s[7]),!pd(s[1],a,t))return;t._a=a,t._tzm=yd(s[8],s[9],s[10]),t._d=Ur.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),b(t).rfc2822=!0}else t._isValid=!1}function gd(t){var s=ud.exec(t._i);if(s!==null){t._d=new Date(+s[1]);return}if(bo(t),t._isValid===!1)delete t._isValid;else return;if(vo(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:e.createFromInputFallback(t)}e.createFromInputFallback=q("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function nr(t,s,a){return t!=null?t:s!=null?s:a}function bd(t){var s=new Date(e.now());return t._useUTC?[s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()]:[s.getFullYear(),s.getMonth(),s.getDate()]}function Ai(t){var s,a,u=[],f,p,v;if(!t._d){for(f=bd(t),t._w&&t._a[lt]==null&&t._a[ht]==null&&vd(t),t._dayOfYear!=null&&(v=nr(t._a[Oe],f[Oe]),(t._dayOfYear>Er(v)||t._dayOfYear===0)&&(b(t)._overflowDayOfYear=!0),a=Ur(v,0,t._dayOfYear),t._a[ht]=a.getUTCMonth(),t._a[lt]=a.getUTCDate()),s=0;s<3&&t._a[s]==null;++s)t._a[s]=u[s]=f[s];for(;s<7;s++)t._a[s]=u[s]=t._a[s]==null?s===2?1:0:t._a[s];t._a[De]===24&&t._a[st]===0&&t._a[pt]===0&&t._a[Wt]===0&&(t._nextDay=!0,t._a[De]=0),t._d=(t._useUTC?Ur:Su).apply(null,u),p=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[De]=24),t._w&&typeof t._w.d!="undefined"&&t._w.d!==p&&(b(t).weekdayMismatch=!0)}}function vd(t){var s,a,u,f,p,v,L,A,oe;s=t._w,s.GG!=null||s.W!=null||s.E!=null?(p=1,v=4,a=nr(s.GG,t._a[Oe],Yr(me(),1,4).year),u=nr(s.W,1),f=nr(s.E,1),(f<1||f>7)&&(A=!0)):(p=t._locale._week.dow,v=t._locale._week.doy,oe=Yr(me(),p,v),a=nr(s.gg,t._a[Oe],oe.year),u=nr(s.w,oe.week),s.d!=null?(f=s.d,(f<0||f>6)&&(A=!0)):s.e!=null?(f=s.e+p,(s.e<0||s.e>6)&&(A=!0)):f=p),u<1||u>yt(a,p,v)?b(t)._overflowWeeks=!0:A!=null?b(t)._overflowWeekday=!0:(L=fo(a,u,f,p,v),t._a[Oe]=L.year,t._dayOfYear=L.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Wi(t){if(t._f===e.ISO_8601){bo(t);return}if(t._f===e.RFC_2822){vo(t);return}t._a=[],b(t).empty=!0;var s=""+t._i,a,u,f,p,v,L=s.length,A=0,oe,Ie;for(f=Ks(t._f,t._locale).match(Ri)||[],Ie=f.length,a=0;a<Ie;a++)p=f[a],u=(s.match(lu(p,t))||[])[0],u&&(v=s.substr(0,s.indexOf(u)),v.length>0&&b(t).unusedInput.push(v),s=s.slice(s.indexOf(u)+u.length),A+=u.length),er[p]?(u?b(t).empty=!1:b(t).unusedTokens.push(p),du(p,u,t)):t._strict&&!u&&b(t).unusedTokens.push(p);b(t).charsLeftOver=L-A,s.length>0&&b(t).unusedInput.push(s),t._a[De]<=12&&b(t).bigHour===!0&&t._a[De]>0&&(b(t).bigHour=void 0),b(t).parsedDateParts=t._a.slice(0),b(t).meridiem=t._meridiem,t._a[De]=_d(t._locale,t._a[De],t._meridiem),oe=b(t).era,oe!==null&&(t._a[Oe]=t._locale.erasConvertYear(oe,t._a[Oe])),Ai(t),Ii(t)}function _d(t,s,a){var u;return a==null?s:t.meridiemHour!=null?t.meridiemHour(s,a):(t.isPM!=null&&(u=t.isPM(a),u&&s<12&&(s+=12),!u&&s===12&&(s=0)),s)}function wd(t){var s,a,u,f,p,v,L=!1,A=t._f.length;if(A===0){b(t).invalidFormat=!0,t._d=new Date(NaN);return}for(f=0;f<A;f++)p=0,v=!1,s=N({},t),t._useUTC!=null&&(s._useUTC=t._useUTC),s._f=t._f[f],Wi(s),F(s)&&(v=!0),p+=b(s).charsLeftOver,p+=b(s).unusedTokens.length*10,b(s).score=p,L?p<u&&(u=p,a=s):(u==null||p<u||v)&&(u=p,a=s,v&&(L=!0));w(t,a||s)}function xd(t){if(!t._d){var s=Ui(t._i),a=s.day===void 0?s.date:s.day;t._a=y([s.year,s.month,a,s.hour,s.minute,s.second,s.millisecond],function(u){return u&&parseInt(u,10)}),Ai(t)}}function kd(t){var s=new V(Ii(_o(t)));return s._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function _o(t){var s=t._i,a=t._f;return t._locale=t._locale||gt(t._l),s===null||a===void 0&&s===""?T({nullInput:!0}):(typeof s=="string"&&(t._i=s=t._locale.preparse(s)),I(s)?new V(Ii(s)):(h(s)?t._d=s:i(a)?wd(t):a?Wi(t):Dd(t),F(t)||(t._d=null),t))}function Dd(t){var s=t._i;d(s)?t._d=new Date(e.now()):h(s)?t._d=new Date(s.valueOf()):typeof s=="string"?gd(t):i(s)?(t._a=y(s.slice(0),function(a){return parseInt(a,10)}),Ai(t)):o(s)?xd(t):m(s)?t._d=new Date(s):e.createFromInputFallback(t)}function wo(t,s,a,u,f){var p={};return(s===!0||s===!1)&&(u=s,s=void 0),(a===!0||a===!1)&&(u=a,a=void 0),(o(t)&&c(t)||i(t)&&t.length===0)&&(t=void 0),p._isAMomentObject=!0,p._useUTC=p._isUTC=f,p._l=a,p._i=t,p._f=s,p._strict=u,kd(p)}function me(t,s,a,u){return wo(t,s,a,u,!1)}var Sd=q("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=me.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:T()}),Td=q("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=me.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:T()});function xo(t,s){var a,u;if(s.length===1&&i(s[0])&&(s=s[0]),!s.length)return me();for(a=s[0],u=1;u<s.length;++u)(!s[u].isValid()||s[u][t](a))&&(a=s[u]);return a}function Fd(){var t=[].slice.call(arguments,0);return xo("isBefore",t)}function Md(){var t=[].slice.call(arguments,0);return xo("isAfter",t)}var Rd=function(){return Date.now?Date.now():+new Date},Lr=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ed(t){var s,a=!1,u,f=Lr.length;for(s in t)if(l(t,s)&&!(ve.call(Lr,s)!==-1&&(t[s]==null||!isNaN(t[s]))))return!1;for(u=0;u<f;++u)if(t[Lr[u]]){if(a)return!1;parseFloat(t[Lr[u]])!==W(t[Lr[u]])&&(a=!0)}return!0}function Ud(){return this._isValid}function Yd(){return ot(NaN)}function kn(t){var s=Ui(t),a=s.year||0,u=s.quarter||0,f=s.month||0,p=s.week||s.isoWeek||0,v=s.day||0,L=s.hour||0,A=s.minute||0,oe=s.second||0,Ie=s.millisecond||0;this._isValid=Ed(s),this._milliseconds=+Ie+oe*1e3+A*6e4+L*1e3*60*60,this._days=+v+p*7,this._months=+f+u*3+a*12,this._data={},this._locale=gt(),this._bubble()}function Dn(t){return t instanceof kn}function $i(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function Od(t,s,a){var u=Math.min(t.length,s.length),f=Math.abs(t.length-s.length),p=0,v;for(v=0;v<u;v++)(a&&t[v]!==s[v]||!a&&W(t[v])!==W(s[v]))&&p++;return p+f}function ko(t,s){Q(t,0,0,function(){var a=this.utcOffset(),u="+";return a<0&&(a=-a,u="-"),u+Ee(~~(a/60),2)+s+Ee(~~a%60,2)})}ko("Z",":"),ko("ZZ",""),R("Z",gn),R("ZZ",gn),se(["Z","ZZ"],function(t,s,a){a._useUTC=!0,a._tzm=Vi(gn,t)});var Qd=/([\+\-]|\d\d)/gi;function Vi(t,s){var a=(s||"").match(t),u,f,p;return a===null?null:(u=a[a.length-1]||[],f=(u+"").match(Qd)||["-",0,0],p=+(f[1]*60)+W(f[2]),p===0?0:f[0]==="+"?p:-p)}function ji(t,s){var a,u;return s._isUTC?(a=s.clone(),u=(I(t)||h(t)?t.valueOf():me(t).valueOf())-a.valueOf(),a._d.setTime(a._d.valueOf()+u),e.updateOffset(a,!1),a):me(t).local()}function Hi(t){return-Math.round(t._d.getTimezoneOffset())}e.updateOffset=function(){};function Ld(t,s,a){var u=this._offset||0,f;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=Vi(gn,t),t===null)return this}else Math.abs(t)<16&&!a&&(t=t*60);return!this._isUTC&&s&&(f=Hi(this)),this._offset=t,this._isUTC=!0,f!=null&&this.add(f,"m"),u!==t&&(!s||this._changeInProgress?Fo(this,ot(t-u,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?u:Hi(this)}function Nd(t,s){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,s),this):-this.utcOffset()}function Cd(t){return this.utcOffset(0,t)}function Bd(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Hi(this),"m")),this}function Id(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=Vi(ou,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function Pd(t){return this.isValid()?(t=t?me(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function Ad(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Wd(){if(!d(this._isDSTShifted))return this._isDSTShifted;var t={},s;return N(t,this),t=_o(t),t._a?(s=t._isUTC?_(t._a):me(t._a),this._isDSTShifted=this.isValid()&&Od(t._a,s.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function $d(){return this.isValid()?!this._isUTC:!1}function Vd(){return this.isValid()?this._isUTC:!1}function Do(){return this.isValid()?this._isUTC&&this._offset===0:!1}var jd=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Hd=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ot(t,s){var a=t,u=null,f,p,v;return Dn(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:m(t)||!isNaN(+t)?(a={},s?a[s]=+t:a.milliseconds=+t):(u=jd.exec(t))?(f=u[1]==="-"?-1:1,a={y:0,d:W(u[lt])*f,h:W(u[De])*f,m:W(u[st])*f,s:W(u[pt])*f,ms:W($i(u[Wt]*1e3))*f}):(u=Hd.exec(t))?(f=u[1]==="-"?-1:1,a={y:$t(u[2],f),M:$t(u[3],f),w:$t(u[4],f),d:$t(u[5],f),h:$t(u[6],f),m:$t(u[7],f),s:$t(u[8],f)}):a==null?a={}:typeof a=="object"&&("from"in a||"to"in a)&&(v=Gd(me(a.from),me(a.to)),a={},a.ms=v.milliseconds,a.M=v.months),p=new kn(a),Dn(t)&&l(t,"_locale")&&(p._locale=t._locale),Dn(t)&&l(t,"_isValid")&&(p._isValid=t._isValid),p}ot.fn=kn.prototype,ot.invalid=Yd;function $t(t,s){var a=t&&parseFloat(t.replace(",","."));return(isNaN(a)?0:a)*s}function So(t,s){var a={};return a.months=s.month()-t.month()+(s.year()-t.year())*12,t.clone().add(a.months,"M").isAfter(s)&&--a.months,a.milliseconds=+s-+t.clone().add(a.months,"M"),a}function Gd(t,s){var a;return t.isValid()&&s.isValid()?(s=ji(s,t),t.isBefore(s)?a=So(t,s):(a=So(s,t),a.milliseconds=-a.milliseconds,a.months=-a.months),a):{milliseconds:0,months:0}}function To(t,s){return function(a,u){var f,p;return u!==null&&!isNaN(+u)&&(ee(s,"moment()."+s+"(period, number) is deprecated. Please use moment()."+s+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),p=a,a=u,u=p),f=ot(a,u),Fo(this,f,t),this}}function Fo(t,s,a,u){var f=s._milliseconds,p=$i(s._days),v=$i(s._months);t.isValid()&&(u=u==null?!0:u,v&&ao(t,fn(t,"Month")+v*a),p&&eo(t,"Date",fn(t,"Date")+p*a),f&&t._d.setTime(t._d.valueOf()+f*a),u&&e.updateOffset(t,p||v))}var zd=To(1,"add"),Zd=To(-1,"subtract");function Mo(t){return typeof t=="string"||t instanceof String}function Jd(t){return I(t)||h(t)||Mo(t)||m(t)||Kd(t)||qd(t)||t===null||t===void 0}function qd(t){var s=o(t)&&!c(t),a=!1,u=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],f,p,v=u.length;for(f=0;f<v;f+=1)p=u[f],a=a||l(t,p);return s&&a}function Kd(t){var s=i(t),a=!1;return s&&(a=t.filter(function(u){return!m(u)&&Mo(t)}).length===0),s&&a}function Xd(t){var s=o(t)&&!c(t),a=!1,u=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],f,p;for(f=0;f<u.length;f+=1)p=u[f],a=a||l(t,p);return s&&a}function ec(t,s){var a=t.diff(s,"days",!0);return a<-6?"sameElse":a<-1?"lastWeek":a<0?"lastDay":a<1?"sameDay":a<2?"nextDay":a<7?"nextWeek":"sameElse"}function tc(t,s){arguments.length===1&&(arguments[0]?Jd(arguments[0])?(t=arguments[0],s=void 0):Xd(arguments[0])&&(s=arguments[0],t=void 0):(t=void 0,s=void 0));var a=t||me(),u=ji(a,this).startOf("day"),f=e.calendarFormat(this,u)||"sameElse",p=s&&(ie(s[f])?s[f].call(this,a):s[f]);return this.format(p||this.localeData().calendar(f,this,me(a)))}function rc(){return new V(this)}function nc(t,s){var a=I(t)?t:me(t);return this.isValid()&&a.isValid()?(s=qe(s)||"millisecond",s==="millisecond"?this.valueOf()>a.valueOf():a.valueOf()<this.clone().startOf(s).valueOf()):!1}function ic(t,s){var a=I(t)?t:me(t);return this.isValid()&&a.isValid()?(s=qe(s)||"millisecond",s==="millisecond"?this.valueOf()<a.valueOf():this.clone().endOf(s).valueOf()<a.valueOf()):!1}function sc(t,s,a,u){var f=I(t)?t:me(t),p=I(s)?s:me(s);return this.isValid()&&f.isValid()&&p.isValid()?(u=u||"()",(u[0]==="("?this.isAfter(f,a):!this.isBefore(f,a))&&(u[1]===")"?this.isBefore(p,a):!this.isAfter(p,a))):!1}function oc(t,s){var a=I(t)?t:me(t),u;return this.isValid()&&a.isValid()?(s=qe(s)||"millisecond",s==="millisecond"?this.valueOf()===a.valueOf():(u=a.valueOf(),this.clone().startOf(s).valueOf()<=u&&u<=this.clone().endOf(s).valueOf())):!1}function ac(t,s){return this.isSame(t,s)||this.isAfter(t,s)}function lc(t,s){return this.isSame(t,s)||this.isBefore(t,s)}function uc(t,s,a){var u,f,p;if(!this.isValid())return NaN;if(u=ji(t,this),!u.isValid())return NaN;switch(f=(u.utcOffset()-this.utcOffset())*6e4,s=qe(s),s){case"year":p=Sn(this,u)/12;break;case"month":p=Sn(this,u);break;case"quarter":p=Sn(this,u)/3;break;case"second":p=(this-u)/1e3;break;case"minute":p=(this-u)/6e4;break;case"hour":p=(this-u)/36e5;break;case"day":p=(this-u-f)/864e5;break;case"week":p=(this-u-f)/6048e5;break;default:p=this-u}return a?p:Ke(p)}function Sn(t,s){if(t.date()<s.date())return-Sn(s,t);var a=(s.year()-t.year())*12+(s.month()-t.month()),u=t.clone().add(a,"months"),f,p;return s-u<0?(f=t.clone().add(a-1,"months"),p=(s-u)/(u-f)):(f=t.clone().add(a+1,"months"),p=(s-u)/(f-u)),-(a+p)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function dc(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function cc(t){if(!this.isValid())return null;var s=t!==!0,a=s?this.clone().utc():this;return a.year()<0||a.year()>9999?dn(a,s?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):ie(Date.prototype.toISOString)?s?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",dn(a,"Z")):dn(a,s?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function fc(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",s="",a,u,f,p;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",s="Z"),a="["+t+'("]',u=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",f="-MM-DD[T]HH:mm:ss.SSS",p=s+'[")]',this.format(a+u+f+p)}function mc(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var s=dn(this,t);return this.localeData().postformat(s)}function hc(t,s){return this.isValid()&&(I(t)&&t.isValid()||me(t).isValid())?ot({to:this,from:t}).locale(this.locale()).humanize(!s):this.localeData().invalidDate()}function pc(t){return this.from(me(),t)}function yc(t,s){return this.isValid()&&(I(t)&&t.isValid()||me(t).isValid())?ot({from:this,to:t}).locale(this.locale()).humanize(!s):this.localeData().invalidDate()}function gc(t){return this.to(me(),t)}function Ro(t){var s;return t===void 0?this._locale._abbr:(s=gt(t),s!=null&&(this._locale=s),this)}var Eo=q("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function Uo(){return this._locale}var Tn=1e3,ir=60*Tn,Fn=60*ir,Yo=(365*400+97)*24*Fn;function sr(t,s){return(t%s+s)%s}function Oo(t,s,a){return t<100&&t>=0?new Date(t+400,s,a)-Yo:new Date(t,s,a).valueOf()}function Qo(t,s,a){return t<100&&t>=0?Date.UTC(t+400,s,a)-Yo:Date.UTC(t,s,a)}function bc(t){var s,a;if(t=qe(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(a=this._isUTC?Qo:Oo,t){case"year":s=a(this.year(),0,1);break;case"quarter":s=a(this.year(),this.month()-this.month()%3,1);break;case"month":s=a(this.year(),this.month(),1);break;case"week":s=a(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":s=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":s=a(this.year(),this.month(),this.date());break;case"hour":s=this._d.valueOf(),s-=sr(s+(this._isUTC?0:this.utcOffset()*ir),Fn);break;case"minute":s=this._d.valueOf(),s-=sr(s,ir);break;case"second":s=this._d.valueOf(),s-=sr(s,Tn);break}return this._d.setTime(s),e.updateOffset(this,!0),this}function vc(t){var s,a;if(t=qe(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(a=this._isUTC?Qo:Oo,t){case"year":s=a(this.year()+1,0,1)-1;break;case"quarter":s=a(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":s=a(this.year(),this.month()+1,1)-1;break;case"week":s=a(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":s=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":s=a(this.year(),this.month(),this.date()+1)-1;break;case"hour":s=this._d.valueOf(),s+=Fn-sr(s+(this._isUTC?0:this.utcOffset()*ir),Fn)-1;break;case"minute":s=this._d.valueOf(),s+=ir-sr(s,ir)-1;break;case"second":s=this._d.valueOf(),s+=Tn-sr(s,Tn)-1;break}return this._d.setTime(s),e.updateOffset(this,!0),this}function _c(){return this._d.valueOf()-(this._offset||0)*6e4}function wc(){return Math.floor(this.valueOf()/1e3)}function xc(){return new Date(this.valueOf())}function kc(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function Dc(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function Sc(){return this.isValid()?this.toISOString():null}function Tc(){return F(this)}function Fc(){return w({},b(this))}function Mc(){return b(this).overflow}function Rc(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Q("N",0,0,"eraAbbr"),Q("NN",0,0,"eraAbbr"),Q("NNN",0,0,"eraAbbr"),Q("NNNN",0,0,"eraName"),Q("NNNNN",0,0,"eraNarrow"),Q("y",["y",1],"yo","eraYear"),Q("y",["yy",2],0,"eraYear"),Q("y",["yyy",3],0,"eraYear"),Q("y",["yyyy",4],0,"eraYear"),R("N",Gi),R("NN",Gi),R("NNN",Gi),R("NNNN",Pc),R("NNNNN",Ac),se(["N","NN","NNN","NNNN","NNNNN"],function(t,s,a,u){var f=a._locale.erasParse(t,u,a._strict);f?b(a).era=f:b(a).invalidEra=t}),R("y",rr),R("yy",rr),R("yyy",rr),R("yyyy",rr),R("yo",Wc),se(["y","yy","yyy","yyyy"],Oe),se(["yo"],function(t,s,a,u){var f;a._locale._eraYearOrdinalRegex&&(f=t.match(a._locale._eraYearOrdinalRegex)),a._locale.eraYearOrdinalParse?s[Oe]=a._locale.eraYearOrdinalParse(t,f):s[Oe]=parseInt(t,10)});function Ec(t,s){var a,u,f,p=this._eras||gt("en")._eras;for(a=0,u=p.length;a<u;++a){switch(typeof p[a].since){case"string":f=e(p[a].since).startOf("day"),p[a].since=f.valueOf();break}switch(typeof p[a].until){case"undefined":p[a].until=1/0;break;case"string":f=e(p[a].until).startOf("day").valueOf(),p[a].until=f.valueOf();break}}return p}function Uc(t,s,a){var u,f,p=this.eras(),v,L,A;for(t=t.toUpperCase(),u=0,f=p.length;u<f;++u)if(v=p[u].name.toUpperCase(),L=p[u].abbr.toUpperCase(),A=p[u].narrow.toUpperCase(),a)switch(s){case"N":case"NN":case"NNN":if(L===t)return p[u];break;case"NNNN":if(v===t)return p[u];break;case"NNNNN":if(A===t)return p[u];break}else if([v,L,A].indexOf(t)>=0)return p[u]}function Yc(t,s){var a=t.since<=t.until?1:-1;return s===void 0?e(t.since).year():e(t.since).year()+(s-t.offset)*a}function Oc(){var t,s,a,u=this.localeData().eras();for(t=0,s=u.length;t<s;++t)if(a=this.clone().startOf("day").valueOf(),u[t].since<=a&&a<=u[t].until||u[t].until<=a&&a<=u[t].since)return u[t].name;return""}function Qc(){var t,s,a,u=this.localeData().eras();for(t=0,s=u.length;t<s;++t)if(a=this.clone().startOf("day").valueOf(),u[t].since<=a&&a<=u[t].until||u[t].until<=a&&a<=u[t].since)return u[t].narrow;return""}function Lc(){var t,s,a,u=this.localeData().eras();for(t=0,s=u.length;t<s;++t)if(a=this.clone().startOf("day").valueOf(),u[t].since<=a&&a<=u[t].until||u[t].until<=a&&a<=u[t].since)return u[t].abbr;return""}function Nc(){var t,s,a,u,f=this.localeData().eras();for(t=0,s=f.length;t<s;++t)if(a=f[t].since<=f[t].until?1:-1,u=this.clone().startOf("day").valueOf(),f[t].since<=u&&u<=f[t].until||f[t].until<=u&&u<=f[t].since)return(this.year()-e(f[t].since).year())*a+f[t].offset;return this.year()}function Cc(t){return l(this,"_erasNameRegex")||zi.call(this),t?this._erasNameRegex:this._erasRegex}function Bc(t){return l(this,"_erasAbbrRegex")||zi.call(this),t?this._erasAbbrRegex:this._erasRegex}function Ic(t){return l(this,"_erasNarrowRegex")||zi.call(this),t?this._erasNarrowRegex:this._erasRegex}function Gi(t,s){return s.erasAbbrRegex(t)}function Pc(t,s){return s.erasNameRegex(t)}function Ac(t,s){return s.erasNarrowRegex(t)}function Wc(t,s){return s._eraYearOrdinalRegex||rr}function zi(){var t=[],s=[],a=[],u=[],f,p,v=this.eras();for(f=0,p=v.length;f<p;++f)s.push(He(v[f].name)),t.push(He(v[f].abbr)),a.push(He(v[f].narrow)),u.push(He(v[f].name)),u.push(He(v[f].abbr)),u.push(He(v[f].narrow));this._erasRegex=new RegExp("^("+u.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+s.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+a.join("|")+")","i")}Q(0,["gg",2],0,function(){return this.weekYear()%100}),Q(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Mn(t,s){Q(0,[t,t.length],0,s)}Mn("gggg","weekYear"),Mn("ggggg","weekYear"),Mn("GGGG","isoWeekYear"),Mn("GGGGG","isoWeekYear"),Ue("weekYear","gg"),Ue("isoWeekYear","GG"),Ye("weekYear",1),Ye("isoWeekYear",1),R("G",yn),R("g",yn),R("GG",fe,je),R("gg",fe,je),R("GGGG",Oi,Yi),R("gggg",Oi,Yi),R("GGGGG",pn,mn),R("ggggg",pn,mn),Rr(["gggg","ggggg","GGGG","GGGGG"],function(t,s,a,u){s[u.substr(0,2)]=W(t)}),Rr(["gg","GG"],function(t,s,a,u){s[u]=e.parseTwoDigitYear(t)});function $c(t){return Lo.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Vc(t){return Lo.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function jc(){return yt(this.year(),1,4)}function Hc(){return yt(this.isoWeekYear(),1,4)}function Gc(){var t=this.localeData()._week;return yt(this.year(),t.dow,t.doy)}function zc(){var t=this.localeData()._week;return yt(this.weekYear(),t.dow,t.doy)}function Lo(t,s,a,u,f){var p;return t==null?Yr(this,u,f).year:(p=yt(t,u,f),s>p&&(s=p),Zc.call(this,t,s,a,u,f))}function Zc(t,s,a,u,f){var p=fo(t,s,a,u,f),v=Ur(p.year,0,p.dayOfYear);return this.year(v.getUTCFullYear()),this.month(v.getUTCMonth()),this.date(v.getUTCDate()),this}Q("Q",0,"Qo","quarter"),Ue("quarter","Q"),Ye("quarter",7),R("Q",to),se("Q",function(t,s){s[ht]=(W(t)-1)*3});function Jc(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Q("D",["DD",2],"Do","date"),Ue("date","D"),Ye("date",9),R("D",fe),R("DD",fe,je),R("Do",function(t,s){return t?s._dayOfMonthOrdinalParse||s._ordinalParse:s._dayOfMonthOrdinalParseLenient}),se(["D","DD"],lt),se("Do",function(t,s){s[lt]=W(t.match(fe)[0])});var No=tr("Date",!0);Q("DDD",["DDDD",3],"DDDo","dayOfYear"),Ue("dayOfYear","DDD"),Ye("dayOfYear",4),R("DDD",hn),R("DDDD",ro),se(["DDD","DDDD"],function(t,s,a){a._dayOfYear=W(t)});function qc(t){var s=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?s:this.add(t-s,"d")}Q("m",["mm",2],0,"minute"),Ue("minute","m"),Ye("minute",14),R("m",fe),R("mm",fe,je),se(["m","mm"],st);var Kc=tr("Minutes",!1);Q("s",["ss",2],0,"second"),Ue("second","s"),Ye("second",15),R("s",fe),R("ss",fe,je),se(["s","ss"],pt);var Xc=tr("Seconds",!1);Q("S",0,0,function(){return~~(this.millisecond()/100)}),Q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Q(0,["SSS",3],0,"millisecond"),Q(0,["SSSS",4],0,function(){return this.millisecond()*10}),Q(0,["SSSSS",5],0,function(){return this.millisecond()*100}),Q(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),Q(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),Q(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),Q(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Ue("millisecond","ms"),Ye("millisecond",16),R("S",hn,to),R("SS",hn,je),R("SSS",hn,ro);var Ut,Co;for(Ut="SSSS";Ut.length<=9;Ut+="S")R(Ut,rr);function ef(t,s){s[Wt]=W(("0."+t)*1e3)}for(Ut="S";Ut.length<=9;Ut+="S")se(Ut,ef);Co=tr("Milliseconds",!1),Q("z",0,0,"zoneAbbr"),Q("zz",0,0,"zoneName");function tf(){return this._isUTC?"UTC":""}function rf(){return this._isUTC?"Coordinated Universal Time":""}var k=V.prototype;k.add=zd,k.calendar=tc,k.clone=rc,k.diff=uc,k.endOf=vc,k.format=mc,k.from=hc,k.fromNow=pc,k.to=yc,k.toNow=gc,k.get=iu,k.invalidAt=Mc,k.isAfter=nc,k.isBefore=ic,k.isBetween=sc,k.isSame=oc,k.isSameOrAfter=ac,k.isSameOrBefore=lc,k.isValid=Tc,k.lang=Eo,k.locale=Ro,k.localeData=Uo,k.max=Td,k.min=Sd,k.parsingFlags=Fc,k.set=su,k.startOf=bc,k.subtract=Zd,k.toArray=kc,k.toObject=Dc,k.toDate=xc,k.toISOString=cc,k.inspect=fc,typeof Symbol!="undefined"&&Symbol.for!=null&&(k[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),k.toJSON=Sc,k.toString=dc,k.unix=wc,k.valueOf=_c,k.creationData=Rc,k.eraName=Oc,k.eraNarrow=Qc,k.eraAbbr=Lc,k.eraYear=Nc,k.year=co,k.isLeapYear=Du,k.weekYear=$c,k.isoWeekYear=Vc,k.quarter=k.quarters=Jc,k.month=lo,k.daysInMonth=wu,k.week=k.weeks=Eu,k.isoWeek=k.isoWeeks=Uu,k.weeksInYear=Gc,k.weeksInWeekYear=zc,k.isoWeeksInYear=jc,k.isoWeeksInISOWeekYear=Hc,k.date=No,k.day=k.days=Vu,k.weekday=ju,k.isoWeekday=Hu,k.dayOfYear=qc,k.hour=k.hours=Xu,k.minute=k.minutes=Kc,k.second=k.seconds=Xc,k.millisecond=k.milliseconds=Co,k.utcOffset=Ld,k.utc=Cd,k.local=Bd,k.parseZone=Id,k.hasAlignedHourOffset=Pd,k.isDST=Ad,k.isLocal=$d,k.isUtcOffset=Vd,k.isUtc=Do,k.isUTC=Do,k.zoneAbbr=tf,k.zoneName=rf,k.dates=q("dates accessor is deprecated. Use date instead.",No),k.months=q("months accessor is deprecated. Use month instead",lo),k.years=q("years accessor is deprecated. Use year instead",co),k.zone=q("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Nd),k.isDSTShifted=q("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Wd);function nf(t){return me(t*1e3)}function sf(){return me.apply(null,arguments).parseZone()}function Bo(t){return t}var K=le.prototype;K.calendar=H,K.longDateFormat=zl,K.invalidDate=Jl,K.ordinal=Xl,K.preparse=Bo,K.postformat=Bo,K.relativeTime=tu,K.pastFuture=ru,K.set=E,K.eras=Ec,K.erasParse=Uc,K.erasConvertYear=Yc,K.erasAbbrRegex=Bc,K.erasNameRegex=Cc,K.erasNarrowRegex=Ic,K.months=gu,K.monthsShort=bu,K.monthsParse=_u,K.monthsRegex=ku,K.monthsShortRegex=xu,K.week=Tu,K.firstDayOfYear=Ru,K.firstDayOfWeek=Mu,K.weekdays=Iu,K.weekdaysMin=Au,K.weekdaysShort=Pu,K.weekdaysParse=$u,K.weekdaysRegex=Gu,K.weekdaysShortRegex=zu,K.weekdaysMinRegex=Zu,K.isPM=qu,K.meridiem=ed;function Rn(t,s,a,u){var f=gt(),p=_().set(u,s);return f[a](p,t)}function Io(t,s,a){if(m(t)&&(s=t,t=void 0),t=t||"",s!=null)return Rn(t,s,a,"month");var u,f=[];for(u=0;u<12;u++)f[u]=Rn(t,u,a,"month");return f}function Zi(t,s,a,u){typeof t=="boolean"?(m(s)&&(a=s,s=void 0),s=s||""):(s=t,a=s,t=!1,m(s)&&(a=s,s=void 0),s=s||"");var f=gt(),p=t?f._week.dow:0,v,L=[];if(a!=null)return Rn(s,(a+p)%7,u,"day");for(v=0;v<7;v++)L[v]=Rn(s,(v+p)%7,u,"day");return L}function of(t,s){return Io(t,s,"months")}function af(t,s){return Io(t,s,"monthsShort")}function lf(t,s,a){return Zi(t,s,a,"weekdays")}function uf(t,s,a){return Zi(t,s,a,"weekdaysShort")}function df(t,s,a){return Zi(t,s,a,"weekdaysMin")}Et("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var s=t%10,a=W(t%100/10)===1?"th":s===1?"st":s===2?"nd":s===3?"rd":"th";return t+a}}),e.lang=q("moment.lang is deprecated. Use moment.locale instead.",Et),e.langData=q("moment.langData is deprecated. Use moment.localeData instead.",gt);var bt=Math.abs;function cf(){var t=this._data;return this._milliseconds=bt(this._milliseconds),this._days=bt(this._days),this._months=bt(this._months),t.milliseconds=bt(t.milliseconds),t.seconds=bt(t.seconds),t.minutes=bt(t.minutes),t.hours=bt(t.hours),t.months=bt(t.months),t.years=bt(t.years),this}function Po(t,s,a,u){var f=ot(s,a);return t._milliseconds+=u*f._milliseconds,t._days+=u*f._days,t._months+=u*f._months,t._bubble()}function ff(t,s){return Po(this,t,s,1)}function mf(t,s){return Po(this,t,s,-1)}function Ao(t){return t<0?Math.floor(t):Math.ceil(t)}function hf(){var t=this._milliseconds,s=this._days,a=this._months,u=this._data,f,p,v,L,A;return t>=0&&s>=0&&a>=0||t<=0&&s<=0&&a<=0||(t+=Ao(Ji(a)+s)*864e5,s=0,a=0),u.milliseconds=t%1e3,f=Ke(t/1e3),u.seconds=f%60,p=Ke(f/60),u.minutes=p%60,v=Ke(p/60),u.hours=v%24,s+=Ke(v/24),A=Ke(Wo(s)),a+=A,s-=Ao(Ji(A)),L=Ke(a/12),a%=12,u.days=s,u.months=a,u.years=L,this}function Wo(t){return t*4800/146097}function Ji(t){return t*146097/4800}function pf(t){if(!this.isValid())return NaN;var s,a,u=this._milliseconds;if(t=qe(t),t==="month"||t==="quarter"||t==="year")switch(s=this._days+u/864e5,a=this._months+Wo(s),t){case"month":return a;case"quarter":return a/3;case"year":return a/12}else switch(s=this._days+Math.round(Ji(this._months)),t){case"week":return s/7+u/6048e5;case"day":return s+u/864e5;case"hour":return s*24+u/36e5;case"minute":return s*1440+u/6e4;case"second":return s*86400+u/1e3;case"millisecond":return Math.floor(s*864e5)+u;default:throw new Error("Unknown unit "+t)}}function yf(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+W(this._months/12)*31536e6:NaN}function vt(t){return function(){return this.as(t)}}var gf=vt("ms"),bf=vt("s"),vf=vt("m"),_f=vt("h"),wf=vt("d"),xf=vt("w"),kf=vt("M"),Df=vt("Q"),Sf=vt("y");function Tf(){return ot(this)}function Ff(t){return t=qe(t),this.isValid()?this[t+"s"]():NaN}function Vt(t){return function(){return this.isValid()?this._data[t]:NaN}}var Mf=Vt("milliseconds"),Rf=Vt("seconds"),Ef=Vt("minutes"),Uf=Vt("hours"),Yf=Vt("days"),Of=Vt("months"),Qf=Vt("years");function Lf(){return Ke(this.days()/7)}var _t=Math.round,or={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Nf(t,s,a,u,f){return f.relativeTime(s||1,!!a,t,u)}function Cf(t,s,a,u){var f=ot(t).abs(),p=_t(f.as("s")),v=_t(f.as("m")),L=_t(f.as("h")),A=_t(f.as("d")),oe=_t(f.as("M")),Ie=_t(f.as("w")),wt=_t(f.as("y")),Yt=p<=a.ss&&["s",p]||p<a.s&&["ss",p]||v<=1&&["m"]||v<a.m&&["mm",v]||L<=1&&["h"]||L<a.h&&["hh",L]||A<=1&&["d"]||A<a.d&&["dd",A];return a.w!=null&&(Yt=Yt||Ie<=1&&["w"]||Ie<a.w&&["ww",Ie]),Yt=Yt||oe<=1&&["M"]||oe<a.M&&["MM",oe]||wt<=1&&["y"]||["yy",wt],Yt[2]=s,Yt[3]=+t>0,Yt[4]=u,Nf.apply(null,Yt)}function Bf(t){return t===void 0?_t:typeof t=="function"?(_t=t,!0):!1}function If(t,s){return or[t]===void 0?!1:s===void 0?or[t]:(or[t]=s,t==="s"&&(or.ss=s-1),!0)}function Pf(t,s){if(!this.isValid())return this.localeData().invalidDate();var a=!1,u=or,f,p;return typeof t=="object"&&(s=t,t=!1),typeof t=="boolean"&&(a=t),typeof s=="object"&&(u=Object.assign({},or,s),s.s!=null&&s.ss==null&&(u.ss=s.s-1)),f=this.localeData(),p=Cf(this,!a,u,f),a&&(p=f.pastFuture(+this,p)),f.postformat(p)}var qi=Math.abs;function ar(t){return(t>0)-(t<0)||+t}function En(){if(!this.isValid())return this.localeData().invalidDate();var t=qi(this._milliseconds)/1e3,s=qi(this._days),a=qi(this._months),u,f,p,v,L=this.asSeconds(),A,oe,Ie,wt;return L?(u=Ke(t/60),f=Ke(u/60),t%=60,u%=60,p=Ke(a/12),a%=12,v=t?t.toFixed(3).replace(/\.?0+$/,""):"",A=L<0?"-":"",oe=ar(this._months)!==ar(L)?"-":"",Ie=ar(this._days)!==ar(L)?"-":"",wt=ar(this._milliseconds)!==ar(L)?"-":"",A+"P"+(p?oe+p+"Y":"")+(a?oe+a+"M":"")+(s?Ie+s+"D":"")+(f||u||t?"T":"")+(f?wt+f+"H":"")+(u?wt+u+"M":"")+(t?wt+v+"S":"")):"P0D"}var J=kn.prototype;J.isValid=Ud,J.abs=cf,J.add=ff,J.subtract=mf,J.as=pf,J.asMilliseconds=gf,J.asSeconds=bf,J.asMinutes=vf,J.asHours=_f,J.asDays=wf,J.asWeeks=xf,J.asMonths=kf,J.asQuarters=Df,J.asYears=Sf,J.valueOf=yf,J._bubble=hf,J.clone=Tf,J.get=Ff,J.milliseconds=Mf,J.seconds=Rf,J.minutes=Ef,J.hours=Uf,J.days=Yf,J.weeks=Lf,J.months=Of,J.years=Qf,J.humanize=Pf,J.toISOString=En,J.toString=En,J.toJSON=En,J.locale=Ro,J.localeData=Uo,J.toIsoString=q("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",En),J.lang=Eo,Q("X",0,0,"unix"),Q("x",0,0,"valueOf"),R("x",yn),R("X",au),se("X",function(t,s,a){a._d=new Date(parseFloat(t)*1e3)}),se("x",function(t,s,a){a._d=new Date(W(t))});return e.version="2.29.4",r(me),e.fn=k,e.min=Fd,e.max=Md,e.now=Rd,e.utc=_,e.unix=nf,e.months=of,e.isDate=h,e.locale=Et,e.invalid=T,e.duration=ot,e.isMoment=I,e.weekdays=lf,e.parseZone=sf,e.localeData=gt,e.isDuration=Dn,e.monthsShort=af,e.weekdaysMin=df,e.defineLocale=Bi,e.updateLocale=id,e.locales=sd,e.weekdaysShort=uf,e.normalizeUnits=qe,e.relativeTimeRounding=Bf,e.relativeTimeThreshold=If,e.calendarFormat=ec,e.prototype=k,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var vh={};zf(vh,{default:()=>Mi});module.exports=Zf(vh);var Cr=class{constructor(e){this.plugin=e}startPeriodicTask(){let e=!0;this.periodicTask().finally(()=>{e=!1}),this.plugin.registerInterval(window.setInterval(()=>{if(e){console.log("Skip reminder interval task because task is already running.");return}e=!0,this.periodicTask().finally(()=>{e=!1})},this.plugin.settings.reminderCheckIntervalSec.value*1e3))}async periodicTask(){if(this.plugin.ui.reload(!1),this.plugin.data.scanned.value||this.plugin.fileSystem.reloadRemindersInAllFiles().then(()=>{this.plugin.data.scanned.value=!0,this.plugin.data.save()}),this.plugin.data.save(!1),this.plugin.ui.isEditing())return;let e=this.plugin.reminders.getExpiredReminders(this.plugin.settings.reminderTime.value),r;for(let i of e)if(this.plugin.app.workspace.layoutReady){if(i.muteNotification)continue;if(r)for(;r.beingDisplayed;)await this.sleep(100);this.plugin.ui.showReminder(i),r=i}}async sleep(e){return new Promise(r=>setTimeout(r,e))}};var At=require("obsidian");var Ja=require("obsidian");function Vo(n,e){return n||e.fileSystem.reloadRemindersInAllFiles(),!0}function jo(n,e){return n||e.showReminderList(),!0}var Ho=window.require?window.require("electron"):void 0;async function Go(n,e){return Ho&&(await Ho.remote.dialog.showMessageBox({type:"question",title:"Obsidian Reminder",message:n,detail:e,buttons:["OK","Cancel"],cancelId:1})).response===0?0:1}var Qt=class Qt{constructor(e,r,i,o,l){this.lineIndex=e;this.prefix=r;this.check=i;this.suffix=o;this.body=l}static parse(e,r){let i=Qt.regexp.exec(r);return i?new Qt(e,i.groups.prefix,i.groups.check,i.groups.suffix,i.groups.body):null}toMarkdown(){return`${this.prefix}${this.check}${this.suffix}${this.body}`}isChecked(){return Qt.checkedStatuses.some(e=>e===this.check)}setChecked(e){this.check=e?"x":" "}getHeaderLength(){return this.prefix.length+this.check.length+this.suffix.length}clone(){return Qt.parse(this.lineIndex,this.toMarkdown())}};g(Qt,"regexp",/^(?<prefix>((> ?)*)?\s*[-*][ ]+\[)(?<check>.)(?<suffix>\]\s+)(?<body>.*)$/),g(Qt,"checkedStatuses",["x","-"]);var Br=Qt,Ir=class{constructor(e,r){this.file=e;g(this,"lines",[]);g(this,"todos",[]);this.parse(r)}parse(e){this.lines=e.split(`
`),this.todos=[],this.lines.forEach((r,i)=>{let o=Br.parse(i,r);o&&this.todos.push(o)})}getTodos(){return this.todos}insertTodo(e,r){r.lineIndex=e,this.lines.splice(e,0,r.toMarkdown());let i=-1;for(let o in this.todos){let l=this.todos[o];l.lineIndex>=e&&(i<0&&(i=parseInt(o)),l.lineIndex++)}i<=0?this.todos.splice(0,0,r):this.todos.splice(i,0,r)}getTodo(e){let r=this.todos.find(i=>i.lineIndex===e);return r==null?null:r}applyChanges(){this.todos.forEach(e=>{this.lines[e.lineIndex]=e.toMarkdown()})}toMarkdown(){return this.applyChanges(),this.lines.join(`
`)}};var lr=class{constructor(e){this._value=e}get value(){return this._value}},jt=class{constructor(e){this._value=e;g(this,"onChangeFunctions",[])}onChanged(e){this.onChangeFunctions.push(e)}get value(){return this._value}set value(e){let r=this._value;this._value=e,this.onChangeFunctions.forEach(i=>{i(r,e)})}};var Xe=Ot(xt(),1);var G=class n{constructor(e,r){this.time=e;this._hasTimePart=r}static now(){return new n((0,Xe.default)(),!0)}static parse(e){return e.length>10?new n((0,Xe.default)(e,"YYYY-MM-DD HH:mm"),!0):new n((0,Xe.default)(e,"YYYY-MM-DD"),!1)}static duration(e,r,i,o){return r.fixedTime(o).diff(e.fixedTime(o),i)}getTimeInMillis(e){return this.fixedTime(e).valueOf()}format(e,r){return this.fixedTime(r).format(e)}toYYYYMMMM(e){return this.fixedTime(e).format("YYYY, MMMM")}toYYYYMMDD(e){return this.fixedTime(e).format("YYYY-MM-DD")}add(e,r,i){return new n(this.fixedTime(i).clone().add(e,r),this._hasTimePart)}fixedTime(e){return this._hasTimePart?this.time:e===void 0?this.time:this.time.clone().add(e.minutes,"minutes")}get hasTimePart(){return this._hasTimePart}moment(){return this.time}isValid(){return this.time.isValid()}clone(e){let r=e==null?this._hasTimePart:e,i=this.time.clone();return new n(i,r)}toString(){return this._hasTimePart?this.format("YYYY-MM-DD HH:mm"):this.format("YYYY-MM-DD")}equals(e){return this._hasTimePart===e._hasTimePart&&this.time.isSame(e.time)}},Un=class n{constructor(e,r){this.hour=e;this.minute=r}static parse(e){if(!e.match(/^\d{1,2}:\d{1,2}$/))throw`Unexpected format time(${e}). Time must be HH:mm.`;let r=e.split(":");if(r.length!==2)throw`Unexpected format time(${e}). time must be HH:mm.`;let i=parseInt(r[0]),o=parseInt(r[1]);if(i>23||i<0)throw"hour must be 0~23";if(o>59||o<0)throw"minute must be 0~59";return new n(i,o)}get minutes(){return this.hour*60+this.minute}toString(){let e=r=>r<10?"0"+r:""+r;return`${e(this.hour)}:${e(this.minute)}`}};function dr(n,e){return()=>new G((0,Xe.default)(),!0).add(n,e)}function zo(n){return dr(n,"minutes")}function Xi(n){return dr(n,"hours")}function Jf(n){return dr(n,"days")}function qf(n){return dr(n,"weeks")}function Kf(n){return dr(n,"months")}function Xf(n){return dr(n,"years")}function Ht(n){return()=>{let e=(0,Xe.default)();return e.isoWeekday()<=n?new G(e.isoWeekday(n),!1):new G(e.add(1,"weeks").isoWeekday(n),!1)}}function es(){return()=>new G((0,Xe.default)().add(1,"days"),!1)}function Zo(){return()=>new G((0,Xe.default)().add(1,"weeks"),!1)}function em(){return()=>new G((0,Xe.default)().add(1,"months"),!1)}function tm(){return()=>new G((0,Xe.default)().add(1,"years"),!1)}var he=class{constructor(e,r){this.label=e;this.later=r}};function Jo(n){return n.split(`
`).map(e=>rm(e.trim()))}function rm(n){if(n=n.toLowerCase(),n.startsWith("in")){let e=n.split(" ");if(e.length!==3)throw"Unsupported format. Should be 'In N (minutes|hours)'";let r=e[1]==="a"||e[1]==="an"?1:parseInt(e[1]);switch(e[2]){case"minute":case"minutes":{let i=r==1?"minute":"minutes";return new he(`In ${r} ${i}`,zo(r))}case"hour":case"hours":{let i=r==1?"hour":"hours";return new he(`In ${r} ${i}`,Xi(r))}case"day":case"days":{let i=r==1?"day":"days";return new he(`In ${r} ${i}`,Jf(r))}case"week":case"weeks":{let i=r==1?"week":"weeks";return new he(`In ${r} ${i}`,qf(r))}case"month":case"months":{let i=r==1?"month":"months";return new he(`In ${r} ${i}`,Kf(r))}case"year":case"years":{let i=r==1?"year":"years";return new he(`In ${r} ${i}`,Xf(r))}}}else if(n.startsWith("next")){let e=n.substring(5);switch(e){case"sunday":return new he("Next Sunday",Ht(0));case"monday":return new he("Next Monday",Ht(1));case"tuesday":return new he("Next Tuesday",Ht(2));case"wednesday":return new he("Next Wednesday",Ht(3));case"thursday":return new he("Next Thursday",Ht(4));case"friday":return new he("Next Friday",Ht(5));case"saturday":return new he("Next Saturday",Ht(6));case"day":return new he("Tomorrow",es());case"week":return new he("Next week",Zo());case"month":return new he("Next month",em());case"year":return new he("Next year",tm());default:throw`Unsupported weekday: ${e}`}}else if(n==="tomorrow")return new he("Tomorrow",es());throw`Unsupported format: ${n}`}var Eh=[new he("In 30 minutes",zo(30)),new he("In 1 hours",Xi(1)),new he("In 3 hours",Xi(3)),new he("Tomorrow",es()),new he("Next week",Zo())],ts=class{constructor(){g(this,"dateFormat",new lr("YYYY-MM-DD"));g(this,"dateTimeFormat",new lr("YYYY-MM-DD HH:mm"));g(this,"strict",new lr(!1))}setTimeFormat(e,r,i){this.dateFormat=e,this.dateTimeFormat=r,this.strict=i}parse(e){let r=this.doParse(e,!0);return r!=null?r:this.strict.value?null:this.doParse(e,!1)}doParse(e,r){let i=(0,Xe.default)(e,this.dateTimeFormat.value,r);if(i.isValid())return new G(i,!0);let o=(0,Xe.default)(e,this.dateFormat.value,r);return o.isValid()?new G(o,!1):null}toString(e){return e.hasTimePart?e.format(this.dateTimeFormat.value):e.format(this.dateFormat.value)}},ut=new ts;var cr=class{constructor(e,r,i,o,l){this.file=e;this.title=r;this.time=i;this.rowNumber=o;this.done=l;g(this,"muteNotification",!1);g(this,"beingDisplayed",!1)}key(){return this.file+this.title+this.time.toString()}equals(e){return this.rowNumber===e.rowNumber&&this.title===e.title&&this.time.equals(e.time)&&this.file===e.file}getFileName(){let e=this.file.split(/[/\\]/);return e[e.length-1].replace(/^(.*?)(\..+)?$/,"$1")}static extractFileName(e){let r=e.split(/[/\\]/);return r[r.length-1].replace(/^(.*?)(\..+)?$/,"$1")}},Yn=class{constructor(e){this.onChange=e;g(this,"fileToReminders",new Map);g(this,"reminders",[]);g(this,"reminderTime")}getExpiredReminders(e){let r=new Date().getTime(),i=[];for(let o=0;o<this.reminders.length;o++){let l=this.reminders[o];if(l.time.getTimeInMillis(e)<=r)i.push(l);else break}return i}byDate(e){return this.reminders.filter(r=>r.time.toYYYYMMDD()===e.toYYYYMMDD())}removeReminder(e){console.debug("Remove reminder: %o",e),this.reminders.remove(e);let r=this.fileToReminders.get(e.file);r&&(r.remove(e),r.length===0&&this.fileToReminders.delete(e.file)),this.onChange()}clear(){this.fileToReminders.clear(),this.reminders=[],this.onChange()}removeByFile(e){return this.fileToReminders.delete(e)?(this.sortReminders(),!0):!1}replaceFile(e,r){let i=this.fileToReminders.get(e);if(i){if(this.equals(i,r))return!1;let o=new Map;for(let l of i)o.set(l.key(),l.muteNotification);for(let l of r){let c=o.get(l.key());o.set(l.key(),l.muteNotification),c!==void 0&&(l.muteNotification=c)}}return this.fileToReminders.set(e,r),this.sortReminders(),!0}equals(e,r){if(e.length!==r.length)return!1;this.sort(e),this.sort(r);for(let i in e){let o=e[i],l=r[i];if(o==null&&l!=null||l==null&&o!=null)return!1;if(!(o==null&&l==null)&&!o.equals(l))return!1}return!0}sortReminders(){let e=[];for(let r of this.fileToReminders.values())e.push(...r);this.sort(e),this.reminders=e,this.onChange()}sort(e){e.sort((r,i)=>{var l,c;let o=r.time.getTimeInMillis((l=this.reminderTime)==null?void 0:l.value)-i.time.getTimeInMillis((c=this.reminderTime)==null?void 0:c.value);return o>0?1:o<0?-1:0})}},Ko=[{name:"US Style (12h)",format:{yearMonthFormat:"MMMM YYYY",monthDayFormat:"MM/DD",shortDateWithWeekdayFormat:"M/DD (ddd)",timeFormat:"h:mm A"}},{name:"US Style (24h)",format:{yearMonthFormat:"MMMM YYYY",monthDayFormat:"MM/DD",shortDateWithWeekdayFormat:"M/DD (ddd)",timeFormat:"HH:mm"}},{name:"EU Style (24h)",format:{yearMonthFormat:"MMMM YYYY",monthDayFormat:"DD/MM",shortDateWithWeekdayFormat:"D/MM (ddd)",timeFormat:"HH:mm"}},{name:"EU Style (12h)",format:{yearMonthFormat:"MMMM YYYY",monthDayFormat:"DD/MM",shortDateWithWeekdayFormat:"D/MM (ddd)",timeFormat:"h:mm A"}},{name:"JP Style (24h)",format:{yearMonthFormat:"YYYY\u5E74MM\u6708",monthDayFormat:"MM/DD",shortDateWithWeekdayFormat:"M\u6708D\u65E5 (ddd)",timeFormat:"HH:mm"}},{name:"JP Style (12h)",format:{yearMonthFormat:"YYYY\u5E74MM\u6708",monthDayFormat:"MM/DD",shortDateWithWeekdayFormat:"M\u6708D\u65E5 (ddd)",timeFormat:"h:mm A"}}];function qo(n,e,r,i){let o=G.duration(e,n,"days",r);if(o>30)return new Lt(n.format(i.yearMonthFormat,r),l=>l.format(i.monthDayFormat,r));if(o>=7)return new Lt("Over 1 week",l=>l.format(i.monthDayFormat,r));if(n.toYYYYMMDD(r)===e.toYYYYMMDD(r)){let l=new Lt("Today",c=>c.format(i.timeFormat,r));return l.isToday=!0,l}return n.toYYYYMMDD(r)===e.add(1,"days",r).toYYYYMMDD()?new Lt("Tomorrow",l=>l.format(i.timeFormat,r)):new Lt(n.format(i.shortDateWithWeekdayFormat,r),l=>l.format(i.timeFormat,r))}var Lt=class{constructor(e,r){this.name=e;this.timeToStringFunc=r;g(this,"isToday",!1);g(this,"isOverdue",!1)}timeToString(e){return this.timeToStringFunc(e)}};function Xo(n,e,r){let i=G.now(),o=[],l=[],c=[],d=qo(i,i,e,r);for(let m=0;m<n.length;m++){let h=n[m];if(h.muteNotification){c.push(h);continue}let y=qo(h.time,i,e,r);y.name!==d.name&&((l.length>0||d.isToday)&&o.push(new Pr(d,l)),l=[]),l.push(h),d=y}if(l.length>0&&o.push(new Pr(d,l)),c.length>0){let m=new Lt("Overdue",h=>h.format(r.timeFormat,e));m.isOverdue=!0,o.splice(0,0,new Pr(m,c)),console.log(m),console.log(o)}return o}var Pr=class{constructor(e,r){this.group=e;this.reminders=r}get name(){return this.group.name}get isOverdue(){return this.group.isOverdue}timeToString(e){return this.group.timeToString(e)}};var et=class et{constructor(e,r){this.key=e;this.defaultValue=r}};g(et,"now",new et("now",G.now())),g(et,"useCustomEmojiForTasksPlugin",new et("useCustomEmojiForTasksPlugin",!1)),g(et,"removeTagsForTasksPlugin",new et("removeTagsForTasksPlugin",!1)),g(et,"linkDatesToDailyNotes",new et("linkDatesToDailyNotes",!1)),g(et,"strictDateFormat",new et("strictDateFormat",!1));var Pe=et,Ar=class{constructor(){g(this,"parameters",new Map)}setParameter(e,r){this.parameters.set(e.key,()=>r.value)}setParameterFunc(e,r){this.parameters.set(e.key,r)}setParameterValue(e,r){this.parameters.set(e.key,()=>r)}getParameter(e){let r=this.parameters.get(e.key);return r==null?e.defaultValue:r()}},Nt=class{constructor(){g(this,"config",new Ar)}setConfig(e){this.config=e}parse(e){return e.getTodos().map(r=>{let i=this.parseValidReminder(r);if(i==null)return null;let o=i.getTitle();if(o==null)return null;let l=i.getTime();return l==null?null:new cr(e.file,o,l,r.lineIndex,r.isChecked())}).filter(r=>r!=null)}async modify(e,r,i){let o=e.getTodo(r.rowNumber);if(o===null)return console.warn("Not a todo: reminder=%o",r),!1;let l=this.parseValidReminder(o);return l===null||!this.modifyReminder(e,o,l,i)?!1:(o.body=l.toMarkdown(),!0)}parseValidReminder(e){let r=this.parseReminder(e);return r===null||!this.isValidReminder(r)?null:r}isValidReminder(e){return e.getTime()!==null}modifyReminder(e,r,i,o){if(o.rawTime!==void 0){if(!i.setRawTime(o.rawTime))return console.warn("The reminder doesn't support raw time: parsed=%o",i),!1}else o.time!==void 0&&i.setTime(o.time);return o.checked!==void 0&&r.setChecked(o.checked),!0}appendReminder(e,r,i){let o=Br.parse(0,e);if(o==null)return null;let l=this.parseReminder(o),c=o.getHeaderLength();return i!=null&&(i-=c),l!=null?l.setTime(r,i):(l=this.newReminder(o.body,r,i),l.setTime(r)),o.body=l.toMarkdown(),{insertedLine:o.toMarkdown(),caretPosition:c+l.getEndOfTimeTextIndex()}}isStrictDateFormat(){return this.config.getParameter(Pe.strictDateFormat)}},On=class{constructor(){g(this,"config");g(this,"formats",[])}setConfig(e){this.config=e,this.syncConfig()}parse(e){let r=[];for(let i of this.formats){let o=i.parse(e);o!=null&&r.push(...o)}return r}async modify(e,r,i){for(let o of this.formats)if(await o.modify(e,r,i))return!0;return!1}resetFormat(e){this.formats=e,this.syncConfig()}syncConfig(){this.config!=null&&this.formats.forEach(e=>e.setConfig(this.config))}appendReminder(e,r){return this.formats[0]==null?null:this.formats[0].appendReminder(e,r)}};var Wr=class Wr{constructor(e,r,i,o){this.linkDatesToDailyNotes=e;this.title1=r;this.time=i;this.title2=o}static parse(e,r){r==null&&(r=!1);let i=Wr.regexp.exec(e);if(i==null)return null;let o=i.groups.title1,l=i.groups.time;if(l==null)return null;let c=i.groups.title2;return r&&(l=l.replace("[[",""),l=l.replace("]]","")),new Wr(r,o,l,c)}getTitle(){return`${this.title1.trim()} ${this.title2.trim()}`.trim()}getTime(){return ut.parse(this.time)}setTime(e){this.time=ut.toString(e)}setRawTime(e){return this.time=e,!0}getEndOfTimeTextIndex(){return this.toMarkdown().length-this.title2.length}toMarkdown(){let e=`${this.title1}(@${this.time})${this.title2}`;if(!this.linkDatesToDailyNotes)return e;let r=ut.parse(this.time);if(!r)return e;let i=ut.toString(r.clone(!1));return e.replace(i,`[[${i}]]`)}};g(Wr,"regexp",/^(?<title1>.*?)\(@(?<time>.+?)\)(?<title2>.*)$/);var Qn=Wr,Ln=class Ln extends Nt{parseReminder(e){return Qn.parse(e.body,this.linkDatesToDailyNotes())}newReminder(e,r,i){let o,l;return i!=null?(o=e.substring(0,i),l=e.substring(i)):(o=e,l=""),new Qn(this.linkDatesToDailyNotes(),o,r.toString(),l)}linkDatesToDailyNotes(){return this.config.getParameter(Pe.linkDatesToDailyNotes)}};g(Ln,"instance",new Ln);var fr=Ln;var rs=Ot(xt(),1);function Nn(n){return n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}var nm=new class{get dateTrigger(){return this.get("date-trigger","@")}get dateFormat(){return this.get("date-format","YYYY-MM-DD")}get timeTrigger(){return this.get("time-trigger","@@")}get timeFormat(){return this.get("time-format","HH:mm")}get linkDateToDailyNote(){return this.get("link-date-to-daily-note",!1)}get(e,r){var d,m;if(!window)return r;let i=(m=(d=window==null?void 0:window.app)==null?void 0:d.plugins)==null?void 0:m.plugins;if(!i)return r;let o=i["obsidian-kanban"];if(!o||!o.settings)return r;let c=o.settings[e];return c==null?r:c}},Pn=class Pn{constructor(e){this.setting=e;g(this,"dateRegExp");g(this,"timeRegExp");let r;e.linkDateToDailyNote?r=`${Nn(this.setting.dateTrigger)}\\[\\[(?<date>.+?)\\]\\]`:r=`${Nn(this.setting.dateTrigger)}\\{(?<date>.+?)\\}`;let i=`${Nn(this.setting.timeTrigger)}\\{(?<time>.+?)\\}`;this.dateRegExp=new RegExp(r),this.timeRegExp=new RegExp(i)}format(e){let r;return this.setting.linkDateToDailyNote?r=`${this.setting.dateTrigger}[[${e.format(this.setting.dateFormat)}]]`:r=`${this.setting.dateTrigger}{${e.format(this.setting.dateFormat)}}`,e.hasTimePart?`${r} ${this.setting.timeTrigger}{${e.format(this.setting.timeFormat)}}`:r}split(e,r){let i=e,o,l,c=this.dateRegExp.exec(e);if(c)o=c.groups.date,e=e.replace(this.dateRegExp,"");else return{title:i};let d=this.timeRegExp.exec(e);d&&(l=d.groups.time,e=e.replace(this.timeRegExp,""));let m=e.trim(),h,y=r!=null?r:!0;return l?h=new G((0,rs.default)(`${o} ${l}`,`${this.setting.dateFormat} ${this.setting.timeFormat}`,y),!0):h=new G((0,rs.default)(o,this.setting.dateFormat,y),!1),h.isValid()?{title:m,time:h}:{title:i}}};g(Pn,"instance",new Pn(nm));var Cn=Pn,Bn=class n{constructor(e,r){this.title=e;this.time=r}static parse(e,r){let i=Cn.instance.split(e,r);return i.time==null?null:new n(i.title,i.time)}getTitle(){return this.title.trim()}getTime(){return this.time?this.time:null}setTime(e){this.time=e}setRawTime(){return!1}getEndOfTimeTextIndex(){return this.toMarkdown().length}toMarkdown(){return`${this.title.trim()} ${Cn.instance.format(this.time)}`}},An=class An extends Nt{parseReminder(e){return Bn.parse(e.body,this.isStrictDateFormat())}newReminder(e,r){let i=new Bn(e,r);return i.setTime(r),i}};g(An,"instance",new An);var In=An;var Kr=Ot(xt(),1);var $r=["MO","TU","WE","TH","FR","SA","SU"],xe=function(){function n(e,r){if(r===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=r}return n.fromStr=function(e){return new n($r.indexOf(e))},n.prototype.nth=function(e){return this.n===e?this:new n(this.weekday,e)},n.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},n.prototype.toString=function(){var e=$r[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},n.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},n}();var ue=function(n){return n!=null},Ge=function(n){return typeof n=="number"},ns=function(n){return typeof n=="string"&&$r.includes(n)},Fe=Array.isArray,tt=function(n,e){e===void 0&&(e=n),arguments.length===1&&(e=n,n=0);for(var r=[],i=n;i<e;i++)r.push(i);return r};var z=function(n,e){var r=0,i=[];if(Fe(n))for(;r<e;r++)i[r]=[].concat(n);else for(;r<e;r++)i[r]=n;return i},ea=function(n){return Fe(n)?n:[n]};function Gt(n,e,r){r===void 0&&(r=" ");var i=String(n);return e=e>>0,i.length>e?String(i):(e=e-i.length,e>r.length&&(r+=z(r,e/r.length)),r.slice(0,e)+String(i))}var ta=function(n,e,r){var i=n.split(e);return r?i.slice(0,r).concat([i.slice(r).join(e)]):i},Qe=function(n,e){var r=n%e;return r*e<0?r+e:r},Wn=function(n,e){return{div:Math.floor(n/e),mod:Qe(n,e)}},ze=function(n){return!ue(n)||n.length===0},_e=function(n){return!ze(n)},Z=function(n,e){return _e(n)&&n.indexOf(e)!==-1};var dt=function(n,e,r,i,o,l){return i===void 0&&(i=0),o===void 0&&(o=0),l===void 0&&(l=0),new Date(Date.UTC(n,e-1,r,i,o,l))},im=[31,28,31,30,31,30,31,31,30,31,30,31],na=1e3*60*60*24,$n=9999,ia=dt(1970,1,1),sm=[6,0,1,2,3,4,5];var mr=function(n){return n%4===0&&n%100!==0||n%400===0},is=function(n){return n instanceof Date},zt=function(n){return is(n)&&!isNaN(n.getTime())};var om=function(n,e){var r=n.getTime(),i=e.getTime(),o=r-i;return Math.round(o/na)},Vr=function(n){return om(n,ia)},Vn=function(n){return new Date(ia.getTime()+n*na)},am=function(n){var e=n.getUTCMonth();return e===1&&mr(n.getUTCFullYear())?29:im[e]},kt=function(n){return sm[n.getUTCDay()]},ss=function(n,e){var r=dt(n,e+1,1);return[kt(r),am(r)]},jn=function(n,e){return e=e||n,new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},Hn=function(n){var e=new Date(n.getTime());return e},os=function(n){for(var e=[],r=0;r<n.length;r++)e.push(Hn(n[r]));return e},Dt=function(n){n.sort(function(e,r){return e.getTime()-r.getTime()})},hr=function(n,e){e===void 0&&(e=!0);var r=new Date(n);return[Gt(r.getUTCFullYear().toString(),4,"0"),Gt(r.getUTCMonth()+1,2,"0"),Gt(r.getUTCDate(),2,"0"),"T",Gt(r.getUTCHours(),2,"0"),Gt(r.getUTCMinutes(),2,"0"),Gt(r.getUTCSeconds(),2,"0"),e?"Z":""].join("")},jr=function(n){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/,r=e.exec(n);if(!r)throw new Error("Invalid UNTIL value: ".concat(n));return new Date(Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[5],10)||0,parseInt(r[6],10)||0,parseInt(r[7],10)||0))},ra=function(n,e){var r=n.toLocaleString("sv-SE",{timeZone:e});return r.replace(" ","T")+"Z"},sa=function(n,e){var r=Intl.DateTimeFormat().resolvedOptions().timeZone,i=new Date(ra(n,r)),o=new Date(ra(n,e!=null?e:"UTC")),l=o.getTime()-i.getTime();return new Date(n.getTime()-l)};var lm=function(){function n(e,r){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=e,this.args=r,e==="between"?(this.maxDate=r.inc?r.before:new Date(r.before.getTime()-1),this.minDate=r.inc?r.after:new Date(r.after.getTime()+1)):e==="before"?this.maxDate=r.inc?r.dt:new Date(r.dt.getTime()-1):e==="after"&&(this.minDate=r.inc?r.dt:new Date(r.dt.getTime()+1))}return n.prototype.accept=function(e){++this.total;var r=this.minDate&&e<this.minDate,i=this.maxDate&&e>this.maxDate;if(this.method==="between"){if(r)return!0;if(i)return!1}else if(this.method==="before"){if(i)return!1}else if(this.method==="after")return r?!0:(this.add(e),!1);return this.add(e)},n.prototype.add=function(e){return this._result.push(e),!0},n.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":default:return e.length?e[e.length-1]:null}},n.prototype.clone=function(){return new n(this.method,this.args)},n}(),St=lm;var as=function(n,e){return as=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},as(n,e)};function pr(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");as(n,e);function r(){this.constructor=n}n.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Me=function(){return Me=Object.assign||function(e){for(var r,i=1,o=arguments.length;i<o;i++){r=arguments[i];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e},Me.apply(this,arguments)};function S(n,e,r){if(r||arguments.length===2)for(var i=0,o=e.length,l;i<o;i++)(l||!(i in e))&&(l||(l=Array.prototype.slice.call(e,0,i)),l[i]=e[i]);return n.concat(l||Array.prototype.slice.call(e))}var um=function(n){pr(e,n);function e(r,i,o){var l=n.call(this,r,i)||this;return l.iterator=o,l}return e.prototype.add=function(r){return this.iterator(r,this._result.length)?(this._result.push(r),!0):!1},e}(St),ls=um;var dm={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}},Zt=dm;var oa=function(n,e){return n.indexOf(e)!==-1},cm=function(n){return n.toString()},fm=function(n,e,r){return"".concat(e," ").concat(r,", ").concat(n)},mm=function(){function n(e,r,i,o){if(r===void 0&&(r=cm),i===void 0&&(i=Zt),o===void 0&&(o=fm),this.text=[],this.language=i||Zt,this.gettext=r,this.dateFormatter=o,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var l=[].concat(this.options.bymonthday),c=[].concat(this.options.bynmonthday);l.sort(function(y,w){return y-w}),c.sort(function(y,w){return w-y}),this.bymonthday=l.concat(c),this.bymonthday.length||(this.bymonthday=null)}if(ue(this.origOptions.byweekday)){var d=Fe(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],m=String(d);this.byweekday={allWeeks:d.filter(function(y){return!y.n}),someWeeks:d.filter(function(y){return!!y.n}),isWeekdays:m.indexOf("MO")!==-1&&m.indexOf("TU")!==-1&&m.indexOf("WE")!==-1&&m.indexOf("TH")!==-1&&m.indexOf("FR")!==-1&&m.indexOf("SA")===-1&&m.indexOf("SU")===-1,isEveryDay:m.indexOf("MO")!==-1&&m.indexOf("TU")!==-1&&m.indexOf("WE")!==-1&&m.indexOf("TH")!==-1&&m.indexOf("FR")!==-1&&m.indexOf("SA")!==-1&&m.indexOf("SU")!==-1};var h=function(y,w){return y.weekday-w.weekday};this.byweekday.allWeeks.sort(h),this.byweekday.someWeeks.sort(h),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return n.isFullyConvertible=function(e){var r=!0;if(!(e.options.freq in n.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var i in e.origOptions){if(oa(["dtstart","tzid","wkst","freq"],i))return!0;if(!oa(n.IMPLEMENTED[e.options.freq],i))return!1}return r},n.prototype.isFullyConvertible=function(){return n.isFullyConvertible(this.rrule)},n.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in n.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[U.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var r=this.options.until;this.add(this.dateFormatter(r.getUTCFullYear(),this.language.monthNames[r.getUTCMonth()],r.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},n.prototype.HOURLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))},n.prototype.MINUTELY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("minutes"):e("minute"))},n.prototype.DAILY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},n.prototype.WEEKLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e("days"):e("day")):(this.options.interval===1&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.origOptions.byhour&&this._byhour())},n.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()},n.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))},n.prototype._bymonthday=function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))},n.prototype._byweekday=function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))},n.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},n.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},n.prototype.nth=function(e){e=parseInt(e.toString(),10);var r,i=this.gettext;if(e===-1)return i("last");var o=Math.abs(e);switch(o){case 1:case 21:case 31:r=o+i("st");break;case 2:case 22:r=o+i("nd");break;case 3:case 23:r=o+i("rd");break;default:r=o+i("th")}return e<0?r+" "+i("last"):r},n.prototype.monthtext=function(e){return this.language.monthNames[e-1]},n.prototype.weekdaytext=function(e){var r=Ge(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[r]},n.prototype.plural=function(e){return e%100!==1},n.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},n.prototype.list=function(e,r,i,o){var l=this;o===void 0&&(o=","),Fe(e)||(e=[e]);var c=function(m,h,y){for(var w="",_=0;_<m.length;_++)_!==0&&(_===m.length-1?w+=" "+y+" ":w+=h+" "),w+=m[_];return w};r=r||function(m){return m.toString()};var d=function(m){return r&&r.call(l,m)};return i?c(e.map(d),o,i):e.map(d).join(o+" ")},n}(),ct=mm;var hm=function(){function n(e){this.done=!0,this.rules=e}return n.prototype.start=function(e){return this.text=e,this.done=!1,this.nextSymbol()},n.prototype.isDone=function(){return this.done&&this.symbol===null},n.prototype.nextSymbol=function(){var e,r;this.symbol=null,this.value=null;do{if(this.done)return!1;var i=void 0;e=null;for(var o in this.rules){i=this.rules[o];var l=i.exec(this.text);l&&(e===null||l[0].length>e[0].length)&&(e=l,r=o)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(r==="SKIP");return this.symbol=r,this.value=e,!0},n.prototype.accept=function(e){if(this.symbol===e){if(this.value){var r=this.value;return this.nextSymbol(),r}return this.nextSymbol(),!0}return!1},n.prototype.acceptNumber=function(){return this.accept("number")},n.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},n}();function Hr(n,e){e===void 0&&(e=Zt);var r={},i=new hm(e.tokens);if(!i.start(n))return null;return o(),r;function o(){i.expect("every");var _=i.acceptNumber();if(_&&(r.interval=parseInt(_[0],10)),i.isDone())throw new Error("Unexpected end");switch(i.symbol){case"day(s)":r.freq=U.DAILY,i.nextSymbol()&&(c(),w());break;case"weekday(s)":r.freq=U.WEEKLY,r.byweekday=[U.MO,U.TU,U.WE,U.TH,U.FR],i.nextSymbol(),c(),w();break;case"week(s)":r.freq=U.WEEKLY,i.nextSymbol()&&(l(),c(),w());break;case"hour(s)":r.freq=U.HOURLY,i.nextSymbol()&&(l(),w());break;case"minute(s)":r.freq=U.MINUTELY,i.nextSymbol()&&(l(),w());break;case"month(s)":r.freq=U.MONTHLY,i.nextSymbol()&&(l(),w());break;case"year(s)":r.freq=U.YEARLY,i.nextSymbol()&&(l(),w());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":r.freq=U.WEEKLY;var x=i.symbol.substr(0,2).toUpperCase();if(r.byweekday=[U[x]],!i.nextSymbol())return;for(;i.accept("comma");){if(i.isDone())throw new Error("Unexpected end");var b=m();if(!b)throw new Error("Unexpected symbol "+i.symbol+", expected weekday");r.byweekday.push(U[b]),i.nextSymbol()}c(),y(),w();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(r.freq=U.YEARLY,r.bymonth=[d()],!i.nextSymbol())return;for(;i.accept("comma");){if(i.isDone())throw new Error("Unexpected end");var D=d();if(!D)throw new Error("Unexpected symbol "+i.symbol+", expected month");r.bymonth.push(D),i.nextSymbol()}l(),w();break;default:throw new Error("Unknown symbol")}}function l(){var _=i.accept("on"),x=i.accept("the");if(_||x)do{var b=h(),D=m(),F=d();if(b)D?(i.nextSymbol(),r.byweekday||(r.byweekday=[]),r.byweekday.push(U[D].nth(b))):(r.bymonthday||(r.bymonthday=[]),r.bymonthday.push(b),i.accept("day(s)"));else if(D)i.nextSymbol(),r.byweekday||(r.byweekday=[]),r.byweekday.push(U[D]);else if(i.symbol==="weekday(s)")i.nextSymbol(),r.byweekday||(r.byweekday=[U.MO,U.TU,U.WE,U.TH,U.FR]);else if(i.symbol==="week(s)"){i.nextSymbol();var T=i.acceptNumber();if(!T)throw new Error("Unexpected symbol "+i.symbol+", expected week number");for(r.byweekno=[parseInt(T[0],10)];i.accept("comma");){if(T=i.acceptNumber(),!T)throw new Error("Unexpected symbol "+i.symbol+"; expected monthday");r.byweekno.push(parseInt(T[0],10))}}else if(F)i.nextSymbol(),r.bymonth||(r.bymonth=[]),r.bymonth.push(F);else return}while(i.accept("comma")||i.accept("the")||i.accept("on"))}function c(){var _=i.accept("at");if(_)do{var x=i.acceptNumber();if(!x)throw new Error("Unexpected symbol "+i.symbol+", expected hour");for(r.byhour=[parseInt(x[0],10)];i.accept("comma");){if(x=i.acceptNumber(),!x)throw new Error("Unexpected symbol "+i.symbol+"; expected hour");r.byhour.push(parseInt(x[0],10))}}while(i.accept("comma")||i.accept("at"))}function d(){switch(i.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 m(){switch(i.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return i.symbol.substr(0,2).toUpperCase();default:return!1}}function h(){switch(i.symbol){case"last":return i.nextSymbol(),-1;case"first":return i.nextSymbol(),1;case"second":return i.nextSymbol(),i.accept("last")?-2:2;case"third":return i.nextSymbol(),i.accept("last")?-3:3;case"nth":var _=parseInt(i.value[1],10);if(_<-366||_>366)throw new Error("Nth out of range: "+_);return i.nextSymbol(),i.accept("last")?-_:_;default:return!1}}function y(){i.accept("on"),i.accept("the");var _=h();if(_)for(r.bymonthday=[_],i.nextSymbol();i.accept("comma");){if(_=h(),!_)throw new Error("Unexpected symbol "+i.symbol+"; expected monthday");r.bymonthday.push(_),i.nextSymbol()}}function w(){if(i.symbol==="until"){var _=Date.parse(i.text);if(!_)throw new Error("Cannot parse until date:"+i.text);r.until=new Date(_)}else i.accept("for")&&(r.count=parseInt(i.value[0],10),i.expect("number"))}}var $;(function(n){n[n.YEARLY=0]="YEARLY",n[n.MONTHLY=1]="MONTHLY",n[n.WEEKLY=2]="WEEKLY",n[n.DAILY=3]="DAILY",n[n.HOURLY=4]="HOURLY",n[n.MINUTELY=5]="MINUTELY",n[n.SECONDLY=6]="SECONDLY"})($||($={}));function Gr(n){return n<$.HOURLY}var aa=function(n,e){return e===void 0&&(e=Zt),new U(Hr(n,e)||void 0)},yr=["count","until","interval","byweekday","bymonthday","bymonth"];ct.IMPLEMENTED=[];ct.IMPLEMENTED[$.HOURLY]=yr;ct.IMPLEMENTED[$.MINUTELY]=yr;ct.IMPLEMENTED[$.DAILY]=["byhour"].concat(yr);ct.IMPLEMENTED[$.WEEKLY]=yr;ct.IMPLEMENTED[$.MONTHLY]=yr;ct.IMPLEMENTED[$.YEARLY]=["byweekno","byyearday"].concat(yr);var la=function(n,e,r,i){return new ct(n,e,r,i).toString()},ua=ct.isFullyConvertible;var gr=function(){function n(e,r,i,o){this.hour=e,this.minute=r,this.second=i,this.millisecond=o||0}return n.prototype.getHours=function(){return this.hour},n.prototype.getMinutes=function(){return this.minute},n.prototype.getSeconds=function(){return this.second},n.prototype.getMilliseconds=function(){return this.millisecond},n.prototype.getTime=function(){return(this.hour*60*60+this.minute*60+this.second)*1e3+this.millisecond},n}();var da=function(n){pr(e,n);function e(r,i,o,l,c,d,m){var h=n.call(this,l,c,d,m)||this;return h.year=r,h.month=i,h.day=o,h}return e.fromDate=function(r){return new this(r.getUTCFullYear(),r.getUTCMonth()+1,r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.valueOf()%1e3)},e.prototype.getWeekday=function(){return kt(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(r){this.year+=r},e.prototype.addMonths=function(r){if(this.month+=r,this.month>12){var i=Math.floor(this.month/12),o=Qe(this.month,12);this.month=o,this.year+=i,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(r,i){i>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-i))+r*7:this.day+=-(this.getWeekday()-i)+r*7,this.fixDay()},e.prototype.addDaily=function(r){this.day+=r,this.fixDay()},e.prototype.addHours=function(r,i,o){for(i&&(this.hour+=Math.floor((23-this.hour)/r)*r);;){this.hour+=r;var l=Wn(this.hour,24),c=l.div,d=l.mod;if(c&&(this.hour=d,this.addDaily(c)),ze(o)||Z(o,this.hour))break}},e.prototype.addMinutes=function(r,i,o,l){for(i&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/r)*r);;){this.minute+=r;var c=Wn(this.minute,60),d=c.div,m=c.mod;if(d&&(this.minute=m,this.addHours(d,!1,o)),(ze(o)||Z(o,this.hour))&&(ze(l)||Z(l,this.minute)))break}},e.prototype.addSeconds=function(r,i,o,l,c){for(i&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/r)*r);;){this.second+=r;var d=Wn(this.second,60),m=d.div,h=d.mod;if(m&&(this.second=h,this.addMinutes(m,!1,o,l)),(ze(o)||Z(o,this.hour))&&(ze(l)||Z(l,this.minute))&&(ze(c)||Z(c,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var r=ss(this.year,this.month-1)[1];if(!(this.day<=r))for(;this.day>r;){if(this.day-=r,++this.month,this.month===13&&(this.month=1,++this.year,this.year>$n))return;r=ss(this.year,this.month-1)[1]}}},e.prototype.add=function(r,i){var o=r.freq,l=r.interval,c=r.wkst,d=r.byhour,m=r.byminute,h=r.bysecond;switch(o){case $.YEARLY:return this.addYears(l);case $.MONTHLY:return this.addMonths(l);case $.WEEKLY:return this.addWeekly(l,c);case $.DAILY:return this.addDaily(l);case $.HOURLY:return this.addHours(l,i,d);case $.MINUTELY:return this.addMinutes(l,i,d,m);case $.SECONDLY:return this.addSeconds(l,i,d,m,h)}},e}(gr);function us(n){for(var e=[],r=Object.keys(n),i=0,o=r;i<o.length;i++){var l=o[i];Z(ma,l)||e.push(l),is(n[l])&&!zt(n[l])&&e.push(l)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return Me({},n)}function ca(n){var e=Me(Me({},zr),us(n));if(ue(e.byeaster)&&(e.freq=U.YEARLY),!(ue(e.freq)&&U.FREQUENCIES[e.freq]))throw new Error("Invalid frequency: ".concat(e.freq," ").concat(n.freq));if(e.dtstart||(e.dtstart=new Date(new Date().setMilliseconds(0))),ue(e.wkst)?Ge(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=U.MO.weekday,ue(e.bysetpos)){Ge(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var r=0;r<e.bysetpos.length;r++){var i=e.bysetpos[r];if(i===0||!(i>=-366&&i<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(e.byweekno||_e(e.byweekno)||_e(e.byyearday)||e.bymonthday||_e(e.bymonthday)||ue(e.byweekday)||ue(e.byeaster)))switch(e.freq){case U.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case U.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case U.WEEKLY:e.byweekday=[kt(e.dtstart)];break}if(ue(e.bymonth)&&!Fe(e.bymonth)&&(e.bymonth=[e.bymonth]),ue(e.byyearday)&&!Fe(e.byyearday)&&Ge(e.byyearday)&&(e.byyearday=[e.byyearday]),!ue(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(Fe(e.bymonthday)){for(var o=[],l=[],r=0;r<e.bymonthday.length;r++){var i=e.bymonthday[r];i>0?o.push(i):i<0&&l.push(i)}e.bymonthday=o,e.bynmonthday=l}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(ue(e.byweekno)&&!Fe(e.byweekno)&&(e.byweekno=[e.byweekno]),!ue(e.byweekday))e.bynweekday=null;else if(Ge(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(ns(e.byweekday))e.byweekday=[xe.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof xe)!e.byweekday.n||e.freq>U.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var c=[],d=[],r=0;r<e.byweekday.length;r++){var m=e.byweekday[r];if(Ge(m)){c.push(m);continue}else if(ns(m)){c.push(xe.fromStr(m).weekday);continue}!m.n||e.freq>U.MONTHLY?c.push(m.weekday):d.push([m.weekday,m.n])}e.byweekday=_e(c)?c:null,e.bynweekday=_e(d)?d:null}return ue(e.byhour)?Ge(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<U.HOURLY?[e.dtstart.getUTCHours()]:null,ue(e.byminute)?Ge(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<U.MINUTELY?[e.dtstart.getUTCMinutes()]:null,ue(e.bysecond)?Ge(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<U.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function fa(n){var e=n.dtstart.getTime()%1e3;if(!Gr(n.freq))return[];var r=[];return n.byhour.forEach(function(i){n.byminute.forEach(function(o){n.bysecond.forEach(function(l){r.push(new gr(i,o,l,e))})})}),r}function Jr(n){var e=n.split(`
`).map(pm).filter(function(r){return r!==null});return Me(Me({},e[0]),e[1])}function Zr(n){var e={},r=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(n);if(!r)return e;var i=r[1],o=r[2];return i&&(e.tzid=i),e.dtstart=jr(o),e}function pm(n){if(n=n.replace(/^\s+|\s+$/,""),!n.length)return null;var e=/^([A-Z]+?)[:;]/.exec(n.toUpperCase());if(!e)return ha(n);var r=e[1];switch(r.toUpperCase()){case"RRULE":case"EXRULE":return ha(n);case"DTSTART":return Zr(n);default:throw new Error("Unsupported RFC prop ".concat(r," in ").concat(n))}}function ha(n){var e=n.replace(/^RRULE:/i,""),r=Zr(e),i=n.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return i.forEach(function(o){var l=o.split("="),c=l[0],d=l[1];switch(c.toUpperCase()){case"FREQ":r.freq=$[d.toUpperCase()];break;case"WKST":r.wkst=rt[d.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var m=ym(d),h=c.toLowerCase();r[h]=m;break;case"BYWEEKDAY":case"BYDAY":r.byweekday=gm(d);break;case"DTSTART":case"TZID":var y=Zr(n);r.tzid=y.tzid,r.dtstart=y.dtstart;break;case"UNTIL":r.until=jr(d);break;case"BYEASTER":r.byeaster=Number(d);break;default:throw new Error("Unknown RRULE property '"+c+"'")}}),r}function ym(n){if(n.indexOf(",")!==-1){var e=n.split(",");return e.map(pa)}return pa(n)}function pa(n){return/^[+-]?\d+$/.test(n)?Number(n):n}function gm(n){var e=n.split(",");return e.map(function(r){if(r.length===2)return rt[r];var i=r.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!i||i.length<3)throw new SyntaxError("Invalid weekday string: ".concat(r));var o=Number(i[1]),l=i[2],c=rt[l].weekday;return new xe(c,o)})}var Jt=function(){function n(e,r){if(isNaN(e.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=r}return Object.defineProperty(n.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),n.prototype.toString=function(){var e=hr(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},n.prototype.getTime=function(){return this.date.getTime()},n.prototype.rezonedDate=function(){return this.isUTC?this.date:sa(this.date,this.tzid)},n}();function qr(n){for(var e=[],r="",i=Object.keys(n),o=Object.keys(zr),l=0;l<i.length;l++)if(i[l]!=="tzid"&&Z(o,i[l])){var c=i[l].toUpperCase(),d=n[i[l]],m="";if(!(!ue(d)||Fe(d)&&!d.length)){switch(c){case"FREQ":m=U.FREQUENCIES[n.freq];break;case"WKST":Ge(d)?m=new xe(d).toString():m=d.toString();break;case"BYWEEKDAY":c="BYDAY",m=ea(d).map(function(x){return x instanceof xe?x:Fe(x)?new xe(x[0],x[1]):new xe(x)}).toString();break;case"DTSTART":r=bm(d,n.tzid);break;case"UNTIL":m=hr(d,!n.tzid);break;default:if(Fe(d)){for(var h=[],y=0;y<d.length;y++)h[y]=String(d[y]);m=h.toString()}else m=String(d)}m&&e.push([c,m])}}var w=e.map(function(x){var b=x[0],D=x[1];return"".concat(b,"=").concat(D.toString())}).join(";"),_="";return w!==""&&(_="RRULE:".concat(w)),[r,_].filter(function(x){return!!x}).join(`
`)}function bm(n,e){return n?"DTSTART"+new Jt(new Date(n),e).toString():""}function vm(n,e){return Array.isArray(n)?!Array.isArray(e)||n.length!==e.length?!1:n.every(function(r,i){return r.getTime()===e[i].getTime()}):n instanceof Date?e instanceof Date&&n.getTime()===e.getTime():n===e}var ya=function(){function n(){this.all=!1,this.before=[],this.after=[],this.between=[]}return n.prototype._cacheAdd=function(e,r,i){r&&(r=r instanceof Date?Hn(r):os(r)),e==="all"?this.all=r:(i._value=r,this[e].push(i))},n.prototype._cacheGet=function(e,r){var i=!1,o=r?Object.keys(r):[],l=function(y){for(var w=0;w<o.length;w++){var _=o[w];if(!vm(r[_],y[_]))return!0}return!1},c=this[e];if(e==="all")i=this.all;else if(Fe(c))for(var d=0;d<c.length;d++){var m=c[d];if(!(o.length&&l(m))){i=m._value;break}}if(!i&&this.all){for(var h=new St(e,r),d=0;d<this.all.length&&h.accept(this.all[d]);d++);i=h.getValue(),this._cacheAdd(e,i,r)}return Fe(i)?os(i):i instanceof Date?Hn(i):i},n}();var ga=S(S(S(S(S(S(S(S(S(S(S(S(S([],z(1,31),!0),z(2,28),!0),z(3,31),!0),z(4,30),!0),z(5,31),!0),z(6,30),!0),z(7,31),!0),z(8,31),!0),z(9,30),!0),z(10,31),!0),z(11,30),!0),z(12,31),!0),z(1,7),!0),ba=S(S(S(S(S(S(S(S(S(S(S(S(S([],z(1,31),!0),z(2,29),!0),z(3,31),!0),z(4,30),!0),z(5,31),!0),z(6,30),!0),z(7,31),!0),z(8,31),!0),z(9,30),!0),z(10,31),!0),z(11,30),!0),z(12,31),!0),z(1,7),!0),_m=tt(1,29),wm=tt(1,30),Ct=tt(1,31),Le=tt(1,32),va=S(S(S(S(S(S(S(S(S(S(S(S(S([],Le,!0),wm,!0),Le,!0),Ct,!0),Le,!0),Ct,!0),Le,!0),Le,!0),Ct,!0),Le,!0),Ct,!0),Le,!0),Le.slice(0,7),!0),_a=S(S(S(S(S(S(S(S(S(S(S(S(S([],Le,!0),_m,!0),Le,!0),Ct,!0),Le,!0),Ct,!0),Le,!0),Le,!0),Ct,!0),Le,!0),Ct,!0),Le,!0),Le.slice(0,7),!0),xm=tt(-28,0),km=tt(-29,0),Bt=tt(-30,0),Ne=tt(-31,0),wa=S(S(S(S(S(S(S(S(S(S(S(S(S([],Ne,!0),km,!0),Ne,!0),Bt,!0),Ne,!0),Bt,!0),Ne,!0),Ne,!0),Bt,!0),Ne,!0),Bt,!0),Ne,!0),Ne.slice(0,7),!0),xa=S(S(S(S(S(S(S(S(S(S(S(S(S([],Ne,!0),xm,!0),Ne,!0),Bt,!0),Ne,!0),Bt,!0),Ne,!0),Ne,!0),Bt,!0),Ne,!0),Bt,!0),Ne,!0),Ne.slice(0,7),!0),ka=[0,31,60,91,121,152,182,213,244,274,305,335,366],Da=[0,31,59,90,120,151,181,212,243,273,304,334,365],ds=function(){for(var n=[],e=0;e<55;e++)n=n.concat(tt(7));return n}();function Sa(n,e){var r=dt(n,1,1),i=mr(n)?366:365,o=mr(n+1)?366:365,l=Vr(r),c=kt(r),d=Me(Me({yearlen:i,nextyearlen:o,yearordinal:l,yearweekday:c},Dm(n)),{wnomask:null});if(ze(e.byweekno))return d;d.wnomask=z(0,i+7);var m,h,y=m=Qe(7-c+e.wkst,7);y>=4?(y=0,h=d.yearlen+Qe(c-e.wkst,7)):h=i-y;for(var w=Math.floor(h/7),_=Qe(h,7),x=Math.floor(w+_/4),b=0;b<e.byweekno.length;b++){var D=e.byweekno[b];if(D<0&&(D+=x+1),D>0&&D<=x){var F=void 0;D>1?(F=y+(D-1)*7,y!==m&&(F-=7-m)):F=y;for(var T=0;T<7&&(d.wnomask[F]=1,F++,d.wdaymask[F]!==e.wkst);T++);}}if(Z(e.byweekno,1)){var F=y+x*7;if(y!==m&&(F-=7-m),F<i)for(var b=0;b<7&&(d.wnomask[F]=1,F+=1,d.wdaymask[F]!==e.wkst);b++);}if(y){var B=void 0;if(Z(e.byweekno,-1))B=-1;else{var P=kt(dt(n-1,1,1)),N=Qe(7-P.valueOf()+e.wkst,7),V=mr(n-1)?366:365,I=void 0;N>=4?(N=0,I=V+Qe(P-e.wkst,7)):I=i-y,B=Math.floor(52+Qe(I,7)/4)}if(Z(e.byweekno,B))for(var F=0;F<y;F++)d.wnomask[F]=1}return d}function Dm(n){var e=mr(n)?366:365,r=dt(n,1,1),i=kt(r);return e===365?{mmask:ga,mdaymask:_a,nmdaymask:xa,wdaymask:ds.slice(i),mrange:Da}:{mmask:ba,mdaymask:va,nmdaymask:wa,wdaymask:ds.slice(i),mrange:ka}}function Ta(n,e,r,i,o,l){var c={lastyear:n,lastmonth:e,nwdaymask:[]},d=[];if(l.freq===U.YEARLY)if(ze(l.bymonth))d=[[0,r]];else for(var m=0;m<l.bymonth.length;m++)e=l.bymonth[m],d.push(i.slice(e-1,e+1));else l.freq===U.MONTHLY&&(d=[i.slice(e-1,e+1)]);if(ze(d))return c;c.nwdaymask=z(0,r);for(var m=0;m<d.length;m++)for(var h=d[m],y=h[0],w=h[1]-1,_=0;_<l.bynweekday.length;_++){var x=void 0,b=l.bynweekday[_],D=b[0],F=b[1];F<0?(x=w+(F+1)*7,x-=Qe(o[x]-D,7)):(x=y+(F-1)*7,x+=Qe(7-o[x]+D,7)),y<=x&&x<=w&&(c.nwdaymask[x]=1)}return c}function Fa(n,e){e===void 0&&(e=0);var r=n%19,i=Math.floor(n/100),o=n%100,l=Math.floor(i/4),c=i%4,d=Math.floor((i+8)/25),m=Math.floor((i-d+1)/3),h=Math.floor(19*r+i-l-m+15)%30,y=Math.floor(o/4),w=o%4,_=Math.floor(32+2*c+2*y-h-w)%7,x=Math.floor((r+11*h+22*_)/451),b=Math.floor((h+_-7*x+114)/31),D=(h+_-7*x+114)%31+1,F=Date.UTC(n,b-1,D+e),T=Date.UTC(n,0,1);return[Math.ceil((F-T)/(1e3*60*60*24))]}var Sm=function(){function n(e){this.options=e}return n.prototype.rebuild=function(e,r){var i=this.options;if(e!==this.lastyear&&(this.yearinfo=Sa(e,i)),_e(i.bynweekday)&&(r!==this.lastmonth||e!==this.lastyear)){var o=this.yearinfo,l=o.yearlen,c=o.mrange,d=o.wdaymask;this.monthinfo=Ta(e,r,l,c,d,i)}ue(i.byeaster)&&(this.eastermask=Fa(e,i.byeaster))},Object.defineProperty(n.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),n.prototype.ydayset=function(){return[tt(this.yearlen),0,this.yearlen]},n.prototype.mdayset=function(e,r){for(var i=this.mrange[r-1],o=this.mrange[r],l=z(null,this.yearlen),c=i;c<o;c++)l[c]=c;return[l,i,o]},n.prototype.wdayset=function(e,r,i){for(var o=z(null,this.yearlen+7),l=Vr(dt(e,r,i))-this.yearordinal,c=l,d=0;d<7&&(o[l]=l,++l,this.wdaymask[l]!==this.options.wkst);d++);return[o,c,l]},n.prototype.ddayset=function(e,r,i){var o=z(null,this.yearlen),l=Vr(dt(e,r,i))-this.yearordinal;return o[l]=l,[o,l,l+1]},n.prototype.htimeset=function(e,r,i,o){var l=this,c=[];return this.options.byminute.forEach(function(d){c=c.concat(l.mtimeset(e,d,i,o))}),Dt(c),c},n.prototype.mtimeset=function(e,r,i,o){var l=this.options.bysecond.map(function(c){return new gr(e,r,c,o)});return Dt(l),l},n.prototype.stimeset=function(e,r,i,o){return[new gr(e,r,i,o)]},n.prototype.getdayset=function(e){switch(e){case $.YEARLY:return this.ydayset.bind(this);case $.MONTHLY:return this.mdayset.bind(this);case $.WEEKLY:return this.wdayset.bind(this);case $.DAILY:return this.ddayset.bind(this);default:return this.ddayset.bind(this)}},n.prototype.gettimeset=function(e){switch(e){case $.HOURLY:return this.htimeset.bind(this);case $.MINUTELY:return this.mtimeset.bind(this);case $.SECONDLY:return this.stimeset.bind(this)}},n}(),Ma=Sm;function Ra(n,e,r,i,o,l){for(var c=[],d=0;d<n.length;d++){var m=void 0,h=void 0,y=n[d];y<0?(m=Math.floor(y/e.length),h=Qe(y,e.length)):(m=Math.floor((y-1)/e.length),h=Qe(y-1,e.length));for(var w=[],_=r;_<i;_++){var x=l[_];ue(x)&&w.push(x)}var b=void 0;m<0?b=w.slice(m)[0]:b=w[m];var D=e[h],F=Vn(o.yearordinal+b),T=jn(F,D);Z(c,T)||c.push(T)}return Dt(c),c}function Gn(n,e){var r=e.dtstart,i=e.freq,o=e.interval,l=e.until,c=e.bysetpos,d=e.count;if(d===0||o===0)return Tt(n);var m=da.fromDate(r),h=new Ma(e);h.rebuild(m.year,m.month);for(var y=Mm(h,m,e);;){var w=h.getdayset(i)(m.year,m.month,m.day),_=w[0],x=w[1],b=w[2],D=Fm(_,x,b,h,e);if(_e(c))for(var F=Ra(c,y,x,b,h,_),T=0;T<F.length;T++){var B=F[T];if(l&&B>l)return Tt(n);if(B>=r){var P=Ea(B,e);if(!n.accept(P)||d&&(--d,!d))return Tt(n)}}else for(var T=x;T<b;T++){var N=_[T];if(ue(N))for(var V=Vn(h.yearordinal+N),I=0;I<y.length;I++){var be=y[I],B=jn(V,be);if(l&&B>l)return Tt(n);if(B>=r){var P=Ea(B,e);if(!n.accept(P)||d&&(--d,!d))return Tt(n)}}}if(e.interval===0||(m.add(e,D),m.year>$n))return Tt(n);Gr(i)||(y=h.gettimeset(i)(m.hour,m.minute,m.second,0)),h.rebuild(m.year,m.month)}}function Tm(n,e,r){var i=r.bymonth,o=r.byweekno,l=r.byweekday,c=r.byeaster,d=r.bymonthday,m=r.bynmonthday,h=r.byyearday;return _e(i)&&!Z(i,n.mmask[e])||_e(o)&&!n.wnomask[e]||_e(l)&&!Z(l,n.wdaymask[e])||_e(n.nwdaymask)&&!n.nwdaymask[e]||c!==null&&!Z(n.eastermask,e)||(_e(d)||_e(m))&&!Z(d,n.mdaymask[e])&&!Z(m,n.nmdaymask[e])||_e(h)&&(e<n.yearlen&&!Z(h,e+1)&&!Z(h,-n.yearlen+e)||e>=n.yearlen&&!Z(h,e+1-n.yearlen)&&!Z(h,-n.nextyearlen+e-n.yearlen))}function Ea(n,e){return new Jt(n,e.tzid).rezonedDate()}function Tt(n){return n.getValue()}function Fm(n,e,r,i,o){for(var l=!1,c=e;c<r;c++){var d=n[c];l=Tm(i,d,o),l&&(n[d]=null)}return l}function Mm(n,e,r){var i=r.freq,o=r.byhour,l=r.byminute,c=r.bysecond;return Gr(i)?fa(r):i>=U.HOURLY&&_e(o)&&!Z(o,e.hour)||i>=U.MINUTELY&&_e(l)&&!Z(l,e.minute)||i>=U.SECONDLY&&_e(c)&&!Z(c,e.second)?[]:n.gettimeset(i)(e.hour,e.minute,e.second,e.millisecond)}var rt={MO:new xe(0),TU:new xe(1),WE:new xe(2),TH:new xe(3),FR:new xe(4),SA:new xe(5),SU:new xe(6)},zr={freq:$.YEARLY,dtstart:null,interval:1,wkst:rt.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},ma=Object.keys(zr),U=function(){function n(e,r){e===void 0&&(e={}),r===void 0&&(r=!1),this._cache=r?null:new ya,this.origOptions=us(e);var i=ca(e).parsedOptions;this.options=i}return n.parseText=function(e,r){return Hr(e,r)},n.fromText=function(e,r){return aa(e,r)},n.fromString=function(e){return new n(n.parseString(e)||void 0)},n.prototype._iter=function(e){return Gn(e,this.options)},n.prototype._cacheGet=function(e,r){return this._cache?this._cache._cacheGet(e,r):!1},n.prototype._cacheAdd=function(e,r,i){if(this._cache)return this._cache._cacheAdd(e,r,i)},n.prototype.all=function(e){if(e)return this._iter(new ls("all",{},e));var r=this._cacheGet("all");return r===!1&&(r=this._iter(new St("all",{})),this._cacheAdd("all",r)),r},n.prototype.between=function(e,r,i,o){if(i===void 0&&(i=!1),!zt(e)||!zt(r))throw new Error("Invalid date passed in to RRule.between");var l={before:r,after:e,inc:i};if(o)return this._iter(new ls("between",l,o));var c=this._cacheGet("between",l);return c===!1&&(c=this._iter(new St("between",l)),this._cacheAdd("between",c,l)),c},n.prototype.before=function(e,r){if(r===void 0&&(r=!1),!zt(e))throw new Error("Invalid date passed in to RRule.before");var i={dt:e,inc:r},o=this._cacheGet("before",i);return o===!1&&(o=this._iter(new St("before",i)),this._cacheAdd("before",o,i)),o},n.prototype.after=function(e,r){if(r===void 0&&(r=!1),!zt(e))throw new Error("Invalid date passed in to RRule.after");var i={dt:e,inc:r},o=this._cacheGet("after",i);return o===!1&&(o=this._iter(new St("after",i)),this._cacheAdd("after",o,i)),o},n.prototype.count=function(){return this.all().length},n.prototype.toString=function(){return qr(this.origOptions)},n.prototype.toText=function(e,r,i){return la(this,e,r,i)},n.prototype.isFullyConvertibleToText=function(){return ua(this)},n.prototype.clone=function(){return new n(this.origOptions)},n.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],n.YEARLY=$.YEARLY,n.MONTHLY=$.MONTHLY,n.WEEKLY=$.WEEKLY,n.DAILY=$.DAILY,n.HOURLY=$.HOURLY,n.MINUTELY=$.MINUTELY,n.SECONDLY=$.SECONDLY,n.MO=rt.MO,n.TU=rt.TU,n.WE=rt.WE,n.TH=rt.TH,n.FR=rt.FR,n.SA=rt.SA,n.SU=rt.SU,n.parseString=Jr,n.optionsToString=qr,n}();function Ua(n,e,r,i,o,l){var c={},d=n.accept;function m(_,x){r.forEach(function(b){b.between(_,x,!0).forEach(function(D){c[Number(D)]=!0})})}o.forEach(function(_){var x=new Jt(_,l).rezonedDate();c[Number(x)]=!0}),n.accept=function(_){var x=Number(_);return isNaN(x)?d.call(this,_):!c[x]&&(m(new Date(x-1),new Date(x+1)),!c[x])?(c[x]=!0,d.call(this,_)):!0},n.method==="between"&&(m(n.args.after,n.args.before),n.accept=function(_){var x=Number(_);return c[x]?!0:(c[x]=!0,d.call(this,_))});for(var h=0;h<i.length;h++){var y=new Jt(i[h],l).rezonedDate();if(!n.accept(new Date(y.getTime())))break}e.forEach(function(_){Gn(n,_.options)});var w=n._result;switch(Dt(w),n.method){case"all":case"between":return w;case"before":return w.length&&w[w.length-1]||null;case"after":default:return w.length&&w[0]||null}}var Ya={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function Rm(n,e){var r=[],i=[],o=[],l=[],c=Zr(n),d=c.dtstart,m=c.tzid,h=Qm(n,e.unfold);return h.forEach(function(y){var w;if(y){var _=Om(y),x=_.name,b=_.parms,D=_.value;switch(x.toUpperCase()){case"RRULE":if(b.length)throw new Error("unsupported RRULE parm: ".concat(b.join(",")));r.push(Jr(y));break;case"RDATE":var F=(w=/RDATE(?:;TZID=([^:=]+))?/i.exec(y))!==null&&w!==void 0?w:[],T=F[1];T&&!m&&(m=T),i=i.concat(Oa(D,b));break;case"EXRULE":if(b.length)throw new Error("unsupported EXRULE parm: ".concat(b.join(",")));o.push(Jr(D));break;case"EXDATE":l=l.concat(Oa(D,b));break;case"DTSTART":break;default:throw new Error("unsupported property: "+x)}}}),{dtstart:d,tzid:m,rrulevals:r,rdatevals:i,exrulevals:o,exdatevals:l}}function Em(n,e){var r=Rm(n,e),i=r.rrulevals,o=r.rdatevals,l=r.exrulevals,c=r.exdatevals,d=r.dtstart,m=r.tzid,h=e.cache===!1;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||i.length>1||o.length||l.length||c.length){var y=new fs(h);return y.dtstart(d),y.tzid(m||void 0),i.forEach(function(_){y.rrule(new U(cs(_,d,m),h))}),o.forEach(function(_){y.rdate(_)}),l.forEach(function(_){y.exrule(new U(cs(_,d,m),h))}),c.forEach(function(_){y.exdate(_)}),e.compatible&&e.dtstart&&y.rdate(d),y}var w=i[0]||{};return new U(cs(w,w.dtstart||e.dtstart||d,w.tzid||e.tzid||m),h)}function zn(n,e){return e===void 0&&(e={}),Em(n,Um(e))}function cs(n,e,r){return Me(Me({},n),{dtstart:e,tzid:r})}function Um(n){var e=[],r=Object.keys(n),i=Object.keys(Ya);if(r.forEach(function(o){Z(i,o)||e.push(o)}),e.length)throw new Error("Invalid options: "+e.join(", "));return Me(Me({},Ya),n)}function Ym(n){if(n.indexOf(":")===-1)return{name:"RRULE",value:n};var e=ta(n,":",1),r=e[0],i=e[1];return{name:r,value:i}}function Om(n){var e=Ym(n),r=e.name,i=e.value,o=r.split(";");if(!o)throw new Error("empty property name");return{name:o[0].toUpperCase(),parms:o.slice(1),value:i}}function Qm(n,e){if(e===void 0&&(e=!1),n=n&&n.trim(),!n)throw new Error("Invalid empty string");if(!e)return n.split(/\s/);for(var r=n.split(`
`),i=0;i<r.length;){var o=r[i]=r[i].replace(/\s+$/g,"");o?i>0&&o[0]===" "?(r[i-1]+=o.slice(1),r.splice(i,1)):i+=1:r.splice(i,1)}return r}function Lm(n){n.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function Oa(n,e){return Lm(e),n.split(",").map(function(r){return jr(r)})}function Qa(n){var e=this;return function(r){if(r!==void 0&&(e["_".concat(n)]=r),e["_".concat(n)]!==void 0)return e["_".concat(n)];for(var i=0;i<e._rrule.length;i++){var o=e._rrule[i].origOptions[n];if(o)return o}}}var fs=function(n){pr(e,n);function e(r){r===void 0&&(r=!1);var i=n.call(this,{},r)||this;return i.dtstart=Qa.apply(i,["dtstart"]),i.tzid=Qa.apply(i,["tzid"]),i._rrule=[],i._rdate=[],i._exrule=[],i._exdate=[],i}return e.prototype._iter=function(r){return Ua(r,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(r){La(r,this._rrule)},e.prototype.exrule=function(r){La(r,this._exrule)},e.prototype.rdate=function(r){Na(r,this._rdate)},e.prototype.exdate=function(r){Na(r,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(r){return zn(r.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(r){return zn(r.toString())})},e.prototype.rdates=function(){return this._rdate.map(function(r){return new Date(r.getTime())})},e.prototype.exdates=function(){return this._exdate.map(function(r){return new Date(r.getTime())})},e.prototype.valueOf=function(){var r=[];return!this._rrule.length&&this._dtstart&&(r=r.concat(qr({dtstart:this._dtstart}))),this._rrule.forEach(function(i){r=r.concat(i.toString().split(`
`))}),this._exrule.forEach(function(i){r=r.concat(i.toString().split(`
`).map(function(o){return o.replace(/^RRULE:/,"EXRULE:")}).filter(function(o){return!/^DTSTART/.test(o)}))}),this._rdate.length&&r.push(Ca("RDATE",this._rdate,this.tzid())),this._exdate.length&&r.push(Ca("EXDATE",this._exdate,this.tzid())),r},e.prototype.toString=function(){return this.valueOf().join(`
`)},e.prototype.clone=function(){var r=new e(!!this._cache);return this._rrule.forEach(function(i){return r.rrule(i.clone())}),this._exrule.forEach(function(i){return r.exrule(i.clone())}),this._rdate.forEach(function(i){return r.rdate(new Date(i.getTime()))}),this._exdate.forEach(function(i){return r.exdate(new Date(i.getTime()))}),r},e}(U);function La(n,e){if(!(n instanceof U))throw new TypeError(String(n)+" is not RRule instance");Z(e.map(String),String(n))||e.push(n)}function Na(n,e){if(!(n instanceof Date))throw new TypeError(String(n)+" is not Date instance");Z(e.map(Number),Number(n))||(e.push(n),Dt(e))}function Ca(n,e,r){var i=!r||r.toUpperCase()==="UTC",o=i?"".concat(n,":"):"".concat(n,";TZID=").concat(r,":"),l=e.map(function(c){return hr(c.valueOf(),i)}).join(",");return"".concat(o).concat(l)}var at=class n{constructor(e,r){this.primary=e;this.func=r}static ofChar(e){return new n(e,r=>r===e)}static ofChars(e){if(e.length===0)throw"empty symbol";if(e[0]==null)throw"ch mustn't be null";return e.length===0?this.ofChar(e[0]):new n(e[0],r=>e.filter(i=>r===i).length>0)}isSymbol(e){return this.func(e)}},Zn=class{constructor(e){this.tokens=e}setTokenText(e,r,i=!1,o=!1,l=!1,c){let d=this.getToken(e);if(d===null){if(!o)return null;if(e instanceof at?d={symbol:e.primary,text:r}:d={symbol:e,text:r},l&&d.symbol!==""&&!d.text.startsWith(" ")&&(d.text=" "+d.text),this.tokens.length>0){let m=this.tokens[this.tokens.length-1];this.isTokenEndsWithSpace(m)||(m.text+=" ")}if(c==null)this.tokens.push(d);else{let m=0,h=-1,y=0;for(let w of this.tokens){let _=m+w.symbol.length+w.text.length;if(y>0&&_>c){h=y;break}m=_,y++}h==-1?this.tokens.push(d):(this.tokens.splice(h,0,d),h<this.tokens.length-1&&(d.text=d.text+" "))}return d}return this.replaceTokenText(d,r,i),d}length(){return this.tokens.length}replaceTokenText(e,r,i=!1){if(!i){e.text=r;return}e.text=e.text.replace(/^(\s*).*?(\s*)$/,`$1${r}$2`)}isTokenEndsWithSpace(e){return e.text.match(/^.*\s$/)}getToken(e){for(let r of this.tokens)if(e instanceof at){if(e.isSymbol(r.symbol))return r}else if(e===r.symbol)return r;return null}getTokenText(e,r=!1){let i=this.getToken(e);return i===null?null:r?i.text.replace(/^\s*(.*?)\s*$/,"$1"):i.text}removeToken(e){this.tokens=this.tokens.filter(r=>!e.isSymbol(r.symbol))}forEachTokens(e){this.tokens.forEach(e)}rangeOfSymbol(e){let r=0;for(let i of this.tokens){let o=r+i.symbol.length+i.text.length;if(e.isSymbol(i.symbol))return{start:r,end:o};r=o}}join(){return this.tokens.map(e=>e.symbol+e.text).join("")}};function Ba(n,e){let r=[...n],i="",o=null,l=[],c=()=>{o===null?l.push({symbol:"",text:i}):o.text=i};return r.forEach(d=>{e.filter(h=>h.isSymbol(d)).length>0?(c(),o={symbol:d,text:""},l.push(o),i=""):i+=d}),i.length>0&&c(),l}function Nm(n){return n.replace(/#\w+/g,"")}var re=class re{constructor(e,r,i,o){this.useCustomEmoji=e;this.removeTags=r;this.strictDateFormat=i;this.tokens=o}static parse(e,r,i,o){return new re(r!=null?r:!1,i!=null?i:!1,o!=null?o:!0,new Zn(Ba(e,this.allSymbols)))}getTitle(){let e=this.tokens.getTokenText("",!0);return e!=null&&this.removeTags&&(e=Nm(e)),e}getTime(){return this.getDate(this.getReminderSymbol())}setTime(e,r){this.useCustomEmoji?this.setDate(this.getReminderSymbol(),e,1):this.setDate(this.getReminderSymbol(),e,r)}getDueDate(){return this.getDate(re.symbolDueDate)}setDueDate(e){this.setDate(re.symbolDueDate,e)}setRawTime(e){return this.setDate(this.getReminderSymbol(),e),!0}getReminderSymbol(){return this.useCustomEmoji?re.symbolReminder:re.symbolDueDate}getEndOfTimeTextIndex(){let e=re.symbolDueDate;this.useCustomEmoji&&(e=re.symbolReminder);let r=this.tokens.rangeOfSymbol(e);return r!=null?r.end:this.toMarkdown().length}toMarkdown(){return this.tokens.join()}setTitle(e){this.tokens.setTokenText("",e,!0,!0)}getDoneDate(){return this.getDate(re.symbolDoneDate)}setDoneDate(e){this.setDate(re.symbolDoneDate,e)}getRecurrence(){return this.tokens.getTokenText(re.symbolRecurrence,!0)}clone(){return re.parse(this.toMarkdown(),this.useCustomEmoji,this.removeTags,this.strictDateFormat)}getDate(e){let r=this.tokens.getTokenText(e,!0);if(r===null)return null;if(e===re.symbolReminder)return ut.parse(r);{let i=(0,Kr.default)(r,re.dateFormat,this.strictDateFormat);return i.isValid()?new G(i,!1):null}}setDate(e,r,i){if(r==null){this.tokens.removeToken(e);return}let o;r instanceof G?e===re.symbolReminder?o=ut.toString(r):o=r.format(re.dateFormat):o=r,this.tokens.setTokenText(e,o,!0,!0,this.shouldSplitBetweenSymbolAndText(),i)}shouldSplitBetweenSymbolAndText(){let e=0,r=0;return this.tokens.forEachTokens(i=>{i.symbol!==""&&(i.text.match(/^\s.*$/)?e+=1:r++)}),e>r?!0:!(e<r)}};g(re,"dateFormat","YYYY-MM-DD"),g(re,"symbolDueDate",at.ofChars([..."\u{1F4C5}\u{1F4C6}\u{1F5D3}"])),g(re,"symbolDoneDate",at.ofChar("\u2705")),g(re,"symbolRecurrence",at.ofChar("\u{1F501}")),g(re,"symbolReminder",at.ofChar("\u23F0")),g(re,"symbolScheduled",at.ofChar("\u23F3")),g(re,"symbolStart",at.ofChar("\u{1F6EB}")),g(re,"allSymbols",[re.symbolDueDate,re.symbolDoneDate,re.symbolRecurrence,re.symbolReminder,re.symbolStart,re.symbolScheduled]);var Jn=re,Kn=class Kn extends Nt{parseReminder(e){let r=Jn.parse(e.body,this.useCustomEmoji(),this.removeTagsEnabled(),this.isStrictDateFormat());return this.useCustomEmoji()&&r.getDueDate()==null?null:r}removeTagsEnabled(){return this.config.getParameter(Pe.removeTagsForTasksPlugin)}useCustomEmoji(){return this.config.getParameter(Pe.useCustomEmojiForTasksPlugin)}modifyReminder(e,r,i,o){if(!super.modifyReminder(e,r,i,o))return!1;if(o.checked!==void 0)if(o.checked){let l=i.getRecurrence();if(l!==null){let c=r.clone(),d=i.clone(),m=i.getDueDate();if(m==null)return!1;if(this.useCustomEmoji()){let h=i.getTime();if(h==null)return!1;let y=this.nextDate(l,h.moment()),w=this.nextDate(l,m.moment());if(y==null||w==null)return!1;d.setTime(new G((0,Kr.default)(y),!0)),d.setDueDate(new G((0,Kr.default)(w),!0))}else{let h=this.nextDate(l,m.moment());if(h==null)return!1;let y=new G((0,Kr.default)(h),!0);d.setTime(y)}c.body=d.toMarkdown(),c.setChecked(!1),e.insertTodo(r.lineIndex,c)}i.setDoneDate(this.config.getParameter(Pe.now))}else i.setDoneDate(void 0);return!0}nextDate(e,r){let i=U.parseText(e);if(!i)return;let o=this.config.getParameter(Pe.now).moment();o.set("hour",r.get("hour")),o.set("minute",r.get("minute")),o.set("second",r.get("second")),o.set("millisecond",r.get("millisecond")),o.isAfter(r)&&(r=o);let l=r.clone();i.dtstart=r.utc(!0).toDate();let d=new U(i).after(r.toDate(),!1);if(d==null)return;let m=d.getTime()-i.dtstart.getTime();return l.add(m,"millisecond"),l.toDate()}newReminder(e,r,i){let o=Jn.parse(e,this.useCustomEmoji(),this.removeTagsEnabled(),this.isStrictDateFormat());return o.setTime(r,i),this.useCustomEmoji()&&o.getDueDate()==null&&o.setDueDate(r),o.setTitle(e),o}};g(Kn,"instance",new Kn);var qn=Kn;var br=new On;br.resetFormat([fr.instance]);var Xr=class{constructor(e,r,i,o,l){this.name=e;this.description=r;this.example=i;this.format=o;this.defaultEnabled=l}};function Ia(n){return br.parse(n)}async function Pa(n,e,r){return br.modify(n,e,r)}function Aa(n){n.length===0?br.resetFormat([fr.instance]):br.resetFormat(n.map(e=>e.format))}function Wa(n){br.setConfig(n)}var ms=new Xr("ReminderPluginReminderFormat","Reminder plugin format","(@2021-09-08)",fr.instance,!0),hs=new Xr("TasksPluginReminderFormat","Tasks plugin format","\u{1F4C5} 2021-09-08",qn.instance,!1),ps=new Xr("KanbanPluginReminderFormat","Kanban plugin format","@{2021-09-08}",In.instance,!1),en=[ms,hs,ps];var Ft=class{constructor(e,r){g(this,"doc");this.doc=new Ir(e,r)}getReminders(e=!0){let r=Ia(this.doc);return e?r.filter(i=>!i.done):r}getTodos(){return this.doc.getTodos()}async modifyReminderLines(e){for(let r of this.getReminders(!1)){let i=e(r);if(i===null)return;await this.modifyReminderLine(r,i)}}async updateReminder(e,r){await this.modifyReminderLine(e,r)}async modifyReminderLine(e,r){let i=await Pa(this.doc,e,r);return i?console.info("Reminder was updated: reminder=%o",e):console.warn("Cannot modify reminder because it's not a reminder todo: reminder=%o",e),i}getContent(){return this.doc.toMarkdown()}};var $a=require("obsidian"),Xn=class extends $a.FuzzySuggestModal{constructor(r,i,o){super(r);this.suggestions=i;this.onChooseSuggestionFunc=o}getItems(){return this.suggestions}getItemText(r){return r}onChooseItem(r){this.onChooseSuggestionFunc(r)}};function Va(n,e){new Xn(n,["YYYY-MM-DD","YYYY/MM/DD","DD-MM-YYYY","DD/MM/YYYY"],r=>{new Xn(n,["YYYY-MM-DD HH:mm","YYYY/MM/DD HH:mm","DD-MM-YYYY HH:mm","DD/MM/YYYY HH:mm","YYYY-MM-DDTHH:mm:ss:SSS"],i=>{e(r,i)}).open()}).open()}async function Cm(n,e,r){let i=0,o=n.app.vault;for(let l of o.getMarkdownFiles()){let c=new Ft(l.path,await o.read(l)),d=0;await c.modifyReminderLines(m=>{let h;return m.time.hasTimePart?h=m.time.format(r):h=m.time.format(e),i++,d++,{rawTime:h}}),d>0&&await o.modify(l,c.getContent())}return n.settings.dateFormat.rawValue.value=e,n.settings.dateTimeFormat.rawValue.value=r,i>0&&await n.fileSystem.reloadRemindersInAllFiles(),i}function ja(n,e){return n||Go("Convert reminder time format","This command rewrite reminder dates in all markdown files. You should make a backup of your vault before you execute this. May I continue to convert?").then(r=>{r===0&&Va(e.app,(i,o)=>{Cm(e,i,o).catch(()=>{})})}),!0}function Ha(n,e,r){if(n)return!0;r.showAutoComplete(e)}async function Bm(n,e,r){if(!n.fileSystem.isMarkdownFile(e))return;let i=n.app.vault,o=new Ft(e.path,await i.read(e)),l=o.getReminders(!1).find(c=>c.rowNumber===r);if(l)await o.updateReminder(l,{checked:!l.done});else{let c=o.getTodos().find(d=>d.lineIndex===r);if(console.log(c),!c)return;c.setChecked(!c.isChecked())}await i.modify(e,o.getContent())}function Ga(n,e,r){if(n)return!0;e&&e.file&&Bm(r,e.file,e.editor.getCursor().line)}var za=require("obsidian");var ei=class extends za.SuggestModal{constructor(r,i){super(r);this.onSelect=i}getSuggestions(r){return Ko.filter(i=>i.name.toLowerCase().includes(r.toLowerCase()))}renderSuggestion(r,i){let o=i.createDiv({cls:"reminder-preset-suggestion"}),l=o.createEl("div",{text:r.name,cls:"reminder-preset-title"}),c=G.now(),d=o.createDiv({cls:"reminder-preset-previews"});d.createEl("div",{cls:"reminder-preset-preview-line",text:"Year/Month: "+c.format(r.format.yearMonthFormat)}),d.createEl("div",{cls:"reminder-preset-preview-line",text:"Month/Day: "+c.format(r.format.monthDayFormat)}),d.createEl("div",{cls:"reminder-preset-preview-line",text:"Short: "+c.format(r.format.shortDateWithWeekdayFormat)}),d.createEl("div",{cls:"reminder-preset-preview-line",text:"Time: "+c.format(r.format.timeFormat)}),l.style.fontWeight="600",l.style.marginBottom="4px",d.style.opacity="0.8",d.style.fontSize="12px",d.style.display="grid",d.style.gridAutoRows="min-content",d.style.rowGap="2px"}onChooseSuggestion(r){this.onSelect(r)}};function Za(n,e){return n||new ei(e.app,r=>{e.data.settings.monthDayDisplayFormat.rawValue.value=r.format.monthDayFormat,e.data.settings.yearMonthDisplayFormat.rawValue.value=r.format.yearMonthFormat,e.data.settings.shortDateWithWeekdayDisplayFormat.rawValue.value=r.format.shortDateWithWeekdayFormat,e.data.settings.timeDisplayFormat.rawValue.value=r.format.timeFormat,e.data.save(!0),e.ui.invalidate(),e.ui.reload(!0)}).open(),!0}function qa(n){n.addCommand({id:"scan-reminders",name:"Scan reminders",checkCallback:e=>Vo(e,n)}),n.addCommand({id:"show-reminders",name:"Show reminders",checkCallback:e=>jo(e,n.ui)}),n.addCommand({id:"convert-reminder-time-format",name:"Convert reminder time format",checkCallback:e=>ja(e,n)}),n.addCommand({id:"show-date-chooser",name:"Show calendar popup",icon:"calendar-with-checkmark",hotkeys:[{modifiers:["Meta","Shift"],key:"2"}],editorCheckCallback:(e,r)=>Ha(e,r,n.ui)}),n.addCommand({id:"toggle-checklist-status",name:"Toggle checklist status",hotkeys:[{modifiers:["Meta","Shift"],key:"Enter"}],editorCheckCallback:(e,r,i)=>i instanceof Ja.MarkdownView?Ga(e,i,n):!1}),n.addCommand({id:"set-date-display-format",name:"Set date display format",checkCallback:e=>Za(e,n)})}var Ka=require("obsidian");function Xa(n){if(!Ka.Platform.isMobile)return;let e=`${n.manifest.dir}/logs.txt`,r=[],i=o=>(...l)=>{r.push(`
[${o}]`);for(let c of l)r.push(String(c));n.app.vault.adapter.write(e,r.join(" "))};console.debug=i("debug"),console.error=i("error"),console.info=i("info"),console.log=i("log"),console.warn=i("warn")}var ft="reminder-list";var fi=require("obsidian");function ge(){}function Im(n,e){for(let r in e)n[r]=e[r];return n}function ys(n){return n()}function ti(){return Object.create(null)}function Se(n){n.forEach(ys)}function It(n){return typeof n=="function"}function Ce(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}function el(n){return Object.keys(n).length===0}function tl(n,e,r,i){if(n){let o=rl(n,e,r,i);return n[0](o)}}function rl(n,e,r,i){return n[1]&&i?Im(r.ctx.slice(),n[1](i(e))):r.ctx}function nl(n,e,r,i){if(n[2]&&i){let o=n[2](i(r));if(e.dirty===void 0)return o;if(typeof o=="object"){let l=[],c=Math.max(e.dirty.length,o.length);for(let d=0;d<c;d+=1)l[d]=e.dirty[d]|o[d];return l}return e.dirty|o}return e.dirty}function il(n,e,r,i,o,l){if(o){let c=rl(e,r,i,l);n.p(c,o)}}function sl(n){if(n.ctx.length>32){let e=[],r=n.ctx.length/32;for(let i=0;i<r;i++)e[i]=-1;return e}return-1}var gs=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;var ri=class n{constructor(e){g(this,"_listeners","WeakMap"in gs?new WeakMap:void 0);g(this,"_observer");g(this,"options");this.options=e}observe(e,r){return this._listeners.set(e,r),this._getObserver().observe(e,this.options),()=>{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){var e;return(e=this._observer)!=null?e:this._observer=new ResizeObserver(r=>{var i;for(let o of r)n.entries.set(o.target,o),(i=this._listeners.get(o.target))==null||i(o)})}};ri.entries="WeakMap"in gs?new WeakMap:void 0;var ol=!1;function al(){ol=!0}function ll(){ol=!1}function M(n,e){n.appendChild(e)}function ne(n,e,r){n.insertBefore(e,r||null)}function X(n){n.parentNode&&n.parentNode.removeChild(n)}function nt(n,e){for(let r=0;r<n.length;r+=1)n[r]&&n[r].d(e)}function Y(n){return document.createElement(n)}function Re(n){return document.createTextNode(n)}function de(){return Re(" ")}function ce(n,e,r,i){return n.addEventListener(e,r,i),()=>n.removeEventListener(e,r,i)}function O(n,e,r){r==null?n.removeAttribute(e):n.getAttribute(e)!==r&&n.setAttribute(e,r)}function ul(n){return Array.from(n.childNodes)}function Ae(n,e){e=""+e,n.data!==e&&(n.data=e)}function tn(n,e){n.value=e==null?"":e}function vr(n,e,r){for(let i=0;i<n.options.length;i+=1){let o=n.options[i];if(o.__value===e){o.selected=!0;return}}(!r||e!==void 0)&&(n.selectedIndex=-1)}function ni(n){let e=n.querySelector(":checked");return e&&e.__value}function it(n,e,r){n.classList.toggle(e,!!r)}function ii(n,e,{bubbles:r=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:r,cancelable:i})}function dl(n){let e={};return n.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}var Pt;function Mt(n){Pt=n}function si(){if(!Pt)throw new Error("Function called outside component initialization");return Pt}function qt(n){si().$$.on_mount.push(n)}function bs(n){si().$$.after_update.push(n)}function rn(){let n=si();return(e,r,{cancelable:i=!1}={})=>{let o=n.$$.callbacks[e];if(o){let l=ii(e,r,{cancelable:i});return o.slice().forEach(c=>{c.call(n,l)}),!l.defaultPrevented}return!0}}var Kt=[];var We=[],wr=[],_s=[],cl=Promise.resolve(),ws=!1;function xs(){ws||(ws=!0,cl.then(oi))}function ks(){return xs(),cl}function Rt(n){wr.push(n)}function Ds(n){_s.push(n)}var vs=new Set,_r=0;function oi(){if(_r!==0)return;let n=Pt;do{try{for(;_r<Kt.length;){let e=Kt[_r];_r++,Mt(e),Gm(e.$$)}}catch(e){throw Kt.length=0,_r=0,e}for(Mt(null),Kt.length=0,_r=0;We.length;)We.pop()();for(let e=0;e<wr.length;e+=1){let r=wr[e];vs.has(r)||(vs.add(r),r())}wr.length=0}while(Kt.length);for(;_s.length;)_s.pop()();ws=!1,vs.clear(),Mt(n)}function Gm(n){if(n.fragment!==null){n.update(),Se(n.before_update);let e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Rt)}}function fl(n){let e=[],r=[];wr.forEach(i=>n.indexOf(i)===-1?e.push(i):r.push(i)),r.forEach(i=>i()),wr=e}var ai=new Set,Xt;function xr(){Xt={r:0,c:[],p:Xt}}function kr(){Xt.r||Se(Xt.c),Xt=Xt.p}function ae(n,e){n&&n.i&&(ai.delete(n),n.i(e))}function ye(n,e,r,i){if(n&&n.o){if(ai.has(n))return;ai.add(n),Xt.c.push(()=>{ai.delete(n),i&&(r&&n.d(1),i())}),n.o(e)}else i&&i()}function we(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}var zm=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],Zm=new Set([...zm]);function Ts(n,e,r){let i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=r,r(n.$$.ctx[i]))}function Ze(n){n&&n.c()}function $e(n,e,r){let{fragment:i,after_update:o}=n.$$;i&&i.m(e,r),Rt(()=>{let l=n.$$.on_mount.map(ys).filter(It);n.$$.on_destroy?n.$$.on_destroy.push(...l):Se(l),n.$$.on_mount=[]}),o.forEach(Rt)}function Ve(n,e){let r=n.$$;r.fragment!==null&&(fl(r.after_update),Se(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function qm(n,e){n.$$.dirty[0]===-1&&(Kt.push(n),xs(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function Be(n,e,r,i,o,l,c=null,d=[-1]){let m=Pt;Mt(n);let h=n.$$={fragment:null,ctx:[],props:l,update:ge,not_equal:o,bound:ti(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(m?m.$$.context:[])),callbacks:ti(),dirty:d,skip_bound:!1,root:e.target||m.$$.root};c&&c(h.root);let y=!1;if(h.ctx=r?r(n,e.props||{},(w,_,...x)=>{let b=x.length?x[0]:_;return h.ctx&&o(h.ctx[w],h.ctx[w]=b)&&(!h.skip_bound&&h.bound[w]&&h.bound[w](b),y&&qm(n,w)),_}):[],h.update(),y=!0,Se(h.before_update),h.fragment=i?i(h.ctx):!1,e.target){if(e.hydrate){al();let w=ul(e.target);h.fragment&&h.fragment.l(w),w.forEach(X)}else h.fragment&&h.fragment.c();e.intro&&ae(n.$$.fragment),$e(n,e.target,e.anchor),ll(),oi()}Mt(m)}var Km;typeof HTMLElement=="function"&&(Km=class extends HTMLElement{constructor(e,r,i){super();g(this,"$$ctor");g(this,"$$s");g(this,"$$c");g(this,"$$cn",!1);g(this,"$$d",{});g(this,"$$r",!1);g(this,"$$p_d",{});g(this,"$$l",{});g(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=r,i&&this.attachShadow({mode:"open"})}addEventListener(e,r,i){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(r),this.$$c){let o=this.$$c.$on(e,r);this.$$l_u.set(r,o)}super.addEventListener(e,r,i)}removeEventListener(e,r,i){if(super.removeEventListener(e,r,i),this.$$c){let o=this.$$l_u.get(r);o&&(o(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(l){return()=>{let c;return{c:function(){c=Y("slot"),l!=="default"&&O(c,"name",l)},m:function(h,y){ne(h,c,y)},d:function(h){h&&X(c)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let r={},i=dl(this);for(let l of this.$$s)l in i&&(r[l]=[e(l)]);for(let l of this.attributes){let c=this.$$g_p(l.name);c in this.$$d||(this.$$d[c]=Ss(c,l.value,this.$$p_d,"toProp"))}for(let l in this.$$p_d)!(l in this.$$d)&&this[l]!==void 0&&(this.$$d[l]=this[l],delete this[l]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$scope:{ctx:[]}}});let o=()=>{this.$$r=!0;for(let l in this.$$p_d)if(this.$$d[l]=this.$$c.$$.ctx[this.$$c.$$.props[l]],this.$$p_d[l].reflect){let c=Ss(l,this.$$d[l],this.$$p_d,"toAttribute");c==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,c)}this.$$r=!1};this.$$c.$$.after_update.push(o),o();for(let l in this.$$l)for(let c of this.$$l[l]){let d=this.$$c.$on(l,c);this.$$l_u.set(c,d)}this.$$l={}}}attributeChangedCallback(e,r,i){var o;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ss(e,i,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(e){return Object.keys(this.$$p_d).find(r=>this.$$p_d[r].attribute===e||!this.$$p_d[r].attribute&&r.toLowerCase()===e)||e}});function Ss(n,e,r,i){var l;let o=(l=r[n])==null?void 0:l.type;if(e=o==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!r[n])return e;if(i==="toAttribute")switch(o){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}var Te=class{constructor(){g(this,"$$");g(this,"$$set")}$destroy(){Ve(this,1),this.$destroy=ge}$on(e,r){if(!It(r))return ge;let i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(r),()=>{let o=i.indexOf(r);o!==-1&&i.splice(o,1)}}$set(e){this.$$set&&!el(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var ml="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(ml);var hl=require("obsidian");function Xm(n){let e,r;return{c(){e=Y("span"),r=Y("span"),O(r,"class","reminder-markdown")},m(i,o){ne(i,e,o),M(e,r),n[3](r)},p:ge,i:ge,o:ge,d(i){i&&X(e),n[3](null)}}}function eh(n,e,r){let{sourcePath:i}=e,{markdown:o}=e,l;bs(()=>{l.empty(),hl.MarkdownRenderer.renderMarkdown(o,l,i,window.app.plugins.plugins["obsidian-reminder-plugin"]),l.childNodes.forEach(d=>{d instanceof HTMLElement&&(d.style.display="inline")})});function c(d){We[d?"unshift":"push"](()=>{l=d,r(0,l)})}return n.$$set=d=>{"sourcePath"in d&&r(1,i=d.sourcePath),"markdown"in d&&r(2,o=d.markdown)},[l,i,o,c]}var Fs=class extends Te{constructor(e){super(),Be(this,e,eh,Xm,Ce,{sourcePath:1,markdown:2})}},li=Fs;function pl(n,e,r){let i=n.slice();return i[6]=e[r],i}function th(n){let e,r,i=we(n[0]),o=[];for(let c=0;c<i.length;c+=1)o[c]=yl(pl(n,i,c));let l=c=>ye(o[c],1,1,()=>{o[c]=null});return{c(){e=Y("div");for(let c=0;c<o.length;c+=1)o[c].c()},m(c,d){ne(c,e,d);for(let m=0;m<o.length;m+=1)o[m]&&o[m].m(e,null);r=!0},p(c,d){if(d&15){i=we(c[0]);let m;for(m=0;m<i.length;m+=1){let h=pl(c,i,m);o[m]?(o[m].p(h,d),ae(o[m],1)):(o[m]=yl(h),o[m].c(),ae(o[m],1),o[m].m(e,null))}for(xr(),m=i.length;m<o.length;m+=1)l(m);kr()}},i(c){if(!r){for(let d=0;d<i.length;d+=1)ae(o[d]);r=!0}},o(c){o=o.filter(Boolean);for(let d=0;d<o.length;d+=1)ye(o[d]);r=!1},d(c){c&&X(e),nt(o,c)}}}function rh(n){let e;return{c(){e=Y("div"),e.textContent="No reminders",O(e,"class","reminder-list-item no-reminders svelte-15dajvg")},m(r,i){ne(r,e,i)},p:ge,i:ge,o:ge,d(r){r&&X(e)}}}function yl(n){let e,r,i=n[2](n[6].time)+"",o,l,c,d,m,h,y,w=n[6].getFileName()+"",_,x,b,D,F,T;m=new li({props:{markdown:n[6].title,sourcePath:n[6].file}});function B(...N){return n[4](n[6],...N)}function P(){return n[5](n[6])}return{c(){e=Y("button"),r=Y("span"),o=Re(i),l=de(),c=Y("div"),d=Y("span"),Ze(m.$$.fragment),h=de(),y=Y("span"),_=Re(w),x=de(),O(r,"class","reminder-time svelte-15dajvg"),O(d,"class","reminder-title svelte-15dajvg"),O(y,"class","reminder-file svelte-15dajvg"),O(c,"class","reminder-title-container svelte-15dajvg"),O(e,"class","reminder-list-item hover-highlight svelte-15dajvg"),O(e,"aria-label",b=`[${n[6].time.toString()}] ${n[6].title} - ${n[6].getFileName()}`),O(e,"draggable","true")},m(N,V){ne(N,e,V),M(e,r),M(r,o),M(e,l),M(e,c),M(c,d),$e(m,d,null),M(c,h),M(c,y),M(y,_),M(e,x),D=!0,F||(T=[ce(e,"dragstart",B),ce(e,"click",P)],F=!0)},p(N,V){n=N,(!D||V&5)&&i!==(i=n[2](n[6].time)+"")&&Ae(o,i);let I={};V&1&&(I.markdown=n[6].title),V&1&&(I.sourcePath=n[6].file),m.$set(I),(!D||V&1)&&w!==(w=n[6].getFileName()+"")&&Ae(_,w),(!D||V&1&&b!==(b=`[${n[6].time.toString()}] ${n[6].title} - ${n[6].getFileName()}`))&&O(e,"aria-label",b)},i(N){D||(ae(m.$$.fragment,N),D=!0)},o(N){ye(m.$$.fragment,N),D=!1},d(N){N&&X(e),Ve(m),F=!1,Se(T)}}}function nh(n){let e,r,i,o,l=[rh,th],c=[];function d(m,h){return m[0].length===0?0:1}return r=d(n,-1),i=c[r]=l[r](n),{c(){e=Y("div"),i.c(),O(e,"class","reminder-group svelte-15dajvg")},m(m,h){ne(m,e,h),c[r].m(e,null),o=!0},p(m,[h]){let y=r;r=d(m,h),r===y?c[r].p(m,h):(xr(),ye(c[y],1,1,()=>{c[y]=null}),kr(),i=c[r],i?i.p(m,h):(i=c[r]=l[r](m),i.c()),ae(i,1),i.m(e,null))},i(m){o||(ae(i),o=!0)},o(m){ye(i),o=!1},d(m){m&&X(e),c[r].d()}}}function ih(n,e,r){let{reminders:i}=e,{onOpenReminder:o=()=>{}}=e,{timeToString:l=h=>h.format("HH:MM")}=e,{generateLink:c=()=>""}=e,d=(h,y)=>{var w;(w=y.dataTransfer)==null||w.setData("text/plain",c(h))},m=h=>{o(h)};return n.$$set=h=>{"reminders"in h&&r(0,i=h.reminders),"onOpenReminder"in h&&r(1,o=h.onOpenReminder),"timeToString"in h&&r(2,l=h.timeToString),"generateLink"in h&&r(3,c=h.generateLink)},[i,o,l,c,d,m]}var Ms=class extends Te{constructor(e){super(),Be(this,e,ih,nh,Ce,{reminders:0,onOpenReminder:1,timeToString:2,generateLink:3})}},ui=Ms;function gl(n,e,r){let i=n.slice();return i[4]=e[r],i}function bl(n){let e,r=n[4].name+"",i,o,l,c;function d(...m){return n[3](n[4],...m)}return l=new ui({props:{reminders:n[4].reminders,onOpenReminder:n[1],timeToString:d,generateLink:n[2]}}),{c(){e=Y("div"),i=Re(r),o=de(),Ze(l.$$.fragment),O(e,"class","group-name svelte-2zqui4"),it(e,"group-name-overdue",n[4].isOverdue)},m(m,h){ne(m,e,h),M(e,i),ne(m,o,h),$e(l,m,h),c=!0},p(m,h){n=m,(!c||h&1)&&r!==(r=n[4].name+"")&&Ae(i,r),(!c||h&1)&&it(e,"group-name-overdue",n[4].isOverdue);let y={};h&1&&(y.reminders=n[4].reminders),h&2&&(y.onOpenReminder=n[1]),h&1&&(y.timeToString=d),h&4&&(y.generateLink=n[2]),l.$set(y)},i(m){c||(ae(l.$$.fragment,m),c=!0)},o(m){ye(l.$$.fragment,m),c=!1},d(m){m&&(X(e),X(o)),Ve(l,m)}}}function sh(n){let e,r,i,o=we(n[0]),l=[];for(let d=0;d<o.length;d+=1)l[d]=bl(gl(n,o,d));let c=d=>ye(l[d],1,1,()=>{l[d]=null});return{c(){e=Y("main"),r=Y("div");for(let d=0;d<l.length;d+=1)l[d].c()},m(d,m){ne(d,e,m),M(e,r);for(let h=0;h<l.length;h+=1)l[h]&&l[h].m(r,null);i=!0},p(d,[m]){if(m&7){o=we(d[0]);let h;for(h=0;h<o.length;h+=1){let y=gl(d,o,h);l[h]?(l[h].p(y,m),ae(l[h],1)):(l[h]=bl(y),l[h].c(),ae(l[h],1),l[h].m(r,null))}for(xr(),h=o.length;h<l.length;h+=1)c(h);kr()}},i(d){if(!i){for(let m=0;m<o.length;m+=1)ae(l[m]);i=!0}},o(d){l=l.filter(Boolean);for(let m=0;m<l.length;m+=1)ye(l[m]);i=!1},d(d){d&&X(e),nt(l,d)}}}function oh(n,e,r){let{groups:i}=e,{onOpenReminder:o}=e,{generateLink:l}=e,c=(d,m)=>d.timeToString(m);return n.$$set=d=>{"groups"in d&&r(0,i=d.groups),"onOpenReminder"in d&&r(1,o=d.onOpenReminder),"generateLink"in d&&r(2,l=d.generateLink)},[i,o,l,c]}var Rs=class extends Te{constructor(e){super(),Be(this,e,oh,sh,Ce,{groups:0,onOpenReminder:1,generateLink:2})}},vl=Rs;var di=class extends fi.ItemView{constructor(r,i,o){super(i);this.plugin=r;this.onOpenReminder=o;g(this,"view")}getViewType(){return ft}getDisplayText(){return"Reminders"}getIcon(){return"clock"}async onOpen(){this.view=new vl({target:this.contentEl,props:{groups:this.remindersForView(),onOpenReminder:this.onOpenReminder,generateLink:r=>{let i=this.app.vault.getAbstractFileByPath(r.file),o=this.app.workspace.getActiveFile(),l;return!(i instanceof fi.TFile)||o==null?l=`[[${r.getFileName()}]]`:l=this.app.fileManager.generateMarkdownLink(i,o.path),`${r.title} - ${l}`}}})}reload(){this.view!=null&&this.view.$set({groups:this.remindersForView(),onOpenReminder:this.onOpenReminder})}remindersForView(){return Xo(this.plugin.reminders.reminders,this.plugin.settings.reminderTime.value,{yearMonthFormat:this.plugin.settings.yearMonthDisplayFormat.value,monthDayFormat:this.plugin.settings.monthDayDisplayFormat.value,shortDateWithWeekdayFormat:this.plugin.settings.shortDateWithWeekdayDisplayFormat.value,timeFormat:this.plugin.settings.timeDisplayFormat.value})}onClose(){return this.view&&this.view.$destroy(),Promise.resolve()}},ci=class{constructor(e,r){this.plugin=e;this.onOpenReminder=r;g(this,"valid",!1);[this.plugin.settings.yearMonthDisplayFormat,this.plugin.settings.monthDayDisplayFormat,this.plugin.settings.shortDateWithWeekdayDisplayFormat,this.plugin.settings.timeDisplayFormat].forEach(o=>{o.rawValue.onChanged(()=>{this.invalidate(),this.reload(!0)})})}createView(e){return new di(this.plugin,e,this.onOpenReminder)}openView(){var e;this.plugin.app.workspace.getLeavesOfType(ft).length||(e=this.plugin.app.workspace.getRightLeaf(!1))==null||e.setViewState({type:ft})}reload(e=!1){if(e||!this.valid){let r=this.getViews();r.length>0?(r.forEach(i=>i==null?void 0:i.reload()),this.valid=!0):(this.valid=!1,console.debug("view is null. Skipping reminder list view reload"))}}getViews(){return this.plugin.app.workspace.getLeavesOfType(ft).map(e=>e&&e.view instanceof di?e.view:null).filter(e=>e!=null)}invalidate(){this.valid=!1}};var Ql=require("obsidian");var ki=require("obsidian");var Yl=Ot(xt());var wi=Ot(xt());var Bs=Ot(xt(),1);var _l=require("obsidian");var Es=class{constructor(){g(this,"settingContexts",[])}register(e){this.settingContexts.push(e)}findByKey(e){return this.settingContexts.find(r=>r.key===e)}forEach(e){this.settingContexts.forEach(e)}},Us=class{constructor(e){this._settingRegistry=e;g(this,"validationEl");g(this,"infoEl");g(this,"_setting");g(this,"key");g(this,"name");g(this,"desc");g(this,"tags",[]);g(this,"settingModel");g(this,"anyValueChanged")}init(e,r,i){this.settingModel=e,this._setting=r,this.validationEl=i.createDiv("validation",o=>{o.style.color="var(--text-error)",o.style.marginBottom="1rem",o.style.fontSize="14px",o.style.display="none"}),this.infoEl=i.createDiv("info",o=>{o.style.color="var(--text-faint)",o.style.marginBottom="1rem",o.style.fontSize="14px",o.style.display="none"})}setValidationError(e){this.setText(this.validationEl,e)}setInfo(e){this.setText(this.infoEl,e)}setText(e,r){if(!e){console.error("element not created");return}r===null?e.style.display="none":(e.style.display="block",e.innerHTML=r)}get setting(){return this._setting}get registry(){return this._settingRegistry}hasTag(e){return this.tags.filter(r=>r===e).length>0}update(){this.anyValueChanged&&this.anyValueChanged(this)}setEnabled(e){this.setting.setDisabled(!e)}findContextByKey(e){return this._settingRegistry.findByKey(e)}booleanValue(){return this.settingModel.value}isInitialized(){return this.settingModel&&this.validationEl&&this.setting}},Ys=class{constructor(e){this.registry=e;g(this,"context");this.context=new Us(this.registry),this.registry.register(this.context)}key(e){return this.context.key=e,this}name(e){return this.context.name=e,this}desc(e){return this.context.desc=e,this}tag(e){return this.context.tags.push(e),this}enableWhen(e){return this.context.anyValueChanged=e,this}text(e){return new mi(this.context,!1,e)}textArea(e){return new mi(this.context,!0,e)}number(e){return new Os(this.context,e)}toggle(e){return new Qs(this.context,e)}dropdown(e){return new Ns(this.context,e)}},Dr=class{constructor(e,r){this.context=e;this.initValue=r}onAnyValueChanged(e){return this.context.anyValueChanged=e,this}onValueChange(){this.context.registry.forEach(e=>{e.update()})}buildSettingModel(e,r){return new nn(this.context,e,this.initValue,r)}},mi=class extends Dr{constructor(r,i,o){super(r,o);this.longText=i;g(this,"_placeHolder")}placeHolder(r){return this._placeHolder=r,this}build(r){return this.buildSettingModel(r,({setting:i,rawValue:o,context:l})=>{let c=d=>{var m;d.setPlaceholder((m=this._placeHolder)!=null?m:"").setValue(o.value).onChange(async h=>{try{r.unmarshal(h),o.value=h,l.setValidationError(null),this.onValueChange()}catch(y){y instanceof Error?l.setValidationError(y.message):typeof y=="string"&&l.setValidationError(y)}})};this.longText?i.addTextArea(d=>{c(d)}):i.addText(d=>{c(d)})})}},Os=class extends Dr{constructor(r,i){super(r,i);g(this,"_placeHolder")}placeHolder(r){return this._placeHolder=r,this}build(r){return this.buildSettingModel(r,({setting:i,rawValue:o,context:l})=>{let c=d=>{var m;d.setPlaceholder((m=this._placeHolder)!=null?m:"").setValue(o.value.toString()).onChange(async h=>{try{let y=parseInt(h);o.value=y,l.setValidationError(null),this.onValueChange()}catch(y){y instanceof Error?l.setValidationError(y.message):typeof y=="string"&&l.setValidationError(y)}})};i.addText(d=>{c(d)})})}},Qs=class extends Dr{build(e){return new nn(this.context,e,this.initValue,({setting:r,rawValue:i})=>{r.addToggle(o=>o.setValue(i.value).onChange(async l=>{i.value=l,this.onValueChange()}))})}},Ls=class{constructor(e,r){this.label=e;this.value=r}},Ns=class extends Dr{constructor(){super(...arguments);g(this,"options",[])}addOption(r,i){return this.options.push(new Ls(r,i)),this}build(r){return new nn(this.context,r,this.initValue,({setting:i,rawValue:o})=>{i.addDropdown(l=>{this.options.forEach(c=>{l.addOption(c.value,c.label)}),l.setValue(o.value),l.onChange(async c=>{o.value=c,this.onValueChange()})})})}},nn=class{constructor(e,r,i,o){this.context=e;this.serde=r;this.settingInitializer=o;g(this,"rawValue");if(this.rawValue=new jt(i),e.key==null)throw new Error("key is required.")}createSetting(e){var i,o;let r=new _l.Setting(e).setName((i=this.context.name)!=null?i:"").setDesc((o=this.context.desc)!=null?o:"");return this.context.init(this,r,e),this.settingInitializer({setting:r,rawValue:this.rawValue,context:this.context}),r}get value(){return this.serde.unmarshal(this.rawValue.value)}get key(){return this.context.key}load(e){if(e===void 0)return;let r=e[this.key];r!==void 0&&(this.rawValue.value=r)}store(e){e[this.key]=this.rawValue.value}hasTag(e){return this.context.hasTag(e)}},Cs=class{constructor(e){this.name=e;g(this,"settings",[])}addSettings(...e){this.settings.push(...e)}},hi=class{constructor(){g(this,"groups",[]);g(this,"registry",new Es)}newSettingBuilder(){return new Ys(this.registry)}newGroup(e){let r=new Cs(e);return this.groups.push(r),r}displayOn(e){e.empty(),this.groups.forEach(r=>{e.createEl("h3",{text:r.name}),r.settings.forEach(i=>{i.createSetting(e)})}),this.registry.forEach(r=>r.update())}forEach(e){this.groups.forEach(r=>{r.settings.forEach(i=>{e(i)})})}},pi=class{unmarshal(e){return Un.parse(e)}marshal(e){return e.toString()}},ke=class{unmarshal(e){return e}marshal(e){return e}},yi=class{unmarshal(e){return Jo(e)}marshal(e){return e.map(r=>r.label).join(`
`)}},gi=class{unmarshal(e){return en.find(i=>i.name===e)}marshal(e){return e.name}};var mt="re-scan",Sr=class{constructor(){g(this,"settings",new hi);g(this,"reminderTime");g(this,"reminderTimeStep");g(this,"useSystemNotification");g(this,"laters");g(this,"weekStart");g(this,"dateFormat");g(this,"dateTimeFormat");g(this,"strictDateFormat");g(this,"autoCompleteTrigger");g(this,"primaryFormat");g(this,"useCustomEmojiForTasksPlugin");g(this,"removeTagsForTasksPlugin");g(this,"linkDatesToDailyNotes");g(this,"yearMonthDisplayFormat");g(this,"monthDayDisplayFormat");g(this,"timeDisplayFormat");g(this,"shortDateWithWeekdayDisplayFormat");g(this,"editDetectionSec");g(this,"reminderCheckIntervalSec");let e=new Is(this.settings);this.reminderTime=this.settings.newSettingBuilder().key("reminderTime").name("Reminder Time").desc("Time when a reminder with no time part will show").tag(mt).text("09:00").placeHolder("Time (hh:mm)").build(new pi),this.reminderTimeStep=this.settings.newSettingBuilder().key("reminderTimeStep").name("Reminder Time Step (minutes)").desc("Step of time for reminder time (minutes)").number(15).build(new ke),this.useSystemNotification=this.settings.newSettingBuilder().key("useSystemNotification").name("Use system notification").desc("Use system notification for reminder notifications").toggle(!1).build(new ke),this.laters=this.settings.newSettingBuilder().key("laters").name("Remind me later").desc("Line-separated list of remind me later items").textArea(`In 30 minutes
In 1 hour
In 3 hours
Tomorrow
Next week`).placeHolder(`In 30 minutes
In 1 hour
In 3 hours
Tomorrow
Next week`).build(new yi);let r=this.settings.newSettingBuilder().key("weekStart").name("Week start").desc("Select the first day of the week").dropdown("0");Array.from({length:7},(l,c)=>{let d=(0,Bs.default)().weekday(c).format("dddd");r.addOption(d,c.toString())}),this.weekStart=r.onAnyValueChanged(()=>{Bs.default.updateLocale("en",{week:{dow:Number(this.weekStart.value)}})}).build(new ke),this.dateFormat=this.settings.newSettingBuilder().key("dateFormat").name("Date format").desc("moment style date format: https://momentjs.com/docs/#/displaying/format/").tag(mt).text("YYYY-MM-DD").placeHolder("YYYY-MM-DD").onAnyValueChanged(l=>{l.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new ke),this.strictDateFormat=this.settings.newSettingBuilder().key("strictDateFormat").name("Strict Date format").desc("Strictly parse the date and time").tag(mt).toggle(!1).build(new ke),this.dateTimeFormat=this.settings.newSettingBuilder().key("dateTimeFormat").name("Date and time format").desc("moment() style date time format: https://momentjs.com/docs/#/displaying/format/").tag(mt).text("YYYY-MM-DD HH:mm").placeHolder("YYYY-MM-DD HH:mm").onAnyValueChanged(l=>{l.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new ke),this.linkDatesToDailyNotes=this.settings.newSettingBuilder().key("linkDatesToDailyNotes").name("Link dates to daily notes").desc("When toggled, Dates link to daily notes.").tag(mt).toggle(!1).onAnyValueChanged(l=>{l.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new ke),this.autoCompleteTrigger=this.settings.newSettingBuilder().key("autoCompleteTrigger").name("Calendar popup trigger").desc("Trigger text to show calendar popup").text("(@").placeHolder("(@").onAnyValueChanged(l=>{let c=this.autoCompleteTrigger.value;l.setInfo(`Popup is ${c.length===0?"disabled":"enabled"}`)}).build(new ke);let i=this.settings.newSettingBuilder().key("primaryReminderFormat").name("Primary reminder format").desc("Reminder format for generated reminder by calendar popup").dropdown(en[0].name);en.forEach(l=>i.addOption(`${l.description} - ${l.example}`,l.name)),this.primaryFormat=i.build(new gi),this.useCustomEmojiForTasksPlugin=this.settings.newSettingBuilder().key("useCustomEmojiForTasksPlugin").name("Distinguish between reminder date and due date").desc("Use custom emoji \u23F0 instead of \u{1F4C5} and distinguish between reminder date/time and Tasks Plugin's due date.").tag(mt).toggle(!1).onAnyValueChanged(l=>{l.setEnabled(e.enableTasksPluginReminderFormat.value)}).build(new ke),this.removeTagsForTasksPlugin=this.settings.newSettingBuilder().key("removeTagsForTasksPlugin").name("Remove tags from reminder title").desc("If checked, tags(#xxx) are removed from the reminder list view and notification.").tag(mt).toggle(!1).onAnyValueChanged(l=>{l.setEnabled(e.enableTasksPluginReminderFormat.value)}).build(new ke),this.yearMonthDisplayFormat=this.settings.newSettingBuilder().key("yearMonthDisplayFormat").name("Year & Month Format").desc(`Moment style year and month format:
https://momentjs.com/docs/#/displaying/format/`).text("YYYY, MMMM").placeHolder("YYYY, MMMM").build(new ke),this.monthDayDisplayFormat=this.settings.newSettingBuilder().key("monthDayDisplayFormat").name("Month & Day Format").desc(`Moment style month and day format:
https://momentjs.com/docs/#/displaying/format/`).text("MM/DD").placeHolder("MM/DD").build(new ke),this.shortDateWithWeekdayDisplayFormat=this.settings.newSettingBuilder().key("shortDateWithWeekdayDisplayFormat").name("Short Date with Weekday Format").desc(`Moment style short date with weekday format:
https://momentjs.com/docs/#/displaying/format/`).text("M/DD (ddd)").placeHolder("M/DD (ddd)").build(new ke),this.timeDisplayFormat=this.settings.newSettingBuilder().key("timeDisplayFormat").name("Time Format").desc(`Moment style time format:
https://momentjs.com/docs/#/displaying/format/`).text("HH:mm").placeHolder("HH:mm").build(new ke),this.editDetectionSec=this.settings.newSettingBuilder().key("editDetectionSec").name("Edit Detection Time").desc("The minimum amount of time (in seconds) after a key is typed that it will be identified as notifiable.").number(10).build(new ke),this.reminderCheckIntervalSec=this.settings.newSettingBuilder().key("reminderCheckIntervalSec").name("Reminder check interval").desc("Interval(in seconds) to periodically check whether or not you should be notified of reminders. You will need to restart Obsidian for this setting to take effect.").number(5).build(new ke),this.settings.newGroup("Notification Settings").addSettings(this.reminderTime,this.reminderTimeStep,this.laters,this.useSystemNotification),this.settings.newGroup("Editor").addSettings(this.autoCompleteTrigger,this.primaryFormat),this.settings.newGroup("Reminder Format - Reminder Plugin").addSettings(e.enableReminderPluginReminderFormat,this.dateFormat,this.dateTimeFormat,this.strictDateFormat,this.linkDatesToDailyNotes),this.settings.newGroup("Reminder Format - Tasks Plugin").addSettings(e.enableTasksPluginReminderFormat,this.useCustomEmojiForTasksPlugin,this.removeTagsForTasksPlugin),this.settings.newGroup("Reminder Format - Kanban Plugin").addSettings(e.enableKanbanPluginReminderFormat),this.settings.newGroup("Date/Time Display Format").addSettings(this.yearMonthDisplayFormat,this.monthDayDisplayFormat,this.shortDateWithWeekdayDisplayFormat,this.timeDisplayFormat),this.settings.newGroup("Advanced").addSettings(this.editDetectionSec,this.reminderCheckIntervalSec,this.weekStart);let o=new Ar;o.setParameterFunc(Pe.now,()=>G.now()),o.setParameter(Pe.useCustomEmojiForTasksPlugin,this.useCustomEmojiForTasksPlugin),o.setParameter(Pe.linkDatesToDailyNotes,this.linkDatesToDailyNotes),o.setParameter(Pe.removeTagsForTasksPlugin,this.removeTagsForTasksPlugin),Wa(o)}forEach(e){this.settings.forEach(e)}},Is=class{constructor(e){this.settings=e;g(this,"settingKeyToFormatName",new Map);g(this,"reminderFormatSettings",[]);g(this,"enableReminderPluginReminderFormat");g(this,"enableTasksPluginReminderFormat");g(this,"enableKanbanPluginReminderFormat");this.enableReminderPluginReminderFormat=this.createUseReminderFormatSetting(ms),this.enableTasksPluginReminderFormat=this.createUseReminderFormatSetting(hs),this.enableKanbanPluginReminderFormat=this.createUseReminderFormatSetting(ps)}createUseReminderFormatSetting(e){let r=`enable${e.name}`,i=this.settings.newSettingBuilder().key(r).name(`Enable ${e.description}`).desc(`Enable ${e.description}`).tag(mt).toggle(e.defaultEnabled).onAnyValueChanged(o=>{var l;o.setInfo(`Example: ${(l=e.format.appendReminder("- [ ] Task 1",G.now()))==null?void 0:l.insertedLine}`)}).build(new ke);return this.settingKeyToFormatName.set(r,e),this.reminderFormatSettings.push(i),i.rawValue.onChanged(()=>{this.updateReminderFormat()}),i}updateReminderFormat(){let e=this.reminderFormatSettings.filter(r=>r.value).map(r=>this.settingKeyToFormatName.get(r.key)).filter(r=>r!==void 0);Aa(e)}};var bi=Ot(xt(),1);var Ps=class{constructor(e){this.date=e}isToday(e){return this.date===void 0?!1:this.date.date()===e.date()&&this.date.month()===e.month()&&this.date.year()===e.year()}isHoliday(){let e=bi.default.localeData().firstDayOfWeek();return[(6-e+7)%7,(0-e+7)%7].includes(this.date.weekday())}},As=class{constructor(e){this.weekStart=e;g(this,"days",[]);let r=e.clone();for(let i=0;i<7;i++)this.days.push(new Ps(r.clone())),r.add(1,"day")}},vi=class{constructor(e,r){this.monthStart=e;g(this,"weeks",[]);g(this,"weekStart");this.weekStart=r||0;let i=e.clone().add(-(e.weekday()-this.weekStart+7)%7,"day");for(let o=0;o<6&&!(o>0&&!this.isThisMonth(i));o++)this.weeks.push(new As(i.clone())),i.add(1,"week")}isThisMonth(e){return this.monthStart.month()===e.month()&&this.monthStart.year()===e.year()}},_i=class n{constructor(e,r,i){g(this,"_current");g(this,"today");g(this,"weekStart");this.weekStart=i||0,e?this.today=e:this.today=(0,bi.default)(),r?this._current=new vi(r.clone().set("date",1),this.weekStart):this._current=new vi(this.today.clone().set("date",1),this.weekStart)}nextMonth(){return new n(this.today,this._current.monthStart.clone().add(1,"month"),this.weekStart)}previousMonth(){return new n(this.today,this._current.monthStart.clone().add(-1,"month"),this.weekStart)}calendarString(){let e=Array.from({length:7},(i,o)=>(0,bi.default)().weekday((this.weekStart+o)%7).format("ddd")).join(" "),r=`${this._current.monthStart.format("YYYY, MMM")}
${e}
`;return this._current.weeks.forEach(i=>{let o=" ";i.days.forEach(l=>{let c;l.date&&this._current.isThisMonth(l.date)?c=l.date.format("DD"):c=" ",o=o+c+" "}),r=r+o+`
`}),r}get current(){return this._current}};var Tr=class{constructor(){g(this,"digits",[]);g(this,"lastInput",0)}handle(e){let r=new Date().getTime();return r-this.lastInput>1e3&&this.clear(),this.lastInput=r,this.digits.push(e),this.digits.join("")}clear(){this.digits=[]}};var ah=n=>({}),wl=n=>({});function xl(n,e,r){let i=n.slice();return i[25]=e[r],i}function kl(n,e,r){let i=n.slice();return i[28]=e[r],i}function Dl(n,e,r){let i=n.slice();return i[28]=e[r],i}function Sl(n){let e,r=n[28]+"",i;return{c(){e=Y("th"),i=Re(r),O(e,"class","svelte-kmxndl")},m(o,l){ne(o,e,l),M(e,i)},p(o,l){l[0]&16&&r!==(r=o[28]+"")&&Ae(i,r)},d(o){o&&X(e)}}}function Tl(n){let e,r,i=n[28].date.format("D")+"",o,l,c;function d(){return n[15](n[28])}function m(){return n[16](n[28])}return{c(){e=Y("td"),r=Y("button"),o=Re(i),O(r,"tabindex","-1"),O(r,"class","calendar-date svelte-kmxndl"),it(r,"is-selected",n[28].isToday(n[0])),it(r,"other-month",!n[1].current.isThisMonth(n[28].date)),it(r,"is-holiday",n[28].isHoliday()),it(r,"is-past",n[28].date.isBefore(n[1].today))},m(h,y){ne(h,e,y),M(e,r),M(r,o),l||(c=[ce(r,"click",d),ce(r,"dblclick",m)],l=!0)},p(h,y){n=h,y[0]&2&&i!==(i=n[28].date.format("D")+"")&&Ae(o,i),y[0]&3&&it(r,"is-selected",n[28].isToday(n[0])),y[0]&2&&it(r,"other-month",!n[1].current.isThisMonth(n[28].date)),y[0]&2&&it(r,"is-holiday",n[28].isHoliday()),y[0]&2&&it(r,"is-past",n[28].date.isBefore(n[1].today))},d(h){h&&X(e),l=!1,Se(c)}}}function Fl(n){let e,r,i=we(n[25].days),o=[];for(let l=0;l<i.length;l+=1)o[l]=Tl(kl(n,i,l));return{c(){e=Y("tr");for(let l=0;l<o.length;l+=1)o[l].c();r=de()},m(l,c){ne(l,e,c);for(let d=0;d<o.length;d+=1)o[d]&&o[d].m(e,null);M(e,r)},p(l,c){if(c[0]&195){i=we(l[25].days);let d;for(d=0;d<i.length;d+=1){let m=kl(l,i,d);o[d]?o[d].p(m,c):(o[d]=Tl(m),o[d].c(),o[d].m(e,r))}for(;d<o.length;d+=1)o[d].d(1);o.length=i.length}},d(l){l&&X(e),nt(o,l)}}}function lh(n){let e,r,i,o,l,c=n[1].current.monthStart.format("MMM")+"",d,m,h,y=n[1].current.monthStart.format("YYYY")+"",w,_,x,b,D,F,T,B,P,N,V,I,be,q,j=we(n[4]),ee=[];for(let C=0;C<j.length;C+=1)ee[C]=Sl(Dl(n,j,C));let ie=we(n[1].current.weeks),E=[];for(let C=0;C<ie.length;C+=1)E[C]=Fl(xl(n,ie,C));let te=n[12].footer,le=tl(te,n,n[11],wl);return{c(){e=Y("div"),r=Y("div"),i=Y("button"),i.textContent="<",o=de(),l=Y("span"),d=Re(c),m=de(),h=Y("span"),w=Re(y),_=de(),x=Y("button"),x.textContent=">",b=de(),D=Y("table"),F=Y("thead"),T=Y("tr");for(let C=0;C<ee.length;C+=1)ee[C].c();B=de(),P=Y("tbody");for(let C=0;C<E.length;C+=1)E[C].c();N=de(),V=Y("div"),le&&le.c(),O(i,"tabindex","-1"),O(i,"class","month-nav svelte-kmxndl"),O(l,"class","month svelte-kmxndl"),O(h,"class","year svelte-kmxndl"),O(x,"tabindex","-1"),O(x,"class","month-nav svelte-kmxndl"),O(r,"class","year-month svelte-kmxndl"),O(V,"class","footer"),O(e,"class","reminder-calendar svelte-kmxndl"),O(e,"tabindex","0"),O(e,"role","grid")},m(C,Je){ne(C,e,Je),M(e,r),M(r,i),M(r,o),M(r,l),M(l,d),M(r,m),M(r,h),M(h,w),M(r,_),M(r,x),M(e,b),M(e,D),M(D,F),M(F,T);for(let H=0;H<ee.length;H+=1)ee[H]&&ee[H].m(T,null);M(D,B),M(D,P);for(let H=0;H<E.length;H+=1)E[H]&&E[H].m(P,null);n[17](D),M(e,N),M(e,V),le&&le.m(V,null),n[18](V),I=!0,be||(q=[ce(i,"click",n[13]),ce(x,"click",n[14]),ce(e,"focus",n[19]),ce(e,"blur",n[20]),ce(e,"keydown",n[10])],be=!0)},p(C,Je){if((!I||Je[0]&2)&&c!==(c=C[1].current.monthStart.format("MMM")+"")&&Ae(d,c),(!I||Je[0]&2)&&y!==(y=C[1].current.monthStart.format("YYYY")+"")&&Ae(w,y),Je[0]&16){j=we(C[4]);let H;for(H=0;H<j.length;H+=1){let Ee=Dl(C,j,H);ee[H]?ee[H].p(Ee,Je):(ee[H]=Sl(Ee),ee[H].c(),ee[H].m(T,null))}for(;H<ee.length;H+=1)ee[H].d(1);ee.length=j.length}if(Je[0]&195){ie=we(C[1].current.weeks);let H;for(H=0;H<ie.length;H+=1){let Ee=xl(C,ie,H);E[H]?E[H].p(Ee,Je):(E[H]=Fl(Ee),E[H].c(),E[H].m(P,null))}for(;H<E.length;H+=1)E[H].d(1);E.length=ie.length}le&&le.p&&(!I||Je[0]&2048)&&il(le,te,C,C[11],I?nl(te,C[11],Je,ah):sl(C[11]),wl)},i(C){I||(ae(le,C),I=!0)},o(C){ye(le,C),I=!1},d(C){C&&X(e),nt(ee,C),nt(E,C),n[17](null),le&&le.d(C),n[18](null),be=!1,Se(q)}}}function uh(n,e,r){let i,o,{$$slots:l={},$$scope:c}=e,{value:d=(0,wi.default)()}=e,m=rn(),h=new Sr,y=Number(h.weekStart.value),w,_;function x(E){r(0,d=E)}function b(E){r(0,d=E),T()}function D(){r(0,d=d.add(-1,"month"))}function F(){r(0,d=d.add(1,"month"))}function T(){m("select",d)}let B=new Tr;function P(E){if(E.key>="0"&&E.key<="9"){E.preventDefault();let te=B.handle(E.key);switch(te.length){case 1:{let le=parseInt(te);le>0&&r(0,d=d.set("date",le));break}case 2:te.startsWith("0")&&(te=te.slice(1)),r(0,d=d.set("date",parseInt(te)));break;case 4:{let le=te.slice(0,2),C=te.slice(2,4);le.startsWith("0")&&(le=le.slice(1)),C.startsWith("0")&&(C=C.slice(1)),r(0,d=d.set("month",parseInt(le)-1)),r(0,d=d.set("date",parseInt(C)))}break}return}B.clear(),E.key==="ArrowLeft"||E.ctrlKey&&E.key==="B"?(r(0,d=d.add(-1,"day")),E.preventDefault()):E.key==="ArrowRight"||E.ctrlKey&&E.key==="F"?(r(0,d=d.add(1,"day")),E.preventDefault()):E.key==="ArrowUp"||E.ctrlKey&&E.key==="P"?r(0,d=d.add(-7,"day")):E.key==="ArrowDown"||E.ctrlKey&&E.key==="N"?(r(0,d=d.add(7,"day")),E.preventDefault()):E.key==="Enter"&&(T(),E.preventDefault())}qt(()=>{r(3,_.style.width=w.clientWidth+"px",_)});let N=()=>D(),V=()=>F(),I=E=>x(E.date),be=E=>b(E.date);function q(E){We[E?"unshift":"push"](()=>{w=E,r(2,w)})}function j(E){We[E?"unshift":"push"](()=>{_=E,r(3,_)})}let ee=()=>{m("focus")},ie=()=>{m("blur")};return n.$$set=E=>{"value"in E&&r(0,d=E.value),"$$scope"in E&&r(11,c=E.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&1&&r(1,i=new _i((0,wi.default)().startOf("day"),d.startOf("day"),y)),n.$$.dirty[0]&2&&r(4,o=Array.from({length:7},(E,te)=>(0,wi.default)().weekday((i.weekStart+te)%7).format("ddd")))},[d,i,w,_,o,m,x,b,D,F,P,c,l,N,V,I,be,q,j,ee,ie]}var Ws=class extends Te{constructor(e){super(),Be(this,e,uh,lh,Ce,{value:0},null,[-1,-1])}},Ml=Ws;function Rl(n,e,r){let i=n.slice();return i[11]=e[r],i}function El(n){let e,r=n[11]+"",i,o;return{c(){e=Y("option"),i=Re(r),e.__value=o=n[11],tn(e,e.__value)},m(l,c){ne(l,e,c),M(e,i)},p:ge,d(l){l&&X(e)}}}function dh(n){let e,r,i,o=we(n[4]),l=[];for(let c=0;c<o.length;c+=1)l[c]=El(Rl(n,o,c));return{c(){e=Y("select");for(let c=0;c<l.length;c+=1)l[c].c();O(e,"class","time-picker svelte-193wkl6"),n[0]===void 0&&Rt(()=>n[7].call(e))},m(c,d){ne(c,e,d);for(let m=0;m<l.length;m+=1)l[m]&&l[m].m(e,null);vr(e,n[0],!0),r||(i=[ce(e,"change",n[7]),ce(e,"dblclick",n[1]),ce(e,"focus",n[2]),ce(e,"blur",n[3]),ce(e,"keydown",n[5])],r=!0)},p(c,[d]){if(d&16){o=we(c[4]);let m;for(m=0;m<o.length;m+=1){let h=Rl(c,o,m);l[m]?l[m].p(h,d):(l[m]=El(h),l[m].c(),l[m].m(e,null))}for(;m<l.length;m+=1)l[m].d(1);l.length=o.length}d&17&&vr(e,c[0])},i:ge,o:ge,d(c){c&&X(e),nt(l,c),r=!1,Se(i)}}}function ch(n,e,r){let{value:i="00:00"}=e,{step:o=15}=e,l=rn();function c(){l("select",i)}function d(){l("focus")}function m(){l("blur")}function h(){let b=[];for(let D=0;D<60*24;D+=o){let F=Math.floor(D/60),T=D%60;b.push(`${F.toString().padStart(2,"0")}:${T.toString().padStart(2,"0")}`)}return b}let y=h(),w=new Tr;function _(b){if(b.key>="0"&&b.key<="9"){b.preventDefault();let D=w.handle(b.key);switch(D.length){case 1:{let F=D.padStart(2,"0"),T=y.filter(B=>B.startsWith(F));T.length>1&&r(0,i=T[0])}break;case 2:{let F=D+":",T=y.filter(B=>B.startsWith(F));T.length>1&&r(0,i=T[0]);break}case 4:{let F=D.slice(0,2)+":"+D.slice(2,4);y.includes(F)&&r(0,i=F)}break}return}if(w.clear(),b.key==="Enter"){c(),b.preventDefault();return}}function x(){i=ni(this),r(0,i),r(4,y)}return n.$$set=b=>{"value"in b&&r(0,i=b.value),"step"in b&&r(6,o=b.step)},[i,c,d,m,y,_,o,x]}var $s=class extends Te{constructor(e){super(),Be(this,e,ch,dh,Ce,{value:0,step:6})}},Ul=$s;function fh(n){let e,r,i,o,l;return o=new ui({props:{reminders:n[1].byDate(new G(n[0],!1))}}),{c(){e=Y("div"),r=Y("hr"),i=de(),Ze(o.$$.fragment),O(r,"class","dtchooser-divider svelte-ps5dkj"),O(e,"slot","footer")},m(c,d){ne(c,e,d),M(e,r),M(e,i),$e(o,e,null),l=!0},p(c,d){let m={};d&3&&(m.reminders=c[1].byDate(new G(c[0],!1))),o.$set(m)},i(c){l||(ae(o.$$.fragment,c),l=!0)},o(c){ye(o.$$.fragment,c),l=!1},d(c){c&&X(e),Ve(o)}}}function mh(n){let e,r,i,o,l,c,d,m,h,y,w,_,x,b,D;function F(N){n[7](N)}let T={$$slots:{footer:[fh]},$$scope:{ctx:n}};n[0]!==void 0&&(T.value=n[0]),r=new Ml({props:T}),We.push(()=>Ts(r,"value",F)),r.$on("select",n[8]);function B(N){n[9](N)}let P={step:n[2]};return n[3]!==void 0&&(P.value=n[3]),h=new Ul({props:P}),We.push(()=>Ts(h,"value",B)),h.$on("select",n[10]),h.$on("focus",n[11]),{c(){e=Y("div"),Ze(r.$$.fragment),o=de(),l=Y("div"),c=Y("div"),d=Y("span"),d.textContent="Time:",m=de(),Ze(h.$$.fragment),w=de(),_=Y("button"),_.textContent="OK",O(d,"class","svelte-ps5dkj"),O(c,"class","dtchooser-time-picker svelte-ps5dkj"),O(_,"class","mod-cta"),O(l,"class","dtchooser-wrapper svelte-ps5dkj"),O(e,"class","dtchooser svelte-ps5dkj")},m(N,V){ne(N,e,V),$e(r,e,null),M(e,o),M(e,l),M(l,c),M(c,d),M(c,m),$e(h,c,null),M(l,w),M(l,_),x=!0,b||(D=ce(_,"click",n[5]),b=!0)},p(N,[V]){let I={};V&4099&&(I.$$scope={dirty:V,ctx:N}),!i&&V&1&&(i=!0,I.value=N[0],Ds(()=>i=!1)),r.$set(I);let be={};V&4&&(be.step=N[2]),!y&&V&8&&(y=!0,be.value=N[3],Ds(()=>y=!1)),h.$set(be)},i(N){x||(ae(r.$$.fragment,N),ae(h.$$.fragment,N),x=!0)},o(N){ye(r.$$.fragment,N),ye(h.$$.fragment,N),x=!1},d(N){N&&X(e),Ve(r),Ve(h),b=!1,D()}}}function hh(n,e,r){var D,F;let{date:i=(0,Yl.default)()}=e,{reminders:o}=e,{onSelect:l}=e,{timeStep:c=15}=e,d=(F=(D=o.reminderTime)==null?void 0:D.value.toString())!=null?F:"10:00",m=!1;function h(){let[T,B]=d.split(":"),P=i.clone();m?(P.set({hour:parseInt(T),minute:parseInt(B)}),l(new G(P,!0))):l(new G(P,!1))}function y(T){i=T,r(0,i)}let w=()=>h();function _(T){d=T,r(3,d)}let x=()=>{h()},b=()=>{r(4,m=!0)};return n.$$set=T=>{"date"in T&&r(0,i=T.date),"reminders"in T&&r(1,o=T.reminders),"onSelect"in T&&r(6,l=T.onSelect),"timeStep"in T&&r(2,c=T.timeStep)},[i,o,c,d,m,h,l,y,w,_,x,b]}var Vs=class extends Te{constructor(e){super(),Be(this,e,hh,mh,Ce,{date:0,reminders:1,onSelect:6,timeStep:2})}},xi=Vs;var js=class extends ki.Modal{constructor(r,i,o,l,c){super(r);this.reminders=i;this.onSelect=o;this.onCancel=l;this.timeStep=c;g(this,"selected")}onOpen(){let r;ki.Platform.isDesktop?(this.modalEl.style.minWidth="0px",this.modalEl.style.minHeight="0px",this.modalEl.style.width="auto",r=this.contentEl):r=this.containerEl,new xi({target:r,props:{onSelect:i=>{this.select(i)},reminders:this.reminders,timeStep:this.timeStep}})}select(r){this.selected=r,this.close()}onClose(){this.selected!=null?this.onSelect(this.selected):this.onCancel()}};function sn(n,e,r=15){return new Promise((i,o)=>{new js(n,e,i,o,r).open()})}var Ol=Ot(xt(),1);var Di=class{constructor(e,r){this.editor=e;g(this,"view");g(this,"dateTimeChooser");g(this,"resultResolve");g(this,"resultReject");this.view=document.createElement("div"),this.view.addClass("date-time-chooser-popup"),this.view.style.position="fixed",this.dateTimeChooser=new xi({target:this.view,props:{onSelect:i=>{this.setResult(i),this.hide()},reminders:r}})}show(){this.setResult(null),this.hide(),this.dateTimeChooser.$set({date:(0,Ol.default)()});let e=this.editor.getCursor(),r=this.editor.charCoords(e),i=document.body,o=i.getBoundingClientRect();return this.view.style.top=`${r.top-o.top+this.editor.defaultTextHeight()}px`,this.view.style.left=`${r.left-o.left}px`,i.appendChild(this.view),new Promise((l,c)=>{this.resultResolve=l,this.resultReject=c})}cancel(){this.setResult(null),this.hide()}setResult(e){this.resultReject==null||this.resultResolve==null||(e===null?this.resultReject():this.resultResolve(e),this.resultReject=void 0,this.resultResolve=void 0)}hide(){this.view.parentNode&&this.view.parentNode.removeChild(this.view)}};var Si=class{constructor(e,r,i){this.trigger=e;this.timeStep=r;this.primaryFormat=i}isTrigger(e,r){let i=this.trigger.value;if(i.length===0)return!1;if(r.text.contains(i.charAt(i.length-1))){let o=e.getLine(r.from.line).substring(0,r.to.ch)+r.text;if(!o.match(/^\s*- \[.\]\s.*/))return!1;if(o.endsWith(i))return!0}return!1}show(e,r,i){let o;if(Ql.Platform.isDesktopApp)try{let l=r.cm;if(l==null){console.error("Cannot get codemirror editor.");return}o=new Di(l,i).show()}catch(l){console.error(l),o=sn(e,i,this.timeStep.value)}else o=sn(e,i,this.timeStep.value);o.then(l=>{this.insert(r,l,!0)}).catch(()=>{})}insert(e,r,i=!1){var m;let o=e.getCursor(),l=e.getLine(o.line),c={line:o.line,ch:l.length};i||(l=l.substring(0,o.ch-this.trigger.value.length));let d=this.primaryFormat.value.format;try{let h=(m=d.appendReminder(l,r))==null?void 0:m.insertedLine;if(h==null){console.error("Cannot append reminder time to the line: line=%s, date=%s",l,r);return}e.replaceRange(h,{line:o.line,ch:0},c)}catch(h){console.error(h)}}};var Ll=require("@codemirror/state"),Nl=require("@codemirror/view");function Cl(n,e,r){return Nl.ViewPlugin.fromClass(class{update(i){i.docChanged&&i.changes.iterChanges((o,l,c,d,m)=>{let h=i.state.doc,y=h.sliceString(d-2,d);if(m.length===0)return;let w=r.autoCompleteTrigger.value,_=r.reminderTimeStep.value;w===y&&sn(n,e,_).then(x=>{let b=r.primaryFormat.value.format;try{let D=h.lineAt(d),F=D.text.lastIndexOf(w),T=F+w.length;w.startsWith("(")&&D.text.charAt(T)===")"&&T++;let B=D.text.substring(0,F)+D.text.substring(T),P=b.appendReminder(B,x,F);if(P==null){console.error("Cannot append reminder time to the line: line=%s, date=%s",D.text,x);return}let N=i.view.state.update({changes:{from:D.from,to:D.to,insert:P.insertedLine},selection:Ll.EditorSelection.cursor(D.from+P.caretPosition)});i.view.update([N])}catch(D){console.error(D)}}).catch(()=>{})})}})}var $l=require("obsidian");var Bl=require("obsidian");function ph(n){let e,r,i,o,l;return{c(){e=Y("div"),r=Y("span"),i=de(),o=Y("span"),l=Re(n[0]),O(r,"class","icon svelte-14sroca"),O(o,"class","text svelte-14sroca"),O(e,"class","icon-text svelte-14sroca")},m(c,d){ne(c,e,d),M(e,r),n[3](r),M(e,i),M(e,o),M(o,l)},p(c,[d]){d&1&&Ae(l,c[0])},i:ge,o:ge,d(c){c&&X(e),n[3](null)}}}function yh(n,e,r){let{icon:i=""}=e,{text:o=""}=e,l;qt(()=>{(0,Bl.setIcon)(l,i)});function c(d){We[d?"unshift":"push"](()=>{l=d,r(1,l)})}return n.$$set=d=>{"icon"in d&&r(2,i=d.icon),"text"in d&&r(0,o=d.text)},[o,l,i,c]}var Hs=class extends Te{constructor(e){super(),Be(this,e,yh,ph,Ce,{icon:2,text:0})}},Ti=Hs;function Il(n,e,r){let i=n.slice();return i[11]=e[r],i[13]=r,i}function Pl(n){let e,r=n[11].label+"",i,o,l;return{c(){e=Y("option"),i=Re(r),e.__value=o=n[13],tn(e,e.__value),e.selected=l=n[5]===n[13]},m(c,d){ne(c,e,d),M(e,i)},p(c,d){d&16&&r!==(r=c[11].label+"")&&Ae(i,r),d&32&&l!==(l=c[5]===c[13])&&(e.selected=l)},d(c){c&&X(e)}}}function gh(n){let e,r,i,o,l,c,d,m,h,y,w,_,x,b,D,F,T,B,P,N,V,I;i=new li({props:{markdown:n[0].title,sourcePath:n[0].file}}),d=new Ti({props:{icon:"link",text:n[0].file}}),_=new Ti({props:{icon:"check-small"}}),F=new Ti({props:{icon:"minus-with-circle",text:"Mute"}});let be=we(n[4]),q=[];for(let j=0;j<be.length;j+=1)q[j]=Pl(Il(n,be,j));return{c(){e=Y("main"),r=Y("h3"),Ze(i.$$.fragment),l=de(),c=Y("button"),Ze(d.$$.fragment),h=de(),y=Y("div"),w=Y("button"),Ze(_.$$.fragment),x=Y("span"),x.textContent="Done",b=de(),D=Y("button"),Ze(F.$$.fragment),T=de(),B=Y("select"),P=Y("option"),P.textContent="Snooze";for(let j=0;j<q.length;j+=1)q[j].c();O(r,"class","reminder-title svelte-1hdpphd"),O(r,"aria-label",o=n[0].title),O(c,"class","reminder-file svelte-1hdpphd"),O(c,"aria-label",m=n[0].file),O(w,"class","mod-cta"),P.selected=!0,P.disabled=!0,P.hidden=!0,P.__value="Snooze",tn(P,P.__value),O(B,"class","dropdown later-select svelte-1hdpphd"),n[5]===void 0&&Rt(()=>n[10].call(B)),O(y,"class","reminder-actions svelte-1hdpphd")},m(j,ee){ne(j,e,ee),M(e,r),$e(i,r,null),M(e,l),M(e,c),$e(d,c,null),M(e,h),M(e,y),M(y,w),$e(_,w,null),M(w,x),n[9](w),M(y,b),M(y,D),$e(F,D,null),M(y,T),M(y,B),M(B,P);for(let ie=0;ie<q.length;ie+=1)q[ie]&&q[ie].m(B,null);vr(B,n[5],!0),N=!0,V||(I=[ce(c,"click",function(){It(n[2])&&n[2].apply(this,arguments)}),ce(w,"click",function(){It(n[1])&&n[1].apply(this,arguments)}),ce(D,"click",function(){It(n[3])&&n[3].apply(this,arguments)}),ce(B,"change",n[10]),ce(B,"change",n[7])],V=!0)},p(j,[ee]){n=j;let ie={};ee&1&&(ie.markdown=n[0].title),ee&1&&(ie.sourcePath=n[0].file),i.$set(ie),(!N||ee&1&&o!==(o=n[0].title))&&O(r,"aria-label",o);let E={};if(ee&1&&(E.text=n[0].file),d.$set(E),(!N||ee&1&&m!==(m=n[0].file))&&O(c,"aria-label",m),ee&48){be=we(n[4]);let te;for(te=0;te<be.length;te+=1){let le=Il(n,be,te);q[te]?q[te].p(le,ee):(q[te]=Pl(le),q[te].c(),q[te].m(B,null))}for(;te<q.length;te+=1)q[te].d(1);q.length=be.length}ee&32&&vr(B,n[5])},i(j){N||(ae(i.$$.fragment,j),ae(d.$$.fragment,j),ae(_.$$.fragment,j),ae(F.$$.fragment,j),N=!0)},o(j){ye(i.$$.fragment,j),ye(d.$$.fragment,j),ye(_.$$.fragment,j),ye(F.$$.fragment,j),N=!1},d(j){j&&X(e),Ve(i),Ve(d),Ve(_),n[9](null),Ve(F),nt(q,j),V=!1,Se(I)}}}function bh(n,e,r){let{reminder:i}=e,{onRemindMeLater:o}=e,{onDone:l}=e,{onOpenFile:c}=e,{onMute:d}=e,m,{laters:h=[]}=e,y;function w(){let b=h[m];b!=null&&o(b.later())}qt(async()=>{await ks(),y.focus()});function _(b){We[b?"unshift":"push"](()=>{y=b,r(6,y)})}function x(){m=ni(this),r(5,m)}return n.$$set=b=>{"reminder"in b&&r(0,i=b.reminder),"onRemindMeLater"in b&&r(8,o=b.onRemindMeLater),"onDone"in b&&r(1,l=b.onDone),"onOpenFile"in b&&r(2,c=b.onOpenFile),"onMute"in b&&r(3,d=b.onMute),"laters"in b&&r(4,h=b.laters)},[i,l,c,d,h,m,y,w,o,_,x]}var Gs=class extends Te{constructor(e){super(),Be(this,e,bh,gh,Ce,{reminder:0,onRemindMeLater:8,onDone:1,onOpenFile:2,onMute:3,laters:4})}},Al=Gs;var Wl=window.require?window.require("electron"):void 0,Fi=class{constructor(e,r,i){this.app=e;this.useSystemNotification=r;this.laters=i}show(e,r,i,o,l){if(!this.isSystemNotification())this.showBuiltinReminder(e,r,i,o,l);else{let c=Wl.remote.Notification,d=new c({title:"Obsidian Reminder",body:e.title});d.on("click",()=>{d.close(),this.showBuiltinReminder(e,r,i,o,l)}),d.on("close",()=>{o()});{let m=this.laters.value;d.on("action",(y,w)=>{if(w===0){i();return}let _=m[w-1];r(_.later())});let h=[{type:"button",text:"Mark as Done"}];m.forEach(y=>{h.push({type:"button",text:y.label})}),d.actions=h}d.show()}}showBuiltinReminder(e,r,i,o,l){new zs(this.app,this.laters.value,e,r,i,o,l).open()}isSystemNotification(){return this.isMobile()?!1:this.useSystemNotification.value}isMobile(){return Wl===void 0}},zs=class extends $l.Modal{constructor(r,i,o,l,c,d,m){super(r);this.laters=i;this.reminder=o;this.onRemindMeLater=l;this.onDone=c;this.onCancel=d;this.onOpenFile=m;g(this,"canceled",!0)}onOpen(){this.reminder.beingDisplayed=!0;let{contentEl:r}=this;new Al({target:r,props:{reminder:this.reminder,laters:this.laters,onRemindMeLater:i=>{this.onRemindMeLater(i),this.canceled=!1,this.close()},onDone:()=>{this.canceled=!1,this.onDone(),this.close()},onOpenFile:()=>{this.canceled=!0,this.onOpenFile(),this.close()},onMute:()=>{this.canceled=!0,this.close()}}})}onClose(){this.reminder.beingDisplayed=!1;let{contentEl:r}=this;r.empty(),this.canceled&&this.onCancel()}};var on=class{constructor(e){this.plugin=e;g(this,"autoComplete");g(this,"editDetector");g(this,"reminderModal");g(this,"viewProxy");this.viewProxy=new ci(this.plugin,r=>{if(r.muteNotification){this.showReminder(r);return}this.openReminderFile(r)}),this.autoComplete=new Si(e.settings.autoCompleteTrigger,e.settings.reminderTimeStep,e.settings.primaryFormat),this.editDetector=new Zs(e.settings.editDetectionSec),this.reminderModal=new Fi(e.app,e.settings.useSystemNotification,e.settings.laters)}onload(){this.plugin.registerView(ft,e=>this.viewProxy.createView(e)),this.plugin.addSettingTab(new Js(this.plugin.app,this.plugin)),this.plugin.registerDomEvent(document,"keydown",()=>{this.editDetector.fileChanged()}),At.Platform.isDesktopApp&&this.plugin.registerEditorExtension(Cl(this.plugin.app,this.plugin.reminders,this.plugin.settings)),qa(this.plugin)}onLayoutReady(){this.plugin.data.debug.value&&Xa(this.plugin),this.viewProxy.openView()}onunload(){this.detachReminderList()}isEditing(){return this.editDetector.isEditing()}invalidate(){this.viewProxy.invalidate()}reload(e=!1){this.viewProxy.reload(e)}showAutoComplete(e){this.autoComplete.show(this.plugin.app,e,this.plugin.reminders)}showReminderModal(e,r,i,o,l){this.reminderModal.show(e,r,i,o,l)}showReminderList(){var e;this.plugin.app.workspace.getLeavesOfType(ft).length||(e=this.plugin.app.workspace.getRightLeaf(!1))==null||e.setViewState({type:ft})}detachReminderList(){this.plugin.app.workspace.getLeavesOfType(ft).forEach(e=>e.detach())}async openReminderFile(e){let r=this.plugin.app.workspace.getLeaf(!1);console.log("Open reminder: ",e);let i=this.plugin.app.vault.getAbstractFileByPath(e.file);if(!(i instanceof At.TFile)){console.error("Cannot open file because it isn't a TFile: %o",i);return}if(await r.openFile(i),!(r.view instanceof At.MarkdownView))return;let o=r.view.editor.getLine(e.rowNumber);r.view.editor.setSelection({line:e.rowNumber,ch:0},{line:e.rowNumber,ch:o.length})}showReminder(e){e.muteNotification=!0,this.showReminderModal(e,r=>{console.info("Remind me later: time=%o",r),e.time=r,e.muteNotification=!1,this.plugin.fileSystem.updateReminder(e,!1),this.plugin.data.save(!0)},()=>{console.info("done"),e.muteNotification=!1,this.plugin.fileSystem.updateReminder(e,!0),this.plugin.reminders.removeReminder(e),this.plugin.data.save(!0)},()=>{console.info("Mute"),e.muteNotification=!0,this.reload(!0)},()=>{console.info("Open"),this.openReminderFile(e)})}},Zs=class{constructor(e){this.editDetectionSec=e;g(this,"lastModified")}fileChanged(){this.lastModified=new Date}isEditing(){return this.editDetectionSec.value<=0||this.lastModified==null?!1:(new Date().getTime()-this.lastModified.getTime())/1e3<this.editDetectionSec.value}},Js=class extends At.PluginSettingTab{constructor(r,i){super(r,i);this.plugin=i}display(){let{containerEl:r}=this;this.plugin.settings.settings.displayOn(r)}};var qs=require("obsidian"),an=class{constructor(e,r,i){this.vault=e;this.reminders=r;this.onRemindersChanged=i}onload(e){[this.vault.on("modify",async r=>{await this.reloadRemindersInFile(r)&&this.onRemindersChanged()}),this.vault.on("delete",async r=>{await this.removeRemindersByFile(r.path)&&this.onRemindersChanged()}),this.vault.on("rename",async(r,i)=>{await this.removeRemindersByFile(i)&&(await this.reloadRemindersInFile(r),this.onRemindersChanged())})].forEach(r=>{e.registerEvent(r)})}async removeRemindersByFile(e){return console.debug("Remove file: path=%s",e),this.reminders.removeByFile(e)}async reloadRemindersInFile(e){if(console.debug("Reload file and collect reminders: file=%s",e.path),!(e instanceof qs.TFile))return console.debug("Cannot read file other than TFile: file=%o",e),!1;if(!this.isMarkdownFile(e))return console.debug("Not a markdown file: file=%o",e),!1;let i=new Ft(e.path,await this.vault.cachedRead(e)).getReminders();if(i.length>0){if(!this.reminders.replaceFile(e.path,i))return!1}else if(!this.reminders.removeByFile(e.path))return!1;return!0}async reloadRemindersInAllFiles(){console.debug("Reload all files and collect reminders"),this.reminders.clear();for(let e of this.vault.getMarkdownFiles())await this.reloadRemindersInFile(e);this.onRemindersChanged()}isMarkdownFile(e){return e.extension.toLowerCase()==="md"}async updateReminder(e,r){let i=this.vault.getAbstractFileByPath(e.file);if(!(i instanceof qs.TFile)){console.error("file is not instance of TFile: %o",i);return}let o=new Ft(i.path,await this.vault.read(i));await o.updateReminder(e,{checked:r,time:e.time}),await this.vault.modify(i,o.getContent())}};var ln=class{constructor(e,r){this.plugin=e;this.reminders=r;g(this,"restoring",!0);g(this,"changed",!1);g(this,"scanned",new jt(!1));g(this,"debug",new jt(!1));g(this,"_settings",new Sr);this.settings.forEach(i=>{i.rawValue.onChanged(()=>{this.restoring||(i.hasTag(mt)&&(this.scanned.value=!1),this.changed=!0)})})}async load(){console.debug("Load reminder plugin data");let e=await this.plugin.loadData();if(!e){this.scanned.value=!1;return}this.scanned.value=e.scanned,e.debug!=null&&(this.debug.value=e.debug);let r=e.settings;this.settings.forEach(i=>{i.load(r)}),e.reminders&&Object.keys(e.reminders).forEach(i=>{let o=e.reminders[i];o&&this.reminders.replaceFile(i,o.map(l=>new cr(i,l.title,G.parse(l.time),l.rowNumber,!1)))}),this.changed=!1,this.restoring&&(this.restoring=!1)}async save(e=!1){if(!e&&!this.changed)return;console.debug("Save reminder plugin data: force=%s, changed=%s",e,this.changed);let r={};this.reminders.fileToReminders.forEach((o,l)=>{r[l]=o.map(c=>({title:c.title,time:c.time.toString(),rowNumber:c.rowNumber}))});let i={};this.settings.forEach(o=>{o.store(i)}),await this.plugin.saveData({scanned:this.scanned.value,reminders:r,debug:this.debug.value,settings:i}),this.changed=!1}get settings(){return this._settings}};var Vl=require("obsidian");var Mi=class extends Vl.Plugin{constructor(r,i){super(r,i);g(this,"_data");g(this,"_ui");g(this,"_reminders");g(this,"_fileSystem");g(this,"_notificationWorker");this._reminders=new Yn(()=>{this.ui&&this.ui.invalidate(),this.data.changed=!0}),this._data=new ln(this,this.reminders),this.reminders.reminderTime=this.settings.reminderTime,ut.setTimeFormat(this.settings.dateFormat,this.settings.dateTimeFormat,this.settings.strictDateFormat),this._ui=new on(this),this._fileSystem=new an(r.vault,this.reminders,()=>{this.ui.reload(!0)}),this._notificationWorker=new Cr(this)}async onload(){this.ui.onload(),this.app.workspace.onLayoutReady(async()=>{await this.data.load(),this.ui.onLayoutReady(),this.fileSystem.onload(this),this._notificationWorker.startPeriodicTask()})}onunload(){this.ui.onunload()}get reminders(){return this._reminders}get ui(){return this._ui}get fileSystem(){return this._fileSystem}get data(){return this._data}get settings(){return this.data.settings}};
/*! Bundled license information:
moment/moment.js:
(*! moment.js *)
(*! version : 2.29.4 *)
(*! authors : Tim Wood, Iskren Chernev, Moment.js contributors *)
(*! license : MIT *)
(*! momentjs.com *)
*/
/* nosourcemap */