diff --git a/.obsidian/plugins/obsidian-activity-history/data.json b/.obsidian/plugins/obsidian-activity-history/data.json index 0bb5dd42..aab4b75d 100644 --- a/.obsidian/plugins/obsidian-activity-history/data.json +++ b/.obsidian/plugins/obsidian-activity-history/data.json @@ -12,8 +12,8 @@ "checkpointList": [ { "path": "/", - "date": "2022-04-18", - "size": 4041085 + "date": "2022-04-19", + "size": 4042722 } ], "activityHistory": [ @@ -422,7 +422,11 @@ }, { "date": "2022-04-18", - "value": 2216 + "value": 2740 + }, + { + "date": "2022-04-19", + "value": 1149 } ] } diff --git a/.obsidian/plugins/obsidian-commits/data.json b/.obsidian/plugins/obsidian-commits/data.json index 61636c18..55c47a40 100644 --- a/.obsidian/plugins/obsidian-commits/data.json +++ b/.obsidian/plugins/obsidian-commits/data.json @@ -612,7 +612,7 @@ "03.03 Food & Wine/Udon in Buttery Tomato n Soy broth.md": { "size": 3268, "tags": 1, - "links": 2 + "links": 4 }, "03.03 Food & Wine/Aromatic Beef Pilaf.md": { "size": 4232, @@ -2297,7 +2297,7 @@ "00.03 News/Lovemaking for longevity a recipe from Tokyo’s imperial archives Aeon Essays.md": { "size": 21130, "tags": 2, - "links": 1 + "links": 2 }, "00.03 News/How the enigmatic Nefertiti came to be locked away in Germany Aeon Essays.md": { "size": 20808, @@ -2322,7 +2322,7 @@ "00.03 News/The 1918 flu didn’t end in 1918. Here’s what its third year can teach us..md": { "size": 9566, "tags": 3, - "links": 1 + "links": 2 }, "00.03 News/XXX-Files Who Torched the Pornhub Palace.md": { "size": 37911, @@ -2347,7 +2347,7 @@ "03.03 Food & Wine/Thai Basil Sauce Noodles with Jammy Eggs.md": { "size": 3289, "tags": 3, - "links": 2 + "links": 4 }, "00.03 News/Why it can be sublime to love someone who doesn’t love you back.md": { "size": 10501, @@ -2657,7 +2657,7 @@ "00.03 News/What i learnt during my 3 days offline.md": { "size": 12408, "tags": 3, - "links": 1 + "links": 2 }, "03.03 Food & Wine/Banana Foster.md": { "size": 3528, @@ -2781,7 +2781,7 @@ }, "03.03 Food & Wine/Fresh Tomato Eggs in Purgatory with Chickpeas.md": { "size": 3521, - "tags": 4, + "tags": 3, "links": 2 }, "01.01 Life Orga/@Life Admin.md": { @@ -3032,7 +3032,7 @@ "00.03 News/The Bullet and the Ballplayer.md": { "size": 46208, "tags": 3, - "links": 1 + "links": 2 }, "00.03 News/The dark side of Discord for teens.md": { "size": 22338, @@ -3685,51 +3685,56 @@ "links": 2 }, "00.01 Admin/Calendars/2022-04-18.md": { - "size": 1208, + "size": 1639, "tags": 0, - "links": 6 + "links": 9 + }, + "00.01 Admin/Calendars/2022-04-19.md": { + "size": 1016, + "tags": 0, + "links": 4 } }, "commitTypes": { "/": { - "Refactor": 500, - "Create": 394, - "Link": 789, - "Expand": 380 + "Refactor": 501, + "Create": 395, + "Link": 797, + "Expand": 383 } }, "dailyCommits": { "/": { "0": 50, - "1": 20, + "1": 21, "2": 1, "3": 9, "4": 12, "5": 6, "6": 17, - "7": 134, + "7": 137, "8": 210, "9": 170, "10": 91, "11": 77, "12": 99, "13": 173, - "14": 118, + "14": 123, "15": 76, "16": 62, "17": 88, - "18": 238, - "19": 70, - "20": 91, + "18": 239, + "19": 71, + "20": 92, "21": 55, "22": 155, - "23": 41 + "23": 42 } }, "weeklyCommits": { "/": { - "Mon": 314, - "Tue": 168, + "Mon": 323, + "Tue": 172, "Wed": 193, "Thu": 276, "Fri": 172, @@ -3740,6 +3745,9 @@ "recentCommits": { "/": { "Expanded": [ + " 2022-04-19 ", + " 2022-04-18 ", + " 2022-04-18 ", " 2022-04-16 ", " Obsidian plugins ", " 2022-04-18 ", @@ -3787,12 +3795,10 @@ " 2022-04-09 Garde-meuble Granny ", " 2022-04-10 ", " 2022-04-08 Dej Ag ", - " 2022-04-09 Garde-meuble Granny ", - " 2022-04-09 ", - " 2022-04-08 ", - " 2022-04-07 " + " 2022-04-09 Garde-meuble Granny " ], "Created": [ + " 2022-04-19 ", " 2022-04-18 ", " 2022-04-17 ", " The History of the Varsity Jacket, From Harvard to Hip-Hop ", @@ -3842,8 +3848,7 @@ " 8 Endangered Places We Can Still Save From Climate Change ", " One Last Trip ", " ‘This Whole Thing Has F---ed Me Up’ ", - " E-commerce giants couldn’t deliver. So these islanders built their own online shopping ecosystem ", - " How did people sleep in the Middle Ages - Medievalists.net " + " E-commerce giants couldn’t deliver. So these islanders built their own online shopping ecosystem " ], "Renamed": [ " The History of the Varsity Jacket, From Harvard to Hip-Hop ", @@ -4040,6 +4045,14 @@ " Test " ], "Linked": [ + " 2022-04-19 ", + " What i learnt during my 3 days offline ", + " Lovemaking for longevity a recipe from Tokyo’s imperial archives Aeon Essays ", + " The Bullet and the Ballplayer ", + " 2022-04-18 ", + " The 1918 flu didn’t end in 1918. Here’s what its third year can teach us. ", + " Thai Basil Sauce Noodles with Jammy Eggs ", + " Udon in Buttery Tomato n Soy broth ", " 2022-04-16 ", " 2022-04-18 ", " 2022-04-18 ", @@ -4082,15 +4095,7 @@ " Big Shells With Spicy Lamb Sausage and Pistachios ", " Churros with Bittersweet Chocolate Sauce ", " 2022-04-24 2nd tour élections présidentielles ", - " 2022-04-10 1er tour Présidentielle ", - " 2022-04-12 ", - " 2022-04-11 ", - " Storj ", - " Zint ", - " 2022-04-11 ", - " 2022-04-10 ", - " H-Town United An Unlikely Soccer Power Rises in Texas ", - " Meet the DIY Duo Behind the Amazon Labor Union’s Guerrilla Bid to Make History " + " 2022-04-10 1er tour Présidentielle " ], "Removed Tags from": [ " Le Miel de Paris ", @@ -4098,7 +4103,8 @@ " Migrants faced the worst of the gig economy, so they made their own delivery app ", " Confessions of a Bitcoin Widow How a Dream Life Turned into a Nightmare The Walrus ", " L’enquête « Suisse Secrets » relance le débat sur la liberté de la presse face au secret bancaire ", - " A Vibe Shift Is Coming " + " A Vibe Shift Is Coming ", + " Fresh Tomato Eggs in Purgatory with Chickpeas " ], "Removed Links from": [ " 2022-01-22 ", diff --git a/.obsidian/plugins/obsidian-map-view/data.json b/.obsidian/plugins/obsidian-map-view/data.json index 8531ed70..14ad8643 100644 --- a/.obsidian/plugins/obsidian-map-view/data.json +++ b/.obsidian/plugins/obsidian-map-view/data.json @@ -84,11 +84,11 @@ } ], "zoomOnGoFromNote": 15, - "tilesUrl": null, "autoZoom": true, "markerClickBehavior": "samePane", "newNoteNameFormat": "Location added on {{date:YYYY-MM-DD}}T{{date:HH-mm}}", - "snippetLines": 3, + "showNotePreview": true, + "showClusterPreview": false, "debug": false, "openIn": [ { @@ -97,12 +97,6 @@ } ], "urlParsingRules": [ - { - "name": "Google Maps", - "regExp": "https:\\/\\/\\S*\\@([0-9\\.\\-]+),([0-9\\.\\-]+)\\S*", - "order": "latFirst", - "preset": true - }, { "name": "OpenStreetMap Show Address", "regExp": "https:\\/\\/www.openstreetmap.org\\S*query=([0-9\\.\\-]+%2C[0-9\\.\\-]+)\\S*", @@ -123,6 +117,8 @@ } ], "chosenMapMode": "auto", + "tilesUrl": null, + "snippetLines": 3, "darkMode": false, "markerIcons": null, "defaultZoom": null, diff --git a/.obsidian/plugins/obsidian-map-view/main.js b/.obsidian/plugins/obsidian-map-view/main.js index 353f2d07..2f75da1f 100644 --- a/.obsidian/plugins/obsidian-map-view/main.js +++ b/.obsidian/plugins/obsidian-map-view/main.js @@ -58,8 +58,8 @@ function __awaiter(thisArg, _arguments, P, generator) { const MAP_VIEW_NAME = 'map'; // SVG editor used: https://svgedit.netlify.app/editor/index.html const RIBBON_ICON = ''; -const TILES_URL_OPENSTREETMAP = 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'; const SEARCH_RESULT_MARKER = { prefix: 'fas', icon: 'fa-search', markerColor: 'blue' }; +const MAX_CLUSTER_PREVIEW_ICONS = 4; const LAT_LIMITS = [-90, 90]; const LNG_LIMITS = [-180, 180]; @@ -14145,9 +14145,18 @@ function formatWithTemplates(s, query = '') { } const CURSOR = '$CURSOR$'; function sanitizeFileName(s) { - const illegalChars = /[\/\?<>\\:\*\|":]/g; + const illegalChars = /[\?<>\\:\*\|":]/g; return s.replace(illegalChars, '-'); } +/** + * Create a new markdown note and populate with the location + * @param app The Obsidian App instance + * @param newNoteType The location format to encode as + * @param directory The directory path to put the file in + * @param fileName The name of the file + * @param location The geolocation + * @param templatePath Optional path to a template to use for constructing the new file + */ function newNote(app, newNoteType, directory, fileName, location, templatePath) { return __awaiter(this, void 0, void 0, function* () { // `$CURSOR$` is used to set the cursor @@ -14168,6 +14177,12 @@ function newNote(app, newNoteType, directory, fileName, location, templatePath) } }); } +/** + * Go to a character index in the note + * @param editor The Obsidian Editor instance + * @param fileLocation The character index in the file to go to + * @param highlight If true will select the whole line + */ function goToEditorLocation(editor, fileLocation, highlight) { return __awaiter(this, void 0, void 0, function* () { if (fileLocation) { @@ -14219,6 +14234,12 @@ function verifyOrAddFrontMatter(editor, fieldName, fieldValue) { } return false; } +/** + * Populate a context menu from the user configurable URLs + * @param menu The menu to attach + * @param location The geolocation to use in the menu item + * @param settings Plugin settings + */ function populateOpenInItems(menu, location, settings) { for (let setting of settings.openIn) { if (!setting.name || !setting.urlPattern) @@ -14341,15 +14362,26 @@ class LocationSuggest extends obsidian.EditorSuggest { } } +/** A class to convert a string (usually a URL) into geolocation format */ class UrlConvertor { constructor(app, settings) { this.settings = settings; } + /** + * Parse the current editor line using the user defined URL parsers. + * Returns leaflet.LatLng on success and null on failure. + * @param editor The Obsidian Editor instance to use + */ findMatchInLine(editor) { const cursor = editor.getCursor(); const result = this.parseLocationFromUrl(editor.getLine(cursor.line)); return result === null || result === void 0 ? void 0 : result.location; } + /** + * Get geolocation from an encoded string (usually a URL). + * Will try each url parsing rule until one succeeds. + * @param line The string to decode + */ parseLocationFromUrl(line) { for (const rule of this.settings.urlParsingRules) { const regexp = RegExp(rule.regExp, 'g'); @@ -14368,6 +14400,13 @@ class UrlConvertor { } return null; } + /** + * Insert a geo link into the editor at the cursor position + * @param location The geolocation to convert to text and insert + * @param editor The Obsidian Editor instance + * @param replaceStart The EditorPosition to start the replacement at. If null will replace any text selected + * @param replaceLength The EditorPosition to stop the replacement at. If null will replace any text selected + */ insertLocationToEditor(location, editor, replaceStart, replaceLength) { const locationString = `[](geo:${location.lat},${location.lng})`; const cursor = editor.getCursor(); @@ -14381,6 +14420,10 @@ class UrlConvertor { editor.setCursor({ line: cursor.line, ch: newCursorPos }); verifyOrAddFrontMatter(editor, 'locations', ''); } + /** + * Replace the text at the cursor location with a geo link + * @param editor The Obsidian Editor instance + */ convertUrlAtCursorToGeolocation(editor) { const cursor = editor.getCursor(); const result = this.parseLocationFromUrl(editor.getLine(cursor.line)); @@ -17347,21 +17390,22 @@ const DEFAULT_SETTINGS = { { ruleName: "#dogs", preset: false, iconDetails: { "prefix": "fas", "icon": "fa-paw" } }, ], zoomOnGoFromNote: 15, - tilesUrl: TILES_URL_OPENSTREETMAP, autoZoom: true, markerClickBehavior: 'samePane', newNoteNameFormat: 'Location added on {{date:YYYY-MM-DD}}T{{date:HH-mm}}', - snippetLines: 3, + showNotePreview: true, + showClusterPreview: false, debug: false, openIn: [{ name: 'Google Maps', urlPattern: 'https://maps.google.com/?q={x},{y}' }], urlParsingRules: [ - { name: 'Google Maps', regExp: /https:\/\/\S*\@([0-9\.\-]+),([0-9\.\-]+)\S*/.source, order: 'latFirst', preset: true }, - { name: 'OpenStreetMap Show Address', regExp: /https:\/\/www.openstreetmap.org\S*query=([0-9\.\-]+%2C[0-9\.\-]+)\S*/.source, order: 'latFirst', preset: true } + { name: 'OpenStreetMap Show Address', regExp: /https:\/\/www.openstreetmap.org\S*query=([0-9\.\-]+%2C[0-9\.\-]+)\S*/.source, order: 'latFirst', preset: true }, + { name: 'Generic Lat,Lng', regExp: /([0-9\.\-]+), ([0-9\.\-]+)/.source, order: 'latFirst', preset: true } ], mapControls: { filtersDisplayed: true, viewDisplayed: true, presetsDisplayed: false }, maxClusterRadiusPixels: 20, searchProvider: 'osm', - mapSources: [{ name: 'OpenStreetMap', urlLight: TILES_URL_OPENSTREETMAP }], + mapSources: [{ name: 'CartoDB', urlLight: 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png', preset: true }], + // mapSources: [{name: 'OpenStreetMap', urlLight: consts.TILES_URL_OPENSTREETMAP}], chosenMapMode: 'auto' }; function convertLegacyMarkerIcons(settings) { @@ -17399,6 +17443,18 @@ function convertLegacyDefaultState(settings) { } return false; } +function removeLegacyPresets1(settings) { + const googleMapsParsingRule = settings.urlParsingRules.findIndex(rule => rule.name == 'Google Maps' && rule.preset); + if (googleMapsParsingRule > -1) { + settings.urlParsingRules.splice(googleMapsParsingRule, 1); + return true; + } + if (settings.mapSources.findIndex(item => item.name == DEFAULT_SETTINGS.mapSources[0].name) === -1) { + settings.mapSources.unshift(DEFAULT_SETTINGS.mapSources[0]); + return true; + } + return false; +} /* jshint node: true */ @@ -17681,8 +17737,15 @@ styleInject(css_248z); // Ugly hack for obsidian-leaflet compatability, see https://github.com/esm7/obsidian-map-view/issues/6 // @ts-ignore let localL = L; +/** An object that represents a single marker in a file, which is either a complete note with a geolocation, or an inline geolocation inside a note */ class FileMarker { + /** + * Construct a new FileMarker object + * @param file The file the pin comes from + * @param location The geolocation + */ constructor(file, location) { + /** Tags that this marker includes */ this.tags = []; this.file = file; this.location = location; @@ -17708,6 +17771,14 @@ class FileMarker { return this.file.name + this.location.lat.toString() + this.location.lng.toString(); } } +/** + * Create a FileMarker for every front matter and inline geolocation in the given file. + * @param mapToAppendTo The list of file markers to append to + * @param file The file object to parse + * @param settings The plugin settings + * @param app The Obsidian App instance + * @param skipMetadata If true will not find markers in the front matter + */ function buildAndAppendFileMarkers(mapToAppendTo, file, settings, app, skipMetadata) { return __awaiter(this, void 0, void 0, function* () { const fileCache = app.metadataCache.getFileCache(file); @@ -17729,6 +17800,12 @@ function buildAndAppendFileMarkers(mapToAppendTo, file, settings, app, skipMetad } }); } +/** + * Create FileMarker instances for all the files in the given list + * @param files The list of file objects to find geolocations in. + * @param settings The plugin settings + * @param app The Obsidian App instance + */ function buildMarkers(files, settings, app) { return __awaiter(this, void 0, void 0, function* () { if (settings.debug) @@ -17746,6 +17823,12 @@ function checkTagPatternMatch(tagPattern, tags) { let match = wildcard(tagPattern, tags); return match && match.length > 0; } +/** + * Create a leaflet icon for the marker + * @param marker The FileMarker to create the icon for + * @param settings The plugin settings + * @param app The Obsidian App instance + */ function getIconForMarker(marker, settings, app) { const fileCache = app.metadataCache.getFileCache(marker.file); // Combine the file tags with the marker-specific tags @@ -17776,12 +17859,21 @@ function getIconFromOptions(iconSpec) { L = backupL; } } +/** + * Make sure that the coordinates are valid world coordinates + * -90 <= longitude <= 90 and -180 <= latitude <= 180 + * @param location + */ function verifyLocation(location) { if (location.lng < LNG_LIMITS[0] || location.lng > LNG_LIMITS[1]) throw Error(`Lng ${location.lng} is outside the allowed limits`); if (location.lat < LAT_LIMITS[0] || location.lat > LAT_LIMITS[1]) throw Error(`Lat ${location.lat} is outside the allowed limits`); } +/** + * Find all inline geolocations in a string + * @param content The file contents to find the coordinates in + */ function matchInlineLocation(content) { // Old syntax of ` `location: ... ` `. This syntax doesn't support a name so we leave an empty capture group const locationRegex1 = /\`()location:\s*\[?([0-9.\-]+)\s*,\s*([0-9.\-]+)\]?\`/g; @@ -17791,6 +17883,12 @@ function matchInlineLocation(content) { const matches2 = content.matchAll(locationRegex2); return Array.from(matches1).concat(Array.from(matches2)); } +/** + * Build markers from inline locations in the file body + * @param file The file object to load + * @param settings The plugin settings + * @param app The Obsidian App instance + */ function getMarkersFromFileContent(file, settings, app) { return __awaiter(this, void 0, void 0, function* () { let markers = []; @@ -17812,6 +17910,7 @@ function getMarkersFromFileContent(file, settings, app) { marker.tags.push('#' + tag[1]); } marker.fileLocation = match.index; + marker.fileLine = content.substring(0, marker.fileLocation).split('\n').length - 1; marker.icon = getIconForMarker(marker, settings, app); marker.snippet = yield makeTextSnippet(file, content, marker.fileLocation, settings); markers.push(marker); @@ -17864,6 +17963,11 @@ function makeTextSnippet(file, fileContent, fileLocation, settings) { return snippet; }); } +/** + * Get the geolocation stored in the front matter of a file + * @param file The file to load the front matter from + * @param app The Obsidian App instance + */ function getFrontMatterLocation(file, app) { const fileCache = app.metadataCache.getFileCache(file); const frontMatter = fileCache === null || fileCache === void 0 ? void 0 : fileCache.frontmatter; @@ -18205,13 +18309,22 @@ class ViewControls { } class MapView extends obsidian.ItemView { + /** + * Construct a new map instance + * @param leaf The leaf the map should be put in + * @param settings The plugin settings + * @param plugin The plugin instance + */ constructor(leaf, settings, plugin) { super(leaf); + /** The map data */ this.display = new class { constructor() { + /** The markers currently on the map */ this.markers = new Map(); } }; + /** Is the view currently open */ this.isOpen = false; this.navigation = true; this.settings = settings; @@ -18226,6 +18339,7 @@ class MapView extends obsidian.ItemView { this.getState = () => { return this.state; }; + // Listen to file changes so we can update markers accordingly this.app.vault.on('delete', file => this.updateMarkersWithRelationToFile(file.path, null, true)); this.app.vault.on('rename', (file, oldPath) => this.updateMarkersWithRelationToFile(oldPath, file, true)); this.app.metadataCache.on('changed', file => this.updateMarkersWithRelationToFile(file.path, file, false)); @@ -18317,6 +18431,16 @@ class MapView extends obsidian.ItemView { className: neededClassName }); this.display.map.addLayer(this.display.tileLayer); + if (!(chosenMapSource === null || chosenMapSource === void 0 ? void 0 : chosenMapSource.ignoreErrors)) { + let recentTileError = false; + this.display.tileLayer.on('tileerror', (event) => { + if (!recentTileError) { + new obsidian.Notice(`Map view: unable to load map tiles. Try switching the map source using the View controls.`, 20000); + recentTileError = true; + setTimeout(() => { recentTileError = false; }, 5000); + } + }); + } } } refreshMap() { @@ -18372,24 +18496,26 @@ class MapView extends obsidian.ItemView { this.state.mapCenter = this.display.map.getCenter(); (_b = (_a = this.display) === null || _a === void 0 ? void 0 : _a.controls) === null || _b === void 0 ? void 0 : _b.invalidateActivePreset(); }); - // --- Work in progress --- - // this.display.clusterGroup.on('clustermouseover', cluster => { - // console.log(cluster.propagatedFrom.getAllChildMarkers()); - // let content = this.contentEl.createDiv(); - // for (const marker of cluster.propagatedFrom.getAllChildMarkers()) { - // console.log(marker); - // const iconElement = marker.options.icon.createIcon(); - // let style = iconElement.style; - // style.marginLeft = style.marginTop = '0'; - // style.position = 'relative'; - // content.appendChild(iconElement); - // } - // cluster.propagatedFrom.bindPopup(content, {closeButton: false, autoPan: false}).openPopup(); - // cluster.propagatedFrom.activePopup = content; - // }); - // this.display.clusterGroup.on('clustermouseout', cluster => { - // // cluster.propagatedFrom.closePopup(); - // }); + if (this.settings.showClusterPreview) { + this.display.clusterGroup.on('clustermouseover', cluster => { + let content = this.contentEl.createDiv(); + content.classList.add('clusterPreviewContainer'); + for (const m of cluster.propagatedFrom.getAllChildMarkers()) { + const marker = m; + const iconElement = marker.options.icon.createIcon(); + iconElement.classList.add('clusterPreviewIcon'); + content.appendChild(iconElement); + if (content.children.length >= MAX_CLUSTER_PREVIEW_ICONS) + break; + } + cluster.propagatedFrom.bindPopup(content, { closeButton: true, autoPan: false }).openPopup(); + cluster.propagatedFrom.activePopup = content; + }); + this.display.clusterGroup.on('clustermouseout', cluster => { + cluster.propagatedFrom.closePopup(); + }); + } + // Build the map marker right-click context menu this.display.map.on('contextmenu', (event) => __awaiter(this, void 0, void 0, function* () { let mapPopup = new obsidian.Menu(this.app); mapPopup.setNoIcon(); @@ -18436,13 +18562,18 @@ class MapView extends obsidian.ItemView { })); }); } - // Updates the map to the given state and then sets the state accordingly, but only if the given state version - // is not lower than the current state version (so concurrent async updates always keep the latest one) + /** + * Set the map state + * @param state The map state to set + * @param force Force setting the state. Will ignore if the state is old + */ updateMarkersToState(state, force = false) { return __awaiter(this, void 0, void 0, function* () { if (this.settings.debug) console.time('updateMarkersToState'); + // Get a list of all files matching the tags const files = this.getFileListByQuery(state.tags); + // Build the markers for all files matching the tag let newMarkers = yield buildMarkers(files, this.settings, this.app); // --- BEYOND THIS POINT NOTHING SHOULD BE ASYNC --- // Saying it again: do not use 'await' below this line! @@ -18454,6 +18585,10 @@ class MapView extends obsidian.ItemView { console.timeEnd('updateMarkersToState'); }); } + /** + * Get a list of files containing at least one of the tags + * @param tags A list of string tags to match + */ getFileListByQuery(tags) { let results = []; const allFiles = this.app.vault.getFiles(); @@ -18474,6 +18609,11 @@ class MapView extends obsidian.ItemView { } return results; } + /** + * Update the actual Leaflet markers of the map according to a new list of logical markers. + * Unchanged markers are not touched, new markers are created and old markers that are not in the updated list are removed. + * @param newMarkers The new array of FileMarkers + */ updateMapMarkers(newMarkers) { let newMarkersMap = new Map(); let markersToAdd = []; @@ -18506,11 +18646,18 @@ class MapView extends obsidian.ItemView { this.goToMarker(marker, event.originalEvent.ctrlKey, true); }); newMarker.on('mouseover', (event) => { + if (this.settings.showNotePreview) { + const previewDetails = { + scroll: marker.fileLine, + line: marker.fileLine, + startLoc: { line: marker.fileLine, col: 0, offset: marker.fileLocation }, + endLoc: { line: marker.fileLine, col: 0, offset: marker.fileLocation } + }; + this.app.workspace.trigger('link-hover', newMarker.getElement(), newMarker.getElement(), marker.file.path, '', previewDetails); + } let content = `

${marker.file.name}

`; if (marker.extraName) content += `

${marker.extraName}

`; - if (marker.snippet) - content += `

${marker.snippet}

`; newMarker.bindPopup(content, { closeButton: true, autoPan: false }).openPopup(); }); newMarker.on('mouseout', (event) => { @@ -18537,6 +18684,7 @@ class MapView extends obsidian.ItemView { }); return newMarker; } + /** Zoom the map to fit all markers on the screen */ autoFitMapToMarkers() { return __awaiter(this, void 0, void 0, function* () { if (this.display.markers.size > 0) { @@ -18545,6 +18693,12 @@ class MapView extends obsidian.ItemView { } }); } + /** + * Open a file in an editor window + * @param file The file object to open + * @param useCtrlKeyBehavior If true will use the alternative behaviour, as set in the settings + * @param editorAction Optional callback to run when the file is opened + */ goToFile(file, useCtrlKeyBehavior, editorAction) { return __awaiter(this, void 0, void 0, function* () { let leafToUse = this.app.workspace.activeLeaf; @@ -18585,21 +18739,36 @@ class MapView extends obsidian.ItemView { yield editorAction(editor); }); } + /** + * Open and go to the editor location represented by the marker + * @param marker The FileMarker to open + * @param useCtrlKeyBehavior If true will use the alternative behaviour, as set in the settings + * @param highlight If true will highlight the line + */ goToMarker(marker, useCtrlKeyBehavior, highlight) { return __awaiter(this, void 0, void 0, function* () { return this.goToFile(marker.file, useCtrlKeyBehavior, (editor) => __awaiter(this, void 0, void 0, function* () { yield goToEditorLocation(editor, marker.fileLocation, highlight); })); }); } + /** + * Update the map markers with a list of markers not from the removed file plus the markers from the new file. + * Run when a file is deleted, renamed or changed. + * @param fileRemoved The old file path + * @param fileAddedOrChanged The new file data + */ updateMarkersWithRelationToFile(fileRemoved, fileAddedOrChanged, skipMetadata) { return __awaiter(this, void 0, void 0, function* () { if (!this.display.map || !this.isOpen) + // If the map has not been set up yet then do nothing return; let newMarkers = []; + // Create an array of all file markers not in the removed file for (let [markerId, fileMarker] of this.display.markers) { if (fileMarker.file.path !== fileRemoved) newMarkers.push(fileMarker); } if (fileAddedOrChanged && fileAddedOrChanged instanceof obsidian.TFile) + // Add file markers from the added file yield buildAndAppendFileMarkers(newMarkers, fileAddedOrChanged, this.settings, this.app); this.updateMapMarkers(newMarkers); }); @@ -18732,17 +18901,25 @@ class SettingsTab extends obsidian.PluginSettingTab { })); }); new obsidian.Setting(containerEl) - .setName('Note lines to show on map marker popup') - .setDesc('Number of total lines to show in the snippet displayed for inline geolocation notes.') - .addSlider(slider => { - var _a; - slider - .setLimits(0, 12, 1) - .setDynamicTooltip() - .setValue((_a = this.plugin.settings.snippetLines) !== null && _a !== void 0 ? _a : DEFAULT_SETTINGS.snippetLines) + .setName('Show note preview on map marker hover') + .setDesc('In addition to the note and internal link name, show the native Obsidian note preview.') + .addToggle(component => { + component + .setValue(this.plugin.settings.showNotePreview) .onChange((value) => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.snippetLines = value; - this.plugin.saveSettings(); + this.plugin.settings.showNotePreview = value; + yield this.plugin.saveSettings(); + })); + }); + new obsidian.Setting(containerEl) + .setName('Show preview for marker clusters') + .setDesc('Show a hover popup summarizing the icons inside a marker cluster. Changes are applied after restart.') + .addToggle(component => { + component + .setValue(this.plugin.settings.showClusterPreview) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.showClusterPreview = value; + yield this.plugin.saveSettings(); })); }); new obsidian.Setting(containerEl) @@ -18871,15 +19048,16 @@ class SettingsTab extends obsidian.PluginSettingTab { this.refreshPluginOnHide = true; yield this.plugin.saveSettings(); })); - }) - .addButton(component => component - .setButtonText('Delete') - .onClick(() => __awaiter(this, void 0, void 0, function* () { - this.plugin.settings.mapSources.remove(setting); - this.refreshPluginOnHide = true; - yield this.plugin.saveSettings(); - this.refreshMapSourceSettings(containerEl); - }))); + }); + if (!setting.preset) + controls.addButton(component => component + .setButtonText('Delete') + .onClick(() => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.mapSources.remove(setting); + this.refreshPluginOnHide = true; + yield this.plugin.saveSettings(); + this.refreshMapSourceSettings(containerEl); + }))); controls.settingEl.style.padding = '5px'; controls.settingEl.style.borderTop = 'none'; } @@ -19252,7 +19430,9 @@ class MapViewPlugin extends obsidian.Plugin { return __awaiter(this, void 0, void 0, function* () { obsidian.addIcon('globe', RIBBON_ICON); yield this.loadSettings(); + // Add a new ribbon entry to the left bar this.addRibbonIcon('globe', 'Open map view', () => { + // When clicked change the active view to the map this.app.workspace.getLeaf().setViewState({ type: MAP_VIEW_NAME }); }); this.registerView(MAP_VIEW_NAME, (leaf) => { @@ -19261,6 +19441,7 @@ class MapViewPlugin extends obsidian.Plugin { this.suggestor = new LocationSuggest(this.app, this.settings); this.urlConvertor = new UrlConvertor(this.app, this.settings); this.registerEditorSuggest(this.suggestor); + // Convert old settings formats that are no longer supported if (convertLegacyMarkerIcons(this.settings)) { yield this.saveSettings(); new obsidian.Notice("Map View: legacy marker icons were converted to the new format"); @@ -19273,6 +19454,12 @@ class MapViewPlugin extends obsidian.Plugin { yield this.saveSettings(); new obsidian.Notice("Map View: legacy default state was converted to the new format"); } + if (removeLegacyPresets1(this.settings)) { + yield this.saveSettings(); + new obsidian.Notice("Map View: legacy URL parsing rules and/or map sources were converted. See the release notes"); + } + // Register commands to the command palette + // Command that opens the map view (same as clicking the map icon) this.addCommand({ id: 'open-map-view', name: 'Open Map View', @@ -19280,6 +19467,7 @@ class MapViewPlugin extends obsidian.Plugin { this.app.workspace.getLeaf().setViewState({ type: MAP_VIEW_NAME }); }, }); + // Command that looks up the selected text to find the location this.addCommand({ id: 'convert-selection-to-location', name: 'Convert Selection to Geolocation', @@ -19289,6 +19477,7 @@ class MapViewPlugin extends obsidian.Plugin { this.suggestor.selectionToLink(editor); } }); + // Command that adds a blank inline location at the cursor location this.addCommand({ id: 'insert-geolink', name: 'Add inline geolocation link', @@ -19298,6 +19487,7 @@ class MapViewPlugin extends obsidian.Plugin { editor.setCursor({ line: positionBeforeInsert.line, ch: positionBeforeInsert.ch + 1 }); } }); + // Command that opens the location search dialog and creates a new note from this location this.addCommand({ id: 'new-geolocation-note', name: 'New geolocation note', @@ -19306,6 +19496,7 @@ class MapViewPlugin extends obsidian.Plugin { dialog.open(); } }); + // Command that opens the location search dialog and adds the location to the current note this.addCommand({ id: 'add-frontmatter-geolocation', name: 'Add geolocation (front matter) to current note', @@ -19315,25 +19506,32 @@ class MapViewPlugin extends obsidian.Plugin { } }); this.addSettingTab(new SettingsTab(this.app, this)); + // Add items to the file context menu (run when the context menu is built) + // This is the context menu in the File Explorer and clicking "More options" (three dots) from within a file. this.app.workspace.on('file-menu', (menu, file, _source, leaf) => { if (file instanceof obsidian.TFile) { const location = getFrontMatterLocation(file, this.app); if (location) { + // If there is a geolocation in the front matter of the file + // Add an option to open it in the map menu.addItem((item) => { item.setTitle('Show on map'); item.setIcon('globe'); item.onClick((evt) => __awaiter(this, void 0, void 0, function* () { return yield this.openMapWithLocation(location, evt.ctrlKey); })); }); + // Add an option to open it in the default app menu.addItem((item) => { item.setTitle('Open with default app'); item.onClick(_ev => { open(`geo:${location.lat},${location.lng}`); }); }); + // Populate menu items from user defined "Open In" strings populateOpenInItems(menu, location, this.settings); } else { if (leaf && leaf.view instanceof obsidian.MarkdownView) { + // If there is no valid geolocation in the front matter, add a menu item to populate it. const editor = leaf.view.editor; menu.addItem((item) => { item.setTitle('Add geolocation (front matter)'); @@ -19347,31 +19545,39 @@ class MapViewPlugin extends obsidian.Plugin { } } }); + // Add items to the editor context menu (run when the context menu is built) + // This is the context menu when right clicking within an editor view. this.app.workspace.on('editor-menu', (menu, editor, view) => __awaiter(this, void 0, void 0, function* () { var _a; if (view instanceof obsidian.FileView) { const location = this.getLocationOnEditorLine(editor, view); if (location) { + // If there is a geolocation on the line + // Add an option to open it in the map menu.addItem((item) => { item.setTitle('Show on map'); item.setIcon('globe'); item.onClick((evt) => __awaiter(this, void 0, void 0, function* () { return yield this.openMapWithLocation(location, evt.ctrlKey); })); }); + // Add an option to open it in the default app menu.addItem((item) => { item.setTitle('Open with default app'); item.onClick(_ev => { open(`geo:${location.lat},${location.lng}`); }); }); + // Populate menu items from user defined "Open In" strings populateOpenInItems(menu, location, this.settings); } if (editor.getSelection()) { + // If there is text selected, add a menu item to convert it to coordinates using geosearch menu.addItem((item) => { item.setTitle('Convert to geolocation (geosearch)'); item.onClick(() => __awaiter(this, void 0, void 0, function* () { return yield this.suggestor.selectionToLink(editor); })); }); } if (this.urlConvertor.findMatchInLine(editor)) + // If the line contains a recognized geolocation that can be converted from a URL parsing rule menu.addItem((item) => { item.setTitle('Convert to geolocation'); item.onClick(() => __awaiter(this, void 0, void 0, function* () { @@ -19381,6 +19587,7 @@ class MapViewPlugin extends obsidian.Plugin { const clipboard = yield navigator.clipboard.readText(); const clipboardLocation = (_a = this.urlConvertor.parseLocationFromUrl(clipboard)) === null || _a === void 0 ? void 0 : _a.location; if (clipboardLocation) { + // If the clipboard contains a recognized geolocation that can be converted from a URL parsing rule menu.addItem((item) => { item.setTitle('Paste as geolocation'); item.onClick(() => __awaiter(this, void 0, void 0, function* () { @@ -19392,6 +19599,11 @@ class MapViewPlugin extends obsidian.Plugin { })); }); } + /** + * Open an instance of the map at the given geolocation + * @param location The geolocation to open the map at + * @param ctrlKey Was the control key pressed + */ openMapWithLocation(location, ctrlKey) { return __awaiter(this, void 0, void 0, function* () { yield this.openMapWithState({ mapCenter: location, mapZoom: this.settings.zoomOnGoFromNote }, ctrlKey); @@ -19413,6 +19625,12 @@ class MapViewPlugin extends obsidian.Plugin { yield chosenLeaf.setViewState({ type: MAP_VIEW_NAME, state: state }); }); } + /** + * Get the geolocation on the current editor line + * @param editor obsidian Editor instance + * @param view obsidian FileView instance + * @private + */ getLocationOnEditorLine(editor, view) { const line = editor.getLine(editor.getCursor().line); const match = matchInlineLocation(line)[0]; @@ -19432,11 +19650,13 @@ class MapViewPlugin extends obsidian.Plugin { } onunload() { } + /** Initialise the plugin settings from Obsidian's cache */ loadSettings() { return __awaiter(this, void 0, void 0, function* () { this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData()); }); } + /** Save the plugin settings to Obsidian's cache so it can be reused later. */ saveSettings() { return __awaiter(this, void 0, void 0, function* () { yield this.saveData(this.settings); diff --git a/.obsidian/plugins/obsidian-map-view/manifest.json b/.obsidian/plugins/obsidian-map-view/manifest.json index 204f28a6..0c17952d 100644 --- a/.obsidian/plugins/obsidian-map-view/manifest.json +++ b/.obsidian/plugins/obsidian-map-view/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-map-view", "name": "Map View", - "version": "1.3.0", + "version": "1.4.0", "minAppVersion": "0.12.10", "description": "An interactive map view.", "isDesktopOnly": false diff --git a/.obsidian/plugins/obsidian-map-view/styles.css b/.obsidian/plugins/obsidian-map-view/styles.css index d0cca90f..753e1ea0 100644 --- a/.obsidian/plugins/obsidian-map-view/styles.css +++ b/.obsidian/plugins/obsidian-map-view/styles.css @@ -53,3 +53,13 @@ .newPresetDialogLine { display: inline-block; } + +.clusterPreviewIcon { + margin-left: 0 !important; + margin-top: 0 !important; + position: relative !important; +} + +.clusterPreviewContainer { + display: inline-flex; +} diff --git a/.obsidian/plugins/obsidian-reminder-plugin/data.json b/.obsidian/plugins/obsidian-reminder-plugin/data.json index 1f9e086e..7871cbce 100644 --- a/.obsidian/plugins/obsidian-reminder-plugin/data.json +++ b/.obsidian/plugins/obsidian-reminder-plugin/data.json @@ -331,15 +331,15 @@ } ], "01.02 Home/Household.md": [ - { - "title": "[[Household]]: *Cardboard* recycling collection", - "time": "2022-04-19", - "rowNumber": 80 - }, { "title": "[[Household]]: *Paper* recycling collection", "time": "2022-04-26", "rowNumber": 72 + }, + { + "title": "[[Household]]: *Cardboard* recycling collection", + "time": "2022-05-03", + "rowNumber": 80 } ], "01.03 Family/Pia Bousquié.md": [ @@ -530,6 +530,21 @@ "title": "12:49 [[2022-04-18|Memo]], [[@Lifestyle]]: check the Tennis Club at the top of the mountain", "time": "2022-04-23", "rowNumber": 91 + }, + { + "title": "14:30 [[2022-04-18|Memo]], [[Selfhosting]], [[Server Alias]], [[Configuring Fail2ban]]: check (imported) nginx filters", + "time": "2022-04-23", + "rowNumber": 93 + }, + { + "title": "14:12 [[2022-04-18|Memo]], [[@Lifestyle]]: Find a cleaner", + "time": "2022-04-24", + "rowNumber": 92 + }, + { + "title": "17:54 [[2022-04-18|Memo]], [[@Lifestyle]]: Look up the afrench sailing circle", + "time": "2022-04-25", + "rowNumber": 94 } ] }, diff --git a/.obsidian/plugins/obsidian-tasks-plugin/main.js b/.obsidian/plugins/obsidian-tasks-plugin/main.js index d1010e0a..a6c22dca 100644 --- a/.obsidian/plugins/obsidian-tasks-plugin/main.js +++ b/.obsidian/plugins/obsidian-tasks-plugin/main.js @@ -8274,10 +8274,10 @@ var require_en = __commonJS({ return exports.casual.parse(text2, ref, option); } exports.parse = parse; - function parseDate(text2, ref, option) { + function parseDate2(text2, ref, option) { return exports.casual.parseDate(text2, ref, option); } - exports.parseDate = parseDate; + exports.parseDate = parseDate2; function createCasualConfiguration(littleEndian = false) { const option = createConfiguration(false, littleEndian); option.parsers.unshift(new ENCasualDateParser_1.default()); @@ -8839,10 +8839,10 @@ var require_de = __commonJS({ return exports.casual.parse(text2, ref, option); } exports.parse = parse; - function parseDate(text2, ref, option) { + function parseDate2(text2, ref, option) { return exports.casual.parseDate(text2, ref, option); } - exports.parseDate = parseDate; + exports.parseDate = parseDate2; function createCasualConfiguration(littleEndian = true) { const option = createConfiguration(false, littleEndian); option.parsers.unshift(new DECasualTimeParser_1.default()); @@ -9512,10 +9512,10 @@ var require_fr = __commonJS({ return exports.casual.parse(text2, ref, option); } exports.parse = parse; - function parseDate(text2, ref, option) { + function parseDate2(text2, ref, option) { return exports.casual.parseDate(text2, ref, option); } - exports.parseDate = parseDate; + exports.parseDate = parseDate2; function createCasualConfiguration(littleEndian = true) { const option = createConfiguration(false, littleEndian); option.parsers.unshift(new FRCasualDateParser_1.default()); @@ -9724,10 +9724,10 @@ var require_ja = __commonJS({ return exports.casual.parse(text2, ref, option); } exports.parse = parse; - function parseDate(text2, ref, option) { + function parseDate2(text2, ref, option) { return exports.casual.parseDate(text2, ref, option); } - exports.parseDate = parseDate; + exports.parseDate = parseDate2; function createCasualConfiguration() { const option = createConfiguration(); option.parsers.unshift(new JPCasualDateParser_1.default()); @@ -10114,10 +10114,10 @@ var require_pt = __commonJS({ return exports.casual.parse(text2, ref, option); } exports.parse = parse; - function parseDate(text2, ref, option) { + function parseDate2(text2, ref, option) { return exports.casual.parseDate(text2, ref, option); } - exports.parseDate = parseDate; + exports.parseDate = parseDate2; function createCasualConfiguration(littleEndian = true) { const option = createConfiguration(false, littleEndian); option.parsers.push(new PTCasualDateParser_1.default()); @@ -10831,10 +10831,10 @@ var require_nl = __commonJS({ return exports.casual.parse(text2, ref, option); } exports.parse = parse; - function parseDate(text2, ref, option) { + function parseDate2(text2, ref, option) { return exports.casual.parseDate(text2, ref, option); } - exports.parseDate = parseDate; + exports.parseDate = parseDate2; function createCasualConfiguration(littleEndian = true) { const option = createConfiguration(false, littleEndian); option.parsers.unshift(new NLCasualDateParser_1.default()); @@ -10923,10 +10923,10 @@ var require_dist = __commonJS({ return exports.casual.parse(text2, ref, option); } exports.parse = parse; - function parseDate(text2, ref, option) { + function parseDate2(text2, ref, option) { return exports.casual.parseDate(text2, ref, option); } - exports.parseDate = parseDate; + exports.parseDate = parseDate2; } }); @@ -14124,6 +14124,7 @@ var Recurrence = class { return text2; } next() { + var _a; let next; if (this.baseOnToday) { const today = window.moment(); @@ -14132,7 +14133,7 @@ var Recurrence = class { })); next = ruleBasedOnToday.after(today.endOf("day").utc(true).toDate()); } else { - const after = window.moment(this.referenceDate).endOf("day").utc(true); + const after = window.moment((_a = this.referenceDate) != null ? _a : void 0).endOf("day").utc(true); next = this.rrule.after(after.toDate()); } if (next !== null) { @@ -14395,10 +14396,12 @@ var _Task = class { const textSpan = li.createSpan(); textSpan.addClass("tasks-list-text"); yield import_obsidian2.MarkdownRenderer.renderMarkdown(taskAsString, textSpan, this.path, null); - const pElement = textSpan.querySelector("p"); + const blockQuote = textSpan.querySelector("blockquote"); + const directParentOfPTag = blockQuote != null ? blockQuote : textSpan; + const pElement = directParentOfPTag.querySelector("p"); if (pElement !== null) { while (pElement.firstChild) { - textSpan.insertBefore(pElement.firstChild, pElement); + directParentOfPTag.insertBefore(pElement.firstChild, pElement); } pElement.remove(); } @@ -16206,7 +16209,7 @@ var LivePreviewExtension = class { var import_obsidian7 = __toModule(require("obsidian")); // src/Query.ts -var import_chrono_node2 = __toModule(require_dist()); +var chrono2 = __toModule(require_dist()); var Query = class { constructor({ source }) { this._limit = void 0; @@ -16573,7 +16576,7 @@ var Query = class { } } parseDate(input) { - return window.moment(import_chrono_node2.default.parseDate(input)).startOf("day"); + return window.moment(chrono2.parseDate(input)).startOf("day"); } stringIncludesCaseInsensitive(haystack, needle) { return haystack.toLocaleLowerCase().includes(needle.toLocaleLowerCase()); diff --git a/.obsidian/plugins/obsidian-tasks-plugin/manifest.json b/.obsidian/plugins/obsidian-tasks-plugin/manifest.json index 1405981a..c8bfe247 100644 --- a/.obsidian/plugins/obsidian-tasks-plugin/manifest.json +++ b/.obsidian/plugins/obsidian-tasks-plugin/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-tasks-plugin", "name": "Tasks", - "version": "1.5.0", + "version": "1.5.1", "minAppVersion": "0.13.21", "description": "Task management for Obsidian", "author": "Martin Schenck", diff --git a/.obsidian/plugins/obsidian42-brat/main.js b/.obsidian/plugins/obsidian42-brat/main.js index d1380405..b56f65ca 100644 --- a/.obsidian/plugins/obsidian42-brat/main.js +++ b/.obsidian/plugins/obsidian42-brat/main.js @@ -1,20 +1,20 @@ -var zt=Object.create;var _=Object.defineProperty;var qt=Object.getOwnPropertyDescriptor;var Vt=Object.getOwnPropertyNames;var Jt=Object.getPrototypeOf,Wt=Object.prototype.hasOwnProperty;var Qt=(i,n)=>()=>(n||i((n={exports:{}}).exports,n),n.exports),Gt=(i,n)=>{for(var e in n)_(i,e,{get:n[e],enumerable:!0})},ut=(i,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of Vt(n))!Wt.call(i,s)&&s!==e&&_(i,s,{get:()=>n[s],enumerable:!(t=qt(n,s))||t.enumerable});return i};var Kt=(i,n,e)=>(e=i!=null?zt(Jt(i)):{},ut(n||!i||!i.__esModule?_(e,"default",{value:i,enumerable:!0}):e,i)),Zt=i=>ut(_({},"__esModule",{value:!0}),i);var a=(i,n,e)=>new Promise((t,s)=>{var o=c=>{try{u(e.next(c))}catch(g){s(g)}},r=c=>{try{u(e.throw(c))}catch(g){s(g)}},u=c=>c.done?t(c.value):Promise.resolve(c.value).then(o,r);u((e=e.apply(i,n)).next())});var _t=Qt(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});var f=require("obsidian"),it="YYYY-MM-DD",st="gggg-[W]ww",Et="YYYY-MM",It="YYYY-[Q]Q",Ft="YYYY";function L(i){var e,t;let n=window.app.plugins.getPlugin("periodic-notes");return n&&((t=(e=n.settings)==null?void 0:e[i])==null?void 0:t.enabled)}function B(){var i,n,e,t;try{let{internalPlugins:s,plugins:o}=window.app;if(L("daily")){let{format:g,folder:d,template:p}=((n=(i=o.getPlugin("periodic-notes"))==null?void 0:i.settings)==null?void 0:n.daily)||{};return{format:g||it,folder:(d==null?void 0:d.trim())||"",template:(p==null?void 0:p.trim())||""}}let{folder:r,format:u,template:c}=((t=(e=s.getPluginById("daily-notes"))==null?void 0:e.instance)==null?void 0:t.options)||{};return{format:u||it,folder:(r==null?void 0:r.trim())||"",template:(c==null?void 0:c.trim())||""}}catch(s){console.info("No custom daily note settings found!",s)}}function R(){var i,n,e,t,s,o,r;try{let u=window.app.plugins,c=(i=u.getPlugin("calendar"))==null?void 0:i.options,g=(e=(n=u.getPlugin("periodic-notes"))==null?void 0:n.settings)==null?void 0:e.weekly;if(L("weekly"))return{format:g.format||st,folder:((t=g.folder)==null?void 0:t.trim())||"",template:((s=g.template)==null?void 0:s.trim())||""};let d=c||{};return{format:d.weeklyNoteFormat||st,folder:((o=d.weeklyNoteFolder)==null?void 0:o.trim())||"",template:((r=d.weeklyNoteTemplate)==null?void 0:r.trim())||""}}catch(u){console.info("No custom weekly note settings found!",u)}}function k(){var n,e,t,s;let i=window.app.plugins;try{let o=L("monthly")&&((e=(n=i.getPlugin("periodic-notes"))==null?void 0:n.settings)==null?void 0:e.monthly)||{};return{format:o.format||Et,folder:((t=o.folder)==null?void 0:t.trim())||"",template:((s=o.template)==null?void 0:s.trim())||""}}catch(o){console.info("No custom monthly note settings found!",o)}}function M(){var n,e,t,s;let i=window.app.plugins;try{let o=L("quarterly")&&((e=(n=i.getPlugin("periodic-notes"))==null?void 0:n.settings)==null?void 0:e.quarterly)||{};return{format:o.format||It,folder:((t=o.folder)==null?void 0:t.trim())||"",template:((s=o.template)==null?void 0:s.trim())||""}}catch(o){console.info("No custom quarterly note settings found!",o)}}function O(){var n,e,t,s;let i=window.app.plugins;try{let o=L("yearly")&&((e=(n=i.getPlugin("periodic-notes"))==null?void 0:n.settings)==null?void 0:e.yearly)||{};return{format:o.format||Ft,folder:((t=o.folder)==null?void 0:t.trim())||"",template:((s=o.template)==null?void 0:s.trim())||""}}catch(o){console.info("No custom yearly note settings found!",o)}}function Dt(...i){let n=[];for(let t=0,s=i.length;t{let X=t(),tt=i.clone().set({hour:X.get("hour"),minute:X.get("minute"),second:X.get("second")});return y&&tt.add(parseInt(N,10),b),h?tt.format(h.substring(1).trim()):tt.format(o)}).replace(/{{\s*yesterday\s*}}/gi,i.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,i.clone().add(1,"d").format(o)));return n.foldManager.save(p,c),p}catch(p){console.error(`Failed to create file: '${d}'`,p),new f.Notice("Unable to create new file.")}})}function oe(i,n){var e;return(e=n[C(i,"day")])!=null?e:null}function re(){let{vault:i}=window.app,{folder:n}=B(),e=i.getAbstractFileByPath(f.normalizePath(n));if(!e)throw new at("Failed to find daily notes folder");let t={};return f.Vault.recurseChildren(e,s=>{if(s instanceof f.TFile){let o=I(s,"day");if(o){let r=C(o,"day");t[r]=s}}}),t}var ot=class extends Error{};function le(){let{moment:i}=window,n=i.localeData()._week.dow,e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;n;)e.push(e.shift()),n--;return e}function ge(i){return le().indexOf(i.toLowerCase())}function kt(i){return a(this,null,function*(){let{vault:n}=window.app,{template:e,format:t,folder:s}=R(),[o,r]=yield E(e),u=i.format(t),c=yield x(s,u);try{let g=yield n.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,P,w,y,N)=>{let b=window.moment(),h=i.clone().set({hour:b.get("hour"),minute:b.get("minute"),second:b.get("second")});return P&&h.add(parseInt(w,10),y),N?h.format(N.substring(1).trim()):h.format(t)}).replace(/{{\s*title\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(d,p,P)=>{let w=ge(p);return i.weekday(w).format(P.trim())}));return window.app.foldManager.save(g,r),g}catch(g){console.error(`Failed to create file: '${c}'`,g),new f.Notice("Unable to create new file.")}})}function ue(i,n){var e;return(e=n[C(i,"week")])!=null?e:null}function ce(){let i={};if(!Ot())return i;let{vault:n}=window.app,{folder:e}=R(),t=n.getAbstractFileByPath(f.normalizePath(e));if(!t)throw new ot("Failed to find weekly notes folder");return f.Vault.recurseChildren(t,s=>{if(s instanceof f.TFile){let o=I(s,"week");if(o){let r=C(o,"week");i[r]=s}}}),i}var rt=class extends Error{};function Mt(i){return a(this,null,function*(){let{vault:n}=window.app,{template:e,format:t,folder:s}=k(),[o,r]=yield E(e),u=i.format(t),c=yield x(s,u);try{let g=yield n.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,P,w,y,N)=>{let b=window.moment(),h=i.clone().set({hour:b.get("hour"),minute:b.get("minute"),second:b.get("second")});return P&&h.add(parseInt(w,10),y),N?h.format(N.substring(1).trim()):h.format(t)}).replace(/{{\s*date\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,u));return window.app.foldManager.save(g,r),g}catch(g){console.error(`Failed to create file: '${c}'`,g),new f.Notice("Unable to create new file.")}})}function de(i,n){var e;return(e=n[C(i,"month")])!=null?e:null}function me(){let i={};if(!xt())return i;let{vault:n}=window.app,{folder:e}=k(),t=n.getAbstractFileByPath(f.normalizePath(e));if(!t)throw new rt("Failed to find monthly notes folder");return f.Vault.recurseChildren(t,s=>{if(s instanceof f.TFile){let o=I(s,"month");if(o){let r=C(o,"month");i[r]=s}}}),i}var lt=class extends Error{};function pe(i){return a(this,null,function*(){let{vault:n}=window.app,{template:e,format:t,folder:s}=M(),[o,r]=yield E(e),u=i.format(t),c=yield x(s,u);try{let g=yield n.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,P,w,y,N)=>{let b=window.moment(),h=i.clone().set({hour:b.get("hour"),minute:b.get("minute"),second:b.get("second")});return P&&h.add(parseInt(w,10),y),N?h.format(N.substring(1).trim()):h.format(t)}).replace(/{{\s*date\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,u));return window.app.foldManager.save(g,r),g}catch(g){console.error(`Failed to create file: '${c}'`,g),new f.Notice("Unable to create new file.")}})}function fe(i,n){var e;return(e=n[C(i,"quarter")])!=null?e:null}function he(){let i={};if(!$t())return i;let{vault:n}=window.app,{folder:e}=M(),t=n.getAbstractFileByPath(f.normalizePath(e));if(!t)throw new lt("Failed to find quarterly notes folder");return f.Vault.recurseChildren(t,s=>{if(s instanceof f.TFile){let o=I(s,"quarter");if(o){let r=C(o,"quarter");i[r]=s}}}),i}var gt=class extends Error{};function be(i){return a(this,null,function*(){let{vault:n}=window.app,{template:e,format:t,folder:s}=O(),[o,r]=yield E(e),u=i.format(t),c=yield x(s,u);try{let g=yield n.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,P,w,y,N)=>{let b=window.moment(),h=i.clone().set({hour:b.get("hour"),minute:b.get("minute"),second:b.get("second")});return P&&h.add(parseInt(w,10),y),N?h.format(N.substring(1).trim()):h.format(t)}).replace(/{{\s*date\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,u));return window.app.foldManager.save(g,r),g}catch(g){console.error(`Failed to create file: '${c}'`,g),new f.Notice("Unable to create new file.")}})}function we(i,n){var e;return(e=n[C(i,"year")])!=null?e:null}function ye(){let i={};if(!Ut())return i;let{vault:n}=window.app,{folder:e}=O(),t=n.getAbstractFileByPath(f.normalizePath(e));if(!t)throw new gt("Failed to find yearly notes folder");return f.Vault.recurseChildren(t,s=>{if(s instanceof f.TFile){let o=I(s,"year");if(o){let r=C(o,"year");i[r]=s}}}),i}function Te(){var t,s;let{app:i}=window,n=i.internalPlugins.plugins["daily-notes"];if(n&&n.enabled)return!0;let e=i.plugins.getPlugin("periodic-notes");return e&&((s=(t=e.settings)==null?void 0:t.daily)==null?void 0:s.enabled)}function Ot(){var e,t;let{app:i}=window;if(i.plugins.getPlugin("calendar"))return!0;let n=i.plugins.getPlugin("periodic-notes");return n&&((t=(e=n.settings)==null?void 0:e.weekly)==null?void 0:t.enabled)}function xt(){var e,t;let{app:i}=window,n=i.plugins.getPlugin("periodic-notes");return n&&((t=(e=n.settings)==null?void 0:e.monthly)==null?void 0:t.enabled)}function $t(){var e,t;let{app:i}=window,n=i.plugins.getPlugin("periodic-notes");return n&&((t=(e=n.settings)==null?void 0:e.quarterly)==null?void 0:t.enabled)}function Ut(){var e,t;let{app:i}=window,n=i.plugins.getPlugin("periodic-notes");return n&&((t=(e=n.settings)==null?void 0:e.yearly)==null?void 0:t.enabled)}function Pe(i){return{day:B,week:R,month:k,quarter:M,year:O}[i]()}function ve(i,n){return{day:Rt,month:Mt,week:kt}[i](n)}l.DEFAULT_DAILY_NOTE_FORMAT=it;l.DEFAULT_MONTHLY_NOTE_FORMAT=Et;l.DEFAULT_QUARTERLY_NOTE_FORMAT=It;l.DEFAULT_WEEKLY_NOTE_FORMAT=st;l.DEFAULT_YEARLY_NOTE_FORMAT=Ft;l.appHasDailyNotesPluginLoaded=Te;l.appHasMonthlyNotesPluginLoaded=xt;l.appHasQuarterlyNotesPluginLoaded=$t;l.appHasWeeklyNotesPluginLoaded=Ot;l.appHasYearlyNotesPluginLoaded=Ut;l.createDailyNote=Rt;l.createMonthlyNote=Mt;l.createPeriodicNote=ve;l.createQuarterlyNote=pe;l.createWeeklyNote=kt;l.createYearlyNote=be;l.getAllDailyNotes=re;l.getAllMonthlyNotes=me;l.getAllQuarterlyNotes=he;l.getAllWeeklyNotes=ce;l.getAllYearlyNotes=ye;l.getDailyNote=oe;l.getDailyNoteSettings=B;l.getDateFromFile=I;l.getDateFromPath=ae;l.getDateUID=C;l.getMonthlyNote=de;l.getMonthlyNoteSettings=k;l.getPeriodicNoteSettings=Pe;l.getQuarterlyNote=fe;l.getQuarterlyNoteSettings=M;l.getTemplateInfo=E;l.getWeeklyNote=ue;l.getWeeklyNoteSettings=R;l.getYearlyNote=we;l.getYearlyNoteSettings=O});var Ne={};Gt(Ne,{default:()=>Z});module.exports=Zt(Ne);var jt=require("obsidian");var T=require("obsidian");var q=require("obsidian");var ct=require("obsidian"),v=class extends ct.FuzzySuggestModal{constructor(e){super(e.app);this.scope.register(["Shift"],"Enter",t=>this.enterTrigger(t)),this.scope.register(["Ctrl"],"Enter",t=>this.enterTrigger(t))}setSuggesterData(e){this.data=e}display(e){return a(this,null,function*(){this.callbackFunction=e,this.open()})}getItems(){return this.data}getItemText(e){return e.display}onChooseItem(){}renderSuggestion(e,t){t.createEl("div",{text:e.item.display})}enterTrigger(e){let t=document.querySelector(".suggestion-item.is-selected div").textContent,s=this.data.find(o=>o.display===t);s&&(this.invokeCallback(s,e),this.close())}onChooseSuggestion(e,t){this.invokeCallback(e.item,t)}invokeCallback(e,t){this.callbackFunction(e,t)}};var A=require("obsidian"),Xt="https://raw.githubusercontent.com/",H=(i,n,e)=>a(void 0,null,function*(){let t=`https://github.com/${i}/releases/download/${n}/${e}`;try{let s=yield(0,A.request)({url:t});return s==="Not Found"||s==='{"error":"Not Found"}'?null:s}catch(s){console.log("error in grabReleaseFileFromRepository",t,s)}}),dt=(i,n=!0)=>a(void 0,null,function*(){let e=Xt+i+(n===!0?"/HEAD/manifest.json":"/HEAD/manifest-beta.json");try{let t=yield(0,A.request)({url:e});return t==="404: Not Found"?null:yield JSON.parse(t)}catch(t){console.log(`error in grabManifestJsonFromRepository for ${e}`,t)}}),mt=()=>a(void 0,null,function*(){let i="https://raw.githubusercontent.com/obsidianmd/obsidian-releases/HEAD/community-plugins.json";try{let n=yield(0,A.request)({url:i});return n==="404: Not Found"?null:yield JSON.parse(n)}catch(n){console.log("error in grabCommmunityPluginList",n)}}),Y=()=>a(void 0,null,function*(){let i="https://raw.githubusercontent.com/obsidianmd/obsidian-releases/HEAD/community-css-themes.json";try{let n=yield(0,A.request)({url:i});return n==="404: Not Found"?null:yield JSON.parse(n)}catch(n){console.log("error in grabCommmunityThemesList",n)}}),et=i=>a(void 0,null,function*(){let n=`https://raw.githubusercontent.com/${i}/HEAD/obsidian.css`;try{let e=yield(0,A.request)({url:n});return e==="404: Not Found"?null:e}catch(e){console.log("error in grabCommmunityThemesList",e)}}),te=(i,n)=>a(void 0,null,function*(){let e=`https://api.github.com/repos/${i}/commits?path=${n}&page=1&per_page=1`;try{let t=yield(0,A.request)({url:e});return t==="404: Not Found"?null:JSON.parse(t)}catch(t){console.log("error in grabCommmunityThemesList",t)}}),j=(i,n)=>a(void 0,null,function*(){let e=yield te(i,n);return e[0].commit.committer.date?e[0].commit.committer.date:""});var pt={pluginList:[],themesList:[],updateAtStartup:!1,updateThemesAtStartup:!1,ribbonIconEnabled:!0,loggingEnabled:!1,loggingPath:"BRAT-log",loggingVerboseEnabled:!1,debuggingMode:!0,notificationsEnabled:!0};function ft(i,n){return a(this,null,function*(){i.settings.pluginList.contains(n)||(i.settings.pluginList.unshift(n),i.saveSettings())})}function ht(i,n){return a(this,null,function*(){return i.settings.pluginList.contains(n)})}function bt(i,n){return a(this,null,function*(){let e={repo:n,lastUpdate:yield j(n,"obsidian.css")};i.settings.themesList.unshift(e),i.saveSettings()})}function wt(i,n){return a(this,null,function*(){return!!i.settings.themesList.find(t=>t.repo===n)})}function yt(i,n,e){i.settings.themesList.forEach(t=>{t.repo===n&&(t.lastUpdate=e,i.saveSettings())})}var Tt=require("obsidian");function m(i,n,e=10,t=null){if(i.settings.notificationsEnabled===!1)return;let s=t?"(click=dismiss, right-click=Info)":"",o=new Tt.Notice(`BRAT -${n} -${s}`,e*1e3);t&&(o.noticeEl.oncontextmenu=()=>a(this,null,function*(){t()}))}function z(){return a(this,null,function*(){try{let i=yield fetch("https://obsidian.md/?"+Math.random());return i.status>=200&&i.status<300}catch(i){return!1}})}var Pt=i=>(0,q.normalizePath)(i.app.vault.configDir+"/themes")+"/",nt=(i,n,e="")=>a(void 0,null,function*(){let t=yield et(n);if(!t)return m(i,"There is no obsidian.css file in the root path of this repository, so there is no theme to install."),!1;yield vt(i,e,t);let s=`${e} theme installed from ${n}. `;return i.log(s+`[Theme Info](https://github.com/${n})`,!1),m(i,`${s}`,10,()=>a(void 0,null,function*(){window.open(`https://github.com/${n}`)})),setTimeout(()=>{i.app.customCss.setTheme(e)},500),!0}),vt=(i,n,e)=>a(void 0,null,function*(){let t=Pt(i),s=i.app.vault.adapter;(yield s.exists(t))===!1&&(yield s.mkdir(t)),yield s.write(t+n+".css",e)}),Nt=i=>a(void 0,null,function*(){let n=yield Y(),e=Object.values(n).map(s=>({display:`Theme: ${s.name} (${s.repo})`,info:s})),t=new v(i);t.setSuggesterData(e),yield t.display(s=>a(void 0,null,function*(){yield nt(i,s.info.repo,s.info.name)}))}),V=i=>("BRAT-"+i.replace("/","----")).substr(0,100),Ct=(i,n)=>a(void 0,null,function*(){i.settings.themesList=i.settings.themesList.filter(t=>t.repo!=n),i.saveSettings(),yield i.app.vault.adapter.remove(Pt(i)+V(n)+".css");let e=`Removed ${n} from BRAT themes list and deleted from vault`;i.log(e,!0),m(i,`${e}`)}),J=(i,n)=>a(void 0,null,function*(){if((yield z())===!1){console.log("BRAT: No internet detected.");return}let e,t="Checking for beta theme updates STARTED";i.log(t,!0),n&&i.settings.notificationsEnabled&&(e=new q.Notice(`BRAT -${t}`,3e4));for(let o of i.settings.themesList){let r=yield j(o.repo,"obsidian.css");r!==o.lastUpdate&&(yield ee(i,o.repo,o.lastUpdate,r))}let s="Checking for beta theme updates COMPLETED";i.log(s,!0),n&&(i.settings.notificationsEnabled&&e.hide(),m(i,s))}),ee=(i,n,e="",t="")=>a(void 0,null,function*(){let s=yield et(n);if(!s)return m(i,"There is no obsidian.css file in the root path of the ${cssGithubRepository} repository, so this theme cannot be updated."),!1;let o=V(n);yield vt(i,o,s),yt(i,n,t);let r=`${o} theme updated from ${n}. From date: ${e} to ${t} `;return i.log(r+`[Theme Info](https://github.com/${n})`,!1),m(i,`${r}`,20,()=>a(void 0,null,function*(){window.open(`https://github.com/${n}`)})),!0});var W=require("obsidian");var S=class extends W.Modal{constructor(e,t=!1){super(e.app);this.plugin=e,this.address="",this.openSettingsTabAfterwards=t}submitForm(){return a(this,null,function*(){if(this.address==="")return;let e=this.address.replace("https://github.com/","");if(yield wt(this.plugin,e)){m(this.plugin,"This plugin is already in the list for beta testing",10);return}(yield nt(this.plugin,e,V(e)))&&(yield bt(this.plugin,e),this.close())})}onOpen(){this.contentEl.createEl("h4",{text:"Github repository for beta theme:"}),this.contentEl.createEl("form",{},e=>{new W.Setting(e).addText(t=>{t.setPlaceholder("Repository (example: GitubUserName/repository-name"),t.onChange(s=>{this.address=s.trim()}),t.inputEl.addEventListener("keydown",s=>a(this,null,function*(){s.key==="Enter"&&this.address!==" "&&(s.preventDefault(),yield this.submitForm())})),t.inputEl.style.width="100%",window.setTimeout(()=>{let s=document.querySelector(".setting-item-info");s&&s.remove(),t.inputEl.focus()},10)}),e.createDiv("modal-button-container",t=>{t.createEl("button",{attr:{type:"button"},text:"Never mind"}).addEventListener("click",()=>this.close()),t.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:"Add Theme"})}),e.addEventListener("submit",t=>a(this,null,function*(){t.preventDefault(),this.address!==""&&(yield this.submitForm())}))})}onClose(){return a(this,null,function*(){this.openSettingsTabAfterwards&&(yield this.plugin.app.setting.open(),yield this.plugin.app.setting.openTabById("obsidian42-brat"))})}};var Q=class extends T.PluginSettingTab{constructor(e,t){super(e,t);this.plugin=t}display(){let{containerEl:e}=this;e.empty(),e.createEl("h2",{text:this.plugin.appName}),new T.Setting(e).setName("Auto-update plugins at startup").setDesc("If enabled all beta plugins will be checked for updates each time Obsidian starts.").addToggle(t=>{t.setValue(this.plugin.settings.updateAtStartup),t.onChange(s=>a(this,null,function*(){this.plugin.settings.updateAtStartup=s,yield this.plugin.saveSettings()}))}),new T.Setting(e).setName("Auto-update themes at startup").setDesc("If enabled all beta themes will be checked for updates each time Obsidian starts.").addToggle(t=>{t.setValue(this.plugin.settings.updateThemesAtStartup),t.onChange(s=>a(this,null,function*(){this.plugin.settings.updateThemesAtStartup=s,yield this.plugin.saveSettings()}))}),new T.Setting(e).setName("Ribbon Button").setDesc("Toggle ribbon button off and on.").addToggle(t=>{t.setValue(this.plugin.settings.ribbonIconEnabled),t.onChange(s=>a(this,null,function*(){this.plugin.settings.ribbonIconEnabled=s,this.plugin.settings.ribbonIconEnabled===!1?this.plugin.ribbonIcon.remove():this.plugin.showRibbonButton(),yield this.plugin.saveSettings()}))}),e.createEl("hr"),e.createEl("h2",{text:"Beta Plugin List"}),e.createEl("div",{text:'The following is a list of beta plugins added via the command palette "Add a beta plugin for testing". '}),e.createEl("p"),e.createEl("div",{text:"Click the x button next to a plugin to remove it from the list."}),e.createEl("p"),e.createEl("span").createEl("b",{text:"Note: "}),e.createSpan({text:"This does not delete the plugin, this should be done from the Community Plugins tab in Settings."}),new T.Setting(e).addButton(t=>{t.setButtonText("Add Beta plugin"),t.onClick(()=>a(this,null,function*(){this.plugin.app.setting.close(),yield this.plugin.betaPlugins.displayAddNewPluginModal(!0)}))});for(let t of this.plugin.settings.pluginList)new T.Setting(e).setName(t).addButton(s=>{s.setIcon("cross"),s.setTooltip("Delete this beta plugin"),s.onClick(()=>a(this,null,function*(){s.buttonEl.textContent===""?s.setButtonText("Click once more to confirm removal"):(s.buttonEl.parentElement.parentElement.remove(),yield this.plugin.betaPlugins.deletePlugin(t))}))});e.createEl("hr"),e.createEl("h2",{text:"Beta Themes List"}),new T.Setting(e).addButton(t=>{t.setButtonText("Add Beta Theme"),t.onClick(()=>a(this,null,function*(){this.plugin.app.setting.close(),new S(this.plugin).open()}))});for(let t of this.plugin.settings.themesList)new T.Setting(e).setName(t.repo).addButton(s=>{s.setIcon("cross"),s.setTooltip("Delete this beta theme"),s.onClick(()=>a(this,null,function*(){s.buttonEl.textContent===""?s.setButtonText("Click once more to confirm removal"):(s.buttonEl.parentElement.parentElement.remove(),yield Ct(this.plugin,t.repo))}))});e.createEl("hr"),e.createEl("h2",{text:"Monitoring"}),new T.Setting(e).setName("Enable Notifications").setDesc("BRAT will provide popup notifications for its various activities. Turn this off means no notifications from BRAT.").addToggle(t=>{t.setValue(this.plugin.settings.notificationsEnabled),t.onChange(s=>a(this,null,function*(){this.plugin.settings.notificationsEnabled=s,yield this.plugin.saveSettings()}))}),new T.Setting(e).setName("Enable Logging").setDesc("Plugin updates will be logged to a file in the log file.").addToggle(t=>{t.setValue(this.plugin.settings.loggingEnabled),t.onChange(s=>a(this,null,function*(){this.plugin.settings.loggingEnabled=s,yield this.plugin.saveSettings()}))}),new T.Setting(this.containerEl).setName("BRAT Log File Location").setDesc("Logs will be saved to this file. Don't add .md to the file name.").addSearch(t=>{t.setPlaceholder("Example: BRAT-log").setValue(this.plugin.settings.loggingPath).onChange(s=>a(this,null,function*(){this.plugin.settings.loggingPath=s,yield this.plugin.saveSettings()}))}),new T.Setting(e).setName("Enable Verbose Logging").setDesc("Get a lot more information in the log.").addToggle(t=>{t.setValue(this.plugin.settings.loggingVerboseEnabled),t.onChange(s=>a(this,null,function*(){this.plugin.settings.loggingVerboseEnabled=s,yield this.plugin.saveSettings()}))}),new T.Setting(e).setName("Debugging Mode").setDesc("Atomic Bomb level console logging. Can be used for troubleshoting and development.").addToggle(t=>{t.setValue(this.plugin.settings.debuggingMode),t.onChange(s=>a(this,null,function*(){this.plugin.settings.debuggingMode=s,yield this.plugin.saveSettings()}))})}};var G=require("obsidian");var F=class extends G.Modal{constructor(e,t,s=!1){super(e.app);this.plugin=e,this.betaPlugins=t,this.address="",this.openSettingsTabAfterwards=s}submitForm(){return a(this,null,function*(){if(this.address==="")return;let e=this.address.replace("https://github.com/","");if(yield ht(this.plugin,e)){m(this.plugin,"This plugin is already in the list for beta testing",10);return}(yield this.betaPlugins.addPlugin(e))&&this.close()})}onOpen(){this.contentEl.createEl("h4",{text:"Github repository for beta plugin:"}),this.contentEl.createEl("form",{},e=>{new G.Setting(e).addText(t=>{t.setPlaceholder("Repository (example: TfTHacker/obsidian-brat"),t.onChange(s=>{this.address=s.trim()}),t.inputEl.addEventListener("keydown",s=>a(this,null,function*(){s.key==="Enter"&&this.address!==" "&&(s.preventDefault(),yield this.submitForm())})),t.inputEl.style.width="100%",window.setTimeout(()=>{let s=document.querySelector(".setting-item-info");s&&s.remove(),t.inputEl.focus()},10)}),e.createDiv("modal-button-container",t=>{t.createEl("button",{attr:{type:"button"},text:"Never mind"}).addEventListener("click",()=>this.close()),t.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:"Add Plugin"})}),e.addEventListener("submit",t=>a(this,null,function*(){t.preventDefault(),this.address!==""&&(yield this.submitForm())}))})}onClose(){return a(this,null,function*(){this.openSettingsTabAfterwards&&(yield this.plugin.app.setting.open(),yield this.plugin.app.setting.openTabById("obsidian42-brat"))})}};var K=require("obsidian");var D=class{constructor(n){this.plugin=n}displayAddNewPluginModal(n=!1){return a(this,null,function*(){new F(this.plugin,this,n).open()})}validateRepository(n,e=!1,t=!1){return a(this,null,function*(){let o=yield dt(n,!e);return o?"id"in o?"version"in o?o:(t&&m(this.plugin,`${n} -The version attribute for the release is missing from the manifest file`,15),null):(t&&m(this.plugin,`${n} -The plugin id attribute for the release is missing from the manifest file`,15),null):(t&&m(this.plugin,`${n} -This does not seem to be an obsidian plugin, as there is no manifest.json file.`,15),null)})}getAllReleaseFiles(n,e,t){return a(this,null,function*(){return{mainJs:yield H(n,e.version,"main.js"),manifest:t?yield H(n,e.version,"manifest.json"):null,styles:yield H(n,e.version,"styles.css")}})}writeReleaseFilesToPluginFolder(n,e){return a(this,null,function*(){let t=(0,K.normalizePath)(this.plugin.app.vault.configDir+"/plugins/"+n)+"/",s=this.plugin.app.vault.adapter;((yield s.exists(t))===!1||!(yield s.exists(t+"manifest.json")))&&(yield s.mkdir(t)),yield s.write(t+"main.js",e.mainJs),yield s.write(t+"manifest.json",e.manifest),e.styles&&(yield s.write(t+"styles.css",e.styles))})}addPlugin(n,e=!1,t=!1,s=!1){return a(this,null,function*(){var g;let r=yield this.validateRepository(n,!0,!1),u=!!r;if(u===!1&&(r=yield this.validateRepository(n,!1,!0)),r===null){let d=`${n} -A manifest.json or manifest-beta.json file does not exist in the root directory of the repository. This plugin cannot be installed.`;return this.plugin.log(d,!0),m(this.plugin,`${d}`,10),!1}if(!r.hasOwnProperty("version")){let d=`${n} -The manifest${u?"-beta":""}.json file in the root directory of the repository does not have a version number in the file. This plugin cannot be installed.`;return this.plugin.log(d,!0),m(this.plugin,`${d}`,10),!1}let c=()=>a(this,null,function*(){let d=yield this.getAllReleaseFiles(n,r,u);if((u||d.manifest===null)&&(d.manifest=JSON.stringify(r)),d.mainJs===null){let p=`${n} -The release is not complete and cannot be download. main.js is missing from the Release`;return this.plugin.log(p,!0),m(this.plugin,`${p}`,10),null}return d});if(e===!1){let d=yield c();if(d===null)return;yield this.writeReleaseFilesToPluginFolder(r.id,d),yield ft(this.plugin,n),yield this.plugin.app.plugins.loadManifests();let p=`${n} -The plugin has been registered with BRAT. You may still need to enable it the Community Plugin List.`;this.plugin.log(p,!0),m(this.plugin,p,10)}else{let d=this.plugin.app.vault.configDir+"/plugins/"+r.id+"/",p=null;try{p=yield this.plugin.app.vault.adapter.read(d+"manifest.json")}catch(w){if(w.errno===-4058)return yield this.addPlugin(n,!1,u),!0;console.log("BRAT - Local Manifest Load",r.id,JSON.stringify(w,null,2))}let P=yield JSON.parse(p);if(P.version!==r.version){let w=yield c();if(w===null)return;if(t){let y=`There is an update available for ${r.id} from version ${P.version} to ${r.version}. `;this.plugin.log(y+`[Release Info](https://github.com/${n}/releases/tag/${r.version})`,!1),m(this.plugin,y,30,()=>a(this,null,function*(){window.open(`https://github.com/${n}/releases/tag/${r.version}`)}))}else{yield this.writeReleaseFilesToPluginFolder(r.id,w),yield this.plugin.app.plugins.loadManifests(),(g=this.plugin.app.plugins.plugins[r.id])!=null&&g.manifest&&(yield this.reloadPlugin(r.id));let y=`${r.id} -Plugin has been updated from version ${P.version} to ${r.version}. `;this.plugin.log(y+`[Release Info](https://github.com/${n}/releases/tag/${r.version})`,!1),m(this.plugin,y,30,()=>a(this,null,function*(){window.open(`https://github.com/${n}/releases/tag/${r.version}`)}))}}else s&&m(this.plugin,`No update available for ${n}`,3)}return!0})}reloadPlugin(n){return a(this,null,function*(){let e=this.plugin.app.plugins;try{yield e.disablePlugin(n),yield e.enablePlugin(n)}catch(t){console.log("reload plugin",t)}})}updatePlugin(n,e=!1,t=!1){return a(this,null,function*(){let s=yield this.addPlugin(n,!0,e,t);return s===!1&&e===!1&&m(this.plugin,`${n} -Update of plugin failed.`),s})}checkForUpdatesAndInstallUpdates(n=!1,e=!1){return a(this,null,function*(){if((yield z())===!1){console.log("BRAT: No internet detected.");return}let t,s="Checking for plugin updates STARTED";this.plugin.log(s,!0),n&&this.plugin.settings.notificationsEnabled&&(t=new K.Notice(`BRAT -${s}`,3e4));for(let r of this.plugin.settings.pluginList)yield this.updatePlugin(r,e);let o="Checking for plugin updates COMPLETED";this.plugin.log(o,!0),n&&(t.hide(),m(this.plugin,o,10))})}deletePlugin(n){return a(this,null,function*(){let e=`Removed ${n} from BRAT plugin list`;this.plugin.log(e,!0),this.plugin.settings.pluginList=this.plugin.settings.pluginList.filter(t=>t!=n),this.plugin.saveSettings()})}getEnabledDisabledPlugins(n){let e=this.plugin.app.plugins,t=Object.values(e.manifests),s=Object.values(e.plugins).map(o=>o.manifest);return n?t.filter(o=>s.find(r=>o.id===r.id)):t.filter(o=>!s.find(r=>o.id===r.id))}};var At=require("obsidian");function St(){(0,At.addIcon)("BratIcon",'')}var $=require("obsidian"),Ht=Kt(_t());function Yt(i,n,e=!1){if(i.settings.debuggingMode&&console.log("BRAT: "+n),i.settings.loggingEnabled){if(i.settings.loggingVerboseEnabled===!1&&e===!0)return;{let t=i.settings.loggingPath+".md",s="[["+(0,$.moment)().format((0,Ht.getDailyNoteSettings)().format).toString()+"]] "+(0,$.moment)().format("HH:mm"),o=$.Platform.isDesktop?window.require("os").hostname():"MOBILE",r=s+" "+o+" "+n.replace(` +var Ve=Object.create;var _=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,We=Object.prototype.hasOwnProperty;var Qe=(s,t)=>()=>(t||s((t={exports:{}}).exports,t),t.exports),Ge=(s,t)=>{for(var e in t)_(s,e,{get:t[e],enumerable:!0})},ge=(s,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of qe(t))!We.call(s,i)&&i!==e&&_(s,i,{get:()=>t[i],enumerable:!(n=je(t,i))||n.enumerable});return s};var Ke=(s,t,e)=>(e=s!=null?Ve(Je(s)):{},ge(t||!s||!s.__esModule?_(e,"default",{value:s,enumerable:!0}):e,s)),Ze=s=>ge(_({},"__esModule",{value:!0}),s);var a=(s,t,e)=>new Promise((n,i)=>{var o=c=>{try{l(e.next(c))}catch(g){i(g)}},r=c=>{try{l(e.throw(c))}catch(g){i(g)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,r);l((e=e.apply(s,t)).next())});var ze=Qe(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0});var p=require("obsidian"),ie="YYYY-MM-DD",se="gggg-[W]ww",Ae="YYYY-MM",Ee="YYYY-[Q]Q",Ie="YYYY";function D(s){var e,n;let t=window.app.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e[s])==null?void 0:n.enabled)}function R(){var s,t,e,n;try{let{internalPlugins:i,plugins:o}=window.app;if(D("daily")){let{format:g,folder:h,template:d}=((t=(s=o.getPlugin("periodic-notes"))==null?void 0:s.settings)==null?void 0:t.daily)||{};return{format:g||ie,folder:(h==null?void 0:h.trim())||"",template:(d==null?void 0:d.trim())||""}}let{folder:r,format:l,template:c}=((n=(e=i.getPluginById("daily-notes"))==null?void 0:e.instance)==null?void 0:n.options)||{};return{format:l||ie,folder:(r==null?void 0:r.trim())||"",template:(c==null?void 0:c.trim())||""}}catch(i){console.info("No custom daily note settings found!",i)}}function k(){var s,t,e,n,i,o,r;try{let l=window.app.plugins,c=(s=l.getPlugin("calendar"))==null?void 0:s.options,g=(e=(t=l.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.weekly;if(D("weekly"))return{format:g.format||se,folder:((n=g.folder)==null?void 0:n.trim())||"",template:((i=g.template)==null?void 0:i.trim())||""};let h=c||{};return{format:h.weeklyNoteFormat||se,folder:((o=h.weeklyNoteFolder)==null?void 0:o.trim())||"",template:((r=h.weeklyNoteTemplate)==null?void 0:r.trim())||""}}catch(l){console.info("No custom weekly note settings found!",l)}}function M(){var t,e,n,i;let s=window.app.plugins;try{let o=D("monthly")&&((e=(t=s.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.monthly)||{};return{format:o.format||Ae,folder:((n=o.folder)==null?void 0:n.trim())||"",template:((i=o.template)==null?void 0:i.trim())||""}}catch(o){console.info("No custom monthly note settings found!",o)}}function x(){var t,e,n,i;let s=window.app.plugins;try{let o=D("quarterly")&&((e=(t=s.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.quarterly)||{};return{format:o.format||Ee,folder:((n=o.folder)==null?void 0:n.trim())||"",template:((i=o.template)==null?void 0:i.trim())||""}}catch(o){console.info("No custom quarterly note settings found!",o)}}function O(){var t,e,n,i;let s=window.app.plugins;try{let o=D("yearly")&&((e=(t=s.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.yearly)||{};return{format:o.format||Ie,folder:((n=o.folder)==null?void 0:n.trim())||"",template:((i=o.template)==null?void 0:i.trim())||""}}catch(o){console.info("No custom yearly note settings found!",o)}}function Le(...s){let t=[];for(let n=0,i=s.length;n{let X=n(),ee=s.clone().set({hour:X.get("hour"),minute:X.get("minute"),second:X.get("second")});return T&&ee.add(parseInt(f,10),P),w?ee.format(w.substring(1).trim()):ee.format(o)}).replace(/{{\s*yesterday\s*}}/gi,s.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,s.clone().add(1,"d").format(o)));return t.foldManager.save(d,c),d}catch(d){console.error(`Failed to create file: '${h}'`,d),new p.Notice("Unable to create new file.")}})}function at(s,t){var e;return(e=t[N(s,"day")])!=null?e:null}function rt(){let{vault:s}=window.app,{folder:t}=R(),e=s.getAbstractFileByPath(p.normalizePath(t));if(!e)throw new oe("Failed to find daily notes folder");let n={};return p.Vault.recurseChildren(e,i=>{if(i instanceof p.TFile){let o=E(i,"day");if(o){let r=N(o,"day");n[r]=i}}}),n}var ae=class extends Error{};function lt(){let{moment:s}=window,t=s.localeData()._week.dow,e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)e.push(e.shift()),t--;return e}function ut(s){return lt().indexOf(s.toLowerCase())}function ke(s){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:i}=k(),[o,r]=yield A(e),l=s.format(n),c=yield $(i,l);try{let g=yield t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,d,b,y,T,f)=>{let P=window.moment(),w=s.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return b&&w.add(parseInt(y,10),T),f?w.format(f.substring(1).trim()):w.format(n)}).replace(/{{\s*title\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(h,d,b)=>{let y=ut(d);return s.weekday(y).format(b.trim())}));return window.app.foldManager.save(g,r),g}catch(g){console.error(`Failed to create file: '${c}'`,g),new p.Notice("Unable to create new file.")}})}function gt(s,t){var e;return(e=t[N(s,"week")])!=null?e:null}function ct(){let s={};if(!xe())return s;let{vault:t}=window.app,{folder:e}=k(),n=t.getAbstractFileByPath(p.normalizePath(e));if(!n)throw new ae("Failed to find weekly notes folder");return p.Vault.recurseChildren(n,i=>{if(i instanceof p.TFile){let o=E(i,"week");if(o){let r=N(o,"week");s[r]=i}}}),s}var re=class extends Error{};function Me(s){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:i}=M(),[o,r]=yield A(e),l=s.format(n),c=yield $(i,l);try{let g=yield t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,d,b,y,T,f)=>{let P=window.moment(),w=s.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return b&&w.add(parseInt(y,10),T),f?w.format(f.substring(1).trim()):w.format(n)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(g,r),g}catch(g){console.error(`Failed to create file: '${c}'`,g),new p.Notice("Unable to create new file.")}})}function dt(s,t){var e;return(e=t[N(s,"month")])!=null?e:null}function mt(){let s={};if(!Oe())return s;let{vault:t}=window.app,{folder:e}=M(),n=t.getAbstractFileByPath(p.normalizePath(e));if(!n)throw new re("Failed to find monthly notes folder");return p.Vault.recurseChildren(n,i=>{if(i instanceof p.TFile){let o=E(i,"month");if(o){let r=N(o,"month");s[r]=i}}}),s}var le=class extends Error{};function pt(s){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:i}=x(),[o,r]=yield A(e),l=s.format(n),c=yield $(i,l);try{let g=yield t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,d,b,y,T,f)=>{let P=window.moment(),w=s.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return b&&w.add(parseInt(y,10),T),f?w.format(f.substring(1).trim()):w.format(n)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(g,r),g}catch(g){console.error(`Failed to create file: '${c}'`,g),new p.Notice("Unable to create new file.")}})}function ft(s,t){var e;return(e=t[N(s,"quarter")])!=null?e:null}function ht(){let s={};if(!$e())return s;let{vault:t}=window.app,{folder:e}=x(),n=t.getAbstractFileByPath(p.normalizePath(e));if(!n)throw new le("Failed to find quarterly notes folder");return p.Vault.recurseChildren(n,i=>{if(i instanceof p.TFile){let o=E(i,"quarter");if(o){let r=N(o,"quarter");s[r]=i}}}),s}var ue=class extends Error{};function bt(s){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:i}=O(),[o,r]=yield A(e),l=s.format(n),c=yield $(i,l);try{let g=yield t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,d,b,y,T,f)=>{let P=window.moment(),w=s.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return b&&w.add(parseInt(y,10),T),f?w.format(f.substring(1).trim()):w.format(n)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(g,r),g}catch(g){console.error(`Failed to create file: '${c}'`,g),new p.Notice("Unable to create new file.")}})}function wt(s,t){var e;return(e=t[N(s,"year")])!=null?e:null}function yt(){let s={};if(!Ue())return s;let{vault:t}=window.app,{folder:e}=O(),n=t.getAbstractFileByPath(p.normalizePath(e));if(!n)throw new ue("Failed to find yearly notes folder");return p.Vault.recurseChildren(n,i=>{if(i instanceof p.TFile){let o=E(i,"year");if(o){let r=N(o,"year");s[r]=i}}}),s}function Tt(){var n,i;let{app:s}=window,t=s.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;let e=s.plugins.getPlugin("periodic-notes");return e&&((i=(n=e.settings)==null?void 0:n.daily)==null?void 0:i.enabled)}function xe(){var e,n;let{app:s}=window;if(s.plugins.getPlugin("calendar"))return!0;let t=s.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.weekly)==null?void 0:n.enabled)}function Oe(){var e,n;let{app:s}=window,t=s.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.monthly)==null?void 0:n.enabled)}function $e(){var e,n;let{app:s}=window,t=s.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.quarterly)==null?void 0:n.enabled)}function Ue(){var e,n;let{app:s}=window,t=s.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.yearly)==null?void 0:n.enabled)}function Pt(s){return{day:R,week:k,month:M,quarter:x,year:O}[s]()}function vt(s,t){return{day:Re,month:Me,week:ke}[s](t)}u.DEFAULT_DAILY_NOTE_FORMAT=ie;u.DEFAULT_MONTHLY_NOTE_FORMAT=Ae;u.DEFAULT_QUARTERLY_NOTE_FORMAT=Ee;u.DEFAULT_WEEKLY_NOTE_FORMAT=se;u.DEFAULT_YEARLY_NOTE_FORMAT=Ie;u.appHasDailyNotesPluginLoaded=Tt;u.appHasMonthlyNotesPluginLoaded=Oe;u.appHasQuarterlyNotesPluginLoaded=$e;u.appHasWeeklyNotesPluginLoaded=xe;u.appHasYearlyNotesPluginLoaded=Ue;u.createDailyNote=Re;u.createMonthlyNote=Me;u.createPeriodicNote=vt;u.createQuarterlyNote=pt;u.createWeeklyNote=ke;u.createYearlyNote=bt;u.getAllDailyNotes=rt;u.getAllMonthlyNotes=mt;u.getAllQuarterlyNotes=ht;u.getAllWeeklyNotes=ct;u.getAllYearlyNotes=yt;u.getDailyNote=at;u.getDailyNoteSettings=R;u.getDateFromFile=E;u.getDateFromPath=ot;u.getDateUID=N;u.getMonthlyNote=dt;u.getMonthlyNoteSettings=M;u.getPeriodicNoteSettings=Pt;u.getQuarterlyNote=ft;u.getQuarterlyNoteSettings=x;u.getTemplateInfo=A;u.getWeeklyNote=gt;u.getWeeklyNoteSettings=k;u.getYearlyNote=wt;u.getYearlyNoteSettings=O});var St={};Ge(St,{default:()=>Z});module.exports=Ze(St);var Ye=require("obsidian");var v=require("obsidian");var q=require("obsidian");var ce=require("obsidian"),S=class extends ce.FuzzySuggestModal{constructor(e){super(e.app);this.scope.register(["Shift"],"Enter",n=>this.enterTrigger(n)),this.scope.register(["Ctrl"],"Enter",n=>this.enterTrigger(n))}setSuggesterData(e){this.data=e}display(e){return a(this,null,function*(){this.callbackFunction=e,this.open()})}getItems(){return this.data}getItemText(e){return e.display}onChooseItem(){}renderSuggestion(e,n){n.createEl("div",{text:e.item.display})}enterTrigger(e){let n=document.querySelector(".suggestion-item.is-selected div").textContent,i=this.data.find(o=>o.display===n);i&&(this.invokeCallback(i,e),this.close())}onChooseSuggestion(e,n){this.invokeCallback(e.item,n)}invokeCallback(e,n){this.callbackFunction(e,n)}};var F=require("obsidian"),Xe="https://raw.githubusercontent.com/",H=(s,t,e)=>a(void 0,null,function*(){let n=`https://github.com/${s}/releases/download/${t}/${e}`;try{let i=yield(0,F.request)({url:n});return i==="Not Found"||i==='{"error":"Not Found"}'?null:i}catch(i){console.log("error in grabReleaseFileFromRepository",n,i)}}),de=(s,t=!0)=>a(void 0,null,function*(){let e=Xe+s+(t===!0?"/HEAD/manifest.json":"/HEAD/manifest-beta.json");try{let n=yield(0,F.request)({url:e});return n==="404: Not Found"?null:yield JSON.parse(n)}catch(n){console.log(`error in grabManifestJsonFromRepository for ${e}`,n)}}),me=()=>a(void 0,null,function*(){let s="https://raw.githubusercontent.com/obsidianmd/obsidian-releases/HEAD/community-plugins.json";try{let t=yield(0,F.request)({url:s});return t==="404: Not Found"?null:yield JSON.parse(t)}catch(t){console.log("error in grabCommmunityPluginList",t)}}),Y=()=>a(void 0,null,function*(){let s="https://raw.githubusercontent.com/obsidianmd/obsidian-releases/HEAD/community-css-themes.json";try{let t=yield(0,F.request)({url:s});return t==="404: Not Found"?null:yield JSON.parse(t)}catch(t){console.log("error in grabCommmunityThemesList",t)}}),te=s=>a(void 0,null,function*(){let t=`https://raw.githubusercontent.com/${s}/HEAD/obsidian.css`;try{let e=yield(0,F.request)({url:t});return e==="404: Not Found"?null:e}catch(e){console.log("error in grabCommmunityThemesList",e)}}),et=(s,t)=>a(void 0,null,function*(){let e=`https://api.github.com/repos/${s}/commits?path=${t}&page=1&per_page=1`;try{let n=yield(0,F.request)({url:e});return n==="404: Not Found"?null:JSON.parse(n)}catch(n){console.log("error in grabCommmunityThemesList",n)}}),V=(s,t)=>a(void 0,null,function*(){let e=yield et(s,t);return e[0].commit.committer.date?e[0].commit.committer.date:""});var pe={pluginList:[],pluginSubListFrozenVersion:[],themesList:[],updateAtStartup:!1,updateThemesAtStartup:!1,ribbonIconEnabled:!0,loggingEnabled:!1,loggingPath:"BRAT-log",loggingVerboseEnabled:!1,debuggingMode:!0,notificationsEnabled:!0};function fe(s,t,e=""){return a(this,null,function*(){let n=!1;s.settings.pluginList.contains(t)||(s.settings.pluginList.unshift(t),n=!0),e!==""&&s.settings.pluginSubListFrozenVersion.filter(i=>i.repo===t).length===0&&(s.settings.pluginSubListFrozenVersion.unshift({repo:t,version:e}),n=!0),n&&s.saveSettings()})}function he(s,t){return a(this,null,function*(){return s.settings.pluginList.contains(t)})}function be(s,t){return a(this,null,function*(){let e={repo:t,lastUpdate:yield V(t,"obsidian.css")};s.settings.themesList.unshift(e),s.saveSettings()})}function we(s,t){return a(this,null,function*(){return!!s.settings.themesList.find(n=>n.repo===t)})}function ye(s,t,e){s.settings.themesList.forEach(n=>{n.repo===t&&(n.lastUpdate=e,s.saveSettings())})}var Te=require("obsidian");function m(s,t,e=10,n=null){if(s.settings.notificationsEnabled===!1)return;let i=n?"(click=dismiss, right-click=Info)":"",o=new Te.Notice(`BRAT +${t} +${i}`,e*1e3);n&&(o.noticeEl.oncontextmenu=()=>a(this,null,function*(){n()}))}function j(){return a(this,null,function*(){try{let s=yield fetch("https://obsidian.md/?"+Math.random());return s.status>=200&&s.status<300}catch(s){return!1}})}var Pe=s=>(0,q.normalizePath)(s.app.vault.configDir+"/themes")+"/",ne=(s,t,e="")=>a(void 0,null,function*(){let n=yield te(t);if(!n)return m(s,"There is no obsidian.css file in the root path of this repository, so there is no theme to install."),!1;yield ve(s,e,n);let i=`${e} theme installed from ${t}. `;return s.log(i+`[Theme Info](https://github.com/${t})`,!1),m(s,`${i}`,10,()=>a(void 0,null,function*(){window.open(`https://github.com/${t}`)})),setTimeout(()=>{s.app.customCss.setTheme(e)},500),!0}),ve=(s,t,e)=>a(void 0,null,function*(){let n=Pe(s),i=s.app.vault.adapter;(yield i.exists(n))===!1&&(yield i.mkdir(n)),yield i.write(n+t+".css",e)}),Se=s=>a(void 0,null,function*(){let t=yield Y(),e=Object.values(t).map(i=>({display:`Theme: ${i.name} (${i.repo})`,info:i})),n=new S(s);n.setSuggesterData(e),yield n.display(i=>a(void 0,null,function*(){yield ne(s,i.info.repo,i.info.name)}))}),J=s=>("BRAT-"+s.replace("/","----")).substr(0,100),Ne=(s,t)=>a(void 0,null,function*(){s.settings.themesList=s.settings.themesList.filter(n=>n.repo!=t),s.saveSettings(),yield s.app.vault.adapter.remove(Pe(s)+J(t)+".css");let e=`Removed ${t} from BRAT themes list and deleted from vault`;s.log(e,!0),m(s,`${e}`)}),W=(s,t)=>a(void 0,null,function*(){if((yield j())===!1){console.log("BRAT: No internet detected.");return}let e,n="Checking for beta theme updates STARTED";s.log(n,!0),t&&s.settings.notificationsEnabled&&(e=new q.Notice(`BRAT +${n}`,3e4));for(let o of s.settings.themesList){let r=yield V(o.repo,"obsidian.css");r!==o.lastUpdate&&(yield tt(s,o.repo,o.lastUpdate,r))}let i="Checking for beta theme updates COMPLETED";s.log(i,!0),t&&(s.settings.notificationsEnabled&&e.hide(),m(s,i))}),tt=(s,t,e="",n="")=>a(void 0,null,function*(){let i=yield te(t);if(!i)return m(s,"There is no obsidian.css file in the root path of the ${cssGithubRepository} repository, so this theme cannot be updated."),!1;let o=J(t);yield ve(s,o,i),ye(s,t,n);let r=`${o} theme updated from ${t}. From date: ${e} to ${n} `;return s.log(r+`[Theme Info](https://github.com/${t})`,!1),m(s,`${r}`,20,()=>a(void 0,null,function*(){window.open(`https://github.com/${t}`)})),!0});var Q=require("obsidian");var C=class extends Q.Modal{constructor(e,n=!1){super(e.app);this.plugin=e,this.address="",this.openSettingsTabAfterwards=n}submitForm(){return a(this,null,function*(){if(this.address==="")return;let e=this.address.replace("https://github.com/","");if(yield we(this.plugin,e)){m(this.plugin,"This plugin is already in the list for beta testing",10);return}(yield ne(this.plugin,e,J(e)))&&(yield be(this.plugin,e),this.close())})}onOpen(){this.contentEl.createEl("h4",{text:"Github repository for beta theme:"}),this.contentEl.createEl("form",{},e=>{new Q.Setting(e).addText(n=>{n.setPlaceholder("Repository (example: GitubUserName/repository-name"),n.onChange(i=>{this.address=i.trim()}),n.inputEl.addEventListener("keydown",i=>a(this,null,function*(){i.key==="Enter"&&this.address!==" "&&(i.preventDefault(),yield this.submitForm())})),n.inputEl.style.width="100%",window.setTimeout(()=>{let i=document.querySelector(".setting-item-info");i&&i.remove(),n.inputEl.focus()},10)}),e.createDiv("modal-button-container",n=>{n.createEl("button",{attr:{type:"button"},text:"Never mind"}).addEventListener("click",()=>this.close()),n.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:"Add Theme"})}),e.addEventListener("submit",n=>a(this,null,function*(){n.preventDefault(),this.address!==""&&(yield this.submitForm())}))})}onClose(){return a(this,null,function*(){this.openSettingsTabAfterwards&&(yield this.plugin.app.setting.open(),yield this.plugin.app.setting.openTabById("obsidian42-brat"))})}};var G=class extends v.PluginSettingTab{constructor(e,n){super(e,n);this.plugin=n}display(){let{containerEl:e}=this;e.empty(),e.createEl("h2",{text:this.plugin.appName}),new v.Setting(e).setName("Auto-update plugins at startup").setDesc("If enabled all beta plugins will be checked for updates each time Obsidian starts. Note: this does not update frozen version plugins.").addToggle(i=>{i.setValue(this.plugin.settings.updateAtStartup),i.onChange(o=>a(this,null,function*(){this.plugin.settings.updateAtStartup=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Auto-update themes at startup").setDesc("If enabled all beta themes will be checked for updates each time Obsidian starts.").addToggle(i=>{i.setValue(this.plugin.settings.updateThemesAtStartup),i.onChange(o=>a(this,null,function*(){this.plugin.settings.updateThemesAtStartup=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Ribbon Button").setDesc("Toggle ribbon button off and on.").addToggle(i=>{i.setValue(this.plugin.settings.ribbonIconEnabled),i.onChange(o=>a(this,null,function*(){this.plugin.settings.ribbonIconEnabled=o,this.plugin.settings.ribbonIconEnabled===!1?this.plugin.ribbonIcon.remove():this.plugin.showRibbonButton(),yield this.plugin.saveSettings()}))}),e.createEl("hr"),e.createEl("h2",{text:"Beta Plugin List"}),e.createEl("div",{text:'The following is a list of beta plugins added via the command palette "Add a beta plugin for testing" or "Add a beta plugin with frozen version for testing". A frozen version is a specific release of a plugin based on its releease tag. '}),e.createEl("p"),e.createEl("div",{text:"Click the x button next to a plugin to remove it from the list."}),e.createEl("p"),e.createEl("span").createEl("b",{text:"Note: "}),e.createSpan({text:"This does not delete the plugin, this should be done from the Community Plugins tab in Settings."}),new v.Setting(e).addButton(i=>{i.setButtonText("Add Beta plugin"),i.onClick(()=>a(this,null,function*(){this.plugin.app.setting.close(),yield this.plugin.betaPlugins.displayAddNewPluginModal(!0,!1)}))});let n=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(i=>i.repo));for(let i of this.plugin.settings.pluginList)n.has(i)||new v.Setting(e).setName(i).addButton(o=>{o.setIcon("cross"),o.setTooltip("Delete this beta plugin"),o.onClick(()=>a(this,null,function*(){o.buttonEl.textContent===""?o.setButtonText("Click once more to confirm removal"):(o.buttonEl.parentElement.parentElement.remove(),yield this.plugin.betaPlugins.deletePlugin(i))}))});new v.Setting(e).addButton(i=>{i.setButtonText("Add Beta plugin with frozen version"),i.onClick(()=>a(this,null,function*(){this.plugin.app.setting.close(),yield this.plugin.betaPlugins.displayAddNewPluginModal(!0,!0)}))});for(let i of this.plugin.settings.pluginSubListFrozenVersion)new v.Setting(e).setName(`${i.repo} (version ${i.version})`).addButton(o=>{o.setIcon("cross"),o.setTooltip("Delete this beta plugin"),o.onClick(()=>a(this,null,function*(){o.buttonEl.textContent===""?o.setButtonText("Click once more to confirm removal"):(o.buttonEl.parentElement.parentElement.remove(),yield this.plugin.betaPlugins.deletePlugin(i.repo))}))});e.createEl("hr"),e.createEl("h2",{text:"Beta Themes List"}),new v.Setting(e).addButton(i=>{i.setButtonText("Add Beta Theme"),i.onClick(()=>a(this,null,function*(){this.plugin.app.setting.close(),new C(this.plugin).open()}))});for(let i of this.plugin.settings.themesList)new v.Setting(e).setName(i.repo).addButton(o=>{o.setIcon("cross"),o.setTooltip("Delete this beta theme"),o.onClick(()=>a(this,null,function*(){o.buttonEl.textContent===""?o.setButtonText("Click once more to confirm removal"):(o.buttonEl.parentElement.parentElement.remove(),yield Ne(this.plugin,i.repo))}))});e.createEl("hr"),e.createEl("h2",{text:"Monitoring"}),new v.Setting(e).setName("Enable Notifications").setDesc("BRAT will provide popup notifications for its various activities. Turn this off means no notifications from BRAT.").addToggle(i=>{i.setValue(this.plugin.settings.notificationsEnabled),i.onChange(o=>a(this,null,function*(){this.plugin.settings.notificationsEnabled=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Enable Logging").setDesc("Plugin updates will be logged to a file in the log file.").addToggle(i=>{i.setValue(this.plugin.settings.loggingEnabled),i.onChange(o=>a(this,null,function*(){this.plugin.settings.loggingEnabled=o,yield this.plugin.saveSettings()}))}),new v.Setting(this.containerEl).setName("BRAT Log File Location").setDesc("Logs will be saved to this file. Don't add .md to the file name.").addSearch(i=>{i.setPlaceholder("Example: BRAT-log").setValue(this.plugin.settings.loggingPath).onChange(o=>a(this,null,function*(){this.plugin.settings.loggingPath=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Enable Verbose Logging").setDesc("Get a lot more information in the log.").addToggle(i=>{i.setValue(this.plugin.settings.loggingVerboseEnabled),i.onChange(o=>a(this,null,function*(){this.plugin.settings.loggingVerboseEnabled=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Debugging Mode").setDesc("Atomic Bomb level console logging. Can be used for troubleshoting and development.").addToggle(i=>{i.setValue(this.plugin.settings.debuggingMode),i.onChange(o=>a(this,null,function*(){this.plugin.settings.debuggingMode=o,yield this.plugin.saveSettings()}))})}};var I=require("obsidian");var L=class extends I.Modal{constructor(e,n,i=!1,o=!1){super(e.app);this.plugin=e,this.betaPlugins=n,this.address="",this.openSettingsTabAfterwards=i,this.useFrozenVersion=o,this.version=""}submitForm(){return a(this,null,function*(){if(this.address==="")return;let e=this.address.replace("https://github.com/","");if(yield he(this.plugin,e)){m(this.plugin,"This plugin is already in the list for beta testing",10);return}(yield this.betaPlugins.addPlugin(e,!1,!1,!1,this.version))&&this.close()})}onOpen(){this.contentEl.createEl("h4",{text:"Github repository for beta plugin:"}),this.contentEl.createEl("form",{},e=>{new I.Setting(e).addText(n=>{n.setPlaceholder("Repository (example: TfTHacker/obsidian-brat)"),n.onChange(i=>{this.address=i.trim()}),n.inputEl.addEventListener("keydown",i=>a(this,null,function*(){i.key==="Enter"&&this.address!==" "&&(this.useFrozenVersion&&this.version!==""||!this.useFrozenVersion)&&(i.preventDefault(),yield this.submitForm())})),n.inputEl.style.width="100%",window.setTimeout(()=>{let i=document.querySelector(".setting-item-info");i&&i.remove(),n.inputEl.focus()},10)}),this.useFrozenVersion&&new I.Setting(e).addText(n=>{n.setPlaceholder("Specify the release version tag (example: 1.0.0)"),n.onChange(i=>{this.version=i.trim()}),n.inputEl.style.width="100%",window.setTimeout(()=>{let i=document.querySelector(".setting-item-info");i&&i.remove()},10)}),e.createDiv("modal-button-container",n=>{n.createEl("button",{attr:{type:"button"},text:"Never mind"}).addEventListener("click",()=>this.close()),n.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:"Add Plugin"})}),e.addEventListener("submit",n=>a(this,null,function*(){n.preventDefault(),this.address!==""&&(this.useFrozenVersion&&this.version!==""||!this.useFrozenVersion)&&(yield this.submitForm())}))})}onClose(){return a(this,null,function*(){this.openSettingsTabAfterwards&&(yield this.plugin.app.setting.open(),yield this.plugin.app.setting.openTabById("obsidian42-brat"))})}};var K=require("obsidian");var B=class{constructor(t){this.plugin=t}displayAddNewPluginModal(t=!1,e=!1){return a(this,null,function*(){new L(this.plugin,this,t,e).open()})}validateRepository(t,e=!1,n=!1){return a(this,null,function*(){let o=yield de(t,!e);return o?"id"in o?"version"in o?o:(n&&m(this.plugin,`${t} +The version attribute for the release is missing from the manifest file`,15),null):(n&&m(this.plugin,`${t} +The plugin id attribute for the release is missing from the manifest file`,15),null):(n&&m(this.plugin,`${t} +This does not seem to be an obsidian plugin, as there is no manifest.json file.`,15),null)})}getAllReleaseFiles(t,e,n,i=""){return a(this,null,function*(){let o=i===""?e.version:i,r=n||i!=="";return{mainJs:yield H(t,o,"main.js"),manifest:r?yield H(t,o,"manifest.json"):null,styles:yield H(t,o,"styles.css")}})}writeReleaseFilesToPluginFolder(t,e){return a(this,null,function*(){let n=(0,K.normalizePath)(this.plugin.app.vault.configDir+"/plugins/"+t)+"/",i=this.plugin.app.vault.adapter;((yield i.exists(n))===!1||!(yield i.exists(n+"manifest.json")))&&(yield i.mkdir(n)),yield i.write(n+"main.js",e.mainJs),yield i.write(n+"manifest.json",e.manifest),e.styles&&(yield i.write(n+"styles.css",e.styles))})}addPlugin(t,e=!1,n=!1,i=!1,o=""){return a(this,null,function*(){var h;let l=yield this.validateRepository(t,!0,!1),c=!!l;if(c===!1&&(l=yield this.validateRepository(t,!1,!0)),l===null){let d=`${t} +A manifest.json or manifest-beta.json file does not exist in the root directory of the repository. This plugin cannot be installed.`;return this.plugin.log(d,!0),m(this.plugin,`${d}`,10),!1}if(!l.hasOwnProperty("version")){let d=`${t} +The manifest${c?"-beta":""}.json file in the root directory of the repository does not have a version number in the file. This plugin cannot be installed.`;return this.plugin.log(d,!0),m(this.plugin,`${d}`,10),!1}let g=()=>a(this,null,function*(){let d=yield this.getAllReleaseFiles(t,l,c,o);if((c||d.manifest===null)&&(d.manifest=JSON.stringify(l)),d.mainJs===null){let b=`${t} +The release is not complete and cannot be download. main.js is missing from the Release`;return this.plugin.log(b,!0),m(this.plugin,`${b}`,10),null}return d});if(e===!1){let d=yield g();if(d===null)return;yield this.writeReleaseFilesToPluginFolder(l.id,d),yield fe(this.plugin,t,o),yield this.plugin.app.plugins.loadManifests();let b=o===""?"":` (version: ${o})`,y=`${t}${b} +The plugin has been registered with BRAT. You may still need to enable it the Community Plugin List.`;this.plugin.log(y,!0),m(this.plugin,y,10)}else{let d=this.plugin.app.vault.configDir+"/plugins/"+l.id+"/",b=null;try{b=yield this.plugin.app.vault.adapter.read(d+"manifest.json")}catch(T){if(T.errno===-4058)return yield this.addPlugin(t,!1,c,!1,o),!0;console.log("BRAT - Local Manifest Load",l.id,JSON.stringify(T,null,2))}if(o!==""||this.plugin.settings.pluginSubListFrozenVersion.map(T=>T.repo).includes(t))return m(this.plugin,`The version of ${t} is frozen, not updating.`,3),!1;let y=yield JSON.parse(b);if(y.version!==l.version){let T=yield g();if(T===null)return;if(n){let f=`There is an update available for ${l.id} from version ${y.version} to ${l.version}. `;this.plugin.log(f+`[Release Info](https://github.com/${t}/releases/tag/${l.version})`,!1),m(this.plugin,f,30,()=>a(this,null,function*(){window.open(`https://github.com/${t}/releases/tag/${l.version}`)}))}else{yield this.writeReleaseFilesToPluginFolder(l.id,T),yield this.plugin.app.plugins.loadManifests(),(h=this.plugin.app.plugins.plugins[l.id])!=null&&h.manifest&&(yield this.reloadPlugin(l.id));let f=`${l.id} +Plugin has been updated from version ${y.version} to ${l.version}. `;this.plugin.log(f+`[Release Info](https://github.com/${t}/releases/tag/${l.version})`,!1),m(this.plugin,f,30,()=>a(this,null,function*(){window.open(`https://github.com/${t}/releases/tag/${l.version}`)}))}}else i&&m(this.plugin,`No update available for ${t}`,3)}return!0})}reloadPlugin(t){return a(this,null,function*(){let e=this.plugin.app.plugins;try{yield e.disablePlugin(t),yield e.enablePlugin(t)}catch(n){console.log("reload plugin",n)}})}updatePlugin(t,e=!1,n=!1){return a(this,null,function*(){let i=yield this.addPlugin(t,!0,e,n);return i===!1&&e===!1&&m(this.plugin,`${t} +Update of plugin failed.`),i})}checkForUpdatesAndInstallUpdates(t=!1,e=!1){return a(this,null,function*(){if((yield j())===!1){console.log("BRAT: No internet detected.");return}let n,i="Checking for plugin updates STARTED";this.plugin.log(i,!0),t&&this.plugin.settings.notificationsEnabled&&(n=new K.Notice(`BRAT +${i}`,3e4));let o=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(l=>l.repo));for(let l of this.plugin.settings.pluginList)o.has(l)||(yield this.updatePlugin(l,e));let r="Checking for plugin updates COMPLETED";this.plugin.log(r,!0),t&&(n.hide(),m(this.plugin,r,10))})}deletePlugin(t){return a(this,null,function*(){let e=`Removed ${t} from BRAT plugin list`;this.plugin.log(e,!0),this.plugin.settings.pluginList=this.plugin.settings.pluginList.filter(n=>n!=t),this.plugin.settings.pluginSubListFrozenVersion=this.plugin.settings.pluginSubListFrozenVersion.filter(n=>n.repo!=t),this.plugin.saveSettings()})}getEnabledDisabledPlugins(t){let e=this.plugin.app.plugins,n=Object.values(e.manifests),i=Object.values(e.plugins).map(o=>o.manifest);return t?n.filter(o=>i.find(r=>o.id===r.id)):n.filter(o=>!i.find(r=>o.id===r.id))}};var Fe=require("obsidian");function Ce(){(0,Fe.addIcon)("BratIcon",'')}var U=require("obsidian"),_e=Ke(ze());function He(s,t,e=!1){if(s.settings.debuggingMode&&console.log("BRAT: "+t),s.settings.loggingEnabled){if(s.settings.loggingVerboseEnabled===!1&&e===!0)return;{let n=s.settings.loggingPath+".md",i="[["+(0,U.moment)().format((0,_e.getDailyNoteSettings)().format).toString()+"]] "+(0,U.moment)().format("HH:mm"),o=U.Platform.isDesktop?window.require("os").hostname():"MOBILE",r=i+" "+o+" "+t.replace(` `," ")+` -`;setTimeout(()=>a(this,null,function*(){if((yield i.app.vault.adapter.exists(t))===!0){let u=yield i.app.vault.adapter.read(t);r=r+u;let c=i.app.vault.getAbstractFileByPath(t);yield i.app.vault.modify(c,r)}else yield i.app.vault.create(t,r)}),10)}}}var U=class{constructor(n){this.bratCommands=[{id:"BRAT-AddBetaPlugin",icon:"BratIcon",name:"Plugins: Add a beta plugin for testing",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.displayAddNewPluginModal()})},{id:"BRAT-checkForUpdatesAndUpdate",icon:"BratIcon",name:"Plugins: Check for updates to all beta plugins and UPDATE",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.checkForUpdatesAndInstallUpdates(!0,!1)})},{id:"BRAT-checkForUpdatesAndDontUpdate",icon:"BratIcon",name:"Plugins: Only check for updates to beta plugins, but don't Update",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.checkForUpdatesAndInstallUpdates(!0,!0)})},{id:"BRAT-updateOnePlugin",icon:"BratIcon",name:"Plugins: Choose a single plugin to update",showInRibbon:!0,callback:()=>a(this,null,function*(){let n=Object.values(this.plugin.settings.pluginList).map(t=>({display:t,info:t})),e=new v(this.plugin);e.setSuggesterData(n),yield e.display(t=>a(this,null,function*(){let s=`Checking for updates for ${t.info}`;this.plugin.log(s,!0),m(this.plugin,` -${s}`,3),yield this.plugin.betaPlugins.updatePlugin(t.info,!1,!0)}))})},{id:"BRAT-restartPlugin",icon:"BratIcon",name:"Plugins: Restart a plugin that is already installed",showInRibbon:!0,callback:()=>a(this,null,function*(){let n=Object.values(this.plugin.app.plugins.manifests).map(t=>({display:t.id,info:t.id})),e=new v(this.plugin);e.setSuggesterData(n),yield e.display(t=>a(this,null,function*(){m(this.plugin,`${t.info} -Plugin reloading .....`,5),yield this.plugin.betaPlugins.reloadPlugin(t.info)}))})},{id:"BRAT-disablePlugin",icon:"BratIcon",name:"Plugins: Disable a plugin - toggle it off",showInRibbon:!0,callback:()=>a(this,null,function*(){let n=this.plugin.betaPlugins.getEnabledDisabledPlugins(!0).map(t=>({display:`${t.name} (${t.id})`,info:t.id})),e=new v(this.plugin);e.setSuggesterData(n),yield e.display(t=>a(this,null,function*(){this.plugin.log(`${t.display} plugin disabled`,!1),yield this.plugin.app.plugins.disablePlugin(t.info)}))})},{id:"BRAT-enablePlugin",icon:"BratIcon",name:"Plugins: Enable a plugin - toggle it on",showInRibbon:!0,callback:()=>a(this,null,function*(){let n=this.plugin.betaPlugins.getEnabledDisabledPlugins(!1).map(t=>({display:`${t.name} (${t.id})`,info:t.id})),e=new v(this.plugin);e.setSuggesterData(n),yield e.display(t=>a(this,null,function*(){this.plugin.log(`${t.display} plugin enabled`,!1),yield this.plugin.app.plugins.enablePlugin(t.info)}))})},{id:"BRAT-openGitHubZRepository",icon:"BratIcon",name:"Plugins: Open the GitHub repository for a plugin",showInRibbon:!0,callback:()=>a(this,null,function*(){let n=yield mt(),e=Object.values(n).map(o=>({display:`Plugin: ${o.name} (${o.repo})`,info:o.repo})),t=Object.values(this.plugin.settings.pluginList).map(o=>({display:"BRAT: "+o,info:o}));e.forEach(o=>t.push(o));let s=new v(this.plugin);s.setSuggesterData(t),yield s.display(o=>a(this,null,function*(){o.info&&window.open(`https://github.com/${o.info}`)}))})},{id:"BRAT-openGitHubRepoTheme",icon:"BratIcon",name:"Themes: Open the GitHub repository for a theme (appearance)",showInRibbon:!0,callback:()=>a(this,null,function*(){let n=yield Y(),e=Object.values(n).map(s=>({display:`Theme: ${s.name} (${s.repo})`,info:s.repo})),t=new v(this.plugin);t.setSuggesterData(e),yield t.display(s=>a(this,null,function*(){s.info&&window.open(`https://github.com/${s.info}`)}))})},{id:"BRAT-opentPluginSettings",icon:"BratIcon",name:"Plugins: Open Plugin Settings Tab",showInRibbon:!0,callback:()=>a(this,null,function*(){let n=this.plugin.app.setting,e=Object.values(n.pluginTabs).map(o=>({display:"Plugin: "+o.name,info:o.id})),t=new v(this.plugin),s=Object.values(n.settingTabs).map(o=>({display:"Core: "+o.name,info:o.id}));e.forEach(o=>s.push(o)),t.setSuggesterData(s),yield t.display(o=>a(this,null,function*(){n.open(),n.openTabById(o.info)}))})},{id:"BRAT-GrabCommunityTheme",icon:"BratIcon",name:"Themes: Grab a community theme",showInRibbon:!0,callback:()=>a(this,null,function*(){return yield Nt(this.plugin)})},{id:"BRAT-GrabBetaTheme",icon:"BratIcon",name:"Themes: Grab a beta theme for testing from a Github repository",showInRibbon:!0,callback:()=>a(this,null,function*(){new S(this.plugin).open()})},{id:"BRAT-updateBetaThemes",icon:"BratIcon",name:"Themes: Update beta themes",showInRibbon:!0,callback:()=>a(this,null,function*(){return yield J(this.plugin,!0)})},{id:"BRAT-switchTheme",icon:"BratIcon",name:"Themes: Switch Active Theme ",showInRibbon:!0,callback:()=>a(this,null,function*(){let n=Object.values(this.plugin.app.customCss.themes).map(t=>({display:t,info:t}));n.unshift({display:"Obsidian Default Theme",info:""});let e=new v(this.plugin);e.setSuggesterData(n),yield e.display(t=>a(this,null,function*(){this.plugin.log(`Switched to theme ${t.display}`,!1),this.plugin.app.customCss.setTheme(t.info)}))})},{id:"BRAT-allCommands",icon:"BratIcon",name:"All Commands list",showInRibbon:!1,callback:()=>a(this,null,function*(){return this.ribbonDisplayCommands()})}];this.plugin=n,this.bratCommands.forEach(e=>a(this,null,function*(){this.plugin.addCommand({id:e.id,name:e.name,icon:e.icon,callback:()=>a(this,null,function*(){yield e.callback()})})}))}ribbonDisplayCommands(){return a(this,null,function*(){let n=[];this.bratCommands.forEach(r=>{r.showInRibbon&&n.push({display:r.name,info:r.callback})});let e=new v(this.plugin),t=this.plugin.app.setting,s=Object.values(t.settingTabs).map(r=>({display:"Core: "+r.name,info:()=>a(this,null,function*(){t.open(),t.openTabById(r.id)})})),o=Object.values(t.pluginTabs).map(r=>({display:"Plugin: "+r.name,info:()=>a(this,null,function*(){t.open(),t.openTabById(r.id)})}));n.push({display:"---- Core Plugin Settings ----",info:()=>a(this,null,function*(){yield this.ribbonDisplayCommands()})}),s.forEach(r=>n.push(r)),n.push({display:"---- Plugin Settings ----",info:()=>a(this,null,function*(){yield this.ribbonDisplayCommands()})}),o.forEach(r=>n.push(r)),e.setSuggesterData(n),yield e.display(r=>a(this,null,function*(){return yield r.info()}))})}};var Z=class extends jt.Plugin{constructor(){super(...arguments);this.appName="Obsidian42 - Beta Reviewer's Auto-update Tool (BRAT)";this.appID="obsidian42-brat"}onload(){return a(this,null,function*(){console.log("loading Obsidian42 - BRAT"),yield this.loadSettings(),this.addSettingTab(new Q(this.app,this)),this.betaPlugins=new D(this),this.commands=new U(this),St(),this.settings.ribbonIconEnabled&&this.showRibbonButton(),this.app.workspace.onLayoutReady(()=>{this.settings.updateAtStartup&&setTimeout(()=>a(this,null,function*(){yield this.betaPlugins.checkForUpdatesAndInstallUpdates(!1)}),6e4),this.settings.updateThemesAtStartup&&setTimeout(()=>a(this,null,function*(){yield J(this,!1)}),12e4)})})}showRibbonButton(){this.ribbonIcon=this.addRibbonIcon("BratIcon","BRAT",()=>a(this,null,function*(){return this.commands.ribbonDisplayCommands()}))}log(e,t=!1){Yt(this,e,t)}onunload(){console.log("unloading "+this.appName)}loadSettings(){return a(this,null,function*(){this.settings=Object.assign({},pt,yield this.loadData())})}saveSettings(){return a(this,null,function*(){yield this.saveData(this.settings)})}}; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vbm9kZV9tb2R1bGVzL29ic2lkaWFuLWRhaWx5LW5vdGVzLWludGVyZmFjZS9kaXN0L21haW4uanMiLCAiLi4vc3JjL21haW4udHMiLCAiLi4vc3JjL3VpL1NldHRpbmdzVGFiLnRzIiwgIi4uL3NyYy9mZWF0dXJlcy90aGVtZXMudHMiLCAiLi4vc3JjL3VpL0dlbmVyaWNGdXp6eVN1Z2dlc3Rlci50cyIsICIuLi9zcmMvZmVhdHVyZXMvZ2l0aHViVXRpbHMudHMiLCAiLi4vc3JjL3VpL3NldHRpbmdzLnRzIiwgIi4uL3NyYy91dGlscy9ub3RpZmljYXRpb25zLnRzIiwgIi4uL3NyYy91dGlscy9pbnRlcm5ldGNvbm5l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sZW5hbWUpO1xuICAgIHRyeSB7XG4gICAgICAgIGNvbnN0IGNyZWF0ZWRGaWxlID0gYXdhaXQgdmF1bHQuY3JlYXRlKG5vcm1hbGl6ZWRQYXRoLCB0ZW1wbGF0ZUNvbnRlbnRzXG4gICAgICAgICAgICAucmVwbGFjZSgve3tcXHMqKGRhdGV8dGltZSlcXHMqKChbKy1dXFxkKykoW3lxbXdkaHNdKSk/XFxzKig6Lis/KT99fS9naSwgKF8sIF90aW1lT3JEYXRlLCBjYWxjLCB0aW1lRGVsdGEsIHVuaXQsIG1vbWVudEZvcm1hdCkgPT4ge1xuICAgICAgICAgICAgY29uc3Qgbm93ID0gd2luZG93Lm1vbWVudCgpO1xuICAgICAgICAgICAgY29uc3QgY3VycmVudERhdGUgPSBkYXRlLmNsb25lKCkuc2V0KHtcbiAgICAgICAgICAgICAgICBob3VyOiBub3cuZ2V0KFwiaG91clwiKSxcbiAgICAgICAgICAgICAgICBtaW51dGU6IG5vdy5nZXQoXCJtaW51dGVcIiksXG4gICAgICAgICAgICAgICAgc2Vjb25kOiBub3cuZ2V0KFwic2Vjb25kXCIpLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpZiAoY2FsYykge1xuICAgICAgICAgICAgICAgIGN1cnJlbnREYXRlLmFkZChwYXJzZUludCh0aW1lRGVsdGEsIDEwKSwgdW5pdCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobW9tZW50Rm9ybWF0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGN1cnJlbnREYXRlLmZvcm1hdChtb21lbnRGb3JtYXQuc3Vic3RyaW5nKDEpLnRyaW0oKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gY3VycmVudERhdGUuZm9ybWF0KGZvcm1hdCk7XG4gICAgICAgIH0pXG4gICAgICAgICAgICAucmVwbGFjZSgve3tcXHMqZGF0ZVxccyp9fS9naSwgZmlsZW5hbWUpXG4gICAgICAgICAgICAucmVwb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mlsZSA9IGF3YWl0IHZhdWx0LmNyZWF0ZShub3JtYWxpemVkUGF0aCwgdGVtcGxhdGVDb250ZW50c1xuICAgICAgICAgICAgLnJlcGxhY2UoL3t7XFxzKihkYXRlfHRpbWUpXFxzKigoWystXVxcZCspKFt5cW13ZGhzXSkpP1xccyooOi4rPyk/fX0vZ2ksIChfLCBfdGltZU9yRGF0ZSwgY2FsYywgdGltZURlbHRhLCB1bml0LCBtb21lbnRGb3JtYXQpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IG5vdyA9IHdpbmRvdy5tb21lbnQoKTtcbiAgICAgICAgICAgIGNvbnN0IGN1cnJlbnREYXRlID0gZGF0ZS5jbG9uZSgpLnNldCh7XG4gICAgICAgICAgICAgICAgaG91cjogbm93LmdldChcImhvdXJcIiksXG4gICAgICAgICAgICAgICAgbWludXRlOiBub3cuZ2V0KFwibWludXRlXCIpLFxuICAgICAgICAgICAgICAgIHNlY29uZDogbm93LmdldChcInNlY29uZFwiKSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgaWYgKGNhbGMpIHtcbiAgICAgICAgICAgICAgICBjdXJyZW50RGF0ZS5hZGQocGFyc2VJbnQodGltZURlbHRhLCAxMCksIHVuaXQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1vbWVudEZvcm1hdCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjdXJyZW50RGF0ZS5mb3JtYXQobW9tZW50Rm9ybWF0LnN1YnN0cmluZygxKS50cmltKCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGN1cnJlbnREYXRlLmZvcm1hdChmb3JtYXQpO1xuICAgICAgICB9KVxuICAgICAgICAgICAgLnJlcGxhY2UoL3t7XFxzKmRhdGVcXHMqfX0vZ2ksIGZpbGVuYW1lKVxuICAgICAgICAgICAgLnJlcGxhY2UoL3t7XFxzKnRpbWVcXHMqfX0vZ2ksIHdpbmRvdy5tb21lbnQoKS5mb3JtYXQo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lLnRyaW0oKTtcclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5hZGRFdmVudExpc3RlbmVyKCdrZXlkb3duJywgYXN5bmMgKGU6IEtleWJvYXJkRXZlbnQpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUua2V5ID09PSAnRW50ZXInICYmIHRoaXMuYWRkcmVzcyAhPT0gJyAnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnN1Ym1pdEZvcm0oKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIHRleHRFbC5pbnB1dEVsLnN0eWxlLndpZHRoID0gXCIxMDAlXCI7XHJcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LnNldFRpbWVvdXQoKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0aXRsZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXCIuc2V0dGluZy1pdGVtLWluZm9cIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aXRsZSkgdGl0bGUucmVtb3ZlKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRFbC5pbnB1dEVsLmZvY3VzKClcclxuICAgICAgICAgICAgICAgICAgICB9LCAxMCk7XHJcbiAgICAgICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgIGZvcm1FbC5jcmVhdGVEaXYoJ21vZGFsLWJ1dHRvbi1jb250YWluZXInLCAoYnV0dG9uQ29udGFpbmVyRWwpID0+IHtcclxuICAgICAgICAgICAgICAgIGJ1dHRvbkNvbnRhaW5lckVsXHJcbiAgICAgICAgICAgICAgICAgICAgLmN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30sIChmb3JtRWwpID0+IHtcclxuICAgICAgICAgICAgbmV3IFNldHRpbmcoZm9ybUVsKVxyXG4gICAgICAgICAgICAgICAgLmFkZFRleHQoKHRleHRFbCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHRleHRFbC5zZXRQbGFjZWhvbGRlcignUmVwb3NpdG9yeSAoZXhhbXBsZTogVGZUSGFja2VyL29ic2lkaWFuLWJyYXQnKTtcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0RWwub25DaGFuZ2UoKHZhbHVlKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuYWRkcmVzcyA9IHZhbHVlLnRyaW0oKTtcclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5hZGRFdmVudExpc3RlbmVyKCdrZXlkb3duJywgYXN5bmMgKGU6IEtleWJvYXJkRXZlbnQpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUua2V5ID09PSAnRW50ZXInICYmIHRoaXMuYWRkcmVzcyAhPT0gJyAnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnN1Ym1pdEZvcm0oKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIHRleHRFbC5pbnB1dEVsLnN0eWxlLndpZHRoID0gXCIxMDAlXCI7XHJcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LnNldFRpbWVvdXQoKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0aXRsZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXCIuc2V0dGluZy1pdGVtLWluZm9cIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aXRsZSkgdGl0bGUucmVtb3ZlKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRFbC5pbnB1dEVsLmZvY3VzKClcclxuICAgICAgICAgICAgICAgICAgICB9LCAxMCk7XHJcbiAgICAgICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgIGZvcm1FbC5jcmVhdGVEaXYoJ21vZGFsLWJ1dHRvbi1jb250YWluZXInLCAoYnV0dG9uQ29udGFpbmVyRWwpID0+IHtcclxuICAgICAgICAgICAgICAgIGJ1dHRvbkNvbnRhaW5lckVsXHJcbiAgICAgICAgICAgICAgICAgICAgLmNyZWF0ZUVsKCdidXR0b24nLCB7IGF0dHI6IHsgdHlwZTogJ2J1dHRvbicgfSwgdGV4dDogJ05ldmVyIG1pbmQnIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJywgKCkgPT4gdGhpcy5jbG9zZSgpKTtcclxuICAgICAgICAgICAgICAgIGJ1dHRvbkNvbnRhaW5lckVsLmNyZWF0ZUVsKCdidXR0b24nLCB7XHJcbiAgICAgICAgICAgICAgICAgICAgYXR0cjogeyB0eXBlOiAnc3VibWl0JyB9LFxyXG4gICAgICAgICAgICAgICAgICAgIGNsczogJ21vZC1jdGEnLFxyXG4gICAgICAgICAgICAgICAgICAgIHRleHQ6ICdBZGQgUGx1Z2luJyxcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgIC8vIGludm9rZWQgd2hlbiBidXR0b24gaXMgY2xpY2tlZC4gXHJcbiAgICAgICAgICAgIGZvcm1FbC5hZGRFdmVudExpc3RlbmVyKCdzdWJtaXQnLCBhc3luYyAoZTogRXZlbnQpID0+IHtcclxuICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmFkZHJlc3MgIT09IC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ICBhd2FpdCBnZnMuZGlzcGxheShhc3luYyAocmVzdWx0cykgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGx1Z2luLmxvZyhgJHtyZXN1bHRzLmRpc3BsYXl9IHBsdWdpbiBlbmFibGVkYCwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcclxuICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnBsdWdpbi5hcHAucGx1Z2lucy5lbmFibGVQbHVnaW4ocmVzdWx0cy5pbmZvKTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGlkOiBcIkJSQVQtb3BlbkdpdEh1YlpSZXBvc2l0b3J5XCIsXHJcbiAgICAgICAgICAgIGljb246IFwiQnJhdEljb25cIixcclxuICAgICAgICAgICAgbmFtZTogXCJQbHVnaW5zOiBPcGVuIHRoZSBHaXRIdWIgcmVwb3NpdG9yeSBmb3IgYSBwbHVnaW5cIixcclxuICAgICAgICAgICAgc2hvd0luUmliYm9uOiB0cnVlLFxyXG4gICAgICAgICAgICBjYWxsYmFjazogYXN5bmMgKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY29tbXVuaXR5UGx1Z2lucyA9IGF3YWl0IGdyYWJDb21tbXVuaXR5UGx1Z2luTGlzdCgpO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY29tbXVuaXR5UGx1Z2luTGlzdDogU3VnZ2VzdGVySXRlbVtdID0gT2JqZWN0LnZhbHVlcyhjb21tdW5pdHlQbHVnaW5zKS5tYXAoKHApID0+IHsgcmV0dXJuIHsgZGlzcGxheTogYFBsdWdpbjogJHtwLm5hbWV9ICAoJHtwLnJlcG99KWAsIGluZm86IHAucmVwbyB9IH0pO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgYnJhdExpc3Q6IFN1Z2dlc3Rlckl0ZW1bXSA9IE9iamVjdC52YWx1ZXModGhpcy5wbHVnaW4uc2V0dGluZ3MucGx1Z2luTGlzdCkubWFwKChwKSA9PiB7IHJldHVybiB7IGRpc3BsYXk6IFwiQlJBVDogXCIgKyBwLCBpbmZvOiBwIH0gfSk7XHJcbiAgICAgICAgICAgICAgICBjb21tdW5pdHlQbHVnaW5MaXN0LmZvckVhY2goc2kgPT4gYnJhdExpc3QucHVzaChzaSkpO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZ2ZzID0gbmV3IEdlbmVyaWNGdXp6eVN1Z2dlc3Rlcih0aGlzLnBsdWdpbik7XHJcbiAgICAgICAgICAgICAgICBnZnMuc2V0U3VnZ2VzdGVyRGF0YShicmF0TGlzdCk7XHJcbiAgICAgICAgICAgICAgICBhd2FpdCBnZnMuZGlzcGxheShhc3luYyAocmVzdWx0cykgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHRzLmluZm8pIHdpbmRvdy5vcGVuKGBodHRwczovL2dpdGh1Yi5jb20vJHtyZXN1bHRzLmluZm99YClcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGlkOiBcIkJSQVQtb3BlbkdpdEh1YlJlcG9UaGVtZVwiLFxyXG4gICAgICAgICAgICBpY29uOiBcIkJyYXRJY29uXCIsXHJcbiAgICAgICAgICAgIG5hbWU6IFwiVGhlbWVzOiBPcGVuIHRoZSBHaXRIdWIgcmVwb3NpdG9yeSBmb3IgYSB0aGVtZSAoYXBwZWFyYW5jZSlcIixcclxuICAgICAgICAgICAgc2hvd0luUmliYm9uOiB0cnVlLFxyXG4gICAgICAgICAgICBjYWxsYmFjazogYXN5bmMgKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY29tbXVuaXR5VGhlbWUgPSBhd2FpdCBncmFiQ29tbW11bml0eVRoZW1lc0xpc3QoKTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGNvbW11bml0eVRoZW1lTGlzdDogU3VnZ2VzdGVySXRlbVtdID0gT2JqZWN0LnZhbHVlcyhjb21tdW5pdHlUaGVtZSkubWFwKChwKSA9PiB7IHJldHVybiB7IGRpc3BsYXk6IGBUaGVtZTogJHtwLm5hbWV9ICAoJHtwLnJlcG99KWAsIGluZm86IHAucmVwbyB9IH0pO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZ2ZzID0gbmV3IEdlbmVyaWNGdXp6eVN1Z2dlc3Rlcih0aGlzLnBsdWdpbik7XHJcbiAgICAgICAgICAgICAgICBnZnMuc2V0U3VnZ2VzdGVyRGF0YShjb21tdW5pdHlUaGVtZUxpc3QpO1xyXG4gICAgICAgICAgICAgICAgYXdhaXQgZ2ZzLmRpc3BsYXkoYXN5bmMgKHJlc3VsdHMpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0cy5pbmZvKSB3aW5kb3cub3BlbihgaHR0cHM6Ly9naXRodWIuY29tLyR7cmVzdWx0cy5pbmZvfWApXHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0sXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBpZDogXCJCUkFULW9wZW50UGx1Z2luU2V0dGluZ3NcIixcclxuICAgICAgICAgICAgaWNvbjogXCJCcmF0SWNvblwiLFxyXG4gICAgICAgICAgICBuYW1lOiBcIlBsdWdpbnM6IE9wZW4gUGx1Z2luIFNldHRpbmdzIFRhYlwiLFxyXG4gICAgICAgICAgICBzaG93SW5SaWJib246IHRydWUsXHJcbiAgICAgICAgICAgIGNhbGxiYWNrOiBhc3luYyAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAvLyBAdHMtaWdub3JlXHJcbiAgICAgICAgICAgICAgICBjb25zdCBzZXR0aW5ncyA9IHRoaXMucGx1Z2luLmFwcC5zZXR0aW5nO1xyXG4gICAgICAgICAgICAgICAgLy8gQHRzLWlnbm9yZVxyXG4gICAgICAgICAgICAgICAgY29uc3QgbGlzdE9mUGx1Z2luU2V0dGluZ3NUYWJzOiBTdWdnZXN0ZXJJdGVtW10gPSBPYmplY3QudmFsdWVzKHNldHRpbmdzLnBsdWdpblRhYnMpLm1hcCgodCkgPT4geyByZXR1cm4geyBkaXNwbGF5OiBcIlBsdWdpbjogXCIgKyB0Lm5hbWUsIGluZm86IHQuaWQgfSB9KTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGdmcyA9IG5ldyBHZW5lcmljRnV6enlTdWdnZXN0ZXIodGhpcy5wbHVnaW4pO1xyXG4gICAgICAgICAgICAgICAgLy8gQHRzLWlnbm9yZVxyXG4gICAgICAgICAgICAgICAgY29uc3QgbGlzdE9mQ29yZVNldHRpbmdzVGFiczogU3VnZ2VzdGVySXRlbVtdID0gT2JqZWN0LnZhbHVlcyhzZXR0aW5ncy5zZXR0aW5nVGFicykubWFwKCh0KSA9PiB7IHJldHVybiB7IGRpc3BsYXk6IFwiQ29yZTogXCIgKyB0Lm5hbWUsIGluZm86IHQuaWQgfSB9KTtcclxuICAgICAgICAgICAgICAgIGxpc3RPZlBsdWdpblNldHRpbmdzVGFicy5mb3JFYWNoKHNpID0+IGxpc3RPZkNvcmVTZXR0aW5nc1RhYnMucHVzaChzaSkpO1xyXG4gICAgICAgICAgICAgICAgZ2ZzLnNldFN1Z2dlc3RlckRhdGEobGlzdE9mQ29yZVNldHRpbmdzVGFicyk7XHJcbiAgICAgICAgICAgICAgICBhd2FpdCBnZnMuZGlzcGxheShhc3luYyAocmVzdWx0cykgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLm9wZW4oKTtcclxuICAgICAgICAgICAgICAgICAgICBzZXR0aW5ncy5vcGVuVGFiQnlJZChyZXN1bHRzLmluZm8pO1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9LFxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgaWQ6IFwiQlJBVC1HcmFiQ29tbXVuaXR5VGhlbWVcIixcclxuICAgICAgICAgICAgaWNvbjogXCJCcmF0SWNvblwiLFxyXG4gICAgICAgICAgICBuYW1lOiBcIlRoZW1lczogR3JhYiBhIGNvbW11bml0eSB0aGVtZVwiLFxyXG4gICAgICAgICAgICBzaG93SW5SaWJib246IHRydWUsXHJcbiAgICAgICAgICAgIGNhbGxiYWNrOiBhc3luYyAoKSA9PiBhd2FpdCB0aGVtZXNJbnN0YWxsRnJvbUNvbW11bml0eUxpc3QodGhpcy5wbHVnaW4pXHJcbiAgICAgICAgfSxcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGlkOiBcIkJSQVQtR3JhYkJldGFUaGVtZVwiLFxyXG4gICAgICAgICAgICBpY29uOiBcIkJyYXRJY29uXCIsXHJcbiAgICAgICAgICAgIG5hbWU6IFwiVGhlbWVzOiBHcmFiIGEgYmV0YSB0aGVtZSBmb3IgdGVzdGluZyBmcm9tIGEgR2l0aHViIHJlcG9zaXRvcnlcIixcclxuICAgICAgICAgICAgc2hvd0luUmliYm9uOiB0cnVlLFxyXG4gICAgICAgICAgICBjYWxsYmFjazogYXN5bmMgKCkgPT4geyAobmV3IEFkZE5ld1RoZW1lKHRoaXMucGx1Z2luKSkub3BlbigpIH1cclxuICAgICAgICB9LFxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgaWQ6IFwiQlJBVC11cGRhdGVCZXRhVGhlbWVzXCIsXHJcbiAgICAgICAgICAgIGljb246IFwiQnJhdEljb25cIixcclxuICAgICAgICAgICAgbmFtZTogXCJUaGVtZXM6IFVwZGF0ZSBiZXRhIHRoZW1lc1wiLFxyXG4gICAgICAgICAgICBzaG93SW5SaWJib246IHRydWUsXHJcbiAgICAgICAgICAgIGNhbGxiYWNrOiBhc3luYyAoKSA9PiBhd2FpdCB0aGVtZXNlQ2hlY2tBbmRVcGRhdGVzKHRoaXMucGx1Z2luLCB0cnVlKSBcclxuICAgICAgICB9LCAgICAgICAgXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBpZDogXCJCUkFULXN3aXRjaFRoZW1lXCIsXHJcbiAgICAgICAgICAgIGljb246IFwiQnJhdEljb25cIixcclxuICAgICAgICAgICAgbmFtZTogXCJUaGVtZXM6IFN3aXRjaCBBY3RpdmUgVGhlbWUgXCIsXHJcbiAgICAgICAgICAgIHNob3dJblJpYmJvbjogdHJ1ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2s6IGFzeW5jICgpID0+IHtcclxuICAgICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcclxuICAgICAgICAgICAgICAgIGNvbnN0IGNvbW11bml0eVRoZW1lTGlzdDogU3VnZ2VzdGVySXRlbVtdID0gT2JqZWN0LnZhbHVlcyh0aGlzLnBsdWdpbi5hcHAuY3VzdG9tQ3NzLnRoZW1lcykubWFwKCh0KSA9PiB7IHJldHVybiB7IGRpc3BsYXk6IHQsIGluZm86IHQgfSB9KTtcclxuICAgICAgICAgICAgICAgIGNvbW11bml0eVRoZW1lTGlzdC51bnNoaWZ0KHsgZGlzcGxheTogXCJPYnNpZGlhbiBEZWZhdWx0IFRoZW1lXCIsIGluZm86IFwiXCIgfSk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBnZnMgPSBuZXcgR2VuZXJpY0Z1enp5U3VnZ2VzdGVyKHRoaXMucGx1Z2luKTtcclxuICAgICAgICAgICAgICAgIGdmcy5zZXRTdWdnZXN0ZXJEYXRhKGNvbW11bml0eVRoZW1lTGlzdCk7XHJcbiAgICAgICAgICAgICAgICBhd2FpdCBnZnMuZGlzcGxheShhc3luYyAocmVzdWx0cykgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGx1Z2luLmxvZyhgU3dpdGNoZWQgdG8gdGhlbWUgJHtyZXN1bHRzLmRpc3BsYXl9YCwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBsdWdpbi5hcHAuY3VzdG9tQ3NzLnNldFRoZW1lKHJlc3VsdHMuaW5mbyk7XHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0sXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBpZDogXCJCUkFULWFsbENvbW1hbmRzXCIsXHJcbiAgICAgICAgICAgIGljb246IFwiQnJhdEljb25cIixcclxuICAgICAgICAgICAgbmFtZTogXCJBbGwgQ29tbWFuZHMgbGlzdFwiLFxyXG4gICAgICAgICAgICBzaG93SW5SaWJib246IGZhbHNlLFxyXG4gICAgICAgICAgICBjYWxsYmFjazogYXN5bmMgKCkgPT4gdGhpcy5yaWJib25EaXNwbGF5Q29tbWFuZHMoKVxyXG4gICAgICAgIH0sXHJcbiAgICBdXHJcblxyXG4gICAgYXN5bmMgcmliYm9uRGlzcGxheUNvbW1hbmRzKCk6IFByb21pc2U8dm9pZD4ge1xyXG4gICAgICAgIGNvbnN0IGJyYXRDb21tYW5kTGlzdDogU3VnZ2VzdGVySXRlbVtdID0gW107XHJcbiAgICAgICAgdGhpcy5icmF0Q29tbWFuZHMuZm9yRWFjaChjbWQgPT4geyBpZiAoY21kLnNob3dJblJpYmJvbikgYnJhdENvbW1hbmRMaXN0LnB1c2goeyBkaXNwbGF5OiBjbWQubmFtZSwgaW5mbzogY21kLmNhbGxiYWNrIH0pIH0pO1xyXG4gICAgICAgIGNvbnN0IGdmcyA9IG5ldyBHZW5lcmljRnV6enlTdWdnZXN0ZXIodGhpcy5wbHVnaW4pO1xyXG4gICAgICAgIC8vIEB0cy1pZ25vcmVcclxuICAgICAgICBjb25zdCBzZXR0aW5ncyA9IHRoaXMucGx1Z2luLmFwcC5zZXR0aW5nO1xyXG4gICAgICAgIC8vIEB0cy1pZ25vcmVcclxuICAgICAgICBjb25zdCBsaXN0T2ZDb3JlU2V0dGluZ3NUYWJzOiBTdWdnZXN0ZXJJdGVtW10gPSBPYmplY3QudmFsdWVzKHNldHRpbmdzLnNldHRpbmdUYWJzKS5tYXAoKHQ6IGFueSkgPT4ge1xyXG4gICAgICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAgICAgZGlzcGxheTogXCJDb3JlOiBcIiArIHQubmFtZSxcclxuICAgICAgICAgICAgICAgIGluZm86IGFzeW5jICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBzZXR0aW5ncy5vcGVuKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgc2V0dGluZ3Mub3BlblRhYkJ5SWQodC5pZCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgICAgICAvLyBAdHMtaWdub3JlXHJcbiAgICAgICAgY29uc3QgbGlzdE9mUGx1Z2luU2V0dGluZ3NUYWJzOiBTdWdnZXN0ZXJJdGVtW10gPSBPYmplY3QudmFsdWVzKHNldHRpbmdzLnBsdWdpblRhYnMpLm1hcCgodDogYW55KSA9PiB7XHJcbiAgICAgICAgICAgIHJldHVybiB7XHJcbiAgICAgICAgICAgICAgICBkaXNwbGF5OiBcIlBsdWdpbjogXCIgKyB0Lm5hbWUsXHJcbiAgICAgICAgICAgICAgICBpbmZvOiBhc3luYyAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2V0dGluZ3Mub3BlbigpO1xyXG4gICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLm9wZW5UYWJCeUlkKHQuaWQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcblxyXG4gICAgICAgIGJyYXRDb21tYW5kTGlzdC5wdXNoKHsgZGlzcGxheTogXCItLS0tIENvcmUgUGx1Z2luIFNldHRpbmdzIC0tLS1cIiwgaW5mbzogYXN5bmMgKCkgPT4geyBhd2FpdCB0aGlzLnJpYmJvbkRpc3BsYXlDb21tYW5kcygpIH0gfSlcclxuICAgICAgICBsaX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TCxLQUFLLFNBQVMsbUJBQW1CLEtBQUssaUJBQWlCLEVBRTNELEtBQUssSUFBSSxVQUFVLGNBQWMsSUFBWSxDQUM1QyxBQUFJLEtBQUssU0FBUyxpQkFDakIsV0FBVyxJQUFZLHdCQUN0QixLQUFNLE1BQUssWUFBWSxpQ0FBaUMsRUFBSyxDQUM5RCxHQUFHLEdBQUssRUFFTCxLQUFLLFNBQVMsdUJBQ2pCLFdBQVcsSUFBWSx3QkFDdEIsS0FBTSxHQUF1QixLQUFNLEVBQUssQ0FDekMsR0FBRyxJQUFNLENBRVgsQ0FBQyxDQUNGLEdBRUEsa0JBQXlCLENBQUUsS0FBSyxXQUFhLEtBQUssY0FBYyxXQUFZLE9BQVEsSUFBUyx3QkFBRyxZQUFLLFNBQVMsc0JBQXNCLEdBQUMsQ0FBRSxDQUV2SSxJQUFJLEVBQW1CLEVBQVUsR0FBYSxDQUFFLEdBQU8sS0FBTSxFQUFXLENBQU8sQ0FBRSxDQUVqRixVQUFpQixDQUFFLFFBQVEsSUFBSSxhQUFlLEtBQUssT0FBTyxDQUFFLENBRXRELGNBQThCLGdDQUFFLEtBQUssU0FBVyxPQUFPLE9BQU8sQ0FBQyxFQUFHLEdBQWtCLEtBQU0sTUFBSyxTQUFTLENBQUMsQ0FBRSxHQUUzRyxjQUE4QixnQ0FBRSxLQUFNLE1BQUssU0FBUyxLQUFLLFFBQVEsQ0FBRSxHQUMxRSIsCiAgIm5hbWVzIjogW10KfQo= +`;setTimeout(()=>a(this,null,function*(){if((yield s.app.vault.adapter.exists(n))===!0){let l=yield s.app.vault.adapter.read(n);r=r+l;let c=s.app.vault.getAbstractFileByPath(n);yield s.app.vault.modify(c,r)}else yield s.app.vault.create(n,r)}),10)}}}var z=class{constructor(t){this.bratCommands=[{id:"BRAT-AddBetaPlugin",icon:"BratIcon",name:"Plugins: Add a beta plugin for testing",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.displayAddNewPluginModal(!1,!1)})},{id:"BRAT-AddBetaPluginWithFrozenVersion",icon:"BratIcon",name:"Plugins: Add a beta plugin with frozen version based on a release tag",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.displayAddNewPluginModal(!1,!0)})},{id:"BRAT-checkForUpdatesAndUpdate",icon:"BratIcon",name:"Plugins: Check for updates to all beta plugins and UPDATE",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.checkForUpdatesAndInstallUpdates(!0,!1)})},{id:"BRAT-checkForUpdatesAndDontUpdate",icon:"BratIcon",name:"Plugins: Only check for updates to beta plugins, but don't Update",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.checkForUpdatesAndInstallUpdates(!0,!0)})},{id:"BRAT-updateOnePlugin",icon:"BratIcon",name:"Plugins: Choose a single plugin version to update",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(i=>i.repo)),e=Object.values(this.plugin.settings.pluginList).filter(i=>!t.has(i)).map(i=>({display:i,info:i})),n=new S(this.plugin);n.setSuggesterData(e),yield n.display(i=>a(this,null,function*(){let o=`Checking for updates for ${i.info}`;this.plugin.log(o,!0),m(this.plugin,` +${o}`,3),yield this.plugin.betaPlugins.updatePlugin(i.info,!1,!0)}))})},{id:"BRAT-restartPlugin",icon:"BratIcon",name:"Plugins: Restart a plugin that is already installed",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=Object.values(this.plugin.app.plugins.manifests).map(n=>({display:n.id,info:n.id})),e=new S(this.plugin);e.setSuggesterData(t),yield e.display(n=>a(this,null,function*(){m(this.plugin,`${n.info} +Plugin reloading .....`,5),yield this.plugin.betaPlugins.reloadPlugin(n.info)}))})},{id:"BRAT-disablePlugin",icon:"BratIcon",name:"Plugins: Disable a plugin - toggle it off",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=this.plugin.betaPlugins.getEnabledDisabledPlugins(!0).map(n=>({display:`${n.name} (${n.id})`,info:n.id})),e=new S(this.plugin);e.setSuggesterData(t),yield e.display(n=>a(this,null,function*(){this.plugin.log(`${n.display} plugin disabled`,!1),yield this.plugin.app.plugins.disablePlugin(n.info)}))})},{id:"BRAT-enablePlugin",icon:"BratIcon",name:"Plugins: Enable a plugin - toggle it on",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=this.plugin.betaPlugins.getEnabledDisabledPlugins(!1).map(n=>({display:`${n.name} (${n.id})`,info:n.id})),e=new S(this.plugin);e.setSuggesterData(t),yield e.display(n=>a(this,null,function*(){this.plugin.log(`${n.display} plugin enabled`,!1),yield this.plugin.app.plugins.enablePlugin(n.info)}))})},{id:"BRAT-openGitHubZRepository",icon:"BratIcon",name:"Plugins: Open the GitHub repository for a plugin",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=yield me(),e=Object.values(t).map(o=>({display:`Plugin: ${o.name} (${o.repo})`,info:o.repo})),n=Object.values(this.plugin.settings.pluginList).map(o=>({display:"BRAT: "+o,info:o}));e.forEach(o=>n.push(o));let i=new S(this.plugin);i.setSuggesterData(n),yield i.display(o=>a(this,null,function*(){o.info&&window.open(`https://github.com/${o.info}`)}))})},{id:"BRAT-openGitHubRepoTheme",icon:"BratIcon",name:"Themes: Open the GitHub repository for a theme (appearance)",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=yield Y(),e=Object.values(t).map(i=>({display:`Theme: ${i.name} (${i.repo})`,info:i.repo})),n=new S(this.plugin);n.setSuggesterData(e),yield n.display(i=>a(this,null,function*(){i.info&&window.open(`https://github.com/${i.info}`)}))})},{id:"BRAT-opentPluginSettings",icon:"BratIcon",name:"Plugins: Open Plugin Settings Tab",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=this.plugin.app.setting,e=Object.values(t.pluginTabs).map(o=>({display:"Plugin: "+o.name,info:o.id})),n=new S(this.plugin),i=Object.values(t.settingTabs).map(o=>({display:"Core: "+o.name,info:o.id}));e.forEach(o=>i.push(o)),n.setSuggesterData(i),yield n.display(o=>a(this,null,function*(){t.open(),t.openTabById(o.info)}))})},{id:"BRAT-GrabCommunityTheme",icon:"BratIcon",name:"Themes: Grab a community theme",showInRibbon:!0,callback:()=>a(this,null,function*(){return yield Se(this.plugin)})},{id:"BRAT-GrabBetaTheme",icon:"BratIcon",name:"Themes: Grab a beta theme for testing from a Github repository",showInRibbon:!0,callback:()=>a(this,null,function*(){new C(this.plugin).open()})},{id:"BRAT-updateBetaThemes",icon:"BratIcon",name:"Themes: Update beta themes",showInRibbon:!0,callback:()=>a(this,null,function*(){return yield W(this.plugin,!0)})},{id:"BRAT-switchTheme",icon:"BratIcon",name:"Themes: Switch Active Theme ",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=Object.values(this.plugin.app.customCss.themes).map(n=>({display:n,info:n}));t.unshift({display:"Obsidian Default Theme",info:""});let e=new S(this.plugin);e.setSuggesterData(t),yield e.display(n=>a(this,null,function*(){this.plugin.log(`Switched to theme ${n.display}`,!1),this.plugin.app.customCss.setTheme(n.info)}))})},{id:"BRAT-allCommands",icon:"BratIcon",name:"All Commands list",showInRibbon:!1,callback:()=>a(this,null,function*(){return this.ribbonDisplayCommands()})}];this.plugin=t,this.bratCommands.forEach(e=>a(this,null,function*(){this.plugin.addCommand({id:e.id,name:e.name,icon:e.icon,callback:()=>a(this,null,function*(){yield e.callback()})})}))}ribbonDisplayCommands(){return a(this,null,function*(){let t=[];this.bratCommands.forEach(r=>{r.showInRibbon&&t.push({display:r.name,info:r.callback})});let e=new S(this.plugin),n=this.plugin.app.setting,i=Object.values(n.settingTabs).map(r=>({display:"Core: "+r.name,info:()=>a(this,null,function*(){n.open(),n.openTabById(r.id)})})),o=Object.values(n.pluginTabs).map(r=>({display:"Plugin: "+r.name,info:()=>a(this,null,function*(){n.open(),n.openTabById(r.id)})}));t.push({display:"---- Core Plugin Settings ----",info:()=>a(this,null,function*(){yield this.ribbonDisplayCommands()})}),i.forEach(r=>t.push(r)),t.push({display:"---- Plugin Settings ----",info:()=>a(this,null,function*(){yield this.ribbonDisplayCommands()})}),o.forEach(r=>t.push(r)),e.setSuggesterData(t),yield e.display(r=>a(this,null,function*(){return yield r.info()}))})}};var Z=class extends Ye.Plugin{constructor(){super(...arguments);this.appName="Obsidian42 - Beta Reviewer's Auto-update Tool (BRAT)";this.appID="obsidian42-brat"}onload(){return a(this,null,function*(){console.log("loading Obsidian42 - BRAT"),yield this.loadSettings(),this.addSettingTab(new G(this.app,this)),this.betaPlugins=new B(this),this.commands=new z(this),Ce(),this.settings.ribbonIconEnabled&&this.showRibbonButton(),this.app.workspace.onLayoutReady(()=>{this.settings.updateAtStartup&&setTimeout(()=>a(this,null,function*(){yield this.betaPlugins.checkForUpdatesAndInstallUpdates(!1)}),6e4),this.settings.updateThemesAtStartup&&setTimeout(()=>a(this,null,function*(){yield W(this,!1)}),12e4)})})}showRibbonButton(){this.ribbonIcon=this.addRibbonIcon("BratIcon","BRAT",()=>a(this,null,function*(){return this.commands.ribbonDisplayCommands()}))}log(e,n=!1){He(this,e,n)}onunload(){console.log("unloading "+this.appName)}loadSettings(){return a(this,null,function*(){this.settings=Object.assign({},pe,yield this.loadData())})}saveSettings(){return a(this,null,function*(){yield this.saveData(this.settings)})}}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vbm9kZV9tb2R1bGVzL29ic2lkaWFuLWRhaWx5LW5vdGVzLWludGVyZmFjZS9kaXN0L21haW4uanMiLCAiLi4vc3JjL21haW4udHMiLCAiLi4vc3JjL3VpL1NldHRpbmdzVGFiLnRzIiwgIi4uL3NyYy9mZWF0dXJlcy90aGVtZXMudHMiLCAiLi4vc3JjL3VpL0dlbmVyaWNGdXp6eVN1Z2dlc3Rlci50cyIsICIuLi9zcmMvZmVhdHVyZXMvZ2l0aHViVXRpbHMudHMiLCAiLi4vc3JjL3VpL3NldHRpbmdzLnRzIiwgIi4uL3NyYy91dGlscy9ub3RpZmljYXRpb25zLnRzIiwgIi4uL3NyYy91dGlsc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QYXRoKGZvbGRlciwgZmlsZW5hbWUpO1xuICAgIHRyeSB7XG4gICAgICAgIGNvbnN0IGNyZWF0ZWRGaWxlID0gYXdhaXQgdmF1bHQuY3JlYXRlKG5vcm1hbGl6ZWRQYXRoLCB0ZW1wbGF0ZUNvbnRlbnRzXG4gICAgICAgICAgICAucmVwbGFjZSgve3tcXHMqKGRhdGV8dGltZSlcXHMqKChbKy1dXFxkKykoW3lxbXdkaHNdKSk/XFxzKig6Lis/KT99fS9naSwgKF8sIF90aW1lT3JEYXRlLCBjYWxjLCB0aW1lRGVsdGEsIHVuaXQsIG1vbWVudEZvcm1hdCkgPT4ge1xuICAgICAgICAgICAgY29uc3Qgbm93ID0gd2luZG93Lm1vbWVudCgpO1xuICAgICAgICAgICAgY29uc3QgY3VycmVudERhdGUgPSBkYXRlLmNsb25lKCkuc2V0KHtcbiAgICAgICAgICAgICAgICBob3VyOiBub3cuZ2V0KFwiaG91clwiKSxcbiAgICAgICAgICAgICAgICBtaW51dGU6IG5vdy5nZXQoXCJtaW51dGVcIiksXG4gICAgICAgICAgICAgICAgc2Vjb25kOiBub3cuZ2V0KFwic2Vjb25kXCIpLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpZiAoY2FsYykge1xuICAgICAgICAgICAgICAgIGN1cnJlbnREYXRlLmFkZChwYXJzZUludCh0aW1lRGVsdGEsIDEwKSwgdW5pdCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobW9tZW50Rm9ybWF0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGN1cnJlbnREYXRlLmZvcm1hdChtb21lbnRGb3JtYXQuc3Vic3RyaW5nKDEpLnRyaW0oKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gY3VycmVudERhdGUuZm9ybWF0KGZvcm1hdCk7XG4gICAgICAgIH0pXG4gICAgICAgICAgICAucmVwbGFjZSgve3tcXHMqZGF0ZVxccyp9fS9naSwgZmlsZW5hbWUpX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ICBjb25zdCBjcmVhdGVkRmlsZSA9IGF3YWl0IHZhdWx0LmNyZWF0ZShub3JtYWxpemVkUGF0aCwgdGVtcGxhdGVDb250ZW50c1xuICAgICAgICAgICAgLnJlcGxhY2UoL3t7XFxzKihkYXRlfHRpbWUpXFxzKigoWystXVxcZCspKFt5cW13ZGhzXSkpP1xccyooOi4rPyk/fX0vZ2ksIChfLCBfdGltZU9yRGF0ZSwgY2FsYywgdGltZURlbHRhLCB1bml0LCBtb21lbnRGb3JtYXQpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IG5vdyA9IHdpbmRvdy5tb21lbnQoKTtcbiAgICAgICAgICAgIGNvbnN0IGN1cnJlbnREYXRlID0gZGF0ZS5jbG9uZSgpLnNldCh7XG4gICAgICAgICAgICAgICAgaG91cjogbm93LmdldChcImhvdXJcIiksXG4gICAgICAgICAgICAgICAgbWludXRlOiBub3cuZ2V0KFwibWludXRlXCIpLFxuICAgICAgICAgICAgICAgIHNlY29uZDogbm93LmdldChcInNlY29uZFwiKSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgaWYgKGNhbGMpIHtcbiAgICAgICAgICAgICAgICBjdXJyZW50RGF0ZS5hZGQocGFyc2VJbnQodGltZURlbHRhLCAxMCksIHVuaXQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1vbWVudEZvcm1hdCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjdXJyZW50RGF0ZS5mb3JtYXQobW9tZW50Rm9ybWF0LnN1YnN0cmluZygxKS50cmltKCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGN1cnJlbnREYXRlLmZvcm1hdChmb3JtYXQpO1xuICAgICAgICB9KVxuICAgICAgICAgICAgLnJlcGxhY2UoL3t7XFxzKmRhdGVcXHMqfX0vZ2ksIGZpbGVuYW1lKVxuICAgICAgICAgICAgLnJlcGxhY2UoL3t7XFxzKnRpbWVcXHMqfX0vZ2ksIHdpbmRvdy5t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ICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgdGV4dEVsLmlucHV0RWwuYWRkRXZlbnRMaXN0ZW5lcigna2V5ZG93bicsIGFzeW5jIChlOiBLZXlib2FyZEV2ZW50KSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmtleSA9PT0gJ0VudGVyJyAmJiB0aGlzLmFkZHJlc3MgIT09ICcgJykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5zdWJtaXRGb3JtKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5zdHlsZS53aWR0aCA9IFwiMTAwJVwiO1xyXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5zZXRUaW1lb3V0KCgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdGl0bGUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKFwiLnNldHRpbmctaXRlbS1pbmZvXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodGl0bGUpIHRpdGxlLnJlbW92ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5mb2N1cygpXHJcbiAgICAgICAgICAgICAgICAgICAgfSwgMTApO1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcblxyXG4gICAgICAgICAgICBmb3JtRWwuY3JlYXRlRGl2KCdtb2RhbC1idXR0b24tY29udGFpbmVyJywgKGJ1dHRvbkNvbnRhaW5lckVsKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBidXR0b25Db250YWluZXJFbFxyXG4gICAgICAgICAgICAgICAgICAgIC5jcmVhdGVFbCgnYnV0dG9uJywgeyBhdHRyOiB7IHR5cGU6ICdidXR0b24nIH0sIHRleHQ6ICdOZXZlciBtaW5kJyB9KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsICgpID0+IHRoaXMuY2xvc2UoKSk7XHJcbiAgICAgICAgICAgICAgICBidXR0b25Db250YWluZXJFbC5jcmVhdGVFbCgnYnV0dG9uJywge1xyXG4gICAgICAgICAgICAgICAgICAgIGF0dHI6IHsgdHlwZTogJ3N1Ym1pdCcgfSxcclxuICAgICAgICAgICAgICAgICAgICBjbHM6ICdtb2QtY3RhJyxcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0OiAnQWRkIFRoZW1lJyxcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgIC8vIGludm9rZWQgd2hlbiBidXR0b24gaXMgY2xpY2tlZC4gXHJcbiAgICAgICAgICAgIGZvcm1FbC5hZGRFdmVudExpc3RlbmVyKCdzdWJtaXQnLCBhc3luYyAoZTogRXZlbnQpID0+IHtcclxuICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmFkZHJlc3MgIT09ICcnKSBhd2FpdCB0aGlzLnN1Ym1pdEZvcm0oKTtcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcblxyXG4gICAgYXN5bmMgb25DbG9zZSgpOiBQcm9taXNlPHZvaWQ+IHtcclxuICAgICAgICBpZiAodGhpcy5vcGVuU2V0dGluZ3NUYWJBZnRlcndhcmRzKSB7XHJcbiAgICAgICAgICAgIGF3YWl0ICh0aGlzLnBsdWdpbiBhcyBhbnkpLmFwcC5zZXR0aW5nLm9wZW4oKTtcclxuICAgICAgICAgICAgYXdhaXQgKHRoaXMucGx1Z2luIGFzIGFueSkuYXBwLnNldHRpbmcub3BlblRhYkJ5SWQoXCJvY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XG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBvbk9wZW4oKTogdm9pZCB7XHJcbiAgICAgICAgdGhpcy5jb250ZW50RWwuY3JlYXRlRWwoJ2g0JywgeyB0ZXh0OiBcIkdpdGh1YiByZXBvc2l0b3J5IGZvciBiZXRhIHBsdWdpbjpcIiB9KTtcclxuICAgICAgICB0aGlzLmNvbnRlbnRFbC5jcmVhdGVFbCgnZm9ybScsIHt9LCAoZm9ybUVsKSA9PiB7XHJcbiAgICAgICAgICAgIG5ldyBTZXR0aW5nKGZvcm1FbClcclxuICAgICAgICAgICAgICAgIC5hZGRUZXh0KCh0ZXh0RWwpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuc2V0UGxhY2Vob2xkZXIoJ1JlcG9zaXRvcnkgKGV4YW1wbGU6IFRmVEhhY2tlci9vYnNpZGlhbi1icmF0KScpO1xyXG4gICAgICAgICAgICAgICAgICAgIHRleHRFbC5vbkNoYW5nZSgodmFsdWUpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5hZGRyZXNzID0gdmFsdWUudHJpbSgpO1xyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIHRleHRFbC5pbnB1dEVsLmFkZEV2ZW50TGlzdGVuZXIoJ2tleWRvd24nLCBhc3luYyAoZTogS2V5Ym9hcmRFdmVudCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5rZXkgPT09ICdFbnRlcicgJiYgdGhpcy5hZGRyZXNzICE9PSAnICcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodGhpcy51c2VGcm96ZW5WZXJzaW9uICYmIHRoaXMudmVyc2lvbiAhPT0gXCJcIikgXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCF0aGlzLnVzZUZyb3plblZlcnNpb24pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5zdWJtaXRGb3JtKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5zdHlsZS53aWR0aCA9IFwiMTAwJVwiO1xyXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5zZXRUaW1lb3V0KCgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdGl0bGUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKFwiLnNldHRpbmctaXRlbS1pbmZvXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodGl0bGUpIHRpdGxlLnJlbW92ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5mb2N1cygpXHJcbiAgICAgICAgICAgICAgICAgICAgfSwgMTApO1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcblxyXG4gICAgICAgICAgICBpZiAodGhpcy51c2VGcm96ZW5WZXJzaW9uKSB7XHJcbiAgICAgICAgICAgICAgICBuZXcgU2V0dGluZyhmb3JtRWwpXHJcbiAgICAgICAgICAgICAgICAgICAgLmFkZFRleHQoKHRleHRFbCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuc2V0UGxhY2Vob2xkZXIoJ1NwZWNpZnkgdGhlIHJlbGVhc2UgdmVyc2lvbiB0YWcgKGV4YW1wbGU6IDEuMC4wKScpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RWwub25DaGFuZ2UoKHZhbHVlKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnZlcnNpb24gPSB2YWx1ZS50cmltKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5zdHlsZS53aWR0aCA9IFwiMTAwJVwiO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuc2V0VGltZW91dCgoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0aXRsZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXCIuc2V0dGluZy1pdGVtLWluZm9cIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGl0bGUpIHRpdGxlLnJlbW92ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCAxMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIGZvcm1FbC5jcmVhdGVEaXYoJ21vZGFsLWJ1dHRvbi1jb250YWluZXInLCAoYnV0dG9uQ29udGFpbmVyRWwpID0+IHtcclxuICAgICAgICAgICAgICAgIGJ1dHRvbkNvbnRhaW5lckVsXHJcbiAgICAgICAgICAgICAgICAgICAgLmNyZWF0ZUVsKCdidXR0b24nLCB7IGF0dHI6IHsgdHlwZTogJ2J1dHRvbicgfSwgdGV4dDogJ05ldmVyIG1pbmQnIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJywgKCkgPT4gdGhpcy5jbG9zZSgpKTtcclxuICAgICAgICAgICAgICAgIGJ1dHRvbkNvbnRhaW5lckVsLmNyZWF0ZUVsKCdidXR0b24nLCB7XHJcbiAgICAgICAgICAgICAgICAgICAgYXR0cjogeyB0eXBlOiAnc3VibWl0JyB9LFxyXG4gICAgICAgICAgICAgICAgICAgIGNsczogJ21vZC1jdGEnLFxyXG4gICAgICAgICAgICAgICAgICAgIHRleHQ6ICdBZGQgUGx1Z2luJyxcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgIC8vIGludm9rZWQgd2hlbiBidXR0b24gaXMgY2xpY2tlZC4gXHJcbiAgICAgICAgICAgIGZvcm1FbC5hZGRFdmVudExpc3RlbmVyKCdzdWJtaXQnLCBhc3luYyAoZTogRXZlbnQpID0+IHtcclxuICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmFkZHJlc3MgIT09ICcnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAodGhpcy51c2VGcm96ZW5WZXJzaW9uICYmIHRoaXMudmVyc2lvbiAhPT0gXCJcIikgXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHx8ICghdGhpcy51c2VGcm96ZW5WZXJzaW9uKVxyXG4gICAgICAgICAgICAgICAgICAgICkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnN1Ym1pdEZvcm0oKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgXHJcbiAgICBhc3luYyBvbkNsb3NlKCk6IFByb21pc2U8dm9pZD4ge1xyXG4gICAgICAgIGlmKHRoaXMub3BlblNldHRpbmdzVGFiQWZ0ZXJ3YXJkcykge1xyXG4gICAgICAgICAgICBhd2FpdCAodGhpcy5wbHVnaW4gYXMgYW55KS5hcHAuc2V0dGluZy5vcGVuKCk7XHJcbiAgICAgICAgICAgIGF3YWl0ICh0aGlzLnBsdWdpbiBhcyBhbnkpLmFwcC5zZXR0aW5nLm9wZW5UYWJCeUl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7XHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0sXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBpZDogXCJCUkFULXJlc3RhcnRQbHVnaW5cIixcclxuICAgICAgICAgICAgaWNvbjogXCJCcmF0SWNvblwiLFxyXG4gICAgICAgICAgICBuYW1lOiBcIlBsdWdpbnM6IFJlc3RhcnQgYSBwbHVnaW4gdGhhdCBpcyBhbHJlYWR5IGluc3RhbGxlZFwiLFxyXG4gICAgICAgICAgICBzaG93SW5SaWJib246IHRydWUsXHJcbiAgICAgICAgICAgIGNhbGxiYWNrOiBhc3luYyAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAvLyBAdHMtaWdub3JlXHJcbiAgICAgICAgICAgICAgICBjb25zdCBwbHVnaW5MaXN0OiBTdWdnZXN0ZXJJdGVtW10gPSBPYmplY3QudmFsdWVzKHRoaXMucGx1Z2luLmFwcC5wbHVnaW5zLm1hbmlmZXN0cykubWFwKChtKSA9PiB7IHJldHVybiB7IGRpc3BsYXk6IG0uaWQsIGluZm86IG0uaWQgfSB9KTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGdmcyA9IG5ldyBHZW5lcmljRnV6enlTdWdnZXN0ZXIodGhpcy5wbHVnaW4pO1xyXG4gICAgICAgICAgICAgICAgZ2ZzLnNldFN1Z2dlc3RlckRhdGEocGx1Z2luTGlzdCk7XHJcbiAgICAgICAgICAgICAgICBhd2FpdCBnZnMuZGlzcGxheShhc3luYyAocmVzdWx0cykgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIFRvYXN0TWVzc2FnZSh0aGlzLnBsdWdpbiwgYCR7cmVzdWx0cy5pbmZvfVxcblBsdWdpbiByZWxvYWRpbmcgLi4uLi5gLCA1KTtcclxuICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnBsdWdpbi5iZXRhUGx1Z2lucy5yZWxvYWRQbHVnaW4ocmVzdWx0cy5pbmZvKTt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GVQbHVnaW4ocmVzdWx0cy5pbmZvKTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGlkOiBcIkJSQVQtZW5hYmxlUGx1Z2luXCIsXHJcbiAgICAgICAgICAgIGljb246IFwiQnJhdEljb25cIixcclxuICAgICAgICAgICAgbmFtZTogXCJQbHVnaW5zOiBFbmFibGUgYSBwbHVnaW4gLSB0b2dnbGUgaXQgb25cIixcclxuICAgICAgICAgICAgc2hvd0luUmliYm9uOiB0cnVlLFxyXG4gICAgICAgICAgICBjYWxsYmFjazogYXN5bmMgKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgcGx1Z2luTGlzdCA9IHRoaXMucGx1Z2luLmJldGFQbHVnaW5zLmdldEVuYWJsZWREaXNhYmxlZFBsdWdpbnMoZmFsc2UpLm1hcChtYW5pZmVzdCA9PiB7IHJldHVybiB7IGRpc3BsYXk6IGAke21hbmlmZXN0Lm5hbWV9ICgke21hbmlmZXN0LmlkfSlgLCBpbmZvOiBtYW5pZmVzdC5pZCB9IH0pO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZ2ZzID0gbmV3IEdlbmVyaWNGdXp6eVN1Z2dlc3Rlcih0aGlzLnBsdWdpbik7XHJcbiAgICAgICAgICAgICAgICBnZnMuc2V0U3VnZ2VzdGVyRGF0YShwbHVnaW5MaXN0KTtcclxuICAgICAgICAgICAgICAgIGF3YWl0IGdmcy5kaXNwbGF5KGFzeW5jIChyZXN1bHRzKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wbHVnaW4ubG9nKGAke3Jlc3VsdHMuZGlzcGxheX0gcGx1Z2luIGVuYWJsZWRgLCBmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gQHRzLWlnbm9yZVxyXG4gICAgICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMucGx1Z2luLmFwcC5wbHVnaW5zLmVuYWJsZVBsdWdpbihyZXN1bHRzLmluZm8pO1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9LFxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgaWQ6IFwiQlJBVC1vcGVuR2l0SHViWlJlcG9zaXRvcnlcIixcclxuICAgICAgICAgICAgaWNvbjogXCJCcmF0SWNvblwiLFxyXG4gICAgICAgICAgICBuYW1lOiBcIlBsdWdpbnM6IE9wZW4gdGhlIEdpdEh1YiByZXBvc2l0b3J5IGZvciBhIHBsdWdpblwiLFxyXG4gICAgICAgICAgICBzaG93SW5SaWJib246IHRydWUsXHJcbiAgICAgICAgICAgIGNhbGxiYWNrOiBhc3luYyAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBjb21tdW5pdHlQbHVnaW5zID0gYXdhaXQgZ3JhYkNvbW1tdW5pdHlQbHVnaW5MaXN0KCk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBjb21tdW5pdHlQbHVnaW5MaXN0OiBTdWdnZXN0ZXJJdGVtW10gPSBPYmplY3QudmFsdWVzKGNvbW11bml0eVBsdWdpbnMpLm1hcCgocCkgPT4geyByZXR1cm4geyBkaXNwbGF5OiBgUGx1Z2luOiAke3AubmFtZX0gICgke3AucmVwb30pYCwgaW5mbzogcC5yZXBvIH0gfSk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBicmF0TGlzdDogU3VnZ2VzdGVySXRlbVtdID0gT2JqZWN0LnZhbHVlcyh0aGlzLnBsdWdpbi5zZXR0aW5ncy5wbHVnaW5MaXN0KS5tYXAoKHApID0+IHsgcmV0dXJuIHsgZGlzcGxheTogXCJCUkFUOiBcIiArIHAsIGluZm86IHAgfSB9KTtcclxuICAgICAgICAgICAgICAgIGNvbW11bml0eVBsdWdpbkxpc3QuZm9yRWFjaChzaSA9PiBicmF0TGlzdC5wdXNoKHNpKSk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBnZnMgPSBuZXcgR2VuZXJpY0Z1enp5U3VnZ2VzdGVyKHRoaXMucGx1Z2luKTtcclxuICAgICAgICAgICAgICAgIGdmcy5zZXRTdWdnZXN0ZXJEYXRhKGJyYXRMaXN0KTtcclxuICAgICAgICAgICAgICAgIGF3YWl0IGdmcy5kaXNwbGF5KGFzeW5jIChyZXN1bHRzKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdHMuaW5mbykgd2luZG93Lm9wZW4oYGh0dHBzOi8vZ2l0aHViLmNvbS8ke3Jlc3VsdHMuaW5mb31gKVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9LFxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgaWQ6IFwiQlJBVC1vcGVuR2l0SHViUmVwb1RoZW1lXCIsXHJcbiAgICAgICAgICAgIGljb246IFwiQnJhdEljb25cIixcclxuICAgICAgICAgICAgbmFtZTogXCJUaGVtZXM6IE9wZW4gdGhlIEdpdEh1YiByZXBvc2l0b3J5IGZvciBhIHRoZW1lIChhcHBlYXJhbmNlKVwiLFxyXG4gICAgICAgICAgICBzaG93SW5SaWJib246IHRydWUsXHJcbiAgICAgICAgICAgIGNhbGxiYWNrOiBhc3luYyAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBjb21tdW5pdHlUaGVtZSA9IGF3YWl0IGdyYWJDb21tbXVuaXR5VGhlbWVzTGlzdCgpO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY29tbXVuaXR5VGhlbWVMaXN0OiBTdWdnZXN0ZXJJdGVtW10gPSBPYmplY3QudmFsdWVzKGNvbW11bml0eVRoZW1lKS5tYXAoKHApID0+IHsgcmV0dXJuIHsgZGlzcGxheTogYFRoZW1lOiAke3AubmFtZX0gICgke3AucmVwb30pYCwgaW5mbzogcC5yZXBvIH0gfSk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBnZnMgPSBuZXcgR2VuZXJpY0Z1enp5U3VnZ2VzdGVyKHRoaXMucGx1Z2luKTtcclxuICAgICAgICAgICAgICAgIGdmcy5zZXRTdWdnZXN0ZXJEYXRhKGNvbW11bml0eVRoZW1lTGlzdCk7XHJcbiAgICAgICAgICAgICAgICBhd2FpdCBnZnMuZGlzcGxheShhc3luYyAocmVzdWx0cykgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHRzLmluZm8pIHdpbmRvdy5vcGVuKGBodHRwczovL2dpdGh1Yi5jb20vJHtyZXN1bHRzLmluZm99YClcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGlkOiBcIkJSQVQtb3BlbnRQbHVnaW5TZXR0aW5nc1wiLFxyXG4gICAgICAgICAgICBpY29uOiBcIkJyYXRJY29uXCIsXHJcbiAgICAgICAgICAgIG5hbWU6IFwiUGx1Z2luczogT3BlbiBQbHVnaW4gU2V0dGluZ3MgVGFiXCIsXHJcbiAgICAgICAgICAgIHNob3dJblJpYmJvbjogdHJ1ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2s6IGFzeW5jICgpID0+IHtcclxuICAgICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcclxuICAgICAgICAgICAgICAgIGNvbnN0IHNldHRpbmdzID0gdGhpcy5wbHVnaW4uYXBwLnNldHRpbmc7XHJcbiAgICAgICAgICAgICAgICAvLyBAdHMtaWdub3JlXHJcbiAgICAgICAgICAgICAgICBjb25zdCBsaXN0T2ZQbHVnaW5TZXR0aW5nc1RhYnM6IFN1Z2dlc3Rlckl0ZW1bXSA9IE9iamVjdC52YWx1ZXMoc2V0dGluZ3MucGx1Z2luVGFicykubWFwKCh0KSA9PiB7IHJldHVybiB7IGRpc3BsYXk6IFwiUGx1Z2luOiBcIiArIHQubmFtZSwgaW5mbzogdC5pZCB9IH0pO1xyXG4gICAgICAgICAgIC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6IGFzeW5jICgpID0+IGF3YWl0IHRoZW1lc0luc3RhbGxGcm9tQ29tbXVuaXR5TGlzdCh0aGlzLnBsdWdpbilcclxuICAgICAgICB9LFxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgaWQ6IFwiQlJBVC1HcmFiQmV0YVRoZW1lXCIsXHJcbiAgICAgICAgICAgIGljb246IFwiQnJhdEljb25cIixcclxuICAgICAgICAgICAgbmFtZTogXCJUaGVtZXM6IEdyYWIgYSBiZXRhIHRoZW1lIGZvciB0ZXN0aW5nIGZyb20gYSBHaXRodWIgcmVwb3NpdG9yeVwiLFxyXG4gICAgICAgICAgICBzaG93SW5SaWJib246IHRydWUsXHJcbiAgICAgICAgICAgIGNhbGxiYWNrOiBhc3luYyAoKSA9PiB7IChuZXcgQWRkTmV3VGhlbWUodGhpcy5wbHVnaW4pKS5vcGVuKCkgfVxyXG4gICAgICAgIH0sXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBpZDogXCJCUkFULXVwZGF0ZUJldGFUaGVtZXNcIixcclxuICAgICAgICAgICAgaWNvbjogXCJCcmF0SWNvblwiLFxyXG4gICAgICAgICAgICBuYW1lOiBcIlRoZW1lczogVXBkYXRlIGJldGEgdGhlbWVzXCIsXHJcbiAgICAgICAgICAgIHNob3dJblJpYmJvbjogdHJ1ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2s6IGFzeW5jICgpID0+IGF3YWl0IHRoZW1lc2VDaGVja0FuZFVwZGF0ZXModGhpcy5wbHVnaW4sIHRydWUpIFxyXG4gICAgICAgIH0sICAgICAgICBcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGlkOiBcIkJSQVQtc3dpdGNoVGhlbWVcIixcclxuICAgICAgICAgICAgaWNvbjogXCJCcmF0SWNvblwiLFxyXG4gICAgICAgICAgICBuYW1lOiBcIlRoZW1lczogU3dpdGNoIEFjdGl2ZSBUaGVtZSBcIixcclxuICAgICAgICAgICAgc2hvd0luUmliYm9uOiB0cnVlLFxyXG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yXG4gICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLm9wZW4oKTtcclxuICAgICAgICAgICAgICAgICAgICBzZXR0aW5ncy5vcGVuVGFiQnlJZCh0LmlkKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIC8vIEB0cy1pZ25vcmVcclxuICAgICAgICBjb25zdCBsaXN0T2ZQbHVnaW5TZXR0aW5nc1RhYnM6IFN1Z2dlc3Rlckl0ZW1bXSA9IE9iamVjdC52YWx1ZXMoc2V0dGluZ3MucGx1Z2luVGFicykubWFwKCh0OiBhbnkpID0+IHtcclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgIGRpc3BsYXk6IFwiUGx1Z2luOiBcIiArIHQubmFtZSxcclxuICAgICAgICAgICAgICAgIGluZm86IGFzeW5jICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBzZXR0aW5ncy5vcGVuKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgc2V0dGluZ3Mub3BlblRhYkJ5SWQodC5pZCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgYnJhdENvbW1hbmRMaXN0LnB1c2goeyBkaXNwbGF5OiBcIi0tLS0gQ29yZSBQbHVnaW4gU2V0dGluZ3MgLS0tLVwiLCBpbmZvOiBhc3luYyAoKSA9PiB7IGF3YWl0IHRoaXMucmliYm9uRGlzcGxheUNvbW1hbmRzKCkgfSB9KVxyXG4gICAgICAgIGxpc3RPZkNvcmVTZXR0aW5nc1RhYnMuZm9yRWFjaChzaSA9PiBicmF0Q29tbWFuZExpc3QucHVzaChzaSkpO1xyXG4gICAgICAgIGJyYXRDb21tYW5kTGlzdC5wdXNoKHsgZGlzcGxheTogXCItLS0tIFBsdWdpbiBTZXR0aW5ncyAtLS0tXCIsIGluZm86IGFzeW5jICgpID0+IHsgY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at/manifest.json index 35516cd9..b0070919 100644 --- a/.obsidian/plugins/obsidian42-brat/manifest.json +++ b/.obsidian/plugins/obsidian42-brat/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian42-brat", "name": "Obsidian42 - BRAT", - "version": "0.6.33", + "version": "0.6.34", "minAppVersion": "0.13.21", "description": "Easily install a beta version of a plugin for testing.", "author": "TfTHacker", diff --git a/.obsidian/workspace b/.obsidian/workspace index 73c15f1d..4fe339e8 100644 --- a/.obsidian/workspace +++ b/.obsidian/workspace @@ -4,7 +4,7 @@ "type": "split", "children": [ { - "id": "f296e98f595bb35a", + "id": "8be92ac6d74448d7", "type": "leaf", "state": { "type": "markdown", @@ -151,17 +151,17 @@ ], "currentTab": 2 }, - "active": "f296e98f595bb35a", + "active": "8be92ac6d74448d7", "lastOpenFiles": [ "01.02 Home/@Main Dashboard.md", - "03.03 Food & Wine/Thai Basil Sauce Noodles with Jammy Eggs.md", - "03.03 Food & Wine/Udon in Buttery Tomato n Soy broth.md", + "00.01 Admin/Calendars/2022-04-19.md", "00.01 Admin/Calendars/2022-04-18.md", - "00.01 Admin/Calendars/2022-04-16.md", - "05.02 Networks/Configuring Fail2ban.md", - "00.01 Admin/Obsidian plugins.md", - "00.01 Admin/Test sheet.md", - "00.01 Admin/Calendars/2022-04-17.md", - "03.03 Food & Wine/@Main dishes.md" + "00.03 News/What i learnt during my 3 days offline.md", + "03.03 Food & Wine/Fresh Tomato Eggs in Purgatory with Chickpeas.md", + "00.03 News/Lovemaking for longevity a recipe from Tokyo’s imperial archives Aeon Essays.md", + "00.03 News/The Bullet and the Ballplayer.md", + "00.03 News/The 1918 flu didn’t end in 1918. Here’s what its third year can teach us..md", + "03.03 Food & Wine/Thai Basil Sauce Noodles with Jammy Eggs.md", + "03.03 Food & Wine/Udon in Buttery Tomato n Soy broth.md" ] } \ No newline at end of file diff --git a/00.01 Admin/Calendars/2022-04-18.md b/00.01 Admin/Calendars/2022-04-18.md index f0affb4f..10cf0ee0 100644 --- a/00.01 Admin/Calendars/2022-04-18.md +++ b/00.01 Admin/Calendars/2022-04-18.md @@ -13,9 +13,9 @@ Stress: 40 FrontHeadBar: 5 EarHeadBar: 45 BackHeadBar: 35 -Water: 0.525 -Coffee: 3 -Steps: +Water: 2.325 +Coffee: 4 +Steps: 12248 Ski: Riding: Racket: @@ -90,6 +90,9 @@ This section does serve for quick memos. %% ### %%   - [ ] 12:49 [[2022-04-18|Memo]], [[@Lifestyle]]: check the Tennis Club at the top of the mountain 📆2022-04-23 +- [ ] 14:12 [[2022-04-18|Memo]], [[@Lifestyle]]: Find a cleaner 📆2022-04-24 +- [ ] 14:30 [[2022-04-18|Memo]], [[Selfhosting]], [[Server Alias]], [[Configuring Fail2ban]]: check (imported) nginx filters 📆2022-04-23 +- [ ] 17:54 [[2022-04-18|Memo]], [[@Lifestyle]]: Look up the afrench sailing circle 📆2022-04-25 --- diff --git a/00.01 Admin/Calendars/2022-04-19.md b/00.01 Admin/Calendars/2022-04-19.md new file mode 100644 index 00000000..54758734 --- /dev/null +++ b/00.01 Admin/Calendars/2022-04-19.md @@ -0,0 +1,104 @@ +--- + +Date: 2022-04-19 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: Yes +Sleep: 7 +Happiness: 90 +Gratefulness: 90 +Stress: 35 +FrontHeadBar: 5 +EarHeadBar: 40 +BackHeadBar: 35 +Water: 2.18 +Coffee: 5 +Steps: +Ski: +Riding: +Racket: +Football: +title: "Daily Note" +allDay: true +date: 2022-04-19 + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2022-04-18|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2022-04-20|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2022-04-19Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2022-04-19NSave + +  + +# 2022-04-19 + +  + +```ad-abstract +title: Summary +collapse: open +Note Description +``` + +  + +```toc +style: number +``` + +  + +--- + +  + +### Memos + +  + +#### Memos + +This section does serve for quick memos. + +  + + +%% ### %% +  + +--- + +  + +### Notes + +  + +Loret ipsum + +  +  \ No newline at end of file diff --git a/00.03 News/Lovemaking for longevity a recipe from Tokyo’s imperial archives Aeon Essays.md b/00.03 News/Lovemaking for longevity a recipe from Tokyo’s imperial archives Aeon Essays.md index 7553660e..dbd3d540 100644 --- a/00.03 News/Lovemaking for longevity a recipe from Tokyo’s imperial archives Aeon Essays.md +++ b/00.03 News/Lovemaking for longevity a recipe from Tokyo’s imperial archives Aeon Essays.md @@ -13,7 +13,7 @@ CollapseMetaTable: Yes --- Parent:: [[@News|News]] -Read:: No +Read:: [[2022-04-18]] --- diff --git a/00.03 News/The 1918 flu didn’t end in 1918. Here’s what its third year can teach us..md b/00.03 News/The 1918 flu didn’t end in 1918. Here’s what its third year can teach us..md index ede6b966..3355b02c 100644 --- a/00.03 News/The 1918 flu didn’t end in 1918. Here’s what its third year can teach us..md +++ b/00.03 News/The 1918 flu didn’t end in 1918. Here’s what its third year can teach us..md @@ -13,7 +13,7 @@ CollapseMetaTable: Yes --- Parent:: [[@News|News]] -Read:: No +Read:: [[2022-04-18]] --- diff --git a/00.03 News/The Bullet and the Ballplayer.md b/00.03 News/The Bullet and the Ballplayer.md index 364f5427..4db16900 100644 --- a/00.03 News/The Bullet and the Ballplayer.md +++ b/00.03 News/The Bullet and the Ballplayer.md @@ -14,7 +14,7 @@ CollapseMetaTable: Yes --- Parent:: [[@News|News]] -Read:: No +Read:: [[2022-04-18]] --- diff --git a/00.03 News/What i learnt during my 3 days offline.md b/00.03 News/What i learnt during my 3 days offline.md index 7dc97a7b..b8c31038 100644 --- a/00.03 News/What i learnt during my 3 days offline.md +++ b/00.03 News/What i learnt during my 3 days offline.md @@ -15,7 +15,7 @@ CollapseMetaTable: "Yes" --- Parent:: [[@News|News]] -Read:: No +Read:: [[2022-04-18]] --- diff --git a/01.02 Home/@Main Dashboard.md b/01.02 Home/@Main Dashboard.md index 2454219b..9b25cf32 100644 --- a/01.02 Home/@Main Dashboard.md +++ b/01.02 Home/@Main Dashboard.md @@ -192,16 +192,16 @@ limit 6 ``` tracker searchType: frontmatter -searchTarget: Happiness, Gratefulness, Ski, Riding, Racket, Football +searchTarget: Happiness, Steps, Ski, Riding, Racket, Football folder: /00.01 Admin/Calendars month: mode: annotation startWeekOn: 'Mon' - threshold: 75, 75, 0, 0, 0, 0 + threshold: 75, 10000, 0, 0, 0, 0 color: green headerMonthColor: orange dimNotInMonth: false - annotation: ☀️,🥳,⛷,🏇,🎾,⚽ + annotation: ☀️,🏃,⛷,🏇,🎾,⚽ showAnnotationOfAllTargets: true ``` diff --git a/01.02 Home/Household.md b/01.02 Home/Household.md index a51af7e4..20c32cd9 100644 --- a/01.02 Home/Household.md +++ b/01.02 Home/Household.md @@ -78,7 +78,8 @@ This section on different household obligations. - [x] [[Household]]: *Paper* recycling collection 🔁 every 2 weeks on Tuesday 📅 2022-02-15 ✅ 2022-02-14 - [x] [[Household]]: *Paper* recycling collection 🔁 every 2 weeks on Tuesday 📅 2022-02-01 ✅ 2022-01-31 - [x] [[Household]]: *Paper* recycling collection 🔁 every 2 weeks on Tuesday 📅 2022-01-18 ✅ 2022-01-17 -- [ ] [[Household]]: *Cardboard* recycling collection 🔁 every 2 weeks on Tuesday 📅 2022-04-19 +- [ ] [[Household]]: *Cardboard* recycling collection 🔁 every 2 weeks on Tuesday 📅 2022-05-03 +- [x] [[Household]]: *Cardboard* recycling collection 🔁 every 2 weeks on Tuesday 📅 2022-04-19 ✅ 2022-04-18 - [x] [[Household]]: *Cardboard* recycling collection 🔁 every 2 weeks on Tuesday 📅 2022-04-05 ✅ 2022-04-05 - [x] [[Household]]: *Cardboard* recycling collection 🔁 every 2 weeks on Tuesday 📅 2022-03-22 ✅ 2022-03-21 - [x] [[Household]]: *Cardboard* recycling collection 🔁 every 2 weeks on Tuesday 📅 2022-03-08 ✅ 2022-03-07 diff --git a/03.03 Food & Wine/Fresh Tomato Eggs in Purgatory with Chickpeas.md b/03.03 Food & Wine/Fresh Tomato Eggs in Purgatory with Chickpeas.md index 9e282294..b630ca1d 100644 --- a/03.03 Food & Wine/Fresh Tomato Eggs in Purgatory with Chickpeas.md +++ b/03.03 Food & Wine/Fresh Tomato Eggs in Purgatory with Chickpeas.md @@ -2,7 +2,7 @@ ServingSize: 2 Alias: [] -Tag: ["NotYetTested", "Breakfast", "Healthy", "Vegetarian"] +Tag: ["Breakfast", "Healthy", "Vegetarian"] Date: 2022-03-13 DocType: "Recipe" Hierarchy: "NonRoot" @@ -10,7 +10,7 @@ location: CollapseMetaTable: Yes Meta: IsFavourite: False - Rating: + Rating: 3 Recipe: Courses: "Main dish" Categories: "Egg"