h.replace(/#/,"")).includes(o.timelineTag.replace(/#/,""))&&(u=this.parseTimelineEvents(o,t,i,c),s.push(...u));let m=this.parseFrontmatterEvents(o,c,a,i,l);if(s.push(...m),!s||!s.length){this.removeEventsFromFile(i.path);return}let p=0;for(let h of s){let f=o.events.find(b=>b.note==i.path&&(!h.timestamp||b.timestamp==h.timestamp));(f==null?void 0:f.date.day)==h.date.day&&(f==null?void 0:f.date.month)==h.date.month&&(f==null?void 0:f.date.year)==h.date.year&&((v=f==null?void 0:f.end)==null?void 0:v.day)==((_=h.end)==null?void 0:_.day)&&((g=f==null?void 0:f.end)==null?void 0:g.month)==((d=h.end)==null?void 0:d.month)&&((O=f==null?void 0:f.end)==null?void 0:O.year)==((z=h.end)==null?void 0:z.year)&&(f==null?void 0:f.category)==h.category&&(f==null?void 0:f.name)==h.name&&(!h.timestamp&&!(f==null?void 0:f.timestamp)||(f==null?void 0:f.timestamp)==h.timestamp)||(A.postMessage({type:"update",id:o.id,index:f?o.events.findIndex(b=>b.id==(f==null?void 0:f.id)):-1,event:h,original:f}),p++)}this.debug&&s.length>0&&console.info(\`\${p}/\${s.length} (\${m.length} from frontmatter, \${u.length} from timelines) event operations completed on \${o.name} for \${i.basename}\`)}parseFrontmatterEvents(t,n,r,i,s){let{date:a,end:o}=this.getDates(r,this.parseTitle?i.basename:"");if(!a)return[];if((a==null?void 0:a.month)&&typeof(a==null?void 0:a.month)=="string"){let u=t.static.months.find(m=>m.name==a.month);u?a.month=t.static.months.indexOf(u):a.month=null}else(a==null?void 0:a.month)&&typeof(a==null?void 0:a.month)=="number"&&(a.month=ce(a.month-1,t.static.months.length));if((o==null?void 0:o.month)&&typeof(o==null?void 0:o.month)=="string"){let u=t.static.months.find(m=>m.name==o.month);u?o.month=t.static.months.indexOf(u):o.month=null}else(o==null?void 0:o.month)&&typeof(o==null?void 0:o.month)=="number"&&(o.month=ce(o.month-1,t.static.months.length));let c=Number(\`\${a.year}\${a.month}\${a.day}00\`),l=t.categories.find(u=>(u==null?void 0:u.name)==n);return[{id:fe(6),name:s!=null?s:i.basename,note:i.path,date:a,end:o,category:l==null?void 0:l.id,description:"",auto:!0}]}parseTimelineEvents(t,n,r,i){var o;let s=[],a=new Ft;for(let c of n.matchAll(Ut)){let l=a.parseFromString(c[0],"text/html"),u={class:l.documentElement.getAttribute("class"),dataset:{date:l.documentElement.getAttribute("data-date"),title:l.documentElement.getAttribute("data-title"),class:l.documentElement.getAttribute("data-class"),end:l.documentElement.getAttribute("data-end")},content:l.documentElement.textContent};if(u.class!=="ob-timelines"||!u.dataset.date)continue;let m=Number(u.dataset.date[0]=="-"?+u.dataset.date.substring(1,u.dataset.date.length).split("-").join("")*-1:+u.dataset.date.split("-").join("")),p=u.dataset.date.split(/(?(d==null?void 0:d.name)==u.dataset.class);s.push({id:fe(6),name:(o=u.dataset.title)!=null?o:r.basename,note:r.path,date:v,end:_,timestamp:m,category:g==null?void 0:g.id,description:u.content,auto:!0})}return s}parseDate(t){var n;if(typeof t=="string"){if(!/\\d+[./-]\\d+[./-]\\d+/.test(t))return;try{let[r]=(n=t.match(/\\d+[./-]\\d+[./-]\\d+/))!=null?n:[];if(!r)return;let i=r.split(/[.\\-\\/]/).map(a=>Number(a)),s=[...new Set(this.format.replace(/[^\\w]/g,"").toUpperCase().split(""))];return{year:i[s.indexOf("Y")],month:i[s.indexOf("M")],day:i[s.indexOf("D")]}}catch(r){return}}else return t}getDates(t={},n){let r="fc-date"in t?"fc-date":"fc-start",i;t&&r in t&&(i=t[r]),i||(i=n);let s=this.parseDate(i),a="fc-end"in t?t["fc-end"]:null,o=this.parseDate(a);return{date:s,end:o}}};new ft;
`)}var Kh=class extends Qt.FuzzySuggestModal{constructor(e){super(e.app);this.plugin=e}getItems(){return this.plugin.data.calendars}getItemText(e){return e.name}onChooseItem(e,n){this.chosen=e,this.close()}},Ts=class extends Qt.Component{constructor(e){super();this.plugin=e;this.queue=new Set;this.tree=new Map;this.worker=new Fs}get calendars(){return this.plugin.data.calendars}get metadataCache(){return this.plugin.app.metadataCache}get vault(){return this.plugin.app.vault}onload(){this.plugin.addCommand({id:"rescan-events",name:"Rescan Events",callback:()=>{this.plugin.data.debug&&console.info("Beginning full rescan for calendar events"),this.start()}}),this.plugin.addCommand({id:"rescan-events-for-calendar",name:"Rescan Events for Calendar",callback:()=>{let e=new Kh(this.plugin);e.onClose=()=>{e.chosen&&(this.plugin.data.debug&&console.info("Beginning full rescan for calendar events for calendar "+e.chosen.name),this.start(e.chosen))},e.open()}}),this.worker.postMessage({type:"calendars",calendars:this.calendars}),this.registerEvent(this.plugin.app.workspace.on("fantasy-calendars-updated",()=>{this.worker.postMessage({type:"calendars",calendars:this.calendars})})),this.worker.postMessage({type:"options",parseTitle:this.plugin.data.parseDates,addToDefaultIfMissing:this.plugin.data.addToDefaultIfMissing,format:this.plugin.format,defaultCalendar:this.plugin.defaultCalendar?.name,debug:this.plugin.data.debug}),this.registerEvent(this.plugin.app.workspace.on("fantasy-calendar-settings-change",()=>{this.worker.postMessage({type:"options",parseTitle:this.plugin.data.parseDates,addToDefaultIfMissing:this.plugin.data.addToDefaultIfMissing,format:this.plugin.format,defaultCalendar:this.plugin.defaultCalendar?.name,debug:this.plugin.data.debug})})),this.registerEvent(this.metadataCache.on("changed",e=>{this.queue.has(e.path)||this.startParsing([e.path])})),this.registerEvent(this.vault.on("rename",async(e,n)=>{if(!!this.calendars.length&&e instanceof Qt.TFile){for(let a of this.calendars)a.events=a.events.filter(r=>r.note!=n);this.worker.postMessage({type:"calendars",calendars:this.calendars}),this.startParsing([e.path])}})),this.registerEvent(this.vault.on("delete",async e=>{if(e instanceof Qt.TFile){for(let n of this.calendars){let a=n.events.filter(r=>r.note===e.path);n.events=n.events.filter(r=>r.note!=e.path);for(let r of a)this.addToTree(n,r)}await this.plugin.saveCalendar(),this.plugin.app.workspace.trigger("fantasy-calendars-event-update",this.tree),this.tree=new Map}})),this.worker.addEventListener("message",async e=>{if(e.data.type=="get"){let{path:n}=e.data;this.queue.delete(n);let a=this.plugin.app.vault.getAbstractFileByPath(n);if(a instanceof Qt.TFile){let r=this.metadataCache.getFileCache(a),i=(0,Qt.getAllTags)(r),o=await this.vault.cachedRead(a);this.worker.postMessage({type:"file",path:n,cache:r,file:{path:a.path,basename:a.basename},allTags:i,data:o})}else if(a instanceof Qt.TFolder){let r=a.children.map(i=>i.path);this.startParsing(r)}}}),this.worker.addEventListener("message",async e=>{if(e.data.type=="update"){let{id:n,index:a,event:r,original:i}=e.data,o=this.calendars.find(l=>l.id==n);if(!o)return;a==-1?(this.plugin.data.debug&&console.debug(`Adding '${r.name}' to ${o.name}`),o.events.push(r)):(this.plugin.data.debug&&console.debug(`Updating '${r.name}' in calendar ${o.name}`),o.events.splice(a,a>=0?1:0,r)),this.addToTree(o,r),i&&this.addToTree(o,i)}}),this.worker.addEventListener("message",async e=>{if(e.data.type=="delete"){let{id:n,index:a,event:r}=e.data;if(!r)return;let i=this.calendars.find(o=>o.id==n);if(!i)return;this.plugin.data.debug&&console.debug(`Removing '${r.name}' from ${i.name}`),i.events=i.events.filter(o=>o.id!=r.id),this.addToTree(i,r)}}),this.worker.addEventListener("message",async e=>{e.data.type=="save"&&(this.plugin.data.debug&&console.debug("Received save event from file watcher"),this.plugin.app.workspace.trigger("fantasy-calendars-event-update",this.tree),this.tree=new Map,await this.plugin.saveCalendar())}),this.start()}start(e){let n=e?[e]:this.calendars;if(!n.length)return;let a=new Set;for(let r of n){if(!r||!r.autoParse)continue;let i=this.vault.getAbstractFileByPath(r.path);if(!(!i||!(i instanceof Qt.TFolder)))for(let o of i.children)a.add(o.path)}!a.size||(this.plugin.data.debug&&console.info(e?`Starting rescan for ${e.name} (${a.size})`:`Starting rescan for ${n.length} calendars (${a.size})`),this.startParsing([...a]))}addToTree(e,n){this.tree.has(e.id)||this.tree.set(e.id,new Set);let a=this.tree.get(e.id);if(!a.has(n.date.year)&&(a.add(n.date.year),n.end&&n.end.year!=n.date.year))for(let r=n.date.year+1;r<=n.end.year;r++)a.add(n.date.year)}startParsing(e){for(let n of e)this.queue.add(n);this.worker.postMessage({type:"queue",paths:e})}onunload(){this.worker.terminate(),this.worker=null}};var Ss=Fe(require("obsidian"));var Bs=class{constructor(e){this.plugin=e}getCalendars(){return this.plugin.data.calendars}getMoons(e,n){let a=n?this.plugin.data.calendars.find(({name:s})=>s==n):this.plugin.defaultCalendar??this.plugin.defaultCalendar,r=this.getHelper(a),i=e||r.current,o=r.getDayForDate(i),l=[];for(let[s,d]of o.moons){let u=createSpan();new jn({target:u,props:{moon:s,phase:d}}),l.push({icon:u,moon:s,phase:d})}return l}getDay(e,n=this.plugin.defaultCalendar){if(!e||typeof e!="object"||e.year==null||e.month==null||e.day==null){new Ss.Notice("The Date parameter is required and must have the day, month and year.");return}typeof n=="string"&&(n=this.plugin.data.calendars.find(o=>o.name==n)??this.plugin.defaultCalendar);let a=this.getHelper(n),r;if(typeof e.month=="string"?r=a.data.months.findIndex(o=>o.name==e.month):r=e.month,isNaN(e.year)||isNaN(r)||r==-1||isNaN(e.day)){let o=[];isNaN(e.year)&&o.push("The year must be a number."),(isNaN(r)||r==-1)&&(typeof e.month=="string"?o.push(`Could not find ${e.month} in the Months list for ${a.calendar.name}`):o.push("The month must be a number or the name of a month in the list of months for the selected calendar.")),isNaN(e.day)&&o.push("The year must be a number."),new Ss.Notice(`There was an issue with the provided date.
${o.join(`
-`)}`);return}let i=a.getDayForDate({year:e.year,month:r,day:e.day});return{moons:i.moons,events:i.events,date:i.date,longDate:i.longDate,leapDay:i.leapday,weekday:i.weekday,displayDate:rn(i.date,a.data.months)}}getHelper(e=this.plugin.defaultCalendar){return new La(e,this.plugin)}};var Ns=Fe(Nn());var Qh=ja.Platform.isMacOS?"Meta":"Control",lr={name:null,description:null,id:null,static:{incrementDay:!1,firstWeekDay:null,overflow:!0,weekdays:[],months:[],moons:[],displayMoons:!0,displayDayNumber:!1,leapDays:[],eras:[]},current:{year:null,month:null,day:null},events:[],categories:[],autoParse:!1,path:"/",supportTimelines:!1,syncTimelines:!0,timelineTag:"#timeline"},Xh={addToDefaultIfMissing:!0,calendars:[],configDirectory:null,currentCalendar:null,dailyNotes:!1,dateFormat:"YYYY-MM-DD",defaultCalendar:null,eventPreview:!1,exit:{saving:!1,event:!1,calendar:!1},eventFrontmatter:!1,parseDates:!1,settingsToggleState:{calendars:!1,events:!1,advanced:!0},showIntercalary:!1,version:{major:null,minor:null,patch:null},debug:!1},Ms=class extends ja.Plugin{constructor(){super(...arguments);this.api=new Bs(this);this.watcher=new Ts(this)}async addNewCalendar(e,n){let a=!n||e.name!=n?.name||e.autoParse&&!n?.autoParse||e.path!=n?.path;n==null?this.data.calendars.push(e):this.data.calendars.splice(this.data.calendars.indexOf(n),1,e),this.data.defaultCalendar||(this.data.defaultCalendar=e.id),a&&this.watcher.start(e),await this.saveCalendar()}get currentCalendar(){return this.data.calendars.find(e=>e.id==this.data.currentCalendar)}get canUseDailyNotes(){return this.dailyNotes._loaded}get dailyNotes(){return this.app.internalPlugins.getPluginById("daily-notes")}get canUseTimelines(){return this.app.plugins.getPlugin("obsidian-timelines")!=null}syncTimelines(e){return e.syncTimelines&&this.canUseTimelines}timelineTag(e){let n=e.timelineTag;return this.syncTimelines(e)&&(n=this.app.plugins.getPlugin("obsidian-timelines").settings.timelineTag),/^#/.test(n)||(n=`#${n}`),n??e.timelineTag??""}get format(){return(this.data.dailyNotes&&this.canUseDailyNotes?this.dailyNotes.instance.options.format:this.data.dateFormat)??"YYYY-MM-DD"}get defaultCalendar(){return this.data.calendars.find(e=>e.id==this.data.defaultCalendar)??this.data.calendars[0]}get view(){let e=this.app.workspace.getLeavesOfType(Kt),n=e.length?e[0]:null;if(n&&n.view&&n.view instanceof Hn)return n.view}get full(){let e=this.app.workspace.getLeavesOfType(ua),n=e.length?e[0]:null;if(n&&n.view&&n.view instanceof Hn)return n.view}async onload(){console.log("Loading Fantasy Calendars v"+this.manifest.version),(window.FantasyCalendarAPI=this.api)&&this.register(()=>delete window.FantasyCalendarAPI),this.registerView(Kt,e=>new Hn(this,e)),this.registerView(ua,e=>new Hn(this,e,{full:!0})),this.app.workspace.onLayoutReady(async()=>{await this.loadSettings(),this.watcher.load(),this.addCommands(),this.addSettingTab(new Ei(this)),this.addCalendarView(!0)}),this.addRibbonIcon(Kt,"Open Large Fantasy Calendar",e=>{this.app.workspace.getLeaf(e.getModifierState(Qh)).setViewState({type:ua})})}async onunload(){console.log("Unloading Fantasy Calendars v"+this.manifest.version),this.app.workspace.getLeavesOfType(Kt).forEach(e=>e.detach()),this.app.workspace.getLeavesOfType(ua).forEach(e=>e.detach()),this.watcher.unload()}addCommands(){this.addCommand({id:"open-fantasy-calendar",name:"Open Fantasy Calendar",callback:()=>{this.addCalendarView()}}),this.addCommand({id:"open-big-fantasy-calendar",name:"Open Large Fantasy Calendar",callback:()=>{this.addFullCalendarView()}}),this.addCommand({id:"toggle-moons",name:"Toggle Moons",checkCallback:e=>{let n=this.app.workspace.getLeavesOfType(Kt);if(n&&n.length)return e||n[0].view.toggleMoons(),!0}}),this.addCommand({id:"view-date",name:"View Date",checkCallback:e=>{let n=this.app.workspace.getLeavesOfType(Kt);if(n&&n.length)return e||n[0].view.openDate(),!0}}),this.addCommand({id:"view-date",name:"View Note Event",checkCallback:e=>{let n=this.app.workspace.getLeavesOfType(Kt);if(n&&n.length&&n[0].view instanceof Hn){let a=this.app.workspace.getActiveFile();if(a){let r=n[0].view.calendar.events.find(i=>i.note==a.path);if(r)return e||n[0].view.openDay(r.date),!0}}}})}async addCalendarView(e=!1){e&&this.app.workspace.getLeavesOfType(Kt)?.length||(await this.app.workspace.getRightLeaf(!1).setViewState({type:Kt}),this.view&&this.app.workspace.revealLeaf(this.view.leaf))}async addFullCalendarView(e=!1){e&&this.app.workspace.getLeavesOfType(ua)?.length||(this.app.workspace.getLeaf(!1).setViewState({type:ua}),this.full&&this.app.workspace.revealLeaf(this.full.leaf))}async loadSettings(){if(this.data={...(0,Ns.default)(Xh),...await this.loadData()},this.configDirectory&&await this.app.vault.adapter.exists(this.configFilePath)&&(this.data=Object.assign({},this.data,JSON.parse(await this.app.vault.adapter.read(this.configFilePath)))),!this.data.defaultCalendar&&this.data.calendars.length&&(this.data.defaultCalendar=this.data.calendars[0].id),this.data.calendars.length&&!this.data.calendars.find(e=>e.id==this.data.defaultCalendar)&&(this.data.defaultCalendar=this.data.calendars[0].id),this.data.autoParse&&this.data.calendars.length){for(let e of this.data.calendars)e.autoParse=this.data.autoParse,e.path=this.data.path;delete this.data.autoParse,delete this.data.path}for(let e of this.data.calendars)e.static.eras&&e.static.eras.length&&e.static.eras.some(n=>!n.id)&&(e.static.eras=e.static.eras.map(n=>({...(0,Ns.default)(n),id:n.id??Ze(6),restart:n.restart??!1,endsYear:n.endsYear??!1,event:n.event??!1})));await this.saveSettings(),this.settingsLoaded=!0,this.app.workspace.trigger("fantasy-calendars-settings-loaded")}onSettingsLoad(e){this.settingsLoaded?e():this.app.workspace.on("fantasy-calendars-settings-loaded",()=>e())}async saveCalendar(){await this.saveSettings(),this.app.workspace.trigger("fantasy-calendars-updated")}get configDirectory(){if(!(!this.data||!this.data.configDirectory))return`${this.data.configDirectory}/plugins/fantasy-calendar`}get configFilePath(){if(!!this.data.configDirectory)return`${this.configDirectory}/data.json`}async saveSettings(){await this.saveData(this.data),this.app.workspace.trigger("fantasy-calendar-settings-change")}async saveData(e){if(this.configDirectory)try{await this.app.vault.adapter.exists(this.configDirectory)||await this.app.vault.adapter.mkdir(this.configDirectory),await this.app.vault.adapter.write(this.configFilePath,JSON.stringify(e))}catch(n){console.error(n),new ja.Notice("There was an error saving into the configured directory.")}await super.saveData(e)}};
+`)}`);return}let i=a.getDayForDate({year:e.year,month:r,day:e.day});return{moons:i.moons,events:i.events,date:i.date,longDate:i.longDate,leapDay:i.leapday,weekday:i.weekday,displayDate:rn(i.date,a.data.months)}}async addCategoryToCalendar(e,n=this.plugin.defaultCalendar){if(!e)throw new Error("Category is required.");if(!e.name||!e.color)throw new Error("A category requires a name and a color.");if(e.id||(e.id=ze(6)),typeof n=="string"&&(n=this.plugin.data.calendars.find(a=>a.name==n)??this.plugin.defaultCalendar),!n||typeof n!="object"||!("categories"in n))throw new Error("Invalid calendar provided.");n.categories.push(e),await this.plugin.saveCalendar()}getHelper(e=this.plugin.defaultCalendar){return new Pa(e,this.plugin)}};var Ns=Fe(Nn());var Qh=Wn.Platform.isMacOS?"Meta":"Control",lr={name:null,description:null,id:null,static:{incrementDay:!1,firstWeekDay:null,overflow:!0,weekdays:[],months:[],moons:[],displayMoons:!0,displayDayNumber:!1,leapDays:[],eras:[]},current:{year:null,month:null,day:null},events:[],categories:[],autoParse:!1,path:"/",supportTimelines:!1,syncTimelines:!0,timelineTag:"#timeline"},Xh={addToDefaultIfMissing:!0,calendars:[],configDirectory:null,currentCalendar:null,dailyNotes:!1,dateFormat:"YYYY-MM-DD",defaultCalendar:null,eventPreview:!1,exit:{saving:!1,event:!1,calendar:!1},eventFrontmatter:!1,parseDates:!1,settingsToggleState:{calendars:!1,events:!1,advanced:!0},showIntercalary:!1,version:{major:null,minor:null,patch:null},debug:!1},Ms=class extends Wn.Plugin{constructor(){super(...arguments);this.api=new Bs(this);this.watcher=new Ts(this);this.save=(0,Wn.debounce)(async e=>{if(this.configDirectory)try{await this.app.vault.adapter.exists(this.configDirectory)||await this.app.vault.adapter.mkdir(this.configDirectory),await this.app.vault.adapter.write(this.configFilePath,JSON.stringify(e))}catch(n){console.error(n),new Wn.Notice("There was an error saving into the configured directory.")}await this.saveData(e)},200)}async addNewCalendar(e,n){let a=!n||e.name!=n?.name||e.autoParse&&!n?.autoParse||e.path!=n?.path;n==null?this.data.calendars.push(e):this.data.calendars.splice(this.data.calendars.indexOf(n),1,e),this.data.defaultCalendar||(this.data.defaultCalendar=e.id),a&&this.watcher.start(e),await this.saveCalendar()}get currentCalendar(){return this.data.calendars.find(e=>e.id==this.data.currentCalendar)}get canUseDailyNotes(){return this.dailyNotes._loaded}get dailyNotes(){return this.app.internalPlugins.getPluginById("daily-notes")}get canUseTimelines(){return this.app.plugins.getPlugin("obsidian-timelines")!=null}syncTimelines(e){return e.syncTimelines&&this.canUseTimelines}timelineTag(e){let n=e.timelineTag;return this.syncTimelines(e)&&(n=this.app.plugins.getPlugin("obsidian-timelines").settings.timelineTag),/^#/.test(n)||(n=`#${n}`),n??e.timelineTag??""}get format(){return(this.data.dailyNotes&&this.canUseDailyNotes?this.dailyNotes.instance.options.format:this.data.dateFormat)??"YYYY-MM-DD"}get defaultCalendar(){return this.data.calendars.find(e=>e.id==this.data.defaultCalendar)??this.data.calendars[0]}get view(){let e=this.app.workspace.getLeavesOfType(Kt),n=e.length?e[0]:null;if(n&&n.view&&n.view instanceof Hn)return n.view}get full(){let e=this.app.workspace.getLeavesOfType(ca),n=e.length?e[0]:null;if(n&&n.view&&n.view instanceof Hn)return n.view}async onload(){console.log("Loading Fantasy Calendars v"+this.manifest.version),(window.FantasyCalendarAPI=this.api)&&this.register(()=>delete window.FantasyCalendarAPI),this.registerView(Kt,e=>new Hn(this,e)),this.registerView(ca,e=>new Hn(this,e,{full:!0})),this.app.workspace.onLayoutReady(async()=>{await this.loadSettings(),this.watcher.load(),this.addCommands(),this.addSettingTab(new Ei(this)),this.addCalendarView(!0)}),this.addRibbonIcon(Kt,"Open Large Fantasy Calendar",e=>{this.app.workspace.getLeaf(e.getModifierState(Qh)).setViewState({type:ca})})}async onunload(){console.log("Unloading Fantasy Calendars v"+this.manifest.version),this.app.workspace.getLeavesOfType(Kt).forEach(e=>e.detach()),this.app.workspace.getLeavesOfType(ca).forEach(e=>e.detach()),this.watcher.unload()}addCommands(){this.addCommand({id:"open-fantasy-calendar",name:"Open Fantasy Calendar",callback:()=>{this.addCalendarView()}}),this.addCommand({id:"open-big-fantasy-calendar",name:"Open Large Fantasy Calendar",callback:()=>{this.addFullCalendarView()}}),this.addCommand({id:"toggle-moons",name:"Toggle Moons",checkCallback:e=>{let n=this.app.workspace.getLeavesOfType(Kt);if(n&&n.length)return e||n[0].view.toggleMoons(),!0}}),this.addCommand({id:"view-date",name:"View Date",checkCallback:e=>{let n=this.app.workspace.getLeavesOfType(Kt);if(n&&n.length)return e||n[0].view.openDate(),!0}}),this.addCommand({id:"view-date",name:"View Note Event",checkCallback:e=>{let n=this.app.workspace.getLeavesOfType(Kt);if(n&&n.length&&n[0].view instanceof Hn){let a=this.app.workspace.getActiveFile();if(a){let r=n[0].view.calendar.events.find(i=>i.note==a.path);if(r)return e||n[0].view.openDay(r.date),!0}}}})}async addCalendarView(e=!1){e&&this.app.workspace.getLeavesOfType(Kt)?.length||(await this.app.workspace.getRightLeaf(!1).setViewState({type:Kt}),this.view&&this.app.workspace.revealLeaf(this.view.leaf))}async addFullCalendarView(e=!1){e&&this.app.workspace.getLeavesOfType(ca)?.length||(this.app.workspace.getLeaf(!1).setViewState({type:ca}),this.full&&this.app.workspace.revealLeaf(this.full.leaf))}async loadSettings(){if(this.data={...(0,Ns.default)(Xh),...await this.loadData()},this.configDirectory&&await this.app.vault.adapter.exists(this.configFilePath)&&(this.data=Object.assign({},this.data,JSON.parse(await this.app.vault.adapter.read(this.configFilePath)))),!this.data.defaultCalendar&&this.data.calendars.length&&(this.data.defaultCalendar=this.data.calendars[0].id),this.data.calendars.length&&!this.data.calendars.find(e=>e.id==this.data.defaultCalendar)&&(this.data.defaultCalendar=this.data.calendars[0].id),this.data.autoParse&&this.data.calendars.length){for(let e of this.data.calendars)e.autoParse=this.data.autoParse,e.path=this.data.path;delete this.data.autoParse,delete this.data.path}for(let e of this.data.calendars)e.static.eras&&e.static.eras.length&&e.static.eras.some(n=>!n.id)&&(e.static.eras=e.static.eras.map(n=>({...(0,Ns.default)(n),id:n.id??ze(6),restart:n.restart??!1,endsYear:n.endsYear??!1,event:n.event??!1})));this.data.eventFrontmatter=!1,await this.saveSettings(),this.settingsLoaded=!0,this.app.workspace.trigger("fantasy-calendars-settings-loaded")}onSettingsLoad(e){this.settingsLoaded?e():this.app.workspace.on("fantasy-calendars-settings-loaded",()=>e())}async saveCalendar(){await this.saveSettings(),this.app.workspace.trigger("fantasy-calendars-updated")}get configDirectory(){if(!(!this.data||!this.data.configDirectory))return`${this.data.configDirectory}/plugins/fantasy-calendar`}get configFilePath(){if(!!this.data.configDirectory)return`${this.configDirectory}/data.json`}async saveSettings(){await this.save(this.data),this.app.workspace.trigger("fantasy-calendar-settings-change")}};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
diff --git a/.obsidian/plugins/fantasy-calendar/manifest.json b/.obsidian/plugins/fantasy-calendar/manifest.json
index 68ff0e6..b88ae75 100644
--- a/.obsidian/plugins/fantasy-calendar/manifest.json
+++ b/.obsidian/plugins/fantasy-calendar/manifest.json
@@ -1,7 +1,7 @@
{
"id": "fantasy-calendar",
"name": "Fantasy Calendar",
- "version": "2.3.10",
+ "version": "2.3.11",
"minAppVersion": "0.12.10",
"author": "Jeremy Valentine",
"description": "Fantasy calendars in Obsidian!",
diff --git a/.obsidian/plugins/homepage/main.js b/.obsidian/plugins/homepage/main.js
index d4ca4c9..53ecf69 100644
--- a/.obsidian/plugins/homepage/main.js
+++ b/.obsidian/plugins/homepage/main.js
@@ -1699,6 +1699,7 @@ var DEFAULT = {
momentFormat: "YYYY-MM-DD",
workspace: "Home",
workspaceEnabled: false,
+ openOnStartup: true,
hasRibbonIcon: true,
openMode: Mode.ReplaceAll,
manualOpenMode: Mode.Retain,
@@ -1725,15 +1726,13 @@ var HomepageSettingTab = class extends import_obsidian2.PluginSettingTab {
display() {
var _a;
const workspacesMode = this.plugin.workspacesMode();
+ const dailynotesAutorun = getDailynotesAutorun(this.app);
this.containerEl.empty();
- if (getDailynotesAutorun(this.app)) {
- this.containerEl.insertAdjacentHTML("afterbegin", "Daily Notes' 'Open daily note on startup' setting is not compatible with this plugin, so functionality has been disabled.
");
- }
const suggestor = workspacesMode ? WorkspaceSuggest : FileSuggest;
- const homepageDesc = `The name of the ${workspacesMode ? "workspace" : "note or canvas"} to open on startup.`;
+ const homepageDesc = `The name of the ${workspacesMode ? "workspace" : "note or canvas"} to open.`;
const homepage = workspacesMode ? "workspace" : "defaultNote";
if (this.plugin.settings.useMoment && !workspacesMode) {
- let dateSetting = new import_obsidian2.Setting(this.containerEl).setName("Homepage format").setDesc("A valid Moment format specification determining the note or canvas to be opened on startup.").addMomentFormat((text) => text.setDefaultFormat("YYYY-MM-DD").setValue(this.plugin.settings.momentFormat).onChange((value) => __async(this, null, function* () {
+ let dateSetting = new import_obsidian2.Setting(this.containerEl).setName("Homepage format").setDesc("A valid Moment format specification determining the note or canvas to open.").addMomentFormat((text) => text.setDefaultFormat("YYYY-MM-DD").setValue(this.plugin.settings.momentFormat).onChange((value) => __async(this, null, function* () {
this.plugin.settings.momentFormat = value;
yield this.plugin.saveSettings();
})));
@@ -1755,10 +1754,18 @@ var HomepageSettingTab = class extends import_obsidian2.PluginSettingTab {
if ((_a = this.plugin.workspacePlugin) == null ? void 0 : _a.enabled) {
this.addToggle("Use workspaces", "Open a workspace, instead of a note or canvas, as the homepage.", "workspaceEnabled", (_) => this.display(), true);
}
- let ribbonSetting = this.addToggle("Use ribbon icon", "Show a little house on the ribbon, allowing you to quickly access the homepage.", "hasRibbonIcon", (value) => this.plugin.setIcon(value), true);
- ribbonSetting.settingEl.setAttribute("style", "padding-top: 70px; border-top: none !important");
+ let startupSetting = this.addToggle("Open on startup", "When launching Obsidian, open the homepage.", "openOnStartup", (_) => this.display(), true);
+ if (dailynotesAutorun) {
+ startupSetting.descEl.createDiv({
+ text: `This setting has been disabled, as it isn't compatible with Daily Notes' "Open daily note on startup" functionality. To use it, disable the Daily Notes setting.`,
+ attr: { class: "mod-warning" }
+ });
+ this.disableSetting(startupSetting.settingEl);
+ }
+ startupSetting.settingEl.style.cssText += "padding-top: 30px; border-top: none !important";
+ this.addToggle("Use ribbon icon", "Show a little house on the ribbon, allowing you to quickly access the homepage.", "hasRibbonIcon", (value) => this.plugin.setIcon(value), true);
this.addHeading("Vault environment");
- this.addDropdown("Opening method", "Determine how extant tabs and panes are affected on startup.", "openMode", Mode);
+ let openingSetting = this.addDropdown("Opening method", "Determine how extant tabs and panes are affected on startup.", "openMode", Mode);
this.addDropdown("Manual opening method", "Determine how extant tabs and panes are affected when opening with commands or the ribbon button.", "manualOpenMode", Mode);
this.addToggle("Auto-create", "If the homepage doesn't exist, create a note with the specified name.", "autoCreate");
this.addToggle("Pin", "Pin the homepage when opening.", "pin");
@@ -1767,15 +1774,18 @@ var HomepageSettingTab = class extends import_obsidian2.PluginSettingTab {
this.addToggle("Revert view on close", "When navigating away from the homepage, restore the default view.", "revertView", (value) => this.plugin.setReversion(value));
this.addToggle("Auto-scroll", "When opening the homepage, scroll to the bottom and focus on the last line.", "autoScroll");
if (getDataviewPlugin(this.plugin.app)) {
- let refreshSetting = this.addToggle("Refresh Dataview", "Always attempt to reload Dataview views when opening the homepage.", "refreshDataview");
- refreshSetting.descEl.createDiv({
+ this.addToggle("Refresh Dataview", "Always attempt to reload Dataview views when opening the homepage.", "refreshDataview").descEl.createDiv({
text: "Requires Dataview auto-refresh to be enabled.",
attr: { class: "mod-warning" }
});
}
- if (workspacesMode) {
- Array.from(document.getElementsByClassName(HIDDEN)).forEach((s) => s.setAttribute("style", "opacity: .5; pointer-events: none !important"));
- }
+ if (workspacesMode)
+ Array.from(document.getElementsByClassName(HIDDEN)).forEach(this.disableSetting);
+ if (!this.settings.openOnStartup || dailynotesAutorun)
+ this.disableSetting(openingSetting.settingEl);
+ }
+ disableSetting(setting) {
+ setting.setAttribute("style", "opacity: .5; pointer-events: none !important;");
}
addHeading(name) {
const heading = new import_obsidian2.Setting(this.containerEl).setHeading().setName(name);
@@ -1894,7 +1904,7 @@ var Homepage = class extends import_obsidian3.Plugin {
return yield ntp._checkForNewTab(e);
});
}
- if (activeInitially)
+ if (activeInitially && this.settings.openOnStartup)
yield this.openHomepage();
this.loaded = true;
}));
@@ -1961,8 +1971,7 @@ var Homepage = class extends import_obsidian3.Plugin {
});
this.executing = true;
this.homepage = this.getHomepageName();
- if (getDailynotesAutorun(this.app)) {
- new import_obsidian3.Notice("Daily Notes' 'Open daily note on startup' setting is not compatible with Homepage. Disable one of the conflicting plugins.");
+ if (getDailynotesAutorun(this.app) && !this.loaded) {
return;
} else if (!this.settings.autoCreate && (yield nonextant())) {
new import_obsidian3.Notice(`Homepage "${this.homepage}" does not exist.`);
diff --git a/.obsidian/plugins/homepage/manifest.json b/.obsidian/plugins/homepage/manifest.json
index 75d5dca..dfb31b7 100644
--- a/.obsidian/plugins/homepage/manifest.json
+++ b/.obsidian/plugins/homepage/manifest.json
@@ -1,7 +1,7 @@
{
"id": "homepage",
"name": "Homepage",
- "version": "2.7.4",
+ "version": "2.8.1",
"minAppVersion": "1.0",
"description": "Open a specified note, canvas, or workspace on startup.",
"author": "novov",
diff --git a/.obsidian/plugins/obsidian-projects/data.json b/.obsidian/plugins/obsidian-projects/data.json
index 0a1cec7..bac9c16 100644
--- a/.obsidian/plugins/obsidian-projects/data.json
+++ b/.obsidian/plugins/obsidian-projects/data.json
@@ -1,17 +1,33 @@
{
+ "version": 2,
"projects": [
{
- "id": "6fad7d3e-5f03-47ae-8c3d-847630a0286c",
"name": "PNJ",
- "path": "PNJ",
- "recursive": true,
+ "id": "6fad7d3e-5f03-47ae-8c3d-847630a0286c",
+ "fieldConfig": {
+ "class": {
+ "options": [
+ "Prolétariat",
+ "Religieux",
+ "Politique",
+ "Divin",
+ "Pègre"
+ ]
+ },
+ "status": {
+ "options": [
+ "TODO",
+ "WIP",
+ "DONE"
+ ]
+ }
+ },
"defaultName": "",
"templates": [],
+ "excludedNotes": [],
+ "isDefault": false,
"views": [
{
- "id": "abe285ba-ef0c-48f8-9b1e-947d7b45fc83",
- "name": "Table",
- "type": "table",
"config": {
"fieldConfig": {
"Avatars": {
@@ -72,6 +88,9 @@
"sortField": "class",
"sortAsc": true
},
+ "filter": {
+ "conditions": []
+ },
"colors": {
"conditions": [
{
@@ -106,12 +125,12 @@
}
}
]
- }
+ },
+ "id": "abe285ba-ef0c-48f8-9b1e-947d7b45fc83",
+ "name": "Table",
+ "type": "table"
},
{
- "id": "63645eb2-4562-4c61-842f-b7a5dd4e3d17",
- "name": "Board",
- "type": "board",
"config": {
"groupByField": "status",
"columns": {
@@ -128,52 +147,52 @@
"weight": 3
}
}
- }
+ },
+ "filter": {
+ "conditions": []
+ },
+ "colors": {
+ "conditions": []
+ },
+ "id": "63645eb2-4562-4c61-842f-b7a5dd4e3d17",
+ "name": "Board",
+ "type": "board"
},
{
- "id": "01f7e93f-eae0-45d9-b8e9-e2390d99593a",
- "name": "Gallery",
- "type": "gallery",
"config": {
"coverField": "image",
"fitStyle": "contain"
- }
+ },
+ "filter": {
+ "conditions": []
+ },
+ "colors": {
+ "conditions": []
+ },
+ "id": "01f7e93f-eae0-45d9-b8e9-e2390d99593a",
+ "name": "Gallery",
+ "type": "gallery"
}
],
- "dataview": false,
- "query": "TABLE type AS \"Type\", image AS image\n",
- "excludedNotes": [],
- "fieldConfig": {
- "class": {
- "options": [
- "Prolétariat",
- "Religieux",
- "Politique",
- "Divin",
- "Pègre"
- ]
- },
- "status": {
- "options": [
- "TODO",
- "WIP",
- "DONE"
- ]
+ "newNotesFolder": "",
+ "dataSource": {
+ "kind": "folder",
+ "config": {
+ "path": "PNJ",
+ "recursive": true
}
}
},
{
- "id": "c404306f-e64f-44a4-8420-f1f305c0724c",
"name": "Lieux",
- "path": "Locations",
- "recursive": true,
+ "id": "c404306f-e64f-44a4-8420-f1f305c0724c",
+ "fieldConfig": {},
"defaultName": "",
"templates": [],
+ "excludedNotes": [],
+ "isDefault": false,
"views": [
{
- "id": "f8a8c207-7a4e-43ed-b688-24c130d7c36e",
- "name": "Table",
- "type": "table",
"config": {
"fieldConfig": {
"banner": {
@@ -183,20 +202,32 @@
"hide": true
}
}
- }
+ },
+ "filter": {
+ "conditions": []
+ },
+ "colors": {
+ "conditions": []
+ },
+ "id": "f8a8c207-7a4e-43ed-b688-24c130d7c36e",
+ "name": "Table",
+ "type": "table"
},
{
- "id": "eebb97fd-6a92-4e58-b47b-f10f1c269043",
- "name": "Board",
- "type": "board",
"config": {
"groupByField": "status"
- }
+ },
+ "filter": {
+ "conditions": []
+ },
+ "colors": {
+ "conditions": []
+ },
+ "id": "eebb97fd-6a92-4e58-b47b-f10f1c269043",
+ "name": "Board",
+ "type": "board"
},
{
- "id": "88e6a45b-648f-4a7c-b0ff-18ee0c78128a",
- "name": "Board 1",
- "type": "board",
"config": {
"groupByField": "type",
"columns": {
@@ -213,66 +244,107 @@
"weight": 3
}
}
- }
- }
- ]
- },
- {
- "id": "b748eaec-7198-4404-b03d-6187c3d1f8f7",
- "name": "Quêtes",
- "path": "Scénario/Quêtes",
- "recursive": true,
- "defaultName": "",
- "templates": [],
- "fieldConfig": {},
- "views": [
- {
- "id": "fc505f4f-5c5e-41fd-8d8c-a24d26cd43b5",
- "name": "Table",
- "type": "table",
- "config": {}
+ },
+ "filter": {
+ "conditions": []
+ },
+ "colors": {
+ "conditions": []
+ },
+ "id": "88e6a45b-648f-4a7c-b0ff-18ee0c78128a",
+ "name": "Board 1",
+ "type": "board"
}
],
- "dataview": false
+ "newNotesFolder": "",
+ "dataSource": {
+ "kind": "folder",
+ "config": {
+ "path": "Locations",
+ "recursive": true
+ }
+ }
},
{
- "id": "a75ff437-fb86-47f2-9a08-0b5f664d3124",
- "name": "Scenes",
- "path": "Scenes",
- "recursive": true,
+ "name": "Quêtes",
+ "id": "b748eaec-7198-4404-b03d-6187c3d1f8f7",
+ "fieldConfig": {},
"defaultName": "",
"templates": [],
- "fieldConfig": {},
+ "excludedNotes": [],
+ "isDefault": false,
"views": [
{
- "id": "4dc257c7-7fbd-43f6-a2ce-6fa1121ece84",
+ "config": {},
+ "filter": {
+ "conditions": []
+ },
+ "colors": {
+ "conditions": []
+ },
+ "id": "fc505f4f-5c5e-41fd-8d8c-a24d26cd43b5",
"name": "Table",
- "type": "table",
+ "type": "table"
+ }
+ ],
+ "newNotesFolder": "",
+ "dataSource": {
+ "kind": "folder",
+ "config": {
+ "path": "Scénario/Quêtes",
+ "recursive": true
+ }
+ }
+ },
+ {
+ "name": "Scenes",
+ "id": "a75ff437-fb86-47f2-9a08-0b5f664d3124",
+ "fieldConfig": {},
+ "defaultName": "",
+ "templates": [],
+ "excludedNotes": [],
+ "isDefault": false,
+ "views": [
+ {
"config": {
"fieldConfig": {
"alias": {
"hide": true
}
}
- }
+ },
+ "filter": {
+ "conditions": []
+ },
+ "colors": {
+ "conditions": []
+ },
+ "id": "4dc257c7-7fbd-43f6-a2ce-6fa1121ece84",
+ "name": "Table",
+ "type": "table"
}
- ]
+ ],
+ "newNotesFolder": "",
+ "dataSource": {
+ "kind": "folder",
+ "config": {
+ "path": "Scenes",
+ "recursive": true
+ }
+ }
},
{
- "id": "f96d231c-f717-4738-b055-3923edb416ac",
"name": "Factions",
- "path": "Factions",
- "recursive": true,
+ "id": "f96d231c-f717-4738-b055-3923edb416ac",
+ "fieldConfig": {},
"defaultName": "",
"templates": [
"Templates/Organisations.md"
],
- "fieldConfig": {},
+ "excludedNotes": [],
+ "isDefault": false,
"views": [
{
- "id": "71c6b47a-9b3d-4023-be85-35b9e3a96ef5",
- "name": "Table",
- "type": "table",
"config": {
"fieldConfig": {
"banner_y": {
@@ -291,11 +363,32 @@
"hide": true
}
}
- }
+ },
+ "filter": {
+ "conditions": []
+ },
+ "colors": {
+ "conditions": []
+ },
+ "id": "71c6b47a-9b3d-4023-be85-35b9e3a96ef5",
+ "name": "Table",
+ "type": "table"
}
],
- "dataview": false
+ "newNotesFolder": "",
+ "dataSource": {
+ "kind": "folder",
+ "config": {
+ "path": "Factions",
+ "recursive": true
+ }
+ }
}
],
- "version": 1
+ "preferences": {
+ "projectSizeLimit": 1000,
+ "frontmatter": {
+ "quoteStrings": "PLAIN"
+ }
+ }
}
\ No newline at end of file
diff --git a/.obsidian/plugins/obsidian-projects/main.js b/.obsidian/plugins/obsidian-projects/main.js
index d51731a..85238d9 100644
--- a/.obsidian/plugins/obsidian-projects/main.js
+++ b/.obsidian/plugins/obsidian-projects/main.js
@@ -60,7 +60,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __async = (__this, __arguments, generator) => {
- return new Promise((resolve, reject) => {
+ return new Promise((resolve3, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
@@ -75,7 +75,7 @@ var __async = (__this, __arguments, generator) => {
reject(e);
}
};
- var step = (x2) => x2.done ? resolve(x2.value) : Promise.resolve(x2.value).then(fulfilled, rejected);
+ var step = (x2) => x2.done ? resolve3(x2.value) : Promise.resolve(x2.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
@@ -351,6 +351,271 @@ var require_localizedFormat = __commonJS({
}
});
+// node_modules/fp-ts/lib/function.js
+var require_function = __commonJS({
+ "node_modules/fp-ts/lib/function.js"(exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.getEndomorphismMonoid = exports.not = exports.SK = exports.hole = exports.pipe = exports.untupled = exports.tupled = exports.absurd = exports.decrement = exports.increment = exports.tuple = exports.flow = exports.flip = exports.constVoid = exports.constUndefined = exports.constNull = exports.constFalse = exports.constTrue = exports.constant = exports.unsafeCoerce = exports.identity = exports.apply = exports.getRing = exports.getSemiring = exports.getMonoid = exports.getSemigroup = exports.getBooleanAlgebra = void 0;
+ var getBooleanAlgebra2 = function(B2) {
+ return function() {
+ return {
+ meet: function(x2, y2) {
+ return function(a2) {
+ return B2.meet(x2(a2), y2(a2));
+ };
+ },
+ join: function(x2, y2) {
+ return function(a2) {
+ return B2.join(x2(a2), y2(a2));
+ };
+ },
+ zero: function() {
+ return B2.zero;
+ },
+ one: function() {
+ return B2.one;
+ },
+ implies: function(x2, y2) {
+ return function(a2) {
+ return B2.implies(x2(a2), y2(a2));
+ };
+ },
+ not: function(x2) {
+ return function(a2) {
+ return B2.not(x2(a2));
+ };
+ }
+ };
+ };
+ };
+ exports.getBooleanAlgebra = getBooleanAlgebra2;
+ var getSemigroup7 = function(S2) {
+ return function() {
+ return {
+ concat: function(f2, g2) {
+ return function(a2) {
+ return S2.concat(f2(a2), g2(a2));
+ };
+ }
+ };
+ };
+ };
+ exports.getSemigroup = getSemigroup7;
+ var getMonoid5 = function(M2) {
+ var getSemigroupM = (0, exports.getSemigroup)(M2);
+ return function() {
+ return {
+ concat: getSemigroupM().concat,
+ empty: function() {
+ return M2.empty;
+ }
+ };
+ };
+ };
+ exports.getMonoid = getMonoid5;
+ var getSemiring2 = function(S2) {
+ return {
+ add: function(f2, g2) {
+ return function(x2) {
+ return S2.add(f2(x2), g2(x2));
+ };
+ },
+ zero: function() {
+ return S2.zero;
+ },
+ mul: function(f2, g2) {
+ return function(x2) {
+ return S2.mul(f2(x2), g2(x2));
+ };
+ },
+ one: function() {
+ return S2.one;
+ }
+ };
+ };
+ exports.getSemiring = getSemiring2;
+ var getRing2 = function(R2) {
+ var S2 = (0, exports.getSemiring)(R2);
+ return {
+ add: S2.add,
+ mul: S2.mul,
+ one: S2.one,
+ zero: S2.zero,
+ sub: function(f2, g2) {
+ return function(x2) {
+ return R2.sub(f2(x2), g2(x2));
+ };
+ }
+ };
+ };
+ exports.getRing = getRing2;
+ var apply2 = function(a2) {
+ return function(f2) {
+ return f2(a2);
+ };
+ };
+ exports.apply = apply2;
+ function identity3(a2) {
+ return a2;
+ }
+ exports.identity = identity3;
+ exports.unsafeCoerce = identity3;
+ function constant2(a2) {
+ return function() {
+ return a2;
+ };
+ }
+ exports.constant = constant2;
+ exports.constTrue = constant2(true);
+ exports.constFalse = constant2(false);
+ exports.constNull = constant2(null);
+ exports.constUndefined = constant2(void 0);
+ exports.constVoid = exports.constUndefined;
+ function flip4(f2) {
+ return function() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ if (args.length > 1) {
+ return f2(args[1], args[0]);
+ }
+ return function(a2) {
+ return f2(a2)(args[0]);
+ };
+ };
+ }
+ exports.flip = flip4;
+ function flow2(ab, bc, cd, de, ef, fg, gh, hi, ij) {
+ switch (arguments.length) {
+ case 1:
+ return ab;
+ case 2:
+ return function() {
+ return bc(ab.apply(this, arguments));
+ };
+ case 3:
+ return function() {
+ return cd(bc(ab.apply(this, arguments)));
+ };
+ case 4:
+ return function() {
+ return de(cd(bc(ab.apply(this, arguments))));
+ };
+ case 5:
+ return function() {
+ return ef(de(cd(bc(ab.apply(this, arguments)))));
+ };
+ case 6:
+ return function() {
+ return fg(ef(de(cd(bc(ab.apply(this, arguments))))));
+ };
+ case 7:
+ return function() {
+ return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));
+ };
+ case 8:
+ return function() {
+ return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));
+ };
+ case 9:
+ return function() {
+ return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));
+ };
+ }
+ return;
+ }
+ exports.flow = flow2;
+ function tuple2() {
+ var t3 = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ t3[_i] = arguments[_i];
+ }
+ return t3;
+ }
+ exports.tuple = tuple2;
+ function increment2(n2) {
+ return n2 + 1;
+ }
+ exports.increment = increment2;
+ function decrement2(n2) {
+ return n2 - 1;
+ }
+ exports.decrement = decrement2;
+ function absurd2(_24) {
+ throw new Error("Called `absurd` function which should be uncallable");
+ }
+ exports.absurd = absurd2;
+ function tupled2(f2) {
+ return function(a2) {
+ return f2.apply(void 0, a2);
+ };
+ }
+ exports.tupled = tupled2;
+ function untupled2(f2) {
+ return function() {
+ var a2 = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ a2[_i] = arguments[_i];
+ }
+ return f2(a2);
+ };
+ }
+ exports.untupled = untupled2;
+ function pipe3(a2, ab, bc, cd, de, ef, fg, gh, hi) {
+ switch (arguments.length) {
+ case 1:
+ return a2;
+ case 2:
+ return ab(a2);
+ case 3:
+ return bc(ab(a2));
+ case 4:
+ return cd(bc(ab(a2)));
+ case 5:
+ return de(cd(bc(ab(a2))));
+ case 6:
+ return ef(de(cd(bc(ab(a2)))));
+ case 7:
+ return fg(ef(de(cd(bc(ab(a2))))));
+ case 8:
+ return gh(fg(ef(de(cd(bc(ab(a2)))))));
+ case 9:
+ return hi(gh(fg(ef(de(cd(bc(ab(a2))))))));
+ default: {
+ var ret = arguments[0];
+ for (var i2 = 1; i2 < arguments.length; i2++) {
+ ret = arguments[i2](ret);
+ }
+ return ret;
+ }
+ }
+ }
+ exports.pipe = pipe3;
+ exports.hole = absurd2;
+ var SK2 = function(_24, b2) {
+ return b2;
+ };
+ exports.SK = SK2;
+ function not3(predicate) {
+ return function(a2) {
+ return !predicate(a2);
+ };
+ }
+ exports.not = not3;
+ var getEndomorphismMonoid2 = function() {
+ return {
+ concat: function(first, second) {
+ return flow2(first, second);
+ },
+ empty: identity3
+ };
+ };
+ exports.getEndomorphismMonoid = getEndomorphismMonoid2;
+ }
+});
+
// node_modules/obsidian-dataview/lib/index.js
var require_lib = __commonJS({
"node_modules/obsidian-dataview/lib/index.js"(exports) {
@@ -432,10 +697,10 @@ var require_lib = __commonJS({
var a2 = [null];
a2.push.apply(a2, args2);
var Constructor = Function.bind.apply(Parent2, a2);
- var instance107 = new Constructor();
+ var instance113 = new Constructor();
if (Class2)
- _setPrototypeOf2(instance107, Class2.prototype);
- return instance107;
+ _setPrototypeOf2(instance113, Class2.prototype);
+ return instance113;
};
}
return _construct.apply(null, arguments);
@@ -1643,7 +1908,7 @@ var require_lib = __commonJS({
var singleton2 = null;
var FixedOffsetZone = /* @__PURE__ */ function(_Zone) {
_inheritsLoose(FixedOffsetZone2, _Zone);
- FixedOffsetZone2.instance = function instance107(offset3) {
+ FixedOffsetZone2.instance = function instance113(offset3) {
return offset3 === 0 ? FixedOffsetZone2.utcInstance : new FixedOffsetZone2(offset3);
};
FixedOffsetZone2.parseSpecifier = function parseSpecifier(s3) {
@@ -6134,7 +6399,7 @@ var require_lib = __commonJS({
return { type: "widget", value: val };
else if (isArray(val))
return { type: "array", value: val };
- else if (isLink3(val))
+ else if (isLink(val))
return { type: "link", value: val };
else if (isFunction(val))
return { type: "function", value: val };
@@ -6333,10 +6598,10 @@ var require_lib = __commonJS({
return typeof val === "boolean";
}
Values2.isBoolean = isBoolean2;
- function isLink3(val) {
- return val instanceof Link;
+ function isLink(val) {
+ return val instanceof Link2;
}
- Values2.isLink = isLink3;
+ Values2.isLink = isLink;
function isWidget(val) {
return val instanceof Widget;
}
@@ -6350,7 +6615,7 @@ var require_lib = __commonJS({
}
Values2.isHtml = isHtml;
function isObject(val) {
- return typeof val == "object" && !isHtml(val) && !isWidget(val) && !isArray(val) && !isDuration(val) && !isDate4(val) && !isLink3(val) && val !== void 0 && !isNull(val);
+ return typeof val == "object" && !isHtml(val) && !isWidget(val) && !isArray(val) && !isDuration(val) && !isDate4(val) && !isLink(val) && val !== void 0 && !isNull(val);
}
Values2.isObject = isObject;
function isFunction(val) {
@@ -6383,12 +6648,12 @@ var require_lib = __commonJS({
}
Groupings2.count = count;
})(Groupings || (Groupings = {}));
- var Link = class {
+ var Link2 = class {
constructor(fields) {
Object.assign(this, fields);
}
static file(path, embed = false, display) {
- return new Link({
+ return new Link2({
path,
embed,
display,
@@ -6399,15 +6664,15 @@ var require_lib = __commonJS({
static infer(linkpath, embed = false, display) {
if (linkpath.includes("#^")) {
let split = linkpath.split("#^");
- return Link.block(split[0], split[1], embed, display);
+ return Link2.block(split[0], split[1], embed, display);
} else if (linkpath.includes("#")) {
let split = linkpath.split("#");
- return Link.header(split[0], split[1], embed, display);
+ return Link2.header(split[0], split[1], embed, display);
} else
- return Link.file(linkpath, embed, display);
+ return Link2.file(linkpath, embed, display);
}
static header(path, header, embed, display) {
- return new Link({
+ return new Link2({
path,
embed,
display,
@@ -6416,7 +6681,7 @@ var require_lib = __commonJS({
});
}
static block(path, blockId, embed, display) {
- return new Link({
+ return new Link2({
path,
embed,
display,
@@ -6425,7 +6690,7 @@ var require_lib = __commonJS({
});
}
static fromObject(object) {
- return new Link(object);
+ return new Link2(object);
}
equals(other) {
if (other == void 0 || other == null)
@@ -6439,22 +6704,22 @@ var require_lib = __commonJS({
return { path: this.path, type: this.type, subpath: this.subpath, display: this.display, embed: this.embed };
}
withPath(path) {
- return new Link(Object.assign({}, this, { path }));
+ return new Link2(Object.assign({}, this, { path }));
}
withDisplay(display) {
- return new Link(Object.assign({}, this, { display }));
+ return new Link2(Object.assign({}, this, { display }));
}
withHeader(header) {
- return Link.header(this.path, header, this.embed, this.display);
+ return Link2.header(this.path, header, this.embed, this.display);
}
toFile() {
- return Link.file(this.path, this.embed, this.display);
+ return Link2.file(this.path, this.embed, this.display);
}
toEmbed() {
if (this.embed) {
return this;
} else {
- let link = new Link(this);
+ let link = new Link2(this);
link.embed = true;
return link;
}
@@ -6463,7 +6728,7 @@ var require_lib = __commonJS({
if (!this.embed) {
return this;
} else {
- let link = new Link(this);
+ let link = new Link2(this);
link.embed = false;
return link;
}
@@ -6689,17 +6954,17 @@ var require_lib = __commonJS({
};
var KEYWORDS = ["FROM", "WHERE", "LIMIT", "GROUP", "FLATTEN"];
function splitOnUnescapedPipe(link) {
- let pipe2 = -1;
- while ((pipe2 = link.indexOf("|", pipe2 + 1)) >= 0) {
- if (pipe2 > 0 && link[pipe2 - 1] == "\\")
+ let pipe3 = -1;
+ while ((pipe3 = link.indexOf("|", pipe3 + 1)) >= 0) {
+ if (pipe3 > 0 && link[pipe3 - 1] == "\\")
continue;
- return [link.substring(0, pipe2).replace(/\\\|/g, "|"), link.substring(pipe2 + 1)];
+ return [link.substring(0, pipe3).replace(/\\\|/g, "|"), link.substring(pipe3 + 1)];
}
return [link.replace(/\\\|/g, "|"), void 0];
}
function parseInnerLink(rawlink) {
let [link, display] = splitOnUnescapedPipe(rawlink);
- return Link.infer(link, false, display);
+ return Link2.infer(link, false, display);
}
function createBinaryParser(child, sep, combine) {
return parsimmon_umd_min.exports.seqMap(child, parsimmon_umd_min.exports.seq(parsimmon_umd_min.exports.optWhitespace, sep, parsimmon_umd_min.exports.optWhitespace, child).many(), (first, rest) => {
@@ -12262,7 +12527,7 @@ var require_internal = __commonJS({
block.f();
outro_and_destroy_block2(block, lookup3);
}
- function update_keyed_each2(old_blocks, dirty, get_key, dynamic, ctx, list, lookup3, node, destroy2, create_each_block21, next2, get_context2) {
+ function update_keyed_each2(old_blocks, dirty, get_key, dynamic, ctx, list, lookup3, node, destroy2, create_each_block22, next2, get_context2) {
let o2 = old_blocks.length;
let n2 = list.length;
let i2 = o2;
@@ -12278,7 +12543,7 @@ var require_internal = __commonJS({
const key = get_key(child_ctx);
let block = lookup3.get(key);
if (!block) {
- block = create_each_block21(key, child_ctx);
+ block = create_each_block22(key, child_ctx);
block.c();
} else if (dynamic) {
block.p(child_ctx, dirty);
@@ -12612,7 +12877,7 @@ var require_internal = __commonJS({
}
component.$$.dirty[i2 / 31 | 0] |= 1 << i2 % 31;
}
- function init6(component, options, instance107, create_fragment107, not_equal2, props, append_styles3, dirty = [-1]) {
+ function init6(component, options, instance113, create_fragment113, not_equal2, props, append_styles3, dirty = [-1]) {
const parent_component = exports.current_component;
set_current_component2(component);
const $$ = component.$$ = {
@@ -12635,7 +12900,7 @@ var require_internal = __commonJS({
};
append_styles3 && append_styles3($$.root);
let ready = false;
- $$.ctx = instance107 ? instance107(component, options.props || {}, (i2, ret, ...rest) => {
+ $$.ctx = instance113 ? instance113(component, options.props || {}, (i2, ret, ...rest) => {
const value = rest.length ? rest[0] : ret;
if ($$.ctx && not_equal2($$.ctx[i2], $$.ctx[i2] = value)) {
if (!$$.skip_bound && $$.bound[i2])
@@ -12648,7 +12913,7 @@ var require_internal = __commonJS({
$$.update();
ready = true;
run_all2($$.before_update);
- $$.fragment = create_fragment107 ? create_fragment107($$.ctx) : false;
+ $$.fragment = create_fragment113 ? create_fragment113($$.ctx) : false;
if (options.target) {
if (options.hydrate) {
start_hydrating2();
@@ -12838,11 +13103,11 @@ var require_internal = __commonJS({
function construct_svelte_component_dev(component, props) {
const error_message = "this={...} of should specify a Svelte component.";
try {
- const instance107 = new component(props);
- if (!instance107.$$ || !instance107.$set || !instance107.$on || !instance107.$destroy) {
+ const instance113 = new component(props);
+ if (!instance113.$$ || !instance113.$set || !instance113.$on || !instance113.$destroy) {
throw new Error(error_message);
}
- return instance107;
+ return instance113;
} catch (err) {
const { message } = err;
if (typeof message === "string" && message.indexOf("is not a constructor") !== -1) {
@@ -13255,1173 +13520,4080 @@ var require_svelte_i18next = __commonJS({
// src/main.ts
var main_exports = {};
__export(main_exports, {
- DEFAULT_SETTINGS: () => DEFAULT_SETTINGS,
default: () => ProjectsPlugin
});
module.exports = __toCommonJS(main_exports);
var import_dayjs9 = __toESM(require_dayjs_min());
var import_isoWeek = __toESM(require_isoWeek());
var import_localizedFormat = __toESM(require_localizedFormat());
-var import_obsidian56 = require("obsidian");
-var import_obsidian_dataview4 = __toESM(require_lib());
-// node_modules/svelte/internal/index.mjs
-function noop() {
-}
-var identity = (x2) => x2;
-function assign(tar, src) {
- for (const k2 in src)
- tar[k2] = src[k2];
- return tar;
-}
-function is_promise(value) {
- return value && typeof value === "object" && typeof value.then === "function";
-}
-function run(fn3) {
- return fn3();
-}
-function blank_object() {
- return /* @__PURE__ */ Object.create(null);
-}
-function run_all(fns) {
- fns.forEach(run);
-}
-function is_function(thing) {
- return typeof thing === "function";
-}
-function safe_not_equal(a2, b2) {
- return a2 != a2 ? b2 == b2 : a2 !== b2 || (a2 && typeof a2 === "object" || typeof a2 === "function");
-}
-var src_url_equal_anchor;
-function src_url_equal(element_src, url) {
- if (!src_url_equal_anchor) {
- src_url_equal_anchor = document.createElement("a");
- }
- src_url_equal_anchor.href = url;
- return element_src === src_url_equal_anchor.href;
-}
-function is_empty(obj) {
- return Object.keys(obj).length === 0;
-}
-function subscribe(store, ...callbacks) {
- if (store == null) {
- return noop;
- }
- const unsub = store.subscribe(...callbacks);
- return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
-}
-function get_store_value(store) {
- let value;
- subscribe(store, (_24) => value = _24)();
- return value;
-}
-function component_subscribe(component, store, callback) {
- component.$$.on_destroy.push(subscribe(store, callback));
-}
-function create_slot(definition, ctx, $$scope, fn3) {
- if (definition) {
- const slot_ctx = get_slot_context(definition, ctx, $$scope, fn3);
- return definition[0](slot_ctx);
- }
-}
-function get_slot_context(definition, ctx, $$scope, fn3) {
- return definition[1] && fn3 ? assign($$scope.ctx.slice(), definition[1](fn3(ctx))) : $$scope.ctx;
-}
-function get_slot_changes(definition, $$scope, dirty, fn3) {
- if (definition[2] && fn3) {
- const lets = definition[2](fn3(dirty));
- if ($$scope.dirty === void 0) {
- return lets;
- }
- if (typeof lets === "object") {
- const merged = [];
- const len = Math.max($$scope.dirty.length, lets.length);
- for (let i2 = 0; i2 < len; i2 += 1) {
- merged[i2] = $$scope.dirty[i2] | lets[i2];
- }
- return merged;
- }
- return $$scope.dirty | lets;
- }
- return $$scope.dirty;
-}
-function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {
- if (slot_changes) {
- const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
- slot.p(slot_context, slot_changes);
- }
-}
-function get_all_dirty_from_scope($$scope) {
- if ($$scope.ctx.length > 32) {
- const dirty = [];
- const length = $$scope.ctx.length / 32;
- for (let i2 = 0; i2 < length; i2++) {
- dirty[i2] = -1;
- }
- return dirty;
- }
- return -1;
-}
-function compute_slots(slots) {
- const result = {};
- for (const key in slots) {
- result[key] = true;
- }
- return result;
-}
-function null_to_empty(value) {
- return value == null ? "" : value;
-}
-function action_destroyer(action_result) {
- return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;
-}
-var is_client = typeof window !== "undefined";
-var now = is_client ? () => window.performance.now() : () => Date.now();
-var raf = is_client ? (cb) => requestAnimationFrame(cb) : noop;
-var tasks = /* @__PURE__ */ new Set();
-function run_tasks(now2) {
- tasks.forEach((task2) => {
- if (!task2.c(now2)) {
- tasks.delete(task2);
- task2.f();
- }
- });
- if (tasks.size !== 0)
- raf(run_tasks);
-}
-function loop(callback) {
- let task2;
- if (tasks.size === 0)
- raf(run_tasks);
- return {
- promise: new Promise((fulfill) => {
- tasks.add(task2 = { c: callback, f: fulfill });
- }),
- abort() {
- tasks.delete(task2);
- }
- };
-}
-var is_hydrating = false;
-function start_hydrating() {
- is_hydrating = true;
-}
-function end_hydrating() {
- is_hydrating = false;
-}
-function append(target, node) {
- target.appendChild(node);
-}
-function append_styles(target, style_sheet_id, styles) {
- const append_styles_to = get_root_for_style(target);
- if (!append_styles_to.getElementById(style_sheet_id)) {
- const style = element("style");
- style.id = style_sheet_id;
- style.textContent = styles;
- append_stylesheet(append_styles_to, style);
- }
-}
-function get_root_for_style(node) {
- if (!node)
- return document;
- const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;
- if (root && root.host) {
- return root;
- }
- return node.ownerDocument;
-}
-function append_empty_stylesheet(node) {
- const style_element = element("style");
- append_stylesheet(get_root_for_style(node), style_element);
- return style_element.sheet;
-}
-function append_stylesheet(node, style) {
- append(node.head || node, style);
- return style.sheet;
-}
-function insert(target, node, anchor) {
- target.insertBefore(node, anchor || null);
-}
-function detach(node) {
- if (node.parentNode) {
- node.parentNode.removeChild(node);
- }
-}
-function destroy_each(iterations, detaching) {
- for (let i2 = 0; i2 < iterations.length; i2 += 1) {
- if (iterations[i2])
- iterations[i2].d(detaching);
- }
-}
-function element(name) {
- return document.createElement(name);
-}
-function text(data) {
- return document.createTextNode(data);
-}
-function space() {
- return text(" ");
-}
-function empty() {
- return text("");
-}
-function listen(node, event, handler, options) {
- node.addEventListener(event, handler, options);
- return () => node.removeEventListener(event, handler, options);
-}
-function stop_propagation(fn3) {
- return function(event) {
- event.stopPropagation();
- return fn3.call(this, event);
- };
-}
-function attr(node, attribute, value) {
- if (value == null)
- node.removeAttribute(attribute);
- else if (node.getAttribute(attribute) !== value)
- node.setAttribute(attribute, value);
-}
-function set_attributes(node, attributes) {
- const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);
- for (const key in attributes) {
- if (attributes[key] == null) {
- node.removeAttribute(key);
- } else if (key === "style") {
- node.style.cssText = attributes[key];
- } else if (key === "__value") {
- node.value = node[key] = attributes[key];
- } else if (descriptors[key] && descriptors[key].set) {
- node[key] = attributes[key];
- } else {
- attr(node, key, attributes[key]);
- }
- }
-}
-function set_custom_element_data_map(node, data_map) {
- Object.keys(data_map).forEach((key) => {
- set_custom_element_data(node, key, data_map[key]);
- });
-}
-function set_custom_element_data(node, prop, value) {
- if (prop in node) {
- node[prop] = typeof node[prop] === "boolean" && value === "" ? true : value;
- } else {
- attr(node, prop, value);
- }
-}
-function children(element2) {
- return Array.from(element2.childNodes);
-}
-function set_data(text2, data) {
- data = "" + data;
- if (text2.wholeText !== data)
- text2.data = data;
-}
-function set_input_value(input, value) {
- input.value = value == null ? "" : value;
-}
-function set_style(node, key, value, important) {
- if (value === null) {
- node.style.removeProperty(key);
- } else {
- node.style.setProperty(key, value, important ? "important" : "");
- }
-}
-function select_option(select, value) {
- for (let i2 = 0; i2 < select.options.length; i2 += 1) {
- const option2 = select.options[i2];
- if (option2.__value === value) {
- option2.selected = true;
- return;
- }
- }
- select.selectedIndex = -1;
-}
-var crossorigin;
-function is_crossorigin() {
- if (crossorigin === void 0) {
- crossorigin = false;
- try {
- if (typeof window !== "undefined" && window.parent) {
- void window.parent.document;
- }
- } catch (error2) {
- crossorigin = true;
- }
- }
- return crossorigin;
-}
-function add_resize_listener(node, fn3) {
- const computed_style = getComputedStyle(node);
- if (computed_style.position === "static") {
- node.style.position = "relative";
- }
- const iframe = element("iframe");
- iframe.setAttribute("style", "display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;");
- iframe.setAttribute("aria-hidden", "true");
- iframe.tabIndex = -1;
- const crossorigin2 = is_crossorigin();
- let unsubscribe;
- if (crossorigin2) {
- iframe.src = "data:text/html,