`).map(e=>Zf(e.trim()))}function Zf(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 ue(`In${r}${i}`,$o(r))}case"hour":case"hours":{let i=r==1?"hour":"hours";return new ue(`In${r}${i}`,zi(r))}case"day":case"days":{let i=r==1?"day":"days";return new ue(`In${r}${i}`,$f(r))}case"week":case"weeks":{let i=r==1?"week":"weeks";return new ue(`In${r}${i}`,jf(r))}case"month":case"months":{let i=r==1?"month":"months";return new ue(`In${r}${i}`,Vf(r))}case"year":case"years":{let i=r==1?"year":"years";return new ue(`In${r}${i}`,Hf(r))}}}else if(n.startsWith("next")){let e=n.substring(5);switch(e){case"sunday":return new ue("Next Sunday",jt(0));case"monday":return new ue("Next Monday",jt(1));case"tuesday":return new ue("Next Tuesday",jt(2));case"wednesday":return new ue("Next Wednesday",jt(3));case"thursday":return new ue("Next Thursday",jt(4));case"friday":return new ue("Next Friday",jt(5));case"saturday":return new ue("Next Saturday",jt(6));case"day":return new ue("Tomorrow",Zi());case"week":return new ue("Next week",jo());case"month":return new ue("Next month",Gf());case"year":return new ue("Next year",zf());default:throw`Unsupportedweekday:${e}`}}else if(n==="tomorrow")return new ue("Tomorrow",Zi());throw`Unsupportedformat:${n}`}var kh=[new ue("In 30 minutes",$o(30)),new ue("In 1 hours",zi(1)),new ue("In 3 hours",zi(3)),new ue("Tomorrow",Zi()),new ue("Next week",jo())],Ji=class{constructor(){g(this,"dateFormat",new or("YYYY-MM-DD"));g(this,"dateTimeFormat",new or("YYYY-MM-DD HH:mm"));g(this,"strict",new or(!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,ze.default)(e,this.dateTimeFormat.value,r);if(i.isValid())return new H(i,!0);let o=(0,ze.default)(e,this.dateFormat.value,r);return o.isValid()?new H(o,!1):null}toString(e){return e.hasTimePart?e.format(this.dateTimeFormat.value):e.format(this.dateFormat.value)}},ot=new Ji;var ur=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")}},En=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(.
`).map(lm).filter(function(r){return r!==null});return De(De({},e[0]),e[1])}function Hr(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=Wr(o),e}function lm(n){if(n=n.replace(/^\s+|\s+$/,""),!n.length)return null;var e=/^([A-Z]+?)[:;]/.exec(n.toUpperCase());if(!e)return la(n);var r=e[1];switch(r.toUpperCase()){case"RRULE":case"EXRULE":return la(n);case"DTSTART":return Hr(n);default:throw new Error("Unsupported RFC prop ".concat(r," in ").concat(n))}}function la(n){var e=n.replace(/^RRULE:/i,""),r=Hr(e),i=n.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return i.forEach(function(o){var l=o.split("="),c=l[0],f=l[1];switch(c.toUpperCase()){case"FREQ":r.freq=$[f.toUpperCase()];break;case"WKST":r.wkst=qe[f.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var m=um(f),h=c.toLowerCase();r[h]=m;break;case"BYWEEKDAY":case"BYDAY":r.byweekday=cm(f);break;case"DTSTART":case"TZID":var y=Hr(n);r.tzid=y.tzid,r.dtstart=y.dtstart;break;case"UNTIL":r.until=Wr(f);break;case"BYEASTER":r.byeaster=Number(f);break;default:throw new Error("Unknown RRULE property '"+c+"'")}}),r}function um(n){if(n.indexOf(",")!==-1){var e=n.split(",");return e.map(ua)}return ua(n)}function ua(n){return/^[+-]?\d+$/.test(n)?Number(n):n}function cm(n){var e=n.split(",");return e.map(function(r){if(r.length===2)return qe[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=qe[l].weekday;return new be(c,o)})}var zt=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=fr(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:Xo(this.date,this.tzid)},n}();function zr(n){for(var e=[],r="",i=Object.keys(n),o=Object.keys(Vr),l=0;l<i.length;l++)if(i[l]!=="tzid"&&G(o,i[l])){var c=i[l].toUpperCase(),f=n[i[l]],m="";if(!(!se(f)||Te(f)&&!f.length)){switch(c){case"FREQ":m=O.FREQUENCIES[n.freq];break;case"WKST":$e(f)?m=new be(f).toString():m=f.toString();break;case"BYWEEKDAY":c="BYDAY",m=zo(f).map(function(x){return x instanceof be?x:Te(x)?new be(x[0],x[1]):new be(x)}).toString();break;case"DTSTART":r=dm(f,n.tzid);break;case"UNTIL":m=fr(f,!n.tzid);break;default:if(Te(f)){for(var h=[],y=0;y<f.length;y++)h[y]=String(f[y]);m=h.toString()}else m=String(f)}m&&e.push([c,m])}}var w=e.map(function(x){var b=x[0],T=x[1];return"".concat(b,"=").concat(T.toString())}).join(";"),_="";return w!==""&&(_="RRULE:".concat(w)),[r,_].filter(function(x){return!!x}).join(`
`)}},wi=class{unmarshal(e){return qr.find(i=>i.name===e)}marshal(e){return e.name}};var ct="re-scan",xi=class{constructor(){g(this,"settings",new bi);g(this,"reminderTime");g(this,"reminderTimeStep");g(this,"useSystemNotification");g(this,"laters");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,"editDetectionSec");g(this,"reminderCheckIntervalSec");let e=new Hs(this.settings);this.reminderTime=this.settings.newSettingBuilder().key("reminderTime").name("Reminder Time").desc("Time when a reminder with no time part will show").tag(ct).text("09:00").placeHolder("Time (hh:mm)").build(new vi),this.reminderTimeStep=this.settings.newSettingBuilder().key("reminderTimeStep").name("Reminder Time Step (minutes)").desc("Step of time for reminder time (minutes)").number(15).build(new Ce),this.useSystemNotification=this.settings.newSettingBuilder().key("useSystemNotification").name("Use system notification").desc("Use system notification for reminder notifications").toggle(!1).build(new Ce),this.laters=this.settings.newSettingBuilder().key("laters").name("Remind me later").desc("Line-separated list of remind me later items").textArea(`In30minutes
In1hour
In3hours
Tomorrow
Nextweek`).placeHolder(`In30minutes
In1hour
In3hours
Tomorrow
Nextweek`).build(new _i),this.dateFormat=this.settings.newSettingBuilder().key("dateFormat").name("Date format").desc("moment style date format: https://momentjs.com/docs/#/displaying/format/").tag(ct).text("YYYY-MM-DD").placeHolder("YYYY-MM-DD").onAnyValueChanged(o=>{o.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new Ce),this.strictDateFormat=this.settings.newSettingBuilder().key("strictDateFormat").name("Strict Date format").desc("Strictly parse the date and time").tag(ct).toggle(!1).build(new Ce),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(ct).text("YYYY-MM-DD HH:mm").placeHolder("YYYY-MM-DD HH:mm").onAnyValueChanged(o=>{o.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new Ce),this.linkDatesToDailyNotes=this.settings.newSettingBuilder().key("linkDatesToDailyNotes").name("Link dates to daily notes").desc("When toggled, Dates link to daily notes.").tag(ct).toggle(!1).onAnyValueChanged(o=>{o.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new Ce),this.autoCompleteTrigger=this.settings.newSettingBuilder().key("autoCompleteTrigger").name("Calendar popup trigger").desc("Trigger text to show calendar popup").text("(@").placeHolder("(@").onAnyValueChanged(o=>{let l=this.autoCompleteTrigger.value;o.setInfo(`Popupis${l.length===0?"disabled":"enabled"}`)}).build(new Ce);let r=this.settings.newSettingBuilder().key("primaryReminderFormat").name("Primary reminder format").desc("Reminder format for generated reminder by calendar popup").dropdown(qr[0].name);qr.forEach(o=>r.addOption(`${o.description}-${o.example}`,o.name)),this.primaryFormat=r.build(new wi),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(ct).toggle(!1).onAnyValueChanged(o=>{o.setEnabled(e.enableTasksPluginReminderFormat.value)}).build(new Ce),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(ct).toggle(!1).onAnyValueChanged(o=>{o.setEnabled(e.enableTasksPluginReminderFormat.value)}).build(new Ce),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 Ce),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 Ce),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("Advanced").addSettings(this.editDetectionSec,this.reminderCheckIntervalSec);let i=new Ir;i.setParameterFunc(Ne.now,()=>H.now()),i.setParameter(Ne.useCustomEmojiForTasksPlugin,this.useCustomEmojiForTasksPlugin),i.setParameter(Ne.linkDatesToDailyNotes,this.linkDatesToDailyNotes),i.setParameter(Ne