diff --git a/.obsidian/plugins/cron/data.json b/.obsidian/plugins/cron/data.json index 9ab4cba5..156b7aae 100644 --- a/.obsidian/plugins/cron/data.json +++ b/.obsidian/plugins/cron/data.json @@ -19,7 +19,7 @@ "601d1cc7-a4f3-4f19-aa9f-3bddd7ab6b1d": { "locked": false, "lockedDeviceName": "iPhone", - "lastRun": "2023-12-09T08:29:13+01:00" + "lastRun": "2023-12-16T08:18:10+01:00" } } } \ No newline at end of file diff --git a/.obsidian/plugins/emoji-shortcodes/data.json b/.obsidian/plugins/emoji-shortcodes/data.json index a7c3d624..865eb54c 100644 --- a/.obsidian/plugins/emoji-shortcodes/data.json +++ b/.obsidian/plugins/emoji-shortcodes/data.json @@ -5,8 +5,9 @@ "historyLimit": 100, "history": [ ":fork_and_knife:", - ":tv:", ":plate_with_cutlery:", + ":tv:", + ":mountain:", ":book:", ":ski:", ":salt:", @@ -41,7 +42,6 @@ ":candy:", ":champagne:", ":wine_glass:", - ":mountain:", ":cityscape:", ":iphone:", ":european_castle:", diff --git a/.obsidian/plugins/obsidian-activity-history/data.json b/.obsidian/plugins/obsidian-activity-history/data.json index 40dd5df9..37126392 100644 --- a/.obsidian/plugins/obsidian-activity-history/data.json +++ b/.obsidian/plugins/obsidian-activity-history/data.json @@ -12,8 +12,8 @@ "checkpointList": [ { "path": "/", - "date": "2023-12-09", - "size": 19746495 + "date": "2023-12-16", + "size": 19971869 } ], "activityHistory": [ @@ -2806,7 +2806,35 @@ }, { "date": "2023-12-09", - "value": 8335 + "value": 8787 + }, + { + "date": "2023-12-10", + "value": 198453 + }, + { + "date": "2023-12-11", + "value": 1611 + }, + { + "date": "2023-12-12", + "value": 18329 + }, + { + "date": "2023-12-13", + "value": 1497 + }, + { + "date": "2023-12-14", + "value": 1347 + }, + { + "date": "2023-12-15", + "value": 1791 + }, + { + "date": "2023-12-16", + "value": 2106 } ] } diff --git a/.obsidian/plugins/obsidian-commits/data.json b/.obsidian/plugins/obsidian-commits/data.json index 4f527f76..2b7098ad 100644 --- a/.obsidian/plugins/obsidian-commits/data.json +++ b/.obsidian/plugins/obsidian-commits/data.json @@ -1120,7 +1120,7 @@ "links": 1 }, "02.02 Paris/@@Paris.md": { - "size": 2501, + "size": 2792, "tags": 3, "links": 9 }, @@ -1570,7 +1570,7 @@ "links": 1 }, "01.02 Home/Household.md": { - "size": 2284, + "size": 2545, "tags": 2, "links": 2 }, @@ -1765,7 +1765,7 @@ "links": 1 }, "01.01 Life Orga/@Finances.md": { - "size": 4792, + "size": 5411, "tags": 4, "links": 5 }, @@ -4120,7 +4120,7 @@ "links": 3 }, "00.08 Bookmarks/Bookmarks - Work.md": { - "size": 1640, + "size": 1874, "tags": 1, "links": 4 }, @@ -11305,7 +11305,7 @@ "links": 6 }, "01.02 Home/Vinyls.md": { - "size": 2385, + "size": 2629, "tags": 4, "links": 1 }, @@ -11334,11 +11334,6 @@ "tags": 3, "links": 1 }, - "00.01 Admin/Calendars/Events/2023-12-13 ⚽️ Borussia - PSG.md": { - "size": 171, - "tags": 0, - "links": 2 - }, "00.01 Admin/Calendars/Events/2023-10-29 ⚽️ Brest 29 - PSG (2-3).md": { "size": 274, "tags": 0, @@ -11680,7 +11675,7 @@ "links": 6 }, "00.01 Admin/Calendars/2023-12-02.md": { - "size": 1412, + "size": 1558, "tags": 0, "links": 8 }, @@ -11717,12 +11712,12 @@ "00.03 News/The Plight of the Oldest Sister.md": { "size": 9124, "tags": 4, - "links": 1 + "links": 2 }, "00.03 News/Inside Foxconn’s struggle to make iPhones in India.md": { "size": 38548, - "tags": 4, - "links": 1 + "tags": 3, + "links": 2 }, "00.03 News/C.T.E. Study Finds That Young Football Players Are Getting the Disease.md": { "size": 9577, @@ -11777,7 +11772,7 @@ "00.01 Admin/Calendars/2023-12-09.md": { "size": 1619, "tags": 0, - "links": 9 + "links": 10 }, "03.04 Cinematheque/The Magnificent Seven (1960).md": { "size": 2052, @@ -11788,14 +11783,94 @@ "size": 2691, "tags": 0, "links": 1 + }, + "00.01 Admin/Calendars/Events/2023-12-09 ⚽️ PSG - FC Nantes.md": { + "size": 234, + "tags": 0, + "links": 2 + }, + "00.01 Admin/Calendars/2023-12-10.md": { + "size": 1412, + "tags": 0, + "links": 5 + }, + "03.02 Travels/Atzmännig Goldingen.md": { + "size": 2274, + "tags": 3, + "links": 2 + }, + "00.03 News/This Maine Fish House Is an Icon. But of What, Exactly.md": { + "size": 28078, + "tags": 4, + "links": 1 + }, + "00.03 News/Reuters, New York Times Top List of Fossil Fuel Industry’s Favorite Media Partners.md": { + "size": 25885, + "tags": 4, + "links": 1 + }, + "00.03 News/Taylor Swift Is TIME's 2023 Person of the Year.md": { + "size": 44841, + "tags": 6, + "links": 1 + }, + "00.03 News/In Uvalde, Students Followed Active Shooter Protocol. The Cops Did Not..md": { + "size": 47352, + "tags": 4, + "links": 1 + }, + "00.03 News/The call of Tokitae.md": { + "size": 49881, + "tags": 3, + "links": 1 + }, + "00.01 Admin/Calendars/2023-12-11.md": { + "size": 1412, + "tags": 0, + "links": 6 + }, + "00.01 Admin/Calendars/2023-12-12.md": { + "size": 1412, + "tags": 0, + "links": 5 + }, + "00.03 News/Deep in the Wilderness, the World’s Largest Beaver Dam Endures.md": { + "size": 16616, + "tags": 4, + "links": 1 + }, + "00.01 Admin/Calendars/2023-12-13.md": { + "size": 1412, + "tags": 0, + "links": 6 + }, + "00.01 Admin/Calendars/Events/2023-12-13 ⚽️ Borussia - PSG (1-1).md": { + "size": 233, + "tags": 0, + "links": 2 + }, + "00.01 Admin/Calendars/2023-12-14.md": { + "size": 1255, + "tags": 0, + "links": 4 + }, + "00.01 Admin/Calendars/2023-12-15.md": { + "size": 1412, + "tags": 0, + "links": 6 + }, + "00.01 Admin/Calendars/2023-12-16.md": { + "size": 1412, + "tags": 0, + "links": 5 } }, "commitTypes": { "/": { - "Refactor": 6265, - "Create": 2192, - "Link": 8408, - "Expand": 1913 + "Refactor": 6276, + "Create": 2207, + "Link": 8443, + "Expand": 1924 } }, "dailyCommits": { @@ -11807,39 +11882,50 @@ "4": 17, "5": 15, "6": 69, - "7": 815, - "8": 1072, - "9": 990, - "10": 694, - "11": 513, - "12": 6660, - "13": 567, - "14": 520, - "15": 553, - "16": 641, - "17": 736, + "7": 825, + "8": 1078, + "9": 996, + "10": 696, + "11": 515, + "12": 6663, + "13": 574, + "14": 521, + "15": 562, + "16": 654, + "17": 737, "18": 883, - "19": 631, - "20": 636, - "21": 632, - "22": 593, + "19": 632, + "20": 639, + "21": 635, + "22": 598, "23": 1275 } }, "weeklyCommits": { "/": { - "Mon": 2695, - "Tue": 1597, - "Wed": 7724, - "Thu": 1120, - "Fri": 1206, + "Mon": 2699, + "Tue": 1607, + "Wed": 7730, + "Thu": 1124, + "Fri": 1210, "Sat": 0, - "Sun": 4436 + "Sun": 4480 } }, "recentCommits": { "/": { "Expanded": [ + " Bookmarks - Work ", + " 2023-12-02 ", + " Vinyls ", + " 2023-12-13 ⚽️ Borussia - PSG ", + " Household ", + " @Finances ", + " @@Paris ", + " Atzmännig Goldingen ", + " Atzmännig Goldingen ", + " 2023-12-09 ⚽️ PSG - FC Nantes ", + " 2023-12-09 ⚽️ PSG - FC Nantes ", " 2023-12-09 ", " Configuring UFW ", " Bookmarks - Mac applications ", @@ -11879,20 +11965,24 @@ " Vinyl Resistance ", " Vinyls ", " @Sally ", - " 2023-11-07 ⚽️ AC Milan - PSG (2-1) ", - " 2023-11-07 ⚽️ AC Milan - PSG ", - " Crypto Tasks ", - " Household ", - " Bourrache ", - " Bookmarks - Investments ", - " 2023-11-03 ⚽️ PSG - Montpellier (3-0) ", - " 2023-11-03 ⚽️ PSG - Montpellier ", - " 2023-11-03 ⚽️ PSG - Montpellier ", - " Mémoires de Léonard ", - " Mémoires de Léonard ", - " 2023-11-02 " + " 2023-11-07 ⚽️ AC Milan - PSG (2-1) " ], "Created": [ + " 2023-12-16 ", + " 2023-12-15 ", + " 2023-12-14 ", + " 2023-12-13 ", + " Deep in the Wilderness, the World’s Largest Beaver Dam Endures ", + " 2023-12-12 ", + " 2023-12-11 ", + " The call of Tokitae ", + " In Uvalde, Students Followed Active Shooter Protocol. The Cops Did Not. ", + " Taylor Swift Is TIME's 2023 Person of the Year ", + " Reuters, New York Times Top List of Fossil Fuel Industry’s Favorite Media Partners ", + " This Maine Fish House Is an Icon. But of What, Exactly ", + " Atzmännig Goldingen ", + " 2023-12-10 ", + " 2023-12-09 PSG - FC Nantes ", " Tschugger (2021–) ", " The Magnificent Seven (1960) ", " 2023-12-09 ", @@ -11928,24 +12018,18 @@ " 2023-11-22 ", " La Familia Grande ", " 2023-11-21 ", - " 2023-11-20 ", - " Lolita ", - " Chasing Chop Suey Tracing Chinese Immigration Through Food ", - " The librarian who couldn’t take it anymore ", - " Inside an OnlyFans empire Sex, influence and the new American Dream ", - " A Coder Considers the Waning Days of the Craft ", - " 2023-11-19 ", - " Untitled ", - " Savage Nights (1992) ", - " 2023-11-18 ", - " November (2022) ", - " Novembre (2020) ", - " 2023-11-17 ", - " The Quick and the Dead (1995) ", - " 2023-11-16 ", - " 2023-11-15 " + " 2023-11-20 " ], "Renamed": [ + " 2023-12-13 ⚽️ Borussia - PSG (1-1) ", + " Deep in the Wilderness, the World’s Largest Beaver Dam Endures ", + " The call of Tokitae ", + " In Uvalde, Students Followed Active Shooter Protocol. The Cops Did Not. ", + " Taylor Swift Is TIME's 2023 Person of the Year ", + " Reuters, New York Times Top List of Fossil Fuel Industry’s Favorite Media Partners ", + " This Maine Fish House Is an Icon. But of What, Exactly ", + " Atzmännig Goldingen ", + " 2023-12-09 ⚽️ PSG - FC Nantes ", " Tschugger (2021–) ", " The Magnificent Seven (1960) ", " Barbie (2023) ", @@ -11987,18 +12071,17 @@ " 2023-11-11 ⚽️ Stade Reims - PSG ", " La Troccase ", " Radix ", - " Vinyl Resistance ", - " 2023-11-07 ⚽️ AC Milan - PSG (2-1) ", - " Mémoires de Léonard ", - " Bourrache ", - " The ‘Crispy R’ and Why R Is the Weirdest Letter ", - " 2023-11-03 ⚽️ PSG - Montpellier (3-0) ", - " Babysitter ", - " Blanc de Noir - Nadine Saxer ", - " Baillotte ", - " Ski Rental Zürich " + " Vinyl Resistance " ], "Tagged": [ + " Deep in the Wilderness, the World’s Largest Beaver Dam Endures ", + " In Uvalde, Students Followed Active Shooter Protocol. The Cops Did Not. ", + " The call of Tokitae ", + " Reuters, New York Times Top List of Fossil Fuel Industry’s Favorite Media Partners ", + " Taylor Swift Is TIME's 2023 Person of the Year ", + " Reuters, New York Times Top List of Fossil Fuel Industry’s Favorite Media Partners ", + " This Maine Fish House Is an Icon. But of What, Exactly ", + " Atzmännig Goldingen ", " Bonnie's ", " Potluck Club ", " Wo Hop ", @@ -12041,17 +12124,10 @@ " Baillotte ", " Ski Rental Zürich ", " Les Disques du Yeti ", - " They Cracked the Code to a Locked USB Drive Worth $235 Million in Bitcoin. Then It Got Weird ", - " Bill Watterson’s Life After “Calvin and Hobbes” ", - " How workers remove toxic debris and ash after Hawaii wildfires ", - " The Evolutionary Reasons We Are Drawn to Horror Movies and Haunted Houses ", - " Vinyls ", - " The Crimes Behind the Seafood You Eat ", - " Baur au Lac ", - " Orcas are learning terrifying new behaviors. Are they getting smarter ", - " La Prochaine Fois que tu Mordras la Poussière " + " They Cracked the Code to a Locked USB Drive Worth $235 Million in Bitcoin. Then It Got Weird " ], "Refactored": [ + " 2023-12-14 ", " 2023-12-05 ", " Skiing in Switzerland ", " 2023-12-03 ", @@ -12101,8 +12177,7 @@ " Mallorca ", " Mallorca ", " Household ", - " 2023-04-15 ", - " Storage and Syncing " + " 2023-04-15 " ], "Deleted": [ " 2024-06-08 💍 Mariage Rémi & Séverine ", @@ -12158,6 +12233,33 @@ " Casita Andina " ], "Linked": [ + " 2023-12-15 ", + " 2023-12-16 ", + " Inside Foxconn’s struggle to make iPhones in India ", + " The Plight of the Oldest Sister ", + " 2023-12-16 ", + " 2023-12-15 ", + " 2023-12-15 ", + " 2023-12-14 ", + " 2023-12-13 ", + " 2023-12-13 ", + " 2023-12-13 ", + " 2023-12-12 ", + " Deep in the Wilderness, the World’s Largest Beaver Dam Endures ", + " 2023-12-12 ", + " 2023-12-11 ", + " 2023-12-11 ", + " 2023-12-11 ", + " The call of Tokitae ", + " In Uvalde, Students Followed Active Shooter Protocol. The Cops Did Not. ", + " Taylor Swift Is TIME's 2023 Person of the Year ", + " Reuters, New York Times Top List of Fossil Fuel Industry’s Favorite Media Partners ", + " This Maine Fish House Is an Icon. But of What, Exactly ", + " 2023-12-10 ", + " Atzmännig Goldingen ", + " 2023-12-10 ", + " 2023-12-09 ⚽️ PSG - FC Nantes ", + " 2023-12-09 ", " 2023-12-09 ", " Tschugger (2021–) ", " 2023-12-09 ", @@ -12181,36 +12283,10 @@ " Bonnie's ", " Potluck Club ", " Wo Hop ", - " Wo Hop ", - " Chasing Chop Suey Tracing Chinese Immigration Through Food ", - " 2023-12-06 ", - " 2023-12-05 ", - " 2023-12-04 ", - " C.T.E. Study Finds That Young Football Players Are Getting the Disease ", - " Inside Foxconn’s struggle to make iPhones in India ", - " The Plight of the Oldest Sister ", - " My Father, My Faith, and Donald Trump ", - " Piecing Together My Father’s Murder ", - " 2023-12-04 ", - " 2023-12-04 ", - " Martin Eden ", - " 2023-12-03 ", - " 2023-12-03 ", - " Grindelwald ", - " 2023-12-03 ", - " 2023-12-02 ", - " 2023-12-02 ", - " 2023-12-02 ", - " 2023-12-02 ", - " 2023-12-01 ", - " 2023-12-01 ", - " 2023-12-01 ", - " 2023-11-30 ", - " 2023-11-29 ", - " 2023-11-29 ", - " 2023-11-28 " + " Wo Hop " ], "Removed Tags from": [ + " Inside Foxconn’s struggle to make iPhones in India ", " The Miseducation of Maria Montessori ", " Rape, Race and a Decades-Old Lie That Still Wounds ", " How a Sexual Assault Case in St. John’s Exposed a Police Force’s Predatory Culture ", @@ -12260,8 +12336,7 @@ " Configuring Fail2ban ", " Configuring Telegram bots ", " @Networks ", - " Configuring UFW ", - " Selfhosting " + " Configuring UFW " ], "Removed Links from": [ " @Commerces Paris ", diff --git a/.obsidian/plugins/obsidian-media-db-plugin/main.js b/.obsidian/plugins/obsidian-media-db-plugin/main.js index 8823dcea..e7646767 100644 --- a/.obsidian/plugins/obsidian-media-db-plugin/main.js +++ b/.obsidian/plugins/obsidian-media-db-plugin/main.js @@ -1,3701 +1,19 @@ /* +------------------------------------------- +Media DB Plugin - Release Build +------------------------------------------- +By: Moritz Jung (https://mprojectscode.github.io/) +Time: Tue, 12 Dec 2023 20:23:33 GMT +Version: 0.6.0 +------------------------------------------- THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __defProps = Object.defineProperties; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropDescs = Object.getOwnPropertyDescriptors; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getOwnPropSymbols = Object.getOwnPropertySymbols; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __propIsEnum = Object.prototype.propertyIsEnumerable; -var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var __spreadValues = (a, b) => { - for (var prop in b || (b = {})) - if (__hasOwnProp.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - if (__getOwnPropSymbols) - for (var prop of __getOwnPropSymbols(b)) { - if (__propIsEnum.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - } - return a; -}; -var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); -var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); -var __export = (target, all) => { - __markAsModule(target); - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __reExport = (target, module2, desc) => { - if (module2 && typeof module2 === "object" || typeof module2 === "function") { - for (let key of __getOwnPropNames(module2)) - if (!__hasOwnProp.call(target, key) && key !== "default") - __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); - } - return target; -}; -var __toModule = (module2) => { - return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); -}; -var __async = (__this, __arguments, generator) => { - return new Promise((resolve, reject) => { - var fulfilled = (value) => { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - }; - var rejected = (value) => { - try { - step(generator.throw(value)); - } catch (e) { - reject(e); - } - }; - var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); - step((generator = generator.apply(__this, __arguments)).next()); - }); -}; - -// src/main.ts -__export(exports, { - default: () => MediaDbPlugin -}); -var import_obsidian17 = __toModule(require("obsidian")); - -// src/settings/Settings.ts -var import_obsidian6 = __toModule(require("obsidian")); - -// src/settings/suggesters/FolderSuggest.ts -var import_obsidian2 = __toModule(require("obsidian")); - -// src/settings/suggesters/Suggest.ts -var import_obsidian = __toModule(require("obsidian")); - -// node_modules/@popperjs/core/lib/enums.js -var top = "top"; -var bottom = "bottom"; -var right = "right"; -var left = "left"; -var auto = "auto"; -var basePlacements = [top, bottom, right, left]; -var start = "start"; -var end = "end"; -var clippingParents = "clippingParents"; -var viewport = "viewport"; -var popper = "popper"; -var reference = "reference"; -var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) { - return acc.concat([placement + "-" + start, placement + "-" + end]); -}, []); -var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) { - return acc.concat([placement, placement + "-" + start, placement + "-" + end]); -}, []); -var beforeRead = "beforeRead"; -var read = "read"; -var afterRead = "afterRead"; -var beforeMain = "beforeMain"; -var main = "main"; -var afterMain = "afterMain"; -var beforeWrite = "beforeWrite"; -var write = "write"; -var afterWrite = "afterWrite"; -var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; - -// node_modules/@popperjs/core/lib/dom-utils/getNodeName.js -function getNodeName(element2) { - return element2 ? (element2.nodeName || "").toLowerCase() : null; -} - -// node_modules/@popperjs/core/lib/dom-utils/getWindow.js -function getWindow(node) { - if (node == null) { - return window; - } - if (node.toString() !== "[object Window]") { - var ownerDocument = node.ownerDocument; - return ownerDocument ? ownerDocument.defaultView || window : window; - } - return node; -} - -// node_modules/@popperjs/core/lib/dom-utils/instanceOf.js -function isElement(node) { - var OwnElement = getWindow(node).Element; - return node instanceof OwnElement || node instanceof Element; -} -function isHTMLElement(node) { - var OwnElement = getWindow(node).HTMLElement; - return node instanceof OwnElement || node instanceof HTMLElement; -} -function isShadowRoot(node) { - if (typeof ShadowRoot === "undefined") { - return false; - } - var OwnElement = getWindow(node).ShadowRoot; - return node instanceof OwnElement || node instanceof ShadowRoot; -} - -// node_modules/@popperjs/core/lib/modifiers/applyStyles.js -function applyStyles(_ref) { - var state = _ref.state; - Object.keys(state.elements).forEach(function(name) { - var style = state.styles[name] || {}; - var attributes = state.attributes[name] || {}; - var element2 = state.elements[name]; - if (!isHTMLElement(element2) || !getNodeName(element2)) { - return; - } - Object.assign(element2.style, style); - Object.keys(attributes).forEach(function(name2) { - var value = attributes[name2]; - if (value === false) { - element2.removeAttribute(name2); - } else { - element2.setAttribute(name2, value === true ? "" : value); - } - }); - }); -} -function effect(_ref2) { - var state = _ref2.state; - var initialStyles = { - popper: { - position: state.options.strategy, - left: "0", - top: "0", - margin: "0" - }, - arrow: { - position: "absolute" - }, - reference: {} - }; - Object.assign(state.elements.popper.style, initialStyles.popper); - state.styles = initialStyles; - if (state.elements.arrow) { - Object.assign(state.elements.arrow.style, initialStyles.arrow); - } - return function() { - Object.keys(state.elements).forEach(function(name) { - var element2 = state.elements[name]; - var attributes = state.attributes[name] || {}; - var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); - var style = styleProperties.reduce(function(style2, property) { - style2[property] = ""; - return style2; - }, {}); - if (!isHTMLElement(element2) || !getNodeName(element2)) { - return; - } - Object.assign(element2.style, style); - Object.keys(attributes).forEach(function(attribute) { - element2.removeAttribute(attribute); - }); - }); - }; -} -var applyStyles_default = { - name: "applyStyles", - enabled: true, - phase: "write", - fn: applyStyles, - effect, - requires: ["computeStyles"] -}; - -// node_modules/@popperjs/core/lib/utils/getBasePlacement.js -function getBasePlacement(placement) { - return placement.split("-")[0]; -} - -// node_modules/@popperjs/core/lib/utils/math.js -var max = Math.max; -var min = Math.min; -var round = Math.round; - -// node_modules/@popperjs/core/lib/utils/userAgent.js -function getUAString() { - var uaData = navigator.userAgentData; - if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) { - return uaData.brands.map(function(item) { - return item.brand + "/" + item.version; - }).join(" "); - } - return navigator.userAgent; -} - -// node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js -function isLayoutViewport() { - return !/^((?!chrome|android).)*safari/i.test(getUAString()); -} - -// node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js -function getBoundingClientRect(element2, includeScale, isFixedStrategy) { - if (includeScale === void 0) { - includeScale = false; - } - if (isFixedStrategy === void 0) { - isFixedStrategy = false; - } - var clientRect = element2.getBoundingClientRect(); - var scaleX = 1; - var scaleY = 1; - if (includeScale && isHTMLElement(element2)) { - scaleX = element2.offsetWidth > 0 ? round(clientRect.width) / element2.offsetWidth || 1 : 1; - scaleY = element2.offsetHeight > 0 ? round(clientRect.height) / element2.offsetHeight || 1 : 1; - } - var _ref = isElement(element2) ? getWindow(element2) : window, visualViewport = _ref.visualViewport; - var addVisualOffsets = !isLayoutViewport() && isFixedStrategy; - var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX; - var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY; - var width = clientRect.width / scaleX; - var height = clientRect.height / scaleY; - return { - width, - height, - top: y, - right: x + width, - bottom: y + height, - left: x, - x, - y - }; -} - -// node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js -function getLayoutRect(element2) { - var clientRect = getBoundingClientRect(element2); - var width = element2.offsetWidth; - var height = element2.offsetHeight; - if (Math.abs(clientRect.width - width) <= 1) { - width = clientRect.width; - } - if (Math.abs(clientRect.height - height) <= 1) { - height = clientRect.height; - } - return { - x: element2.offsetLeft, - y: element2.offsetTop, - width, - height - }; -} - -// node_modules/@popperjs/core/lib/dom-utils/contains.js -function contains(parent, child) { - var rootNode = child.getRootNode && child.getRootNode(); - if (parent.contains(child)) { - return true; - } else if (rootNode && isShadowRoot(rootNode)) { - var next = child; - do { - if (next && parent.isSameNode(next)) { - return true; - } - next = next.parentNode || next.host; - } while (next); - } - return false; -} - -// node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js -function getComputedStyle2(element2) { - return getWindow(element2).getComputedStyle(element2); -} - -// node_modules/@popperjs/core/lib/dom-utils/isTableElement.js -function isTableElement(element2) { - return ["table", "td", "th"].indexOf(getNodeName(element2)) >= 0; -} - -// node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js -function getDocumentElement(element2) { - return ((isElement(element2) ? element2.ownerDocument : element2.document) || window.document).documentElement; -} - -// node_modules/@popperjs/core/lib/dom-utils/getParentNode.js -function getParentNode(element2) { - if (getNodeName(element2) === "html") { - return element2; - } - return element2.assignedSlot || element2.parentNode || (isShadowRoot(element2) ? element2.host : null) || getDocumentElement(element2); -} - -// node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js -function getTrueOffsetParent(element2) { - if (!isHTMLElement(element2) || getComputedStyle2(element2).position === "fixed") { - return null; - } - return element2.offsetParent; -} -function getContainingBlock(element2) { - var isFirefox = /firefox/i.test(getUAString()); - var isIE = /Trident/i.test(getUAString()); - if (isIE && isHTMLElement(element2)) { - var elementCss = getComputedStyle2(element2); - if (elementCss.position === "fixed") { - return null; - } - } - var currentNode = getParentNode(element2); - if (isShadowRoot(currentNode)) { - currentNode = currentNode.host; - } - while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) { - var css = getComputedStyle2(currentNode); - if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") { - return currentNode; - } else { - currentNode = currentNode.parentNode; - } - } - return null; -} -function getOffsetParent(element2) { - var window2 = getWindow(element2); - var offsetParent = getTrueOffsetParent(element2); - while (offsetParent && isTableElement(offsetParent) && getComputedStyle2(offsetParent).position === "static") { - offsetParent = getTrueOffsetParent(offsetParent); - } - if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle2(offsetParent).position === "static")) { - return window2; - } - return offsetParent || getContainingBlock(element2) || window2; -} - -// node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js -function getMainAxisFromPlacement(placement) { - return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y"; -} - -// node_modules/@popperjs/core/lib/utils/within.js -function within(min2, value, max2) { - return max(min2, min(value, max2)); -} -function withinMaxClamp(min2, value, max2) { - var v = within(min2, value, max2); - return v > max2 ? max2 : v; -} - -// node_modules/@popperjs/core/lib/utils/getFreshSideObject.js -function getFreshSideObject() { - return { - top: 0, - right: 0, - bottom: 0, - left: 0 - }; -} - -// node_modules/@popperjs/core/lib/utils/mergePaddingObject.js -function mergePaddingObject(paddingObject) { - return Object.assign({}, getFreshSideObject(), paddingObject); -} - -// node_modules/@popperjs/core/lib/utils/expandToHashMap.js -function expandToHashMap(value, keys) { - return keys.reduce(function(hashMap, key) { - hashMap[key] = value; - return hashMap; - }, {}); -} - -// node_modules/@popperjs/core/lib/modifiers/arrow.js -var toPaddingObject = function toPaddingObject2(padding, state) { - padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, { - placement: state.placement - })) : padding; - return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements)); -}; -function arrow(_ref) { - var _state$modifiersData$; - var state = _ref.state, name = _ref.name, options = _ref.options; - var arrowElement = state.elements.arrow; - var popperOffsets2 = state.modifiersData.popperOffsets; - var basePlacement = getBasePlacement(state.placement); - var axis = getMainAxisFromPlacement(basePlacement); - var isVertical = [left, right].indexOf(basePlacement) >= 0; - var len = isVertical ? "height" : "width"; - if (!arrowElement || !popperOffsets2) { - return; - } - var paddingObject = toPaddingObject(options.padding, state); - var arrowRect = getLayoutRect(arrowElement); - var minProp = axis === "y" ? top : left; - var maxProp = axis === "y" ? bottom : right; - var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len]; - var startDiff = popperOffsets2[axis] - state.rects.reference[axis]; - var arrowOffsetParent = getOffsetParent(arrowElement); - var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; - var centerToReference = endDiff / 2 - startDiff / 2; - var min2 = paddingObject[minProp]; - var max2 = clientSize - arrowRect[len] - paddingObject[maxProp]; - var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; - var offset2 = within(min2, center, max2); - var axisProp = axis; - state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$); -} -function effect2(_ref2) { - var state = _ref2.state, options = _ref2.options; - var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element; - if (arrowElement == null) { - return; - } - if (typeof arrowElement === "string") { - arrowElement = state.elements.popper.querySelector(arrowElement); - if (!arrowElement) { - return; - } - } - if (!contains(state.elements.popper, arrowElement)) { - return; - } - state.elements.arrow = arrowElement; -} -var arrow_default = { - name: "arrow", - enabled: true, - phase: "main", - fn: arrow, - effect: effect2, - requires: ["popperOffsets"], - requiresIfExists: ["preventOverflow"] -}; - -// node_modules/@popperjs/core/lib/utils/getVariation.js -function getVariation(placement) { - return placement.split("-")[1]; -} - -// node_modules/@popperjs/core/lib/modifiers/computeStyles.js -var unsetSides = { - top: "auto", - right: "auto", - bottom: "auto", - left: "auto" -}; -function roundOffsetsByDPR(_ref, win) { - var x = _ref.x, y = _ref.y; - var dpr = win.devicePixelRatio || 1; - return { - x: round(x * dpr) / dpr || 0, - y: round(y * dpr) / dpr || 0 - }; -} -function mapToStyles(_ref2) { - var _Object$assign2; - var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed; - var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y; - var _ref3 = typeof roundOffsets === "function" ? roundOffsets({ - x, - y - }) : { - x, - y - }; - x = _ref3.x; - y = _ref3.y; - var hasX = offsets.hasOwnProperty("x"); - var hasY = offsets.hasOwnProperty("y"); - var sideX = left; - var sideY = top; - var win = window; - if (adaptive) { - var offsetParent = getOffsetParent(popper2); - var heightProp = "clientHeight"; - var widthProp = "clientWidth"; - if (offsetParent === getWindow(popper2)) { - offsetParent = getDocumentElement(popper2); - if (getComputedStyle2(offsetParent).position !== "static" && position === "absolute") { - heightProp = "scrollHeight"; - widthProp = "scrollWidth"; - } - } - offsetParent = offsetParent; - if (placement === top || (placement === left || placement === right) && variation === end) { - sideY = bottom; - var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp]; - y -= offsetY - popperRect.height; - y *= gpuAcceleration ? 1 : -1; - } - if (placement === left || (placement === top || placement === bottom) && variation === end) { - sideX = right; - var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp]; - x -= offsetX - popperRect.width; - x *= gpuAcceleration ? 1 : -1; - } - } - var commonStyles = Object.assign({ - position - }, adaptive && unsetSides); - var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ - x, - y - }, getWindow(popper2)) : { - x, - y - }; - x = _ref4.x; - y = _ref4.y; - if (gpuAcceleration) { - var _Object$assign; - return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); - } - return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2)); -} -function computeStyles(_ref5) { - var state = _ref5.state, options = _ref5.options; - var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; - var commonStyles = { - placement: getBasePlacement(state.placement), - variation: getVariation(state.placement), - popper: state.elements.popper, - popperRect: state.rects.popper, - gpuAcceleration, - isFixed: state.options.strategy === "fixed" - }; - if (state.modifiersData.popperOffsets != null) { - state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { - offsets: state.modifiersData.popperOffsets, - position: state.options.strategy, - adaptive, - roundOffsets - }))); - } - if (state.modifiersData.arrow != null) { - state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { - offsets: state.modifiersData.arrow, - position: "absolute", - adaptive: false, - roundOffsets - }))); - } - state.attributes.popper = Object.assign({}, state.attributes.popper, { - "data-popper-placement": state.placement - }); -} -var computeStyles_default = { - name: "computeStyles", - enabled: true, - phase: "beforeWrite", - fn: computeStyles, - data: {} -}; - -// node_modules/@popperjs/core/lib/modifiers/eventListeners.js -var passive = { - passive: true -}; -function effect3(_ref) { - var state = _ref.state, instance4 = _ref.instance, options = _ref.options; - var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize; - var window2 = getWindow(state.elements.popper); - var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); - if (scroll) { - scrollParents.forEach(function(scrollParent) { - scrollParent.addEventListener("scroll", instance4.update, passive); - }); - } - if (resize) { - window2.addEventListener("resize", instance4.update, passive); - } - return function() { - if (scroll) { - scrollParents.forEach(function(scrollParent) { - scrollParent.removeEventListener("scroll", instance4.update, passive); - }); - } - if (resize) { - window2.removeEventListener("resize", instance4.update, passive); - } - }; -} -var eventListeners_default = { - name: "eventListeners", - enabled: true, - phase: "write", - fn: function fn() { - }, - effect: effect3, - data: {} -}; - -// node_modules/@popperjs/core/lib/utils/getOppositePlacement.js -var hash = { - left: "right", - right: "left", - bottom: "top", - top: "bottom" -}; -function getOppositePlacement(placement) { - return placement.replace(/left|right|bottom|top/g, function(matched) { - return hash[matched]; - }); -} - -// node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js -var hash2 = { - start: "end", - end: "start" -}; -function getOppositeVariationPlacement(placement) { - return placement.replace(/start|end/g, function(matched) { - return hash2[matched]; - }); -} - -// node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js -function getWindowScroll(node) { - var win = getWindow(node); - var scrollLeft = win.pageXOffset; - var scrollTop = win.pageYOffset; - return { - scrollLeft, - scrollTop - }; -} - -// node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js -function getWindowScrollBarX(element2) { - return getBoundingClientRect(getDocumentElement(element2)).left + getWindowScroll(element2).scrollLeft; -} - -// node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js -function getViewportRect(element2, strategy) { - var win = getWindow(element2); - var html = getDocumentElement(element2); - var visualViewport = win.visualViewport; - var width = html.clientWidth; - var height = html.clientHeight; - var x = 0; - var y = 0; - if (visualViewport) { - width = visualViewport.width; - height = visualViewport.height; - var layoutViewport = isLayoutViewport(); - if (layoutViewport || !layoutViewport && strategy === "fixed") { - x = visualViewport.offsetLeft; - y = visualViewport.offsetTop; - } - } - return { - width, - height, - x: x + getWindowScrollBarX(element2), - y - }; -} - -// node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js -function getDocumentRect(element2) { - var _element$ownerDocumen; - var html = getDocumentElement(element2); - var winScroll = getWindowScroll(element2); - var body = (_element$ownerDocumen = element2.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; - var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); - var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); - var x = -winScroll.scrollLeft + getWindowScrollBarX(element2); - var y = -winScroll.scrollTop; - if (getComputedStyle2(body || html).direction === "rtl") { - x += max(html.clientWidth, body ? body.clientWidth : 0) - width; - } - return { - width, - height, - x, - y - }; -} - -// node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js -function isScrollParent(element2) { - var _getComputedStyle = getComputedStyle2(element2), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY; - return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); -} - -// node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js -function getScrollParent(node) { - if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) { - return node.ownerDocument.body; - } - if (isHTMLElement(node) && isScrollParent(node)) { - return node; - } - return getScrollParent(getParentNode(node)); -} - -// node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js -function listScrollParents(element2, list) { - var _element$ownerDocumen; - if (list === void 0) { - list = []; - } - var scrollParent = getScrollParent(element2); - var isBody = scrollParent === ((_element$ownerDocumen = element2.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); - var win = getWindow(scrollParent); - var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; - var updatedList = list.concat(target); - return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target))); -} - -// node_modules/@popperjs/core/lib/utils/rectToClientRect.js -function rectToClientRect(rect) { - return Object.assign({}, rect, { - left: rect.x, - top: rect.y, - right: rect.x + rect.width, - bottom: rect.y + rect.height - }); -} - -// node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js -function getInnerBoundingClientRect(element2, strategy) { - var rect = getBoundingClientRect(element2, false, strategy === "fixed"); - rect.top = rect.top + element2.clientTop; - rect.left = rect.left + element2.clientLeft; - rect.bottom = rect.top + element2.clientHeight; - rect.right = rect.left + element2.clientWidth; - rect.width = element2.clientWidth; - rect.height = element2.clientHeight; - rect.x = rect.left; - rect.y = rect.top; - return rect; -} -function getClientRectFromMixedType(element2, clippingParent, strategy) { - return clippingParent === viewport ? rectToClientRect(getViewportRect(element2, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element2))); -} -function getClippingParents(element2) { - var clippingParents2 = listScrollParents(getParentNode(element2)); - var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle2(element2).position) >= 0; - var clipperElement = canEscapeClipping && isHTMLElement(element2) ? getOffsetParent(element2) : element2; - if (!isElement(clipperElement)) { - return []; - } - return clippingParents2.filter(function(clippingParent) { - return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body"; - }); -} -function getClippingRect(element2, boundary, rootBoundary, strategy) { - var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element2) : [].concat(boundary); - var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]); - var firstClippingParent = clippingParents2[0]; - var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) { - var rect = getClientRectFromMixedType(element2, clippingParent, strategy); - accRect.top = max(rect.top, accRect.top); - accRect.right = min(rect.right, accRect.right); - accRect.bottom = min(rect.bottom, accRect.bottom); - accRect.left = max(rect.left, accRect.left); - return accRect; - }, getClientRectFromMixedType(element2, firstClippingParent, strategy)); - clippingRect.width = clippingRect.right - clippingRect.left; - clippingRect.height = clippingRect.bottom - clippingRect.top; - clippingRect.x = clippingRect.left; - clippingRect.y = clippingRect.top; - return clippingRect; -} - -// node_modules/@popperjs/core/lib/utils/computeOffsets.js -function computeOffsets(_ref) { - var reference2 = _ref.reference, element2 = _ref.element, placement = _ref.placement; - var basePlacement = placement ? getBasePlacement(placement) : null; - var variation = placement ? getVariation(placement) : null; - var commonX = reference2.x + reference2.width / 2 - element2.width / 2; - var commonY = reference2.y + reference2.height / 2 - element2.height / 2; - var offsets; - switch (basePlacement) { - case top: - offsets = { - x: commonX, - y: reference2.y - element2.height - }; - break; - case bottom: - offsets = { - x: commonX, - y: reference2.y + reference2.height - }; - break; - case right: - offsets = { - x: reference2.x + reference2.width, - y: commonY - }; - break; - case left: - offsets = { - x: reference2.x - element2.width, - y: commonY - }; - break; - default: - offsets = { - x: reference2.x, - y: reference2.y - }; - } - var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; - if (mainAxis != null) { - var len = mainAxis === "y" ? "height" : "width"; - switch (variation) { - case start: - offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element2[len] / 2); - break; - case end: - offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element2[len] / 2); - break; - default: - } - } - return offsets; -} - -// node_modules/@popperjs/core/lib/utils/detectOverflow.js -function detectOverflow(state, options) { - if (options === void 0) { - options = {}; - } - var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding; - var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements)); - var altContext = elementContext === popper ? reference : popper; - var popperRect = state.rects.popper; - var element2 = state.elements[altBoundary ? altContext : elementContext]; - var clippingClientRect = getClippingRect(isElement(element2) ? element2 : element2.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy); - var referenceClientRect = getBoundingClientRect(state.elements.reference); - var popperOffsets2 = computeOffsets({ - reference: referenceClientRect, - element: popperRect, - strategy: "absolute", - placement - }); - var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2)); - var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; - var overflowOffsets = { - top: clippingClientRect.top - elementClientRect.top + paddingObject.top, - bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, - left: clippingClientRect.left - elementClientRect.left + paddingObject.left, - right: elementClientRect.right - clippingClientRect.right + paddingObject.right - }; - var offsetData = state.modifiersData.offset; - if (elementContext === popper && offsetData) { - var offset2 = offsetData[placement]; - Object.keys(overflowOffsets).forEach(function(key) { - var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; - var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x"; - overflowOffsets[key] += offset2[axis] * multiply; - }); - } - return overflowOffsets; -} - -// node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js -function computeAutoPlacement(state, options) { - if (options === void 0) { - options = {}; - } - var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; - var variation = getVariation(placement); - var placements2 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) { - return getVariation(placement2) === variation; - }) : basePlacements; - var allowedPlacements = placements2.filter(function(placement2) { - return allowedAutoPlacements.indexOf(placement2) >= 0; - }); - if (allowedPlacements.length === 0) { - allowedPlacements = placements2; - } - var overflows = allowedPlacements.reduce(function(acc, placement2) { - acc[placement2] = detectOverflow(state, { - placement: placement2, - boundary, - rootBoundary, - padding - })[getBasePlacement(placement2)]; - return acc; - }, {}); - return Object.keys(overflows).sort(function(a, b) { - return overflows[a] - overflows[b]; - }); -} - -// node_modules/@popperjs/core/lib/modifiers/flip.js -function getExpandedFallbackPlacements(placement) { - if (getBasePlacement(placement) === auto) { - return []; - } - var oppositePlacement = getOppositePlacement(placement); - return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; -} -function flip(_ref) { - var state = _ref.state, options = _ref.options, name = _ref.name; - if (state.modifiersData[name]._skip) { - return; - } - var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements; - var preferredPlacement = state.options.placement; - var basePlacement = getBasePlacement(preferredPlacement); - var isBasePlacement = basePlacement === preferredPlacement; - var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); - var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) { - return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, { - placement: placement2, - boundary, - rootBoundary, - padding, - flipVariations, - allowedAutoPlacements - }) : placement2); - }, []); - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var checksMap = new Map(); - var makeFallbackChecks = true; - var firstFittingPlacement = placements2[0]; - for (var i = 0; i < placements2.length; i++) { - var placement = placements2[i]; - var _basePlacement = getBasePlacement(placement); - var isStartVariation = getVariation(placement) === start; - var isVertical = [top, bottom].indexOf(_basePlacement) >= 0; - var len = isVertical ? "width" : "height"; - var overflow = detectOverflow(state, { - placement, - boundary, - rootBoundary, - altBoundary, - padding - }); - var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top; - if (referenceRect[len] > popperRect[len]) { - mainVariationSide = getOppositePlacement(mainVariationSide); - } - var altVariationSide = getOppositePlacement(mainVariationSide); - var checks = []; - if (checkMainAxis) { - checks.push(overflow[_basePlacement] <= 0); - } - if (checkAltAxis) { - checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); - } - if (checks.every(function(check) { - return check; - })) { - firstFittingPlacement = placement; - makeFallbackChecks = false; - break; - } - checksMap.set(placement, checks); - } - if (makeFallbackChecks) { - var numberOfChecks = flipVariations ? 3 : 1; - var _loop = function _loop2(_i2) { - var fittingPlacement = placements2.find(function(placement2) { - var checks2 = checksMap.get(placement2); - if (checks2) { - return checks2.slice(0, _i2).every(function(check) { - return check; - }); - } - }); - if (fittingPlacement) { - firstFittingPlacement = fittingPlacement; - return "break"; - } - }; - for (var _i = numberOfChecks; _i > 0; _i--) { - var _ret = _loop(_i); - if (_ret === "break") - break; - } - } - if (state.placement !== firstFittingPlacement) { - state.modifiersData[name]._skip = true; - state.placement = firstFittingPlacement; - state.reset = true; - } -} -var flip_default = { - name: "flip", - enabled: true, - phase: "main", - fn: flip, - requiresIfExists: ["offset"], - data: { - _skip: false - } -}; - -// node_modules/@popperjs/core/lib/modifiers/hide.js -function getSideOffsets(overflow, rect, preventedOffsets) { - if (preventedOffsets === void 0) { - preventedOffsets = { - x: 0, - y: 0 - }; - } - return { - top: overflow.top - rect.height - preventedOffsets.y, - right: overflow.right - rect.width + preventedOffsets.x, - bottom: overflow.bottom - rect.height + preventedOffsets.y, - left: overflow.left - rect.width - preventedOffsets.x - }; -} -function isAnySideFullyClipped(overflow) { - return [top, right, bottom, left].some(function(side) { - return overflow[side] >= 0; - }); -} -function hide(_ref) { - var state = _ref.state, name = _ref.name; - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var preventedOffsets = state.modifiersData.preventOverflow; - var referenceOverflow = detectOverflow(state, { - elementContext: "reference" - }); - var popperAltOverflow = detectOverflow(state, { - altBoundary: true - }); - var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); - var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); - var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); - var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); - state.modifiersData[name] = { - referenceClippingOffsets, - popperEscapeOffsets, - isReferenceHidden, - hasPopperEscaped - }; - state.attributes.popper = Object.assign({}, state.attributes.popper, { - "data-popper-reference-hidden": isReferenceHidden, - "data-popper-escaped": hasPopperEscaped - }); -} -var hide_default = { - name: "hide", - enabled: true, - phase: "main", - requiresIfExists: ["preventOverflow"], - fn: hide -}; - -// node_modules/@popperjs/core/lib/modifiers/offset.js -function distanceAndSkiddingToXY(placement, rects, offset2) { - var basePlacement = getBasePlacement(placement); - var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1; - var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, { - placement - })) : offset2, skidding = _ref[0], distance = _ref[1]; - skidding = skidding || 0; - distance = (distance || 0) * invertDistance; - return [left, right].indexOf(basePlacement) >= 0 ? { - x: distance, - y: skidding - } : { - x: skidding, - y: distance - }; -} -function offset(_ref2) { - var state = _ref2.state, options = _ref2.options, name = _ref2.name; - var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset; - var data = placements.reduce(function(acc, placement) { - acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2); - return acc; - }, {}); - var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y; - if (state.modifiersData.popperOffsets != null) { - state.modifiersData.popperOffsets.x += x; - state.modifiersData.popperOffsets.y += y; - } - state.modifiersData[name] = data; -} -var offset_default = { - name: "offset", - enabled: true, - phase: "main", - requires: ["popperOffsets"], - fn: offset -}; - -// node_modules/@popperjs/core/lib/modifiers/popperOffsets.js -function popperOffsets(_ref) { - var state = _ref.state, name = _ref.name; - state.modifiersData[name] = computeOffsets({ - reference: state.rects.reference, - element: state.rects.popper, - strategy: "absolute", - placement: state.placement - }); -} -var popperOffsets_default = { - name: "popperOffsets", - enabled: true, - phase: "read", - fn: popperOffsets, - data: {} -}; - -// node_modules/@popperjs/core/lib/utils/getAltAxis.js -function getAltAxis(axis) { - return axis === "x" ? "y" : "x"; -} - -// node_modules/@popperjs/core/lib/modifiers/preventOverflow.js -function preventOverflow(_ref) { - var state = _ref.state, options = _ref.options, name = _ref.name; - var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; - var overflow = detectOverflow(state, { - boundary, - rootBoundary, - padding, - altBoundary - }); - var basePlacement = getBasePlacement(state.placement); - var variation = getVariation(state.placement); - var isBasePlacement = !variation; - var mainAxis = getMainAxisFromPlacement(basePlacement); - var altAxis = getAltAxis(mainAxis); - var popperOffsets2 = state.modifiersData.popperOffsets; - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, { - placement: state.placement - })) : tetherOffset; - var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? { - mainAxis: tetherOffsetValue, - altAxis: tetherOffsetValue - } : Object.assign({ - mainAxis: 0, - altAxis: 0 - }, tetherOffsetValue); - var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; - var data = { - x: 0, - y: 0 - }; - if (!popperOffsets2) { - return; - } - if (checkMainAxis) { - var _offsetModifierState$; - var mainSide = mainAxis === "y" ? top : left; - var altSide = mainAxis === "y" ? bottom : right; - var len = mainAxis === "y" ? "height" : "width"; - var offset2 = popperOffsets2[mainAxis]; - var min2 = offset2 + overflow[mainSide]; - var max2 = offset2 - overflow[altSide]; - var additive = tether ? -popperRect[len] / 2 : 0; - var minLen = variation === start ? referenceRect[len] : popperRect[len]; - var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; - var arrowElement = state.elements.arrow; - var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { - width: 0, - height: 0 - }; - var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject(); - var arrowPaddingMin = arrowPaddingObject[mainSide]; - var arrowPaddingMax = arrowPaddingObject[altSide]; - var arrowLen = within(0, referenceRect[len], arrowRect[len]); - var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; - var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; - var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); - var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; - var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; - var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset; - var tetherMax = offset2 + maxOffset - offsetModifierValue; - var preventedOffset = within(tether ? min(min2, tetherMin) : min2, offset2, tether ? max(max2, tetherMax) : max2); - popperOffsets2[mainAxis] = preventedOffset; - data[mainAxis] = preventedOffset - offset2; - } - if (checkAltAxis) { - var _offsetModifierState$2; - var _mainSide = mainAxis === "x" ? top : left; - var _altSide = mainAxis === "x" ? bottom : right; - var _offset = popperOffsets2[altAxis]; - var _len = altAxis === "y" ? "height" : "width"; - var _min = _offset + overflow[_mainSide]; - var _max = _offset - overflow[_altSide]; - var isOriginSide = [top, left].indexOf(basePlacement) !== -1; - var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; - var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; - var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; - var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); - popperOffsets2[altAxis] = _preventedOffset; - data[altAxis] = _preventedOffset - _offset; - } - state.modifiersData[name] = data; -} -var preventOverflow_default = { - name: "preventOverflow", - enabled: true, - phase: "main", - fn: preventOverflow, - requiresIfExists: ["offset"] -}; - -// node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js -function getHTMLElementScroll(element2) { - return { - scrollLeft: element2.scrollLeft, - scrollTop: element2.scrollTop - }; -} - -// node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js -function getNodeScroll(node) { - if (node === getWindow(node) || !isHTMLElement(node)) { - return getWindowScroll(node); - } else { - return getHTMLElementScroll(node); - } -} - -// node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js -function isElementScaled(element2) { - var rect = element2.getBoundingClientRect(); - var scaleX = round(rect.width) / element2.offsetWidth || 1; - var scaleY = round(rect.height) / element2.offsetHeight || 1; - return scaleX !== 1 || scaleY !== 1; -} -function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { - if (isFixed === void 0) { - isFixed = false; - } - var isOffsetParentAnElement = isHTMLElement(offsetParent); - var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); - var documentElement = getDocumentElement(offsetParent); - var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed); - var scroll = { - scrollLeft: 0, - scrollTop: 0 - }; - var offsets = { - x: 0, - y: 0 - }; - if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { - if (getNodeName(offsetParent) !== "body" || isScrollParent(documentElement)) { - scroll = getNodeScroll(offsetParent); - } - if (isHTMLElement(offsetParent)) { - offsets = getBoundingClientRect(offsetParent, true); - offsets.x += offsetParent.clientLeft; - offsets.y += offsetParent.clientTop; - } else if (documentElement) { - offsets.x = getWindowScrollBarX(documentElement); - } - } - return { - x: rect.left + scroll.scrollLeft - offsets.x, - y: rect.top + scroll.scrollTop - offsets.y, - width: rect.width, - height: rect.height - }; -} - -// node_modules/@popperjs/core/lib/utils/orderModifiers.js -function order(modifiers) { - var map = new Map(); - var visited = new Set(); - var result = []; - modifiers.forEach(function(modifier) { - map.set(modifier.name, modifier); - }); - function sort(modifier) { - visited.add(modifier.name); - var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); - requires.forEach(function(dep) { - if (!visited.has(dep)) { - var depModifier = map.get(dep); - if (depModifier) { - sort(depModifier); - } - } - }); - result.push(modifier); - } - modifiers.forEach(function(modifier) { - if (!visited.has(modifier.name)) { - sort(modifier); - } - }); - return result; -} -function orderModifiers(modifiers) { - var orderedModifiers = order(modifiers); - return modifierPhases.reduce(function(acc, phase) { - return acc.concat(orderedModifiers.filter(function(modifier) { - return modifier.phase === phase; - })); - }, []); -} - -// node_modules/@popperjs/core/lib/utils/debounce.js -function debounce(fn2) { - var pending; - return function() { - if (!pending) { - pending = new Promise(function(resolve) { - Promise.resolve().then(function() { - pending = void 0; - resolve(fn2()); - }); - }); - } - return pending; - }; -} - -// node_modules/@popperjs/core/lib/utils/mergeByName.js -function mergeByName(modifiers) { - var merged = modifiers.reduce(function(merged2, current) { - var existing = merged2[current.name]; - merged2[current.name] = existing ? Object.assign({}, existing, current, { - options: Object.assign({}, existing.options, current.options), - data: Object.assign({}, existing.data, current.data) - }) : current; - return merged2; - }, {}); - return Object.keys(merged).map(function(key) { - return merged[key]; - }); -} - -// node_modules/@popperjs/core/lib/createPopper.js -var DEFAULT_OPTIONS = { - placement: "bottom", - modifiers: [], - strategy: "absolute" -}; -function areValidElements() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return !args.some(function(element2) { - return !(element2 && typeof element2.getBoundingClientRect === "function"); - }); -} -function popperGenerator(generatorOptions) { - if (generatorOptions === void 0) { - generatorOptions = {}; - } - var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; - return function createPopper2(reference2, popper2, options) { - if (options === void 0) { - options = defaultOptions; - } - var state = { - placement: "bottom", - orderedModifiers: [], - options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), - modifiersData: {}, - elements: { - reference: reference2, - popper: popper2 - }, - attributes: {}, - styles: {} - }; - var effectCleanupFns = []; - var isDestroyed = false; - var instance4 = { - state, - setOptions: function setOptions(setOptionsAction) { - var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction; - cleanupModifierEffects(); - state.options = Object.assign({}, defaultOptions, state.options, options2); - state.scrollParents = { - reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [], - popper: listScrollParents(popper2) - }; - var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers))); - state.orderedModifiers = orderedModifiers.filter(function(m) { - return m.enabled; - }); - runModifierEffects(); - return instance4.update(); - }, - forceUpdate: function forceUpdate() { - if (isDestroyed) { - return; - } - var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper; - if (!areValidElements(reference3, popper3)) { - return; - } - state.rects = { - reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"), - popper: getLayoutRect(popper3) - }; - state.reset = false; - state.placement = state.options.placement; - state.orderedModifiers.forEach(function(modifier) { - return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); - }); - for (var index = 0; index < state.orderedModifiers.length; index++) { - if (state.reset === true) { - state.reset = false; - index = -1; - continue; - } - var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name; - if (typeof fn2 === "function") { - state = fn2({ - state, - options: _options, - name, - instance: instance4 - }) || state; - } - } - }, - update: debounce(function() { - return new Promise(function(resolve) { - instance4.forceUpdate(); - resolve(state); - }); - }), - destroy: function destroy() { - cleanupModifierEffects(); - isDestroyed = true; - } - }; - if (!areValidElements(reference2, popper2)) { - return instance4; - } - instance4.setOptions(options).then(function(state2) { - if (!isDestroyed && options.onFirstUpdate) { - options.onFirstUpdate(state2); - } - }); - function runModifierEffects() { - state.orderedModifiers.forEach(function(_ref) { - var name = _ref.name, _ref$options = _ref.options, options2 = _ref$options === void 0 ? {} : _ref$options, effect4 = _ref.effect; - if (typeof effect4 === "function") { - var cleanupFn = effect4({ - state, - name, - instance: instance4, - options: options2 - }); - var noopFn = function noopFn2() { - }; - effectCleanupFns.push(cleanupFn || noopFn); - } - }); - } - function cleanupModifierEffects() { - effectCleanupFns.forEach(function(fn2) { - return fn2(); - }); - effectCleanupFns = []; - } - return instance4; - }; -} - -// node_modules/@popperjs/core/lib/popper.js -var defaultModifiers = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default, offset_default, flip_default, preventOverflow_default, arrow_default, hide_default]; -var createPopper = /* @__PURE__ */ popperGenerator({ - defaultModifiers -}); - -// src/utils/Utils.ts -var pluginName = "obsidian-media-db-plugin"; -var contactEmail = "m.projects.code@gmail.com"; -var mediaDbTag = "mediaDB"; -var mediaDbVersion = "0.5.2"; -function wrapAround(value, size) { - if (size <= 0) { - throw Error("size may not be zero or negative"); - } - return mod(value, size); -} -function containsOnlyLettersAndUnderscores(str) { - return /^[a-zA-Z_]+$/.test(str); -} -function replaceIllegalFileNameCharactersInString(string) { - return string.replace(/[\\,#%&{}/*<>$"@.?]*/g, "").replace(/:+/g, " -"); -} -function replaceTags(template, mediaTypeModel) { - return template.replace(new RegExp("{{.*?}}", "g"), (match) => replaceTag(match, mediaTypeModel)); -} -function replaceTag(match, mediaTypeModel) { - let tag = match; - tag = tag.substring(2); - tag = tag.substring(0, tag.length - 2); - tag = tag.trim(); - const parts = tag.split(":"); - if (parts.length === 1) { - const path = parts[0].split("."); - const obj = traverseMetaData(path, mediaTypeModel); - if (obj === void 0) { - return "{{ INVALID TEMPLATE TAG - object undefined }}"; - } - return obj; - } else if (parts.length === 2) { - const operator = parts[0]; - const path = parts[1].split("."); - const obj = traverseMetaData(path, mediaTypeModel); - if (obj === void 0) { - return "{{ INVALID TEMPLATE TAG - object undefined }}"; - } - if (operator === "LIST") { - if (!Array.isArray(obj)) { - return "{{ INVALID TEMPLATE TAG - operator LIST is only applicable on an array }}"; - } - return obj.map((e) => `- ${e}`).join("\n"); - } else if (operator === "ENUM") { - if (!Array.isArray(obj)) { - return "{{ INVALID TEMPLATE TAG - operator ENUM is only applicable on an array }}"; - } - return obj.join(", "); - } - return `{{ INVALID TEMPLATE TAG - unknown operator ${operator} }}`; - } - return "{{ INVALID TEMPLATE TAG }}"; -} -function traverseMetaData(path, mediaTypeModel) { - let o = mediaTypeModel; - for (const part of path) { - if (o !== void 0) { - o = o[part]; - } - } - return o; -} -function markdownTable(content) { - const rows = content.length; - if (rows === 0) { - return ""; - } - const columns = content[0].length; - if (columns === 0) { - return ""; - } - for (const row of content) { - if (row.length !== columns) { - return ""; - } - } - const longestStringInColumns = []; - for (let i = 0; i < columns; i++) { - let longestStringInColumn = 0; - for (const row of content) { - if (row[i].length > longestStringInColumn) { - longestStringInColumn = row[i].length; - } - } - longestStringInColumns.push(longestStringInColumn); - } - let table = ""; - for (let i = 0; i < rows; i++) { - table += "|"; - for (let j = 0; j < columns; j++) { - let element2 = content[i][j]; - element2 += " ".repeat(longestStringInColumns[j] - element2.length); - table += " " + element2 + " |"; - } - table += "\n"; - if (i === 0) { - table += "|"; - for (let j = 0; j < columns; j++) { - table += " " + "-".repeat(longestStringInColumns[j]) + " |"; - } - table += "\n"; - } - } - return table; -} -function dateToString(date) { - return `${date.getMonth() + 1}-${date.getDate()}-${date.getFullYear()}`; -} -function timeToString(time) { - return `${time.getHours()}-${time.getMinutes()}-${time.getSeconds()}`; -} -function dateTimeToString(dateTime) { - return `${dateToString(dateTime)} ${timeToString(dateTime)}`; -} -function mod(n, m) { - return (n % m + m) % m; -} -function capitalizeFirstLetter(string) { - return string.charAt(0).toUpperCase() + string.slice(1); -} -var PropertyMappingValidationError = class extends Error { - constructor(message) { - super(message); - } -}; -var PropertyMappingNameConflictError = class extends Error { - constructor(message) { - super(message); - } -}; -function migrateObject(object, oldData, defaultData) { - for (const key in object) { - object[key] = oldData.hasOwnProperty(key) ? oldData[key] : defaultData[key]; - } -} -function unCamelCase(str) { - return str.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b([A-Z]+)([A-Z])([a-z])/, "$1 $2$3").replace(/^./, function(str2) { - return str2.toUpperCase(); - }); -} - -// src/settings/suggesters/Suggest.ts -var Suggest = class { - constructor(owner, containerEl, scope) { - this.owner = owner; - this.containerEl = containerEl; - containerEl.on("click", ".suggestion-item", this.onSuggestionClick.bind(this)); - containerEl.on("mousemove", ".suggestion-item", this.onSuggestionMouseover.bind(this)); - scope.register([], "ArrowUp", (event) => { - if (!event.isComposing) { - this.setSelectedItem(this.selectedItem - 1, true); - return false; - } - }); - scope.register([], "ArrowDown", (event) => { - if (!event.isComposing) { - this.setSelectedItem(this.selectedItem + 1, true); - return false; - } - }); - scope.register([], "Enter", (event) => { - if (!event.isComposing) { - this.useSelectedItem(event); - return false; - } - }); - } - onSuggestionClick(event, el) { - event.preventDefault(); - const item = this.suggestions.indexOf(el); - this.setSelectedItem(item, false); - this.useSelectedItem(event); - } - onSuggestionMouseover(_event, el) { - const item = this.suggestions.indexOf(el); - this.setSelectedItem(item, false); - } - setSuggestions(values) { - this.containerEl.empty(); - const suggestionEls = []; - values.forEach((value) => { - const suggestionEl = this.containerEl.createDiv("suggestion-item"); - this.owner.renderSuggestion(value, suggestionEl); - suggestionEls.push(suggestionEl); - }); - this.values = values; - this.suggestions = suggestionEls; - this.setSelectedItem(0, false); - } - useSelectedItem(event) { - const currentValue = this.values[this.selectedItem]; - if (currentValue) { - this.owner.selectSuggestion(currentValue, event); - } - } - setSelectedItem(selectedIndex, scrollIntoView) { - const normalizedIndex = this.suggestions.length > 0 ? wrapAround(selectedIndex, this.suggestions.length) : 0; - const prevSelectedSuggestion = this.suggestions[this.selectedItem]; - const selectedSuggestion = this.suggestions[normalizedIndex]; - prevSelectedSuggestion == null ? void 0 : prevSelectedSuggestion.removeClass("is-selected"); - selectedSuggestion == null ? void 0 : selectedSuggestion.addClass("is-selected"); - this.selectedItem = normalizedIndex; - if (scrollIntoView) { - selectedSuggestion.scrollIntoView(false); - } - } -}; -var TextInputSuggest = class { - constructor(app, inputEl) { - this.app = app; - this.inputEl = inputEl; - this.scope = new import_obsidian.Scope(); - this.suggestEl = createDiv("suggestion-container"); - const suggestion = this.suggestEl.createDiv("suggestion"); - this.suggest = new Suggest(this, suggestion, this.scope); - this.scope.register([], "Escape", this.close.bind(this)); - this.inputEl.addEventListener("input", this.onInputChanged.bind(this)); - this.inputEl.addEventListener("focus", this.onInputChanged.bind(this)); - this.inputEl.addEventListener("blur", this.close.bind(this)); - this.suggestEl.on("mousedown", ".suggestion-container", (event) => { - event.preventDefault(); - }); - } - onInputChanged() { - const inputStr = this.inputEl.value; - const suggestions = this.getSuggestions(inputStr); - if (suggestions.length > 0) { - this.suggest.setSuggestions(suggestions); - this.open(this.app.dom.appContainerEl, this.inputEl); - } - } - open(container, inputEl) { - this.app.keymap.pushScope(this.scope); - container.appendChild(this.suggestEl); - this.popper = createPopper(inputEl, this.suggestEl, { - placement: "bottom-start", - modifiers: [ - { - name: "sameWidth", - enabled: true, - fn: ({ state, instance: instance4 }) => { - const targetWidth = `${state.rects.reference.width}px`; - if (state.styles.popper.width === targetWidth) { - return; - } - state.styles.popper.width = targetWidth; - instance4.update(); - }, - phase: "beforeWrite", - requires: ["computeStyles"] - } - ] - }); - } - close() { - this.app.keymap.popScope(this.scope); - this.suggest.setSuggestions([]); - this.popper.destroy(); - this.suggestEl.detach(); - } -}; - -// src/settings/suggesters/FolderSuggest.ts -var FolderSuggest = class extends TextInputSuggest { - getSuggestions(inputStr) { - const abstractFiles = this.app.vault.getAllLoadedFiles(); - const folders = []; - const lowerCaseInputStr = inputStr.toLowerCase(); - abstractFiles.forEach((folder) => { - if (folder instanceof import_obsidian2.TFolder && folder.path.toLowerCase().contains(lowerCaseInputStr)) { - folders.push(folder); - } - }); - return folders; - } - renderSuggestion(file, el) { - el.setText(file.path); - } - selectSuggestion(file) { - this.inputEl.value = file.path; - this.inputEl.trigger("input"); - this.close(); - } -}; - -// src/settings/suggesters/FileSuggest.ts -var import_obsidian3 = __toModule(require("obsidian")); -var FileSuggest = class extends TextInputSuggest { - getSuggestions(inputStr) { - const abstractFiles = this.app.vault.getAllLoadedFiles(); - const files = []; - const lowerCaseInputStr = inputStr.toLowerCase(); - abstractFiles.forEach((file) => { - if (file instanceof import_obsidian3.TFile && file.name.toLowerCase().contains(lowerCaseInputStr)) { - files.push(file); - } - }); - return files; - } - renderSuggestion(file, el) { - el.setText(file.name); - } - selectSuggestion(file) { - this.inputEl.value = file.name; - this.inputEl.trigger("input"); - this.close(); - } -}; - -// node_modules/svelte/internal/index.mjs -function noop() { -} -function run(fn2) { - return fn2(); -} -function blank_object() { - return Object.create(null); -} -function run_all(fns) { - fns.forEach(run); -} -function is_function(thing) { - return typeof thing === "function"; -} -function safe_not_equal(a, b) { - return a != a ? b == b : a !== b || (a && typeof a === "object" || typeof a === "function"); -} -function is_empty(obj) { - return Object.keys(obj).length === 0; -} -var tasks = new Set(); -var globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : global; -var ResizeObserverSingleton = class { - constructor(options) { - this.options = options; - this._listeners = "WeakMap" in globals ? new WeakMap() : void 0; - } - observe(element2, listener) { - this._listeners.set(element2, listener); - this._getObserver().observe(element2, this.options); - return () => { - this._listeners.delete(element2); - this._observer.unobserve(element2); - }; - } - _getObserver() { - var _a; - return (_a = this._observer) !== null && _a !== void 0 ? _a : this._observer = new ResizeObserver((entries) => { - var _a2; - for (const entry of entries) { - ResizeObserverSingleton.entries.set(entry.target, entry); - (_a2 = this._listeners.get(entry.target)) === null || _a2 === void 0 ? void 0 : _a2(entry); - } - }); - } -}; -ResizeObserverSingleton.entries = "WeakMap" in globals ? new WeakMap() : void 0; -var is_hydrating = false; -function start_hydrating() { - is_hydrating = true; -} -function end_hydrating() { - is_hydrating = false; -} -function append(target, node) { - target.appendChild(node); -} -function append_styles(target, style_sheet_id, styles) { - const append_styles_to = get_root_for_style(target); - if (!append_styles_to.getElementById(style_sheet_id)) { - const style = element("style"); - style.id = style_sheet_id; - style.textContent = styles; - append_stylesheet(append_styles_to, style); - } -} -function get_root_for_style(node) { - if (!node) - return document; - const root = node.getRootNode ? node.getRootNode() : node.ownerDocument; - if (root && root.host) { - return root; - } - return node.ownerDocument; -} -function append_stylesheet(node, style) { - append(node.head || node, style); - return style.sheet; -} -function insert(target, node, anchor) { - target.insertBefore(node, anchor || null); -} -function detach(node) { - if (node.parentNode) { - node.parentNode.removeChild(node); - } -} -function destroy_each(iterations, detaching) { - for (let i = 0; i < iterations.length; i += 1) { - if (iterations[i]) - iterations[i].d(detaching); - } -} -function element(name) { - return document.createElement(name); -} -function text(data) { - return document.createTextNode(data); -} -function space() { - return text(" "); -} -function empty() { - return text(""); -} -function listen(node, event, handler, options) { - node.addEventListener(event, handler, options); - return () => node.removeEventListener(event, handler, options); -} -function attr(node, attribute, value) { - if (value == null) - node.removeAttribute(attribute); - else if (node.getAttribute(attribute) !== value) - node.setAttribute(attribute, value); -} -function children(element2) { - return Array.from(element2.childNodes); -} -function set_data(text2, data) { - data = "" + data; - if (text2.data === data) - return; - text2.data = data; -} -function set_input_value(input, value) { - input.value = value == null ? "" : value; -} -function set_style(node, key, value, important) { - if (value == null) { - node.style.removeProperty(key); - } else { - node.style.setProperty(key, value, important ? "important" : ""); - } -} -function select_option(select, value, mounting) { - for (let i = 0; i < select.options.length; i += 1) { - const option = select.options[i]; - if (option.__value === value) { - option.selected = true; - return; - } - } - if (!mounting || value !== void 0) { - select.selectedIndex = -1; - } -} -function select_value(select) { - const selected_option = select.querySelector(":checked"); - return selected_option && selected_option.__value; -} -var managed_styles = new Map(); -var current_component; -function set_current_component(component) { - current_component = component; -} -function get_current_component() { - if (!current_component) - throw new Error("Function called outside component initialization"); - return current_component; -} -function onMount(fn2) { - get_current_component().$$.on_mount.push(fn2); -} -var dirty_components = []; -var binding_callbacks = []; -var render_callbacks = []; -var flush_callbacks = []; -var resolved_promise = /* @__PURE__ */ Promise.resolve(); -var update_scheduled = false; -function schedule_update() { - if (!update_scheduled) { - update_scheduled = true; - resolved_promise.then(flush); - } -} -function add_render_callback(fn2) { - render_callbacks.push(fn2); -} -var seen_callbacks = new Set(); -var flushidx = 0; -function flush() { - if (flushidx !== 0) { - return; - } - const saved_component = current_component; - do { - try { - while (flushidx < dirty_components.length) { - const component = dirty_components[flushidx]; - flushidx++; - set_current_component(component); - update(component.$$); - } - } catch (e) { - dirty_components.length = 0; - flushidx = 0; - throw e; - } - set_current_component(null); - dirty_components.length = 0; - flushidx = 0; - while (binding_callbacks.length) - binding_callbacks.pop()(); - for (let i = 0; i < render_callbacks.length; i += 1) { - const callback = render_callbacks[i]; - if (!seen_callbacks.has(callback)) { - seen_callbacks.add(callback); - callback(); - } - } - render_callbacks.length = 0; - } while (dirty_components.length); - while (flush_callbacks.length) { - flush_callbacks.pop()(); - } - update_scheduled = false; - seen_callbacks.clear(); - set_current_component(saved_component); -} -function update($$) { - if ($$.fragment !== null) { - $$.update(); - run_all($$.before_update); - const dirty = $$.dirty; - $$.dirty = [-1]; - $$.fragment && $$.fragment.p($$.ctx, dirty); - $$.after_update.forEach(add_render_callback); - } -} -function flush_render_callbacks(fns) { - const filtered = []; - const targets = []; - render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c)); - targets.forEach((c) => c()); - render_callbacks = filtered; -} -var outroing = new Set(); -var outros; -function group_outros() { - outros = { - r: 0, - c: [], - p: outros - }; -} -function check_outros() { - if (!outros.r) { - run_all(outros.c); - } - outros = outros.p; -} -function transition_in(block, local) { - if (block && block.i) { - outroing.delete(block); - block.i(local); - } -} -function transition_out(block, local, detach2, callback) { - if (block && block.o) { - if (outroing.has(block)) - return; - outroing.add(block); - outros.c.push(() => { - outroing.delete(block); - if (callback) { - if (detach2) - block.d(1); - callback(); - } - }); - block.o(local); - } else if (callback) { - callback(); - } -} -var _boolean_attributes = [ - "allowfullscreen", - "allowpaymentrequest", - "async", - "autofocus", - "autoplay", - "checked", - "controls", - "default", - "defer", - "disabled", - "formnovalidate", - "hidden", - "inert", - "ismap", - "loop", - "multiple", - "muted", - "nomodule", - "novalidate", - "open", - "playsinline", - "readonly", - "required", - "reversed", - "selected" -]; -var boolean_attributes = new Set([..._boolean_attributes]); -function create_component(block) { - block && block.c(); -} -function mount_component(component, target, anchor, customElement) { - const { fragment, after_update } = component.$$; - fragment && fragment.m(target, anchor); - if (!customElement) { - add_render_callback(() => { - const new_on_destroy = component.$$.on_mount.map(run).filter(is_function); - if (component.$$.on_destroy) { - component.$$.on_destroy.push(...new_on_destroy); - } else { - run_all(new_on_destroy); - } - component.$$.on_mount = []; - }); - } - after_update.forEach(add_render_callback); -} -function destroy_component(component, detaching) { - const $$ = component.$$; - if ($$.fragment !== null) { - flush_render_callbacks($$.after_update); - run_all($$.on_destroy); - $$.fragment && $$.fragment.d(detaching); - $$.on_destroy = $$.fragment = null; - $$.ctx = []; - } -} -function make_dirty(component, i) { - if (component.$$.dirty[0] === -1) { - dirty_components.push(component); - schedule_update(); - component.$$.dirty.fill(0); - } - component.$$.dirty[i / 31 | 0] |= 1 << i % 31; -} -function init(component, options, instance4, create_fragment4, not_equal, props, append_styles2, dirty = [-1]) { - const parent_component = current_component; - set_current_component(component); - const $$ = component.$$ = { - fragment: null, - ctx: [], - props, - update: noop, - not_equal, - bound: blank_object(), - on_mount: [], - on_destroy: [], - on_disconnect: [], - before_update: [], - after_update: [], - context: new Map(options.context || (parent_component ? parent_component.$$.context : [])), - callbacks: blank_object(), - dirty, - skip_bound: false, - root: options.target || parent_component.$$.root - }; - append_styles2 && append_styles2($$.root); - let ready = false; - $$.ctx = instance4 ? instance4(component, options.props || {}, (i, ret, ...rest) => { - const value = rest.length ? rest[0] : ret; - if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { - if (!$$.skip_bound && $$.bound[i]) - $$.bound[i](value); - if (ready) - make_dirty(component, i); - } - return ret; - }) : []; - $$.update(); - ready = true; - run_all($$.before_update); - $$.fragment = create_fragment4 ? create_fragment4($$.ctx) : false; - if (options.target) { - if (options.hydrate) { - start_hydrating(); - const nodes = children(options.target); - $$.fragment && $$.fragment.l(nodes); - nodes.forEach(detach); - } else { - $$.fragment && $$.fragment.c(); - } - if (options.intro) - transition_in(component.$$.fragment); - mount_component(component, options.target, options.anchor, options.customElement); - end_hydrating(); - flush(); - } - set_current_component(parent_component); -} -var SvelteElement; -if (typeof HTMLElement === "function") { - SvelteElement = class extends HTMLElement { - constructor() { - super(); - this.attachShadow({ mode: "open" }); - } - connectedCallback() { - const { on_mount } = this.$$; - this.$$.on_disconnect = on_mount.map(run).filter(is_function); - for (const key in this.$$.slotted) { - this.appendChild(this.$$.slotted[key]); - } - } - attributeChangedCallback(attr2, _oldValue, newValue) { - this[attr2] = newValue; - } - disconnectedCallback() { - run_all(this.$$.on_disconnect); - } - $destroy() { - destroy_component(this, 1); - this.$destroy = noop; - } - $on(type, callback) { - if (!is_function(callback)) { - return noop; - } - const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []); - callbacks.push(callback); - return () => { - const index = callbacks.indexOf(callback); - if (index !== -1) - callbacks.splice(index, 1); - }; - } - $set($$props) { - if (this.$$set && !is_empty($$props)) { - this.$$.skip_bound = true; - this.$$set($$props); - this.$$.skip_bound = false; - } - } - }; -} -var SvelteComponent = class { - $destroy() { - destroy_component(this, 1); - this.$destroy = noop; - } - $on(type, callback) { - if (!is_function(callback)) { - return noop; - } - const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []); - callbacks.push(callback); - return () => { - const index = callbacks.indexOf(callback); - if (index !== -1) - callbacks.splice(index, 1); - }; - } - $set($$props) { - if (this.$$set && !is_empty($$props)) { - this.$$.skip_bound = true; - this.$$set($$props); - this.$$.skip_bound = false; - } - } -}; - -// src/settings/PropertyMapping.ts -var PropertyMappingOption; -(function(PropertyMappingOption2) { - PropertyMappingOption2["Default"] = "default"; - PropertyMappingOption2["Map"] = "remap"; - PropertyMappingOption2["Remove"] = "remove"; -})(PropertyMappingOption || (PropertyMappingOption = {})); -var propertyMappingOptions = [PropertyMappingOption.Default, PropertyMappingOption.Map, PropertyMappingOption.Remove]; -var PropertyMappingModel = class { - constructor(type, properties) { - this.type = type; - this.properties = properties != null ? properties : []; - } - validate() { - console.debug(`MDB | validated property mappings for ${this.type}`); - for (const property of this.properties) { - const propertyValidation = property.validate(); - if (!propertyValidation.res) { - return { - res: false, - err: propertyValidation.err - }; - } - } - for (const property of this.getMappedProperties()) { - const propertiesWithSameTarget = this.getMappedProperties().filter((x) => x.newProperty === property.newProperty); - if (propertiesWithSameTarget.length === 0) { - } else if (propertiesWithSameTarget.length === 1) { - } else { - return { - res: false, - err: new PropertyMappingNameConflictError(`Multiple remapped properties (${propertiesWithSameTarget.map((x) => x.toString()).toString()}) may not share the same name.`) - }; - } - } - for (const property of this.getMappedProperties()) { - const propertiesWithSameTarget = this.properties.filter((x) => x.newProperty === property.property); - if (propertiesWithSameTarget.length === 0) { - } else { - return { - res: false, - err: new PropertyMappingNameConflictError(`Remapped property (${property}) may not share it's new name with an existing property.`) - }; - } - } - return { - res: true - }; - } - getMappedProperties() { - return this.properties.filter((x) => x.mapping === PropertyMappingOption.Map); - } - copy() { - const copy = new PropertyMappingModel(this.type); - for (const property of this.properties) { - const propertyCopy = new PropertyMapping(property.property, property.newProperty, property.mapping, property.locked); - copy.properties.push(propertyCopy); - } - return copy; - } -}; -var PropertyMapping = class { - constructor(property, newProperty, mapping, locked) { - this.property = property; - this.newProperty = newProperty; - this.mapping = mapping; - this.locked = locked != null ? locked : false; - } - validate() { - if (this.locked) { - if (this.mapping === PropertyMappingOption.Remove) { - return { - res: false, - err: new PropertyMappingValidationError(`Error in property mapping "${this.toString()}": locked property may not be removed.`) - }; - } - if (this.mapping === PropertyMappingOption.Map) { - return { - res: false, - err: new PropertyMappingValidationError(`Error in property mapping "${this.toString()}": locked property may not be remapped.`) - }; - } - } - if (this.mapping === PropertyMappingOption.Default) { - return { res: true }; - } - if (this.mapping === PropertyMappingOption.Remove) { - return { res: true }; - } - if (!this.property || !containsOnlyLettersAndUnderscores(this.property)) { - return { - res: false, - err: new PropertyMappingValidationError(`Error in property mapping "${this.toString()}": property may not be empty and only contain letters and underscores.`) - }; - } - if (!this.newProperty || !containsOnlyLettersAndUnderscores(this.newProperty)) { - return { - res: false, - err: new PropertyMappingValidationError(`Error in property mapping "${this.toString()}": new property may not be empty and only contain letters and underscores.`) - }; - } - return { - res: true - }; - } - toString() { - if (this.mapping === PropertyMappingOption.Default) { - return this.property; - } else if (this.mapping === PropertyMappingOption.Map) { - return `${this.property} -> ${this.newProperty}`; - } else if (this.mapping === PropertyMappingOption.Remove) { - return `remove ${this.property}`; - } - return this.property; - } -}; - -// src/settings/Icon.svelte -var import_obsidian4 = __toModule(require("obsidian")); -function add_css(target) { - append_styles(target, "svelte-klmgqw", ".icon-wrapper.svelte-klmgqw{display:inline-block;position:relative;width:20px}.icon.svelte-klmgqw{position:absolute;height:20px;width:20px;top:calc(50% - 10px)}"); -} -function create_if_block(ctx) { - let div1; - let div0; - return { - c() { - div1 = element("div"); - div0 = element("div"); - attr(div0, "class", "icon svelte-klmgqw"); - attr(div1, "class", "icon-wrapper svelte-klmgqw"); - }, - m(target, anchor) { - insert(target, div1, anchor); - append(div1, div0); - ctx[3](div0); - }, - p: noop, - d(detaching) { - if (detaching) - detach(div1); - ctx[3](null); - } - }; -} -function create_fragment(ctx) { - let if_block_anchor; - let if_block = ctx[0].length > 0 && create_if_block(ctx); - return { - c() { - if (if_block) - if_block.c(); - if_block_anchor = empty(); - }, - m(target, anchor) { - if (if_block) - if_block.m(target, anchor); - insert(target, if_block_anchor, anchor); - }, - p(ctx2, [dirty]) { - if (ctx2[0].length > 0) { - if (if_block) { - if_block.p(ctx2, dirty); - } else { - if_block = create_if_block(ctx2); - if_block.c(); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - }, - i: noop, - o: noop, - d(detaching) { - if (if_block) - if_block.d(detaching); - if (detaching) - detach(if_block_anchor); - } - }; -} -function instance($$self, $$props, $$invalidate) { - let { iconName = "" } = $$props; - let { iconSize = 20 } = $$props; - let iconEl; - onMount(() => { - (0, import_obsidian4.setIcon)(iconEl, iconName, iconSize); - }); - function div0_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - iconEl = $$value; - $$invalidate(1, iconEl); - }); - } - $$self.$$set = ($$props2) => { - if ("iconName" in $$props2) - $$invalidate(0, iconName = $$props2.iconName); - if ("iconSize" in $$props2) - $$invalidate(2, iconSize = $$props2.iconSize); - }; - return [iconName, iconEl, iconSize, div0_binding]; -} -var Icon = class extends SvelteComponent { - constructor(options) { - super(); - init(this, options, instance, create_fragment, safe_not_equal, { iconName: 0, iconSize: 2 }, add_css); - } -}; -var Icon_default = Icon; - -// src/settings/PropertyMappingModelComponent.svelte -function get_each_context(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[7] = list[i]; - child_ctx[8] = list; - child_ctx[9] = i; - return child_ctx; -} -function get_each_context_1(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[10] = list[i]; - return child_ctx; -} -function create_else_block(ctx) { - let select; - let t; - let if_block_anchor; - let current; - let mounted; - let dispose; - let each_value_1 = propertyMappingOptions; - let each_blocks = []; - for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); - } - function select_change_handler() { - ctx[3].call(select, ctx[8], ctx[9]); - } - let if_block = ctx[7].mapping === PropertyMappingOption.Map && create_if_block_2(ctx); - return { - c() { - select = element("select"); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - t = space(); - if (if_block) - if_block.c(); - if_block_anchor = empty(); - attr(select, "class", "dropdown"); - if (ctx[7].mapping === void 0) - add_render_callback(select_change_handler); - }, - m(target, anchor) { - insert(target, select, anchor); - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(select, null); - } - } - select_option(select, ctx[7].mapping, true); - insert(target, t, anchor); - if (if_block) - if_block.m(target, anchor); - insert(target, if_block_anchor, anchor); - current = true; - if (!mounted) { - dispose = listen(select, "change", select_change_handler); - mounted = true; - } - }, - p(new_ctx, dirty) { - ctx = new_ctx; - if (dirty & 0) { - each_value_1 = propertyMappingOptions; - let i; - for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_1(ctx, each_value_1, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - } else { - each_blocks[i] = create_each_block_1(child_ctx); - each_blocks[i].c(); - each_blocks[i].m(select, null); - } - } - for (; i < each_blocks.length; i += 1) { - each_blocks[i].d(1); - } - each_blocks.length = each_value_1.length; - } - if (dirty & 1) { - select_option(select, ctx[7].mapping); - } - if (ctx[7].mapping === PropertyMappingOption.Map) { - if (if_block) { - if_block.p(ctx, dirty); - if (dirty & 1) { - transition_in(if_block, 1); - } - } else { - if_block = create_if_block_2(ctx); - if_block.c(); - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } else if (if_block) { - group_outros(); - transition_out(if_block, 1, 1, () => { - if_block = null; - }); - check_outros(); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o(local) { - transition_out(if_block); - current = false; - }, - d(detaching) { - if (detaching) - detach(select); - destroy_each(each_blocks, detaching); - if (detaching) - detach(t); - if (if_block) - if_block.d(detaching); - if (detaching) - detach(if_block_anchor); - mounted = false; - dispose(); - } - }; -} -function create_if_block_1(ctx) { - let div; - return { - c() { - div = element("div"); - div.textContent = "property can not be remapped"; - attr(div, "class", "media-db-plugin-property-binding-text"); - }, - m(target, anchor) { - insert(target, div, anchor); - }, - p: noop, - i: noop, - o: noop, - d(detaching) { - if (detaching) - detach(div); - } - }; -} -function create_each_block_1(ctx) { - let option; - let t0_value = ctx[10] + ""; - let t0; - let t1; - let option_value_value; - return { - c() { - option = element("option"); - t0 = text(t0_value); - t1 = space(); - option.__value = option_value_value = ctx[10]; - option.value = option.__value; - }, - m(target, anchor) { - insert(target, option, anchor); - append(option, t0); - append(option, t1); - }, - p: noop, - d(detaching) { - if (detaching) - detach(option); - } - }; -} -function create_if_block_2(ctx) { - let icon; - let t; - let div; - let input; - let current; - let mounted; - let dispose; - icon = new Icon_default({ props: { iconName: "arrow-right" } }); - function input_input_handler() { - ctx[4].call(input, ctx[8], ctx[9]); - } - return { - c() { - create_component(icon.$$.fragment); - t = space(); - div = element("div"); - input = element("input"); - attr(input, "type", "text"); - attr(input, "spellcheck", "false"); - attr(div, "class", "media-db-plugin-property-mapping-to"); - }, - m(target, anchor) { - mount_component(icon, target, anchor); - insert(target, t, anchor); - insert(target, div, anchor); - append(div, input); - set_input_value(input, ctx[7].newProperty); - current = true; - if (!mounted) { - dispose = listen(input, "input", input_input_handler); - mounted = true; - } - }, - p(new_ctx, dirty) { - ctx = new_ctx; - if (dirty & 1 && input.value !== ctx[7].newProperty) { - set_input_value(input, ctx[7].newProperty); - } - }, - i(local) { - if (current) - return; - transition_in(icon.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(icon.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(icon, detaching); - if (detaching) - detach(t); - if (detaching) - detach(div); - mounted = false; - dispose(); - } - }; -} -function create_each_block(ctx) { - let div1; - let div0; - let pre; - let code; - let t0_value = ctx[7].property + ""; - let t0; - let t1; - let current_block_type_index; - let if_block; - let t2; - let current; - const if_block_creators = [create_if_block_1, create_else_block]; - const if_blocks = []; - function select_block_type(ctx2, dirty) { - if (ctx2[7].locked) - return 0; - return 1; - } - current_block_type_index = select_block_type(ctx, -1); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - return { - c() { - div1 = element("div"); - div0 = element("div"); - pre = element("pre"); - code = element("code"); - t0 = text(t0_value); - t1 = space(); - if_block.c(); - t2 = space(); - attr(pre, "class", "media-db-plugin-property-mapping-element-property-name"); - attr(div0, "class", "media-db-plugin-property-mapping-element-property-name-wrapper"); - attr(div1, "class", "media-db-plugin-property-mapping-element"); - }, - m(target, anchor) { - insert(target, div1, anchor); - append(div1, div0); - append(div0, pre); - append(pre, code); - append(code, t0); - append(div1, t1); - if_blocks[current_block_type_index].m(div1, null); - append(div1, t2); - current = true; - }, - p(ctx2, dirty) { - if ((!current || dirty & 1) && t0_value !== (t0_value = ctx2[7].property + "")) - set_data(t0, t0_value); - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(div1, t2); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o(local) { - transition_out(if_block); - current = false; - }, - d(detaching) { - if (detaching) - detach(div1); - if_blocks[current_block_type_index].d(); - } - }; -} -function create_if_block2(ctx) { - var _a, _b; - let div; - let t_value = ((_b = (_a = ctx[2]) == null ? void 0 : _a.err) == null ? void 0 : _b.message) + ""; - let t; - return { - c() { - div = element("div"); - t = text(t_value); - attr(div, "class", "media-db-plugin-property-mapping-validation"); - }, - m(target, anchor) { - insert(target, div, anchor); - append(div, t); - }, - p(ctx2, dirty) { - var _a2, _b2; - if (dirty & 4 && t_value !== (t_value = ((_b2 = (_a2 = ctx2[2]) == null ? void 0 : _a2.err) == null ? void 0 : _b2.message) + "")) - set_data(t, t_value); - }, - d(detaching) { - if (detaching) - detach(div); - } - }; -} -function create_fragment2(ctx) { - var _a; - let div2; - let div0; - let t0_value = capitalizeFirstLetter(ctx[0].type) + ""; - let t0; - let t1; - let div1; - let t2; - let t3; - let button; - let t4; - let button_class_value; - let current; - let mounted; - let dispose; - let each_value = ctx[0].properties; - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - let if_block = !((_a = ctx[2]) == null ? void 0 : _a.res) && create_if_block2(ctx); - return { - c() { - var _a2; - div2 = element("div"); - div0 = element("div"); - t0 = text(t0_value); - t1 = space(); - div1 = element("div"); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - t2 = space(); - if (if_block) - if_block.c(); - t3 = space(); - button = element("button"); - t4 = text("Save"); - attr(div0, "class", "setting-item-name"); - attr(div1, "class", "media-db-plugin-property-mappings-container"); - attr(button, "class", button_class_value = "media-db-plugin-property-mappings-save-button " + (((_a2 = ctx[2]) == null ? void 0 : _a2.res) ? "mod-cta" : "mod-muted")); - attr(div2, "class", "media-db-plugin-property-mappings-model-container"); - }, - m(target, anchor) { - insert(target, div2, anchor); - append(div2, div0); - append(div0, t0); - append(div2, t1); - append(div2, div1); - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(div1, null); - } - } - append(div2, t2); - if (if_block) - if_block.m(div2, null); - append(div2, t3); - append(div2, button); - append(button, t4); - current = true; - if (!mounted) { - dispose = listen(button, "click", ctx[5]); - mounted = true; - } - }, - p(ctx2, [dirty]) { - var _a2, _b; - if ((!current || dirty & 1) && t0_value !== (t0_value = capitalizeFirstLetter(ctx2[0].type) + "")) - set_data(t0, t0_value); - if (dirty & 1) { - each_value = ctx2[0].properties; - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(div1, null); - } - } - group_outros(); - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - if (!((_a2 = ctx2[2]) == null ? void 0 : _a2.res)) { - if (if_block) { - if_block.p(ctx2, dirty); - } else { - if_block = create_if_block2(ctx2); - if_block.c(); - if_block.m(div2, t3); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - if (!current || dirty & 4 && button_class_value !== (button_class_value = "media-db-plugin-property-mappings-save-button " + (((_b = ctx2[2]) == null ? void 0 : _b.res) ? "mod-cta" : "mod-muted"))) { - attr(button, "class", button_class_value); - } - }, - i(local) { - if (current) - return; - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d(detaching) { - if (detaching) - detach(div2); - destroy_each(each_blocks, detaching); - if (if_block) - if_block.d(); - mounted = false; - dispose(); - } - }; -} -function instance2($$self, $$props, $$invalidate) { - let { model } = $$props; - let { save } = $$props; - let validationResult; - function modelChanged(model2) { - $$invalidate(2, validationResult = model2.validate()); - } - function select_change_handler(each_value, property_index) { - each_value[property_index].mapping = select_value(this); - $$invalidate(0, model); - } - function input_input_handler(each_value, property_index) { - each_value[property_index].newProperty = this.value; - $$invalidate(0, model); - } - const click_handler = () => { - if (model.validate().res) - save(model); - }; - $$self.$$set = ($$props2) => { - if ("model" in $$props2) - $$invalidate(0, model = $$props2.model); - if ("save" in $$props2) - $$invalidate(1, save = $$props2.save); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty & 1) { - $: - modelChanged(model); - } - }; - return [ - model, - save, - validationResult, - select_change_handler, - input_input_handler, - click_handler - ]; -} -var PropertyMappingModelComponent = class extends SvelteComponent { - constructor(options) { - super(); - init(this, options, instance2, create_fragment2, safe_not_equal, { model: 0, save: 1 }); - } -}; -var PropertyMappingModelComponent_default = PropertyMappingModelComponent; - -// src/settings/PropertyMappingModelsComponent.svelte -function get_each_context2(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[2] = list[i]; - return child_ctx; -} -function create_each_block2(ctx) { - let propertymappingmodelcomponent; - let current; - propertymappingmodelcomponent = new PropertyMappingModelComponent_default({ - props: { - model: ctx[2], - save: ctx[1] - } - }); - return { - c() { - create_component(propertymappingmodelcomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(propertymappingmodelcomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const propertymappingmodelcomponent_changes = {}; - if (dirty & 1) - propertymappingmodelcomponent_changes.model = ctx2[2]; - if (dirty & 2) - propertymappingmodelcomponent_changes.save = ctx2[1]; - propertymappingmodelcomponent.$set(propertymappingmodelcomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(propertymappingmodelcomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(propertymappingmodelcomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(propertymappingmodelcomponent, detaching); - } - }; -} -function create_fragment3(ctx) { - let div; - let current; - let each_value = ctx[0]; - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - return { - c() { - div = element("div"); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - attr(div, "class", "setting-item"); - set_style(div, "display", "flex"); - set_style(div, "gap", "10px"); - set_style(div, "flex-direction", "column"); - set_style(div, "align-items", "stretch"); - }, - m(target, anchor) { - insert(target, div, anchor); - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(div, null); - } - } - current = true; - }, - p(ctx2, [dirty]) { - if (dirty & 3) { - each_value = ctx2[0]; - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context2(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block2(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(div, null); - } - } - group_outros(); - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - }, - i(local) { - if (current) - return; - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d(detaching) { - if (detaching) - detach(div); - destroy_each(each_blocks, detaching); - } - }; -} -function instance3($$self, $$props, $$invalidate) { - let { models = [] } = $$props; - let { save } = $$props; - $$self.$$set = ($$props2) => { - if ("models" in $$props2) - $$invalidate(0, models = $$props2.models); - if ("save" in $$props2) - $$invalidate(1, save = $$props2.save); - }; - return [models, save]; -} -var PropertyMappingModelsComponent = class extends SvelteComponent { - constructor(options) { - super(); - init(this, options, instance3, create_fragment3, safe_not_equal, { models: 0, save: 1 }); - } -}; -var PropertyMappingModelsComponent_default = PropertyMappingModelsComponent; - -// src/utils/MediaType.ts -var MediaType; -(function(MediaType2) { - MediaType2["Movie"] = "movie"; - MediaType2["Series"] = "series"; - MediaType2["Game"] = "game"; - MediaType2["MusicRelease"] = "musicRelease"; - MediaType2["Wiki"] = "wiki"; - MediaType2["BoardGame"] = "boardgame"; -})(MediaType || (MediaType = {})); - -// src/utils/MediaTypeManager.ts -var import_obsidian5 = __toModule(require("obsidian")); - -// src/models/MediaTypeModel.ts -var MediaTypeModel = class { - constructor() { - this.type = void 0; - this.subType = void 0; - this.title = void 0; - this.englishTitle = void 0; - this.year = void 0; - this.dataSource = void 0; - this.url = void 0; - this.id = void 0; - this.userData = {}; - } - toMetaDataObject() { - return __spreadProps(__spreadValues(__spreadValues({}, this.getWithOutUserData()), this.userData), { tags: this.getTags().join("/") }); - } - getWithOutUserData() { - const copy = Object.assign({}, this); - delete copy.userData; - return copy; - } -}; - -// src/models/MovieModel.ts -var MovieModel = class extends MediaTypeModel { - constructor(obj = {}) { - super(); - this.genres = void 0; - this.producer = void 0; - this.duration = void 0; - this.onlineRating = void 0; - this.actors = void 0; - this.image = void 0; - this.released = void 0; - this.streamingServices = void 0; - this.premiere = void 0; - this.userData = { - watched: void 0, - lastWatched: void 0, - personalRating: void 0 - }; - migrateObject(this, obj, this); - if (!obj.hasOwnProperty("userData")) { - migrateObject(this.userData, obj, this.userData); - } - this.type = this.getMediaType(); - } - getTags() { - return [mediaDbTag, "tv", "movie"]; - } - getMediaType() { - return MediaType.Movie; - } - getSummary() { - return this.englishTitle + " (" + this.year + ")"; - } -}; - -// src/models/SeriesModel.ts -var SeriesModel = class extends MediaTypeModel { - constructor(obj = {}) { - super(); - this.genres = void 0; - this.studios = void 0; - this.episodes = void 0; - this.duration = void 0; - this.onlineRating = void 0; - this.actors = void 0; - this.image = void 0; - this.released = void 0; - this.streamingServices = void 0; - this.airing = void 0; - this.airedFrom = void 0; - this.airedTo = void 0; - this.userData = { - watched: void 0, - lastWatched: void 0, - personalRating: void 0 - }; - migrateObject(this, obj, this); - if (!obj.hasOwnProperty("userData")) { - migrateObject(this.userData, obj, this.userData); - } - this.type = this.getMediaType(); - } - getTags() { - return [mediaDbTag, "tv", "series"]; - } - getMediaType() { - return MediaType.Series; - } - getSummary() { - return this.title + " (" + this.year + ")"; - } -}; - -// src/models/GameModel.ts -var GameModel = class extends MediaTypeModel { - constructor(obj = {}) { - super(); - this.genres = void 0; - this.onlineRating = void 0; - this.image = void 0; - this.released = void 0; - this.releaseDate = void 0; - this.userData = { - played: void 0, - personalRating: void 0 - }; - migrateObject(this, obj, this); - if (!obj.hasOwnProperty("userData")) { - migrateObject(this.userData, obj, this.userData); - } - this.type = this.getMediaType(); - } - getTags() { - return [mediaDbTag, "game"]; - } - getMediaType() { - return MediaType.Game; - } - getSummary() { - return this.englishTitle + " (" + this.year + ")"; - } -}; - -// src/models/WikiModel.ts -var WikiModel = class extends MediaTypeModel { - constructor(obj = {}) { - super(); - this.wikiUrl = void 0; - this.lastUpdated = void 0; - this.length = void 0; - this.article = void 0; - this.userData = {}; - migrateObject(this, obj, this); - if (!obj.hasOwnProperty("userData")) { - migrateObject(this.userData, obj, this.userData); - } - this.type = this.getMediaType(); - } - getTags() { - return [mediaDbTag, "wiki"]; - } - getMediaType() { - return MediaType.Wiki; - } - getWithOutUserData() { - const copy = Object.assign({}, this); - delete copy.userData; - delete copy.article; - return copy; - } - getSummary() { - return this.title; - } -}; - -// src/models/MusicReleaseModel.ts -var MusicReleaseModel = class extends MediaTypeModel { - constructor(obj = {}) { - super(); - this.genres = void 0; - this.artists = void 0; - this.rating = void 0; - this.userData = { - personalRating: void 0 - }; - migrateObject(this, obj, this); - if (!obj.hasOwnProperty("userData")) { - migrateObject(this.userData, obj, this.userData); - } - this.type = this.getMediaType(); - } - getTags() { - return [mediaDbTag, "music", this.subType]; - } - getMediaType() { - return MediaType.MusicRelease; - } - getSummary() { - let summary = this.title + " (" + this.year + ")"; - if (this.artists.length > 0) - summary += " - " + this.artists.join(", "); - return summary; - } -}; - -// src/models/BoardGameModel.ts -var BoardGameModel = class extends MediaTypeModel { - constructor(obj = {}) { - super(); - this.genres = void 0; - this.onlineRating = void 0; - this.minPlayers = void 0; - this.maxPlayers = void 0; - this.playtime = void 0; - this.publishers = void 0; - this.complexityRating = void 0; - this.image = void 0; - this.released = void 0; - this.userData = { - played: void 0, - personalRating: void 0 - }; - migrateObject(this, obj, this); - if (!obj.hasOwnProperty("userData")) { - migrateObject(this.userData, obj, this.userData); - } - this.type = this.getMediaType(); - } - getTags() { - return [mediaDbTag, "boardgame"]; - } - getMediaType() { - return MediaType.BoardGame; - } - getSummary() { - return this.englishTitle + " (" + this.year + ")"; - } -}; - -// src/utils/MediaTypeManager.ts -var MEDIA_TYPES = [MediaType.Movie, MediaType.Series, MediaType.Game, MediaType.Wiki, MediaType.MusicRelease, MediaType.BoardGame]; -var MediaTypeManager = class { - constructor() { - } - updateTemplates(settings) { - this.mediaFileNameTemplateMap = new Map(); - this.mediaFileNameTemplateMap.set(MediaType.Movie, settings.movieFileNameTemplate); - this.mediaFileNameTemplateMap.set(MediaType.Series, settings.seriesFileNameTemplate); - this.mediaFileNameTemplateMap.set(MediaType.Game, settings.gameFileNameTemplate); - this.mediaFileNameTemplateMap.set(MediaType.Wiki, settings.wikiFileNameTemplate); - this.mediaFileNameTemplateMap.set(MediaType.MusicRelease, settings.musicReleaseFileNameTemplate); - this.mediaFileNameTemplateMap.set(MediaType.BoardGame, settings.boardgameFileNameTemplate); - this.mediaTemplateMap = new Map(); - this.mediaTemplateMap.set(MediaType.Movie, settings.movieTemplate); - this.mediaTemplateMap.set(MediaType.Series, settings.seriesTemplate); - this.mediaTemplateMap.set(MediaType.Game, settings.gameTemplate); - this.mediaTemplateMap.set(MediaType.Wiki, settings.wikiTemplate); - this.mediaTemplateMap.set(MediaType.MusicRelease, settings.musicReleaseTemplate); - this.mediaTemplateMap.set(MediaType.BoardGame, settings.boardgameTemplate); - } - updateFolders(settings) { - this.mediaFolderMap = new Map(); - this.mediaFolderMap.set(MediaType.Movie, settings.movieFolder); - this.mediaFolderMap.set(MediaType.Series, settings.seriesFolder); - this.mediaFolderMap.set(MediaType.Game, settings.gameFolder); - this.mediaFolderMap.set(MediaType.Wiki, settings.wikiFolder); - this.mediaFolderMap.set(MediaType.MusicRelease, settings.musicReleaseFolder); - this.mediaFolderMap.set(MediaType.BoardGame, settings.boardgameFolder); - } - getFileName(mediaTypeModel) { - return replaceTags(this.mediaFileNameTemplateMap.get(mediaTypeModel.getMediaType()), mediaTypeModel); - } - getTemplate(mediaTypeModel, app) { - return __async(this, null, function* () { - const templateFileName = this.mediaTemplateMap.get(mediaTypeModel.getMediaType()); - if (!templateFileName) { - return ""; - } - const templateFile = app.vault.getFiles().filter((f) => f.name === templateFileName).first(); - if (!templateFile) { - return ""; - } - const template = yield app.vault.cachedRead(templateFile); - return replaceTags(template, mediaTypeModel); - }); - } - getFolder(mediaTypeModel, app) { - return __async(this, null, function* () { - let folderPath = this.mediaFolderMap.get(mediaTypeModel.getMediaType()); - if (!folderPath) { - folderPath = `/`; - } - if (!(yield app.vault.adapter.exists(folderPath))) { - yield app.vault.createFolder(folderPath); - } - const folder = app.vault.getAbstractFileByPath(folderPath); - if (!(folder instanceof import_obsidian5.TFolder)) { - throw Error(`Expected ${folder} to be instance of TFolder`); - } - return folder; - }); - } - createMediaTypeModelFromMediaType(obj, mediaType) { - if (mediaType === MediaType.Movie) { - return new MovieModel(obj); - } else if (mediaType === MediaType.Series) { - return new SeriesModel(obj); - } else if (mediaType === MediaType.Game) { - return new GameModel(obj); - } else if (mediaType === MediaType.Wiki) { - return new WikiModel(obj); - } else if (mediaType === MediaType.MusicRelease) { - return new MusicReleaseModel(obj); - } else if (mediaType === MediaType.BoardGame) { - return new BoardGameModel(obj); - } - return void 0; - } -}; - -// src/settings/Settings.ts -var DEFAULT_SETTINGS = { - OMDbKey: "", - sfwFilter: true, - useCustomYamlStringifier: true, - templates: true, - movieTemplate: "", - seriesTemplate: "", - gameTemplate: "", - wikiTemplate: "", - musicReleaseTemplate: "", - boardgameTemplate: "", - movieFileNameTemplate: "{{ title }} ({{ year }})", - seriesFileNameTemplate: "{{ title }} ({{ year }})", - gameFileNameTemplate: "{{ title }} ({{ year }})", - wikiFileNameTemplate: "{{ title }}", - musicReleaseFileNameTemplate: "{{ title }} (by {{ ENUM:artists }} - {{ year }})", - boardgameFileNameTemplate: "{{ title }} ({{ year }})", - moviePropertyConversionRules: "", - seriesPropertyConversionRules: "", - gamePropertyConversionRules: "", - wikiPropertyConversionRules: "", - musicReleasePropertyConversionRules: "", - boardgamePropertyConversionRules: "", - movieFolder: "Media DB/movies", - seriesFolder: "Media DB/series", - gameFolder: "Media DB/games", - wikiFolder: "Media DB/wiki", - musicReleaseFolder: "Media DB/music", - boardgameFolder: "Media DB/boardgames", - propertyMappingModels: [] -}; -var lockedPropertyMappings = ["type", "id", "dataSource"]; -function getDefaultSettings(plugin) { - const defaultSettings = DEFAULT_SETTINGS; - const propertyMappingModels = []; - for (const mediaType of MEDIA_TYPES) { - const model = plugin.mediaTypeManager.createMediaTypeModelFromMediaType({}, mediaType); - const metadataObj = model.toMetaDataObject(); - const propertyMappingModel = new PropertyMappingModel(mediaType); - for (const key of Object.keys(metadataObj)) { - propertyMappingModel.properties.push(new PropertyMapping(key, "", PropertyMappingOption.Default, lockedPropertyMappings.contains(key))); - } - propertyMappingModels.push(propertyMappingModel); - } - defaultSettings.propertyMappingModels = propertyMappingModels; - return defaultSettings; -} -var MediaDbSettingTab = class extends import_obsidian6.PluginSettingTab { - constructor(app, plugin) { - super(app, plugin); - this.plugin = plugin; - } - display() { - const { containerEl } = this; - containerEl.empty(); - containerEl.createEl("h2", { text: "Media DB Plugin Settings" }); - new import_obsidian6.Setting(containerEl).setName("OMDb API key").setDesc('API key for "www.omdbapi.com".').addText((cb) => { - cb.setPlaceholder("API key").setValue(this.plugin.settings.OMDbKey).onChange((data) => { - this.plugin.settings.OMDbKey = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("SFW filter").setDesc("Only shows SFW results for APIs that offer filtering.").addToggle((cb) => { - cb.setValue(this.plugin.settings.sfwFilter).onChange((data) => { - this.plugin.settings.sfwFilter = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("YAML formatter").setDesc("Add optional quotation marks around strings in the metadata block.").addToggle((cb) => { - cb.setValue(this.plugin.settings.useCustomYamlStringifier).onChange((data) => { - this.plugin.settings.useCustomYamlStringifier = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Resolve {{ tags }} in templates").setDesc("Whether to resolve {{ tags }} in templates. The spaces inside the curly braces are important.").addToggle((cb) => { - cb.setValue(this.plugin.settings.templates).onChange((data) => { - this.plugin.settings.templates = data; - this.plugin.saveSettings(); - }); - }); - containerEl.createEl("h3", { text: "New File Location" }); - new import_obsidian6.Setting(containerEl).setName("Movie Folder").setDesc("Where newly imported movies should be places.").addSearch((cb) => { - new FolderSuggest(this.app, cb.inputEl); - cb.setPlaceholder(DEFAULT_SETTINGS.movieFolder).setValue(this.plugin.settings.movieFolder).onChange((data) => { - this.plugin.settings.movieFolder = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Series Folder").setDesc("Where newly imported series should be places.").addSearch((cb) => { - new FolderSuggest(this.app, cb.inputEl); - cb.setPlaceholder(DEFAULT_SETTINGS.seriesFolder).setValue(this.plugin.settings.seriesFolder).onChange((data) => { - this.plugin.settings.seriesFolder = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Game Folder").setDesc("Where newly imported games should be places.").addSearch((cb) => { - new FolderSuggest(this.app, cb.inputEl); - cb.setPlaceholder(DEFAULT_SETTINGS.gameFolder).setValue(this.plugin.settings.gameFolder).onChange((data) => { - this.plugin.settings.gameFolder = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Wiki Folder").setDesc("Where newly imported wiki articles should be places.").addSearch((cb) => { - new FolderSuggest(this.app, cb.inputEl); - cb.setPlaceholder(DEFAULT_SETTINGS.wikiFolder).setValue(this.plugin.settings.wikiFolder).onChange((data) => { - this.plugin.settings.wikiFolder = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Music Folder").setDesc("Where newly imported music should be places.").addSearch((cb) => { - new FolderSuggest(this.app, cb.inputEl); - cb.setPlaceholder(DEFAULT_SETTINGS.musicReleaseFolder).setValue(this.plugin.settings.musicReleaseFolder).onChange((data) => { - this.plugin.settings.musicReleaseFolder = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Board Game Folder").setDesc("Where newly imported board games should be places.").addSearch((cb) => { - new FileSuggest(this.app, cb.inputEl); - cb.setPlaceholder(DEFAULT_SETTINGS.boardgameFolder).setValue(this.plugin.settings.boardgameFolder).onChange((data) => { - this.plugin.settings.boardgameFolder = data; - this.plugin.saveSettings(); - }); - }); - containerEl.createEl("h3", { text: "Template Settings" }); - new import_obsidian6.Setting(containerEl).setName("Movie template").setDesc("Template file to be used when creating a new note for a movie.").addSearch((cb) => { - new FileSuggest(this.app, cb.inputEl); - cb.setPlaceholder("Example: movieTemplate.md").setValue(this.plugin.settings.movieTemplate).onChange((data) => { - this.plugin.settings.movieTemplate = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Series template").setDesc("Template file to be used when creating a new note for a series.").addSearch((cb) => { - new FileSuggest(this.app, cb.inputEl); - cb.setPlaceholder("Example: seriesTemplate.md").setValue(this.plugin.settings.seriesTemplate).onChange((data) => { - this.plugin.settings.seriesTemplate = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Game template").setDesc("Template file to be used when creating a new note for a game.").addSearch((cb) => { - new FileSuggest(this.app, cb.inputEl); - cb.setPlaceholder("Example: gameTemplate.md").setValue(this.plugin.settings.gameTemplate).onChange((data) => { - this.plugin.settings.gameTemplate = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Wiki template").setDesc("Template file to be used when creating a new note for a wiki entry.").addSearch((cb) => { - new FileSuggest(this.app, cb.inputEl); - cb.setPlaceholder("Example: wikiTemplate.md").setValue(this.plugin.settings.wikiTemplate).onChange((data) => { - this.plugin.settings.wikiTemplate = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Music Release template").setDesc("Template file to be used when creating a new note for a music release.").addSearch((cb) => { - new FileSuggest(this.app, cb.inputEl); - cb.setPlaceholder("Example: musicReleaseTemplate.md").setValue(this.plugin.settings.musicReleaseTemplate).onChange((data) => { - this.plugin.settings.musicReleaseTemplate = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Board Game template").setDesc("Template file to be used when creating a new note for a boardgame.").addSearch((cb) => { - new FileSuggest(this.app, cb.inputEl); - cb.setPlaceholder("Example: boardgameTemplate.md").setValue(this.plugin.settings.boardgameTemplate).onChange((data) => { - this.plugin.settings.boardgameTemplate = data; - this.plugin.saveSettings(); - }); - }); - containerEl.createEl("h3", { text: "File Name Settings" }); - new import_obsidian6.Setting(containerEl).setName("Movie file name template").setDesc("Template for the file name used when creating a new note for a movie.").addText((cb) => { - cb.setPlaceholder(`Example: ${DEFAULT_SETTINGS.movieFileNameTemplate}`).setValue(this.plugin.settings.movieFileNameTemplate).onChange((data) => { - this.plugin.settings.movieFileNameTemplate = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Series file name template").setDesc("Template for the file name used when creating a new note for a series.").addText((cb) => { - cb.setPlaceholder(`Example: ${DEFAULT_SETTINGS.seriesFileNameTemplate}`).setValue(this.plugin.settings.seriesFileNameTemplate).onChange((data) => { - this.plugin.settings.seriesFileNameTemplate = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Game file name template").setDesc("Template for the file name used when creating a new note for a game.").addText((cb) => { - cb.setPlaceholder(`Example: ${DEFAULT_SETTINGS.gameFileNameTemplate}`).setValue(this.plugin.settings.gameFileNameTemplate).onChange((data) => { - this.plugin.settings.gameFileNameTemplate = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Wiki file name template").setDesc("Template for the file name used when creating a new note for a wiki entry.").addText((cb) => { - cb.setPlaceholder(`Example: ${DEFAULT_SETTINGS.wikiFileNameTemplate}`).setValue(this.plugin.settings.wikiFileNameTemplate).onChange((data) => { - this.plugin.settings.wikiFileNameTemplate = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Music Release file name template").setDesc("Template for the file name used when creating a new note for a music release.").addText((cb) => { - cb.setPlaceholder(`Example: ${DEFAULT_SETTINGS.musicReleaseFileNameTemplate}`).setValue(this.plugin.settings.musicReleaseFileNameTemplate).onChange((data) => { - this.plugin.settings.musicReleaseFileNameTemplate = data; - this.plugin.saveSettings(); - }); - }); - new import_obsidian6.Setting(containerEl).setName("Board Game file name template").setDesc("Template for the file name used when creating a new note for a boardgame.").addText((cb) => { - cb.setPlaceholder(`Example: ${DEFAULT_SETTINGS.boardgameFileNameTemplate}`).setValue(this.plugin.settings.boardgameFileNameTemplate).onChange((data) => { - this.plugin.settings.boardgameFileNameTemplate = data; - this.plugin.saveSettings(); - }); - }); - containerEl.createEl("h3", { text: "Property Mappings" }); - const propertyMappingExplanation = containerEl.createEl("div"); - propertyMappingExplanation.innerHTML = ` +var si=Object.defineProperty;var Vo=Object.getOwnPropertyDescriptor;var Yo=Object.getOwnPropertyNames;var Go=Object.prototype.hasOwnProperty;var zo=(o,t,e)=>t in o?si(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var Ko=(o,t)=>{for(var e in t)si(o,e,{get:t[e],enumerable:!0})},Xo=(o,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Yo(t))!Go.call(o,i)&&i!==e&&si(o,i,{get:()=>t[i],enumerable:!(r=Vo(t,i))||r.enumerable});return o};var Zo=o=>Xo(si({},"__esModule",{value:!0}),o);var z=(o,t,e)=>(zo(o,typeof t!="symbol"?t+"":t,e),e);var la={};Ko(la,{default:()=>zi});module.exports=Zo(la);var ne=require("obsidian");var P=require("obsidian");var so=require("obsidian");var ao=require("obsidian");var B="top",H="bottom",q="right",L="left",li="auto",We=[B,H,q,L],Re="start",Ke="end",Rr="clippingParents",pi="viewport",vt="popper",Or="reference",Ki=We.reduce(function(o,t){return o.concat([t+"-"+Re,t+"-"+Ke])},[]),di=[].concat(We,[li]).reduce(function(o,t){return o.concat([t,t+"-"+Re,t+"-"+Ke])},[]),Jo="beforeRead",Qo="read",en="afterRead",tn="beforeMain",rn="main",on="afterMain",nn="beforeWrite",an="write",sn="afterWrite",Ar=[Jo,Qo,en,tn,rn,on,nn,an,sn];function K(o){return o?(o.nodeName||"").toLowerCase():null}function $(o){if(o==null)return window;if(o.toString()!=="[object Window]"){var t=o.ownerDocument;return t&&t.defaultView||window}return o}function pe(o){var t=$(o).Element;return o instanceof t||o instanceof Element}function V(o){var t=$(o).HTMLElement;return o instanceof t||o instanceof HTMLElement}function wt(o){if(typeof ShadowRoot=="undefined")return!1;var t=$(o).ShadowRoot;return o instanceof t||o instanceof ShadowRoot}function ln(o){var t=o.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},i=t.attributes[e]||{},n=t.elements[e];!V(n)||!K(n)||(Object.assign(n.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?n.removeAttribute(a):n.setAttribute(a,s===!0?"":s)}))})}function pn(o){var t=o.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],n=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:e[r]),s=a.reduce(function(l,p){return l[p]="",l},{});!V(i)||!K(i)||(Object.assign(i.style,s),Object.keys(n).forEach(function(l){i.removeAttribute(l)}))})}}var Nr={name:"applyStyles",enabled:!0,phase:"write",fn:ln,effect:pn,requires:["computeStyles"]};function X(o){return o.split("-")[0]}var fe=Math.max,Xe=Math.min,Oe=Math.round;function xt(){var o=navigator.userAgentData;return o!=null&&o.brands&&Array.isArray(o.brands)?o.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Wt(){return!/^((?!chrome|android).)*safari/i.test(xt())}function de(o,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var r=o.getBoundingClientRect(),i=1,n=1;t&&V(o)&&(i=o.offsetWidth>0&&Oe(r.width)/o.offsetWidth||1,n=o.offsetHeight>0&&Oe(r.height)/o.offsetHeight||1);var a=pe(o)?$(o):window,s=a.visualViewport,l=!Wt()&&e,p=(r.left+(l&&s?s.offsetLeft:0))/i,d=(r.top+(l&&s?s.offsetTop:0))/n,c=r.width/i,u=r.height/n;return{width:c,height:u,top:d,right:p+c,bottom:d+u,left:p,x:p,y:d}}function Ze(o){var t=de(o),e=o.offsetWidth,r=o.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:o.offsetLeft,y:o.offsetTop,width:e,height:r}}function qt(o,t){var e=t.getRootNode&&t.getRootNode();if(o.contains(t))return!0;if(e&&wt(e)){var r=t;do{if(r&&o.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ae(o){return $(o).getComputedStyle(o)}function Xi(o){return["table","td","th"].indexOf(K(o))>=0}function ee(o){return((pe(o)?o.ownerDocument:o.document)||window.document).documentElement}function Ae(o){return K(o)==="html"?o:o.assignedSlot||o.parentNode||(wt(o)?o.host:null)||ee(o)}function Br(o){return!V(o)||ae(o).position==="fixed"?null:o.offsetParent}function dn(o){var t=/firefox/i.test(xt()),e=/Trident/i.test(xt());if(e&&V(o)){var r=ae(o);if(r.position==="fixed")return null}var i=Ae(o);for(wt(i)&&(i=i.host);V(i)&&["html","body"].indexOf(K(i))<0;){var n=ae(i);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||t&&n.willChange==="filter"||t&&n.filter&&n.filter!=="none")return i;i=i.parentNode}return null}function he(o){for(var t=$(o),e=Br(o);e&&Xi(e)&&ae(e).position==="static";)e=Br(e);return e&&(K(e)==="html"||K(e)==="body"&&ae(e).position==="static")?t:e||dn(o)||t}function Je(o){return["top","bottom"].indexOf(o)>=0?"x":"y"}function Qe(o,t,e){return fe(o,Xe(t,e))}function Ir(o,t,e){var r=Qe(o,t,e);return r>e?e:r}function Ut(){return{top:0,right:0,bottom:0,left:0}}function Ht(o){return Object.assign({},Ut(),o)}function Vt(o,t){return t.reduce(function(e,r){return e[r]=o,e},{})}var cn=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Ht(typeof t!="number"?t:Vt(t,We))};function un(o){var t,e=o.state,r=o.name,i=o.options,n=e.elements.arrow,a=e.modifiersData.popperOffsets,s=X(e.placement),l=Je(s),p=[L,q].indexOf(s)>=0,d=p?"height":"width";if(!(!n||!a)){var c=cn(i.padding,e),u=Ze(n),m=l==="y"?B:L,M=l==="y"?H:q,g=e.rects.reference[d]+e.rects.reference[l]-a[l]-e.rects.popper[d],f=a[l]-e.rects.reference[l],T=he(n),w=T?l==="y"?T.clientHeight||0:T.clientWidth||0:0,D=g/2-f/2,h=c[m],y=w-u[d]-c[M],b=w/2-u[d]/2+D,_=Qe(h,b,y),x=l;e.modifiersData[r]=(t={},t[x]=_,t.centerOffset=_-b,t)}}function mn(o){var t=o.state,e=o.options,r=e.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||qt(t.elements.popper,i)&&(t.elements.arrow=i))}var Lr={name:"arrow",enabled:!0,phase:"main",fn:un,effect:mn,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ce(o){return o.split("-")[1]}var fn={top:"auto",right:"auto",bottom:"auto",left:"auto"};function hn(o,t){var e=o.x,r=o.y,i=t.devicePixelRatio||1;return{x:Oe(e*i)/i||0,y:Oe(r*i)/i||0}}function jr(o){var t,e=o.popper,r=o.popperRect,i=o.placement,n=o.variation,a=o.offsets,s=o.position,l=o.gpuAcceleration,p=o.adaptive,d=o.roundOffsets,c=o.isFixed,u=a.x,m=u===void 0?0:u,M=a.y,g=M===void 0?0:M,f=typeof d=="function"?d({x:m,y:g}):{x:m,y:g};m=f.x,g=f.y;var T=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),D=L,h=B,y=window;if(p){var b=he(e),_="clientHeight",x="clientWidth";if(b===$(e)&&(b=ee(e),ae(b).position!=="static"&&s==="absolute"&&(_="scrollHeight",x="scrollWidth")),b=b,i===B||(i===L||i===q)&&n===Ke){h=H;var E=c&&b===y&&y.visualViewport?y.visualViewport.height:b[_];g-=E-r.height,g*=l?1:-1}if(i===L||(i===B||i===H)&&n===Ke){D=q;var v=c&&b===y&&y.visualViewport?y.visualViewport.width:b[x];m-=v-r.width,m*=l?1:-1}}var C=Object.assign({position:s},p&&fn),S=d===!0?hn({x:m,y:g},$(e)):{x:m,y:g};if(m=S.x,g=S.y,l){var F;return Object.assign({},C,(F={},F[h]=w?"0":"",F[D]=T?"0":"",F.transform=(y.devicePixelRatio||1)<=1?"translate("+m+"px, "+g+"px)":"translate3d("+m+"px, "+g+"px, 0)",F))}return Object.assign({},C,(t={},t[h]=w?g+"px":"",t[D]=T?m+"px":"",t.transform="",t))}function gn(o){var t=o.state,e=o.options,r=e.gpuAcceleration,i=r===void 0?!0:r,n=e.adaptive,a=n===void 0?!0:n,s=e.roundOffsets,l=s===void 0?!0:s,p={placement:X(t.placement),variation:ce(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,jr(Object.assign({},p,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,jr(Object.assign({},p,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var Wr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:gn,data:{}};var ci={passive:!0};function yn(o){var t=o.state,e=o.instance,r=o.options,i=r.scroll,n=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=$(t.elements.popper),p=[].concat(t.scrollParents.reference,t.scrollParents.popper);return n&&p.forEach(function(d){d.addEventListener("scroll",e.update,ci)}),s&&l.addEventListener("resize",e.update,ci),function(){n&&p.forEach(function(d){d.removeEventListener("scroll",e.update,ci)}),s&&l.removeEventListener("resize",e.update,ci)}}var qr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:yn,data:{}};var Mn={left:"right",right:"left",bottom:"top",top:"bottom"};function Tt(o){return o.replace(/left|right|bottom|top/g,function(t){return Mn[t]})}var bn={start:"end",end:"start"};function ui(o){return o.replace(/start|end/g,function(t){return bn[t]})}function et(o){var t=$(o),e=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:e,scrollTop:r}}function tt(o){return de(ee(o)).left+et(o).scrollLeft}function Zi(o,t){var e=$(o),r=ee(o),i=e.visualViewport,n=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){n=i.width,a=i.height;var p=Wt();(p||!p&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:n,height:a,x:s+tt(o),y:l}}function Ji(o){var t,e=ee(o),r=et(o),i=(t=o.ownerDocument)==null?void 0:t.body,n=fe(e.scrollWidth,e.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=fe(e.scrollHeight,e.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+tt(o),l=-r.scrollTop;return ae(i||e).direction==="rtl"&&(s+=fe(e.clientWidth,i?i.clientWidth:0)-n),{width:n,height:a,x:s,y:l}}function it(o){var t=ae(o),e=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+i+r)}function mi(o){return["html","body","#document"].indexOf(K(o))>=0?o.ownerDocument.body:V(o)&&it(o)?o:mi(Ae(o))}function qe(o,t){var e;t===void 0&&(t=[]);var r=mi(o),i=r===((e=o.ownerDocument)==null?void 0:e.body),n=$(r),a=i?[n].concat(n.visualViewport||[],it(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(qe(Ae(a)))}function _t(o){return Object.assign({},o,{left:o.x,top:o.y,right:o.x+o.width,bottom:o.y+o.height})}function vn(o,t){var e=de(o,!1,t==="fixed");return e.top=e.top+o.clientTop,e.left=e.left+o.clientLeft,e.bottom=e.top+o.clientHeight,e.right=e.left+o.clientWidth,e.width=o.clientWidth,e.height=o.clientHeight,e.x=e.left,e.y=e.top,e}function Ur(o,t,e){return t===pi?_t(Zi(o,e)):pe(t)?vn(t,e):_t(Ji(ee(o)))}function wn(o){var t=qe(Ae(o)),e=["absolute","fixed"].indexOf(ae(o).position)>=0,r=e&&V(o)?he(o):o;return pe(r)?t.filter(function(i){return pe(i)&&qt(i,r)&&K(i)!=="body"}):[]}function Qi(o,t,e,r){var i=t==="clippingParents"?wn(o):[].concat(t),n=[].concat(i,[e]),a=n[0],s=n.reduce(function(l,p){var d=Ur(o,p,r);return l.top=fe(d.top,l.top),l.right=Xe(d.right,l.right),l.bottom=Xe(d.bottom,l.bottom),l.left=fe(d.left,l.left),l},Ur(o,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Yt(o){var t=o.reference,e=o.element,r=o.placement,i=r?X(r):null,n=r?ce(r):null,a=t.x+t.width/2-e.width/2,s=t.y+t.height/2-e.height/2,l;switch(i){case B:l={x:a,y:t.y-e.height};break;case H:l={x:a,y:t.y+t.height};break;case q:l={x:t.x+t.width,y:s};break;case L:l={x:t.x-e.width,y:s};break;default:l={x:t.x,y:t.y}}var p=i?Je(i):null;if(p!=null){var d=p==="y"?"height":"width";switch(n){case Re:l[p]=l[p]-(t[d]/2-e[d]/2);break;case Ke:l[p]=l[p]+(t[d]/2-e[d]/2);break;default:}}return l}function ge(o,t){t===void 0&&(t={});var e=t,r=e.placement,i=r===void 0?o.placement:r,n=e.strategy,a=n===void 0?o.strategy:n,s=e.boundary,l=s===void 0?Rr:s,p=e.rootBoundary,d=p===void 0?pi:p,c=e.elementContext,u=c===void 0?vt:c,m=e.altBoundary,M=m===void 0?!1:m,g=e.padding,f=g===void 0?0:g,T=Ht(typeof f!="number"?f:Vt(f,We)),w=u===vt?Or:vt,D=o.rects.popper,h=o.elements[M?w:u],y=Qi(pe(h)?h:h.contextElement||ee(o.elements.popper),l,d,a),b=de(o.elements.reference),_=Yt({reference:b,element:D,strategy:"absolute",placement:i}),x=_t(Object.assign({},D,_)),E=u===vt?x:b,v={top:y.top-E.top+T.top,bottom:E.bottom-y.bottom+T.bottom,left:y.left-E.left+T.left,right:E.right-y.right+T.right},C=o.modifiersData.offset;if(u===vt&&C){var S=C[i];Object.keys(v).forEach(function(F){var k=[q,H].indexOf(F)>=0?1:-1,te=[B,H].indexOf(F)>=0?"y":"x";v[F]+=S[te]*k})}return v}function er(o,t){t===void 0&&(t={});var e=t,r=e.placement,i=e.boundary,n=e.rootBoundary,a=e.padding,s=e.flipVariations,l=e.allowedAutoPlacements,p=l===void 0?di:l,d=ce(r),c=d?s?Ki:Ki.filter(function(M){return ce(M)===d}):We,u=c.filter(function(M){return p.indexOf(M)>=0});u.length===0&&(u=c);var m=u.reduce(function(M,g){return M[g]=ge(o,{placement:g,boundary:i,rootBoundary:n,padding:a})[X(g)],M},{});return Object.keys(m).sort(function(M,g){return m[M]-m[g]})}function xn(o){if(X(o)===li)return[];var t=Tt(o);return[ui(o),t,ui(t)]}function Tn(o){var t=o.state,e=o.options,r=o.name;if(!t.modifiersData[r]._skip){for(var i=e.mainAxis,n=i===void 0?!0:i,a=e.altAxis,s=a===void 0?!0:a,l=e.fallbackPlacements,p=e.padding,d=e.boundary,c=e.rootBoundary,u=e.altBoundary,m=e.flipVariations,M=m===void 0?!0:m,g=e.allowedAutoPlacements,f=t.options.placement,T=X(f),w=T===f,D=l||(w||!M?[Tt(f)]:xn(f)),h=[f].concat(D).reduce(function($e,me){return $e.concat(X(me)===li?er(t,{placement:me,boundary:d,rootBoundary:c,padding:p,flipVariations:M,allowedAutoPlacements:g}):me)},[]),y=t.rects.reference,b=t.rects.popper,_=new Map,x=!0,E=h[0],v=0;v=0,te=k?"width":"height",N=ge(t,{placement:C,boundary:d,rootBoundary:c,altBoundary:u,padding:p}),I=k?F?q:L:F?H:B;y[te]>b[te]&&(I=Tt(I));var Te=Tt(I),le=[];if(n&&le.push(N[S]<=0),s&&le.push(N[I]<=0,N[Te]<=0),le.every(function($e){return $e})){E=C,x=!1;break}_.set(C,le)}if(x)for(var _e=M?3:1,gt=function(me){var je=h.find(function(Ge){var Se=_.get(Ge);if(Se)return Se.slice(0,me).every(function(yt){return yt})});if(je)return E=je,"break"},Le=_e;Le>0;Le--){var Ye=gt(Le);if(Ye==="break")break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}}var Hr={name:"flip",enabled:!0,phase:"main",fn:Tn,requiresIfExists:["offset"],data:{_skip:!1}};function Vr(o,t,e){return e===void 0&&(e={x:0,y:0}),{top:o.top-t.height-e.y,right:o.right-t.width+e.x,bottom:o.bottom-t.height+e.y,left:o.left-t.width-e.x}}function Yr(o){return[B,q,H,L].some(function(t){return o[t]>=0})}function _n(o){var t=o.state,e=o.name,r=t.rects.reference,i=t.rects.popper,n=t.modifiersData.preventOverflow,a=ge(t,{elementContext:"reference"}),s=ge(t,{altBoundary:!0}),l=Vr(a,r),p=Vr(s,i,n),d=Yr(l),c=Yr(p);t.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:p,isReferenceHidden:d,hasPopperEscaped:c},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":c})}var Gr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:_n};function Sn(o,t,e){var r=X(o),i=[L,B].indexOf(r)>=0?-1:1,n=typeof e=="function"?e(Object.assign({},t,{placement:o})):e,a=n[0],s=n[1];return a=a||0,s=(s||0)*i,[L,q].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function Dn(o){var t=o.state,e=o.options,r=o.name,i=e.offset,n=i===void 0?[0,0]:i,a=di.reduce(function(d,c){return d[c]=Sn(c,t.rects,n),d},{}),s=a[t.placement],l=s.x,p=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=a}var zr={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Dn};function En(o){var t=o.state,e=o.name;t.modifiersData[e]=Yt({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Kr={name:"popperOffsets",enabled:!0,phase:"read",fn:En,data:{}};function tr(o){return o==="x"?"y":"x"}function Cn(o){var t=o.state,e=o.options,r=o.name,i=e.mainAxis,n=i===void 0?!0:i,a=e.altAxis,s=a===void 0?!1:a,l=e.boundary,p=e.rootBoundary,d=e.altBoundary,c=e.padding,u=e.tether,m=u===void 0?!0:u,M=e.tetherOffset,g=M===void 0?0:M,f=ge(t,{boundary:l,rootBoundary:p,padding:c,altBoundary:d}),T=X(t.placement),w=ce(t.placement),D=!w,h=Je(T),y=tr(h),b=t.modifiersData.popperOffsets,_=t.rects.reference,x=t.rects.popper,E=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,v=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),C=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,S={x:0,y:0};if(b){if(n){var F,k=h==="y"?B:L,te=h==="y"?H:q,N=h==="y"?"height":"width",I=b[h],Te=I+f[k],le=I-f[te],_e=m?-x[N]/2:0,gt=w===Re?_[N]:x[N],Le=w===Re?-x[N]:-_[N],Ye=t.elements.arrow,$e=m&&Ye?Ze(Ye):{width:0,height:0},me=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Ut(),je=me[k],Ge=me[te],Se=Qe(0,_[N],$e[N]),yt=D?_[N]/2-_e-Se-je-v.mainAxis:gt-Se-je-v.mainAxis,ti=D?-_[N]/2+_e+Se+Ge+v.mainAxis:Le+Se+Ge+v.mainAxis,Mt=t.elements.arrow&&he(t.elements.arrow),ii=Mt?h==="y"?Mt.clientTop||0:Mt.clientLeft||0:0,$t=(F=C==null?void 0:C[h])!=null?F:0,ri=I+yt-$t-ii,oi=I+ti-$t,Rt=Qe(m?Xe(Te,ri):Te,I,m?fe(le,oi):le);b[h]=Rt,S[h]=Rt-I}if(s){var Ot,ni=h==="x"?B:L,ai=h==="x"?H:q,De=b[y],ze=y==="y"?"height":"width",At=De+f[ni],Nt=De-f[ai],bt=[B,L].indexOf(T)!==-1,Bt=(Ot=C==null?void 0:C[y])!=null?Ot:0,It=bt?At:De-_[ze]-x[ze]-Bt+v.altAxis,Lt=bt?De+_[ze]+x[ze]-Bt-v.altAxis:Nt,jt=m&&bt?Ir(It,De,Lt):Qe(m?It:At,De,m?Lt:Nt);b[y]=jt,S[y]=jt-De}t.modifiersData[r]=S}}var Xr={name:"preventOverflow",enabled:!0,phase:"main",fn:Cn,requiresIfExists:["offset"]};function ir(o){return{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}}function rr(o){return o===$(o)||!V(o)?et(o):ir(o)}function Pn(o){var t=o.getBoundingClientRect(),e=Oe(t.width)/o.offsetWidth||1,r=Oe(t.height)/o.offsetHeight||1;return e!==1||r!==1}function or(o,t,e){e===void 0&&(e=!1);var r=V(t),i=V(t)&&Pn(t),n=ee(t),a=de(o,i,e),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!e)&&((K(t)!=="body"||it(n))&&(s=rr(t)),V(t)?(l=de(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):n&&(l.x=tt(n))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function Fn(o){var t=new Map,e=new Set,r=[];o.forEach(function(n){t.set(n.name,n)});function i(n){e.add(n.name);var a=[].concat(n.requires||[],n.requiresIfExists||[]);a.forEach(function(s){if(!e.has(s)){var l=t.get(s);l&&i(l)}}),r.push(n)}return o.forEach(function(n){e.has(n.name)||i(n)}),r}function nr(o){var t=Fn(o);return Ar.reduce(function(e,r){return e.concat(t.filter(function(i){return i.phase===r}))},[])}function ar(o){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(o())})})),t}}function sr(o){var t=o.reduce(function(e,r){var i=e[r.name];return e[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,e},{});return Object.keys(t).map(function(e){return t[e]})}var Zr={placement:"bottom",modifiers:[],strategy:"absolute"};function Jr(){for(var o=arguments.length,t=new Array(o),e=0;e$"@.?]*/g,"").replace(/:+/g," -")}function mr(o,t){return o.replace(new RegExp("{{.*?}}","g"),e=>$n(e,t))}function $n(o,t){let e=o;e=e.substring(2),e=e.substring(0,e.length-2),e=e.trim();let r=e.split(":");if(r.length===1){let i=r[0].split("."),n=eo(i,t);return n===void 0?"{{ INVALID TEMPLATE TAG - object undefined }}":n}else if(r.length===2){let i=r[0],n=r[1].split("."),a=eo(n,t);return a===void 0?"{{ INVALID TEMPLATE TAG - object undefined }}":i==="LIST"?Array.isArray(a)?a.map(s=>`- ${s}`).join(` +`):"{{ INVALID TEMPLATE TAG - operator LIST is only applicable on an array }}":i==="ENUM"?Array.isArray(a)?a.join(", "):"{{ INVALID TEMPLATE TAG - operator ENUM is only applicable on an array }}":`{{ INVALID TEMPLATE TAG - unknown operator ${i} }}`}return"{{ INVALID TEMPLATE TAG }}"}function eo(o,t){let e=t;for(let r of o)e!==void 0&&(e=e[r]);return e}function ro(o){let t=o.length;if(t===0)return"";let e=o[0].length;if(e===0)return"";for(let n of o)if(n.length!==e)return"";let r=[];for(let n=0;na&&(a=s[n].length);r.push(a)}let i="";for(let n=0;ncreateFragment(t=>t.createDiv().innerHTML=o);function Rn(o){return`${o.getMonth()+1}-${o.getDate()}-${o.getFullYear()}`}function On(o){return`${o.getHours()}-${o.getMinutes()}-${o.getSeconds()}`}function no(o){return`${Rn(o)} ${On(o)}`}function fi(o,t){return(o%t+t)%t}function fr(o){return o.charAt(0).toUpperCase()+o.slice(1)}var rt=class extends Error{constructor(t){super(t)}},Gt=class extends Error{constructor(t){super(t)}};function R(o,t,e){for(let r in o)o[r]=t.hasOwnProperty(r)?t[r]:e[r]}function zt(o){return o.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b([A-Z]+)([A-Z])([a-z])/,"$1 $2$3").replace(/^./,function(t){return t.toUpperCase()})}var hr=class{constructor(t,e,r){this.owner=t,this.containerEl=e,e.on("click",".suggestion-item",this.onSuggestionClick.bind(this)),e.on("mousemove",".suggestion-item",this.onSuggestionMouseover.bind(this)),r.register([],"ArrowUp",i=>{if(!i.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),r.register([],"ArrowDown",i=>{if(!i.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),r.register([],"Enter",i=>{if(!i.isComposing)return this.useSelectedItem(i),!1})}onSuggestionClick(t,e){t.preventDefault();let r=this.suggestions.indexOf(e);this.setSelectedItem(r,!1),this.useSelectedItem(t)}onSuggestionMouseover(t,e){let r=this.suggestions.indexOf(e);this.setSelectedItem(r,!1)}setSuggestions(t){this.containerEl.empty();let e=[];t.forEach(r=>{let i=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(r,i),e.push(i)}),this.values=t,this.suggestions=e,this.setSelectedItem(0,!1)}useSelectedItem(t){let e=this.values[this.selectedItem];e&&this.owner.selectSuggestion(e,t)}setSelectedItem(t,e){let r=this.suggestions.length>0?to(t,this.suggestions.length):0,i=this.suggestions[this.selectedItem],n=this.suggestions[r];i==null||i.removeClass("is-selected"),n==null||n.addClass("is-selected"),this.selectedItem=r,e&&n.scrollIntoView(!1)}},St=class{constructor(t,e){this.app=t,this.inputEl=e,this.scope=new ao.Scope,this.suggestEl=createDiv("suggestion-container");let r=this.suggestEl.createDiv("suggestion");this.suggest=new hr(this,r,this.scope),this.scope.register([],"Escape",this.close.bind(this)),this.inputEl.addEventListener("input",this.onInputChanged.bind(this)),this.inputEl.addEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.addEventListener("blur",this.close.bind(this)),this.suggestEl.on("mousedown",".suggestion-container",i=>{i.preventDefault()})}onInputChanged(){let t=this.inputEl.value,e=this.getSuggestions(t);e.length>0&&(this.suggest.setSuggestions(e),this.open(this.app.dom.appContainerEl,this.inputEl))}open(t,e){this.app.keymap.pushScope(this.scope),t.appendChild(this.suggestEl),this.popper=lr(e,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"sameWidth",enabled:!0,fn:({state:r,instance:i})=>{let n=`${r.rects.reference.width}px`;r.styles.popper.width!==n&&(r.styles.popper.width=n,i.update())},phase:"beforeWrite",requires:["computeStyles"]}]})}close(){this.app.keymap.popScope(this.scope),this.suggest.setSuggestions([]),this.popper.destroy(),this.suggestEl.detach()}};var ye=class extends St{getSuggestions(t){let e=this.app.vault.getAllLoadedFiles(),r=[],i=t.toLowerCase();return e.forEach(n=>{n instanceof so.TFolder&&n.path.toLowerCase().contains(i)&&r.push(n)}),r}renderSuggestion(t,e){e.setText(t.path)}selectSuggestion(t){this.inputEl.value=t.path,this.inputEl.trigger("input"),this.close()}};var lo=require("obsidian"),Me=class extends St{getSuggestions(t){let e=this.app.vault.getAllLoadedFiles(),r=[],i=t.toLowerCase();return e.forEach(n=>{n instanceof lo.TFile&&n.name.toLowerCase().contains(i)&&r.push(n)}),r}renderSuggestion(t,e){e.setText(t.name)}selectSuggestion(t){this.inputEl.value=t.name,this.inputEl.trigger("input"),this.close()}};function re(){}function gr(o){return o()}function hi(){return Object.create(null)}function Ee(o){o.forEach(gr)}function gi(o){return typeof o=="function"}function Dt(o,t){return o!=o?t==t:o!==t||o&&typeof o=="object"||typeof o=="function"}function po(o){return Object.keys(o).length===0}var yr=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;var yi=class o{constructor(t){z(this,"_listeners","WeakMap"in yr?new WeakMap:void 0);z(this,"_observer");z(this,"options");this.options=t}observe(t,e){return this._listeners.set(t,e),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){var t;return(t=this._observer)!=null?t:this._observer=new ResizeObserver(e=>{var r;for(let i of e)o.entries.set(i.target,i),(r=this._listeners.get(i.target))==null||r(i)})}};yi.entries="WeakMap"in yr?new WeakMap:void 0;var co=!1;function uo(){co=!0}function mo(){co=!1}function j(o,t){o.appendChild(t)}function fo(o,t,e){let r=ho(o);if(!r.getElementById(t)){let i=O("style");i.id=t,i.textContent=e,Bn(r,i)}}function ho(o){if(!o)return document;let t=o.getRootNode?o.getRootNode():o.ownerDocument;return t&&t.host?t:o.ownerDocument}function Bn(o,t){return j(o.head||o,t),t.sheet}function Y(o,t,e){o.insertBefore(t,e||null)}function W(o){o.parentNode&&o.parentNode.removeChild(o)}function Kt(o,t){for(let e=0;eo.removeEventListener(t,e,r)}function A(o,t,e){e==null?o.removeAttribute(t):o.getAttribute(t)!==e&&o.setAttribute(t,e)}function go(o){return Array.from(o.childNodes)}function bi(o,t){t=""+t,o.data!==t&&(o.data=t)}function vi(o,t){o.value=t==null?"":t}function Zt(o,t,e,r){e==null?o.style.removeProperty(t):o.style.setProperty(t,e,r?"important":"")}function Mr(o,t,e){for(let r=0;r{t[e.slot||"default"]=!0}),t}var He;function Ne(o){He=o}function vo(){if(!He)throw new Error("Function called outside component initialization");return He}function br(o){vo().$$.on_mount.push(o)}var nt=[];var wi=[],Ct=[],wo=[],Un=Promise.resolve(),wr=!1;function xo(){wr||(wr=!0,Un.then(xi))}function at(o){Ct.push(o)}var vr=new Set,Et=0;function xi(){if(Et!==0)return;let o=He;do{try{for(;Eto.indexOf(r)===-1?t.push(r):e.push(r)),e.forEach(r=>r()),Ct=t}var Ti=new Set,st;function lt(){st={r:0,c:[],p:st}}function pt(){st.r||Ee(st.c),st=st.p}function G(o,t){o&&o.i&&(Ti.delete(o),o.i(t))}function se(o,t,e,r){if(o&&o.o){if(Ti.has(o))return;Ti.add(o),st.c.push(()=>{Ti.delete(o),r&&(e&&o.d(1),r())}),o.o(t)}else r&&r()}function Be(o){return(o==null?void 0:o.length)!==void 0?o:Array.from(o)}var Vn=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],Yn=new Set([...Vn]);function _i(o){o&&o.c()}function Jt(o,t,e){let{fragment:r,after_update:i}=o.$$;r&&r.m(t,e),at(()=>{let n=o.$$.on_mount.map(gr).filter(gi);o.$$.on_destroy?o.$$.on_destroy.push(...n):Ee(n),o.$$.on_mount=[]}),i.forEach(at)}function Qt(o,t){let e=o.$$;e.fragment!==null&&(To(e.after_update),Ee(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function zn(o,t){o.$$.dirty[0]===-1&&(nt.push(o),xo(),o.$$.dirty.fill(0)),o.$$.dirty[t/31|0]|=1<{let M=m.length?m[0]:u;return p.ctx&&i(p.ctx[c],p.ctx[c]=M)&&(!p.skip_bound&&p.bound[c]&&p.bound[c](M),d&&zn(o,c)),u}):[],p.update(),d=!0,Ee(p.before_update),p.fragment=r?r(p.ctx):!1,t.target){if(t.hydrate){uo();let c=go(t.target);p.fragment&&p.fragment.l(c),c.forEach(W)}else p.fragment&&p.fragment.c();t.intro&&G(o.$$.fragment),Jt(o,t.target,t.anchor),mo(),xi()}Ne(l)}var Kn;typeof HTMLElement=="function"&&(Kn=class extends HTMLElement{constructor(t,e,r){super();z(this,"$$ctor");z(this,"$$s");z(this,"$$c");z(this,"$$cn",!1);z(this,"$$d",{});z(this,"$$r",!1);z(this,"$$p_d",{});z(this,"$$l",{});z(this,"$$l_u",new Map);this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){let i=this.$$c.$on(t,e);this.$$l_u.set(e,i)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){let i=this.$$l_u.get(e);i&&(i(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(n){return()=>{let a;return{c:function(){a=O("slot"),n!=="default"&&A(a,"name",n)},m:function(p,d){Y(p,a,d)},d:function(p){p&&W(a)}}}};if(await Promise.resolve(),!this.$$cn)return;let e={},r=Mo(this);for(let n of this.$$s)n in r&&(e[n]=[t(n)]);for(let n of this.attributes){let a=this.$$g_p(n.name);a in this.$$d||(this.$$d[a]=xr(a,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$scope:{ctx:[]}}});let i=()=>{this.$$r=!0;for(let n in this.$$p_d)if(this.$$d[n]=this.$$c.$$.ctx[this.$$c.$$.props[n]],this.$$p_d[n].reflect){let a=xr(n,this.$$d[n],this.$$p_d,"toAttribute");a==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,a)}this.$$r=!1};this.$$c.$$.after_update.push(i),i();for(let n in this.$$l)for(let a of this.$$l[n]){let s=this.$$c.$on(n,a);this.$$l_u.set(a,s)}this.$$l={}}}attributeChangedCallback(t,e,r){var i;this.$$r||(t=this.$$g_p(t),this.$$d[t]=xr(t,r,this.$$p_d,"toProp"),(i=this.$$c)==null||i.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(t){return Object.keys(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function xr(o,t,e,r){var n;let i=(n=e[o])==null?void 0:n.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!r||!e[o])return t;if(r==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t==null?null:t;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}var Ie=class{constructor(){z(this,"$$");z(this,"$$set")}$destroy(){Qt(this,1),this.$destroy=re}$on(t,e){if(!gi(e))return re;let r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{let i=r.indexOf(e);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!po(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}};var _o="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(_o);var So=["default","remap","remove"],Ft=class o{constructor(t,e){this.type=t,this.properties=e!=null?e:[]}validate(){console.debug(`MDB | validated property mappings for ${this.type}`);for(let t of this.properties){let e=t.validate();if(!e.res)return{res:!1,err:e.err}}for(let t of this.getMappedProperties()){let e=this.getMappedProperties().filter(r=>r.newProperty===t.newProperty);if(e.length!==0){if(e.length!==1)return{res:!1,err:new Gt(`Multiple remapped properties (${e.map(r=>r.toString()).toString()}) may not share the same name.`)}}}for(let t of this.getMappedProperties())if(this.properties.filter(r=>r.newProperty===t.property).length!==0)return{res:!1,err:new Gt(`Remapped property (${t}) may not share it's new name with an existing property.`)};return{res:!0}}getMappedProperties(){return this.properties.filter(t=>t.mapping==="remap")}copy(){let t=new o(this.type);for(let e of this.properties){let r=new dt(e.property,e.newProperty,e.mapping,e.locked);t.properties.push(r)}return t}},dt=class{constructor(t,e,r,i){this.property=t,this.newProperty=e,this.mapping=r,this.locked=i!=null?i:!1}validate(){if(this.locked){if(this.mapping==="remove")return{res:!1,err:new rt(`Error in property mapping "${this.toString()}": locked property may not be removed.`)};if(this.mapping==="remap")return{res:!1,err:new rt(`Error in property mapping "${this.toString()}": locked property may not be remapped.`)}}return this.mapping==="default"?{res:!0}:this.mapping==="remove"?{res:!0}:!this.property||!ur(this.property)?{res:!1,err:new rt(`Error in property mapping "${this.toString()}": property may not be empty and only contain letters and underscores.`)}:!this.newProperty||!ur(this.newProperty)?{res:!1,err:new rt(`Error in property mapping "${this.toString()}": new property may not be empty and only contain letters and underscores.`)}:{res:!0}}toString(){return this.mapping==="default"?this.property:this.mapping==="remap"?`${this.property} -> ${this.newProperty}`:this.mapping==="remove"?`remove ${this.property}`:this.property}};var Eo=require("obsidian");function Xn(o){fo(o,"svelte-klmgqw",".icon-wrapper.svelte-klmgqw{display:inline-block;position:relative;width:20px}.icon.svelte-klmgqw{position:absolute;height:20px;width:20px;top:calc(50% - 10px)}")}function Do(o){let t,e;return{c(){t=O("div"),e=O("div"),A(e,"class","icon svelte-klmgqw"),A(t,"class","icon-wrapper svelte-klmgqw")},m(r,i){Y(r,t,i),j(t,e),o[3](e)},p:re,d(r){r&&W(t),o[3](null)}}}function Zn(o){let t,e=o[0].length>0&&Do(o);return{c(){e&&e.c(),t=Mi()},m(r,i){e&&e.m(r,i),Y(r,t,i)},p(r,[i]){r[0].length>0?e?e.p(r,i):(e=Do(r),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:re,o:re,d(r){r&&W(t),e&&e.d(r)}}}function Jn(o,t,e){let{iconName:r=""}=t,{iconSize:i=20}=t,n;br(()=>{(0,Eo.setIcon)(n,r,i)});function a(s){wi[s?"unshift":"push"](()=>{n=s,e(1,n)})}return o.$$set=s=>{"iconName"in s&&e(0,r=s.iconName),"iconSize"in s&&e(2,i=s.iconSize)},[r,n,i,a]}var Tr=class extends Ie{constructor(t){super(),Pt(this,t,Jn,Zn,Dt,{iconName:0,iconSize:2},Xn)}},Co=Tr;function Po(o,t,e){let r=o.slice();return r[7]=t[e],r[8]=t,r[9]=e,r}function Qn(o,t,e){let r=o.slice();return r[10]=t[e],r}function ea(o){let t,e,r,i,n,a,s=Be(So),l=[];for(let c=0;c{d=null}),pt())},i(c){i||(G(d),i=!0)},o(c){se(d),i=!1},d(c){c&&(W(t),W(e),W(r)),Kt(l,c),d&&d.d(c),n=!1,a()}}}function ta(o){let t;return{c(){t=O("div"),t.textContent="property can not be remapped",A(t,"class","media-db-plugin-property-binding-text")},m(e,r){Y(e,t,r)},p:re,i:re,o:re,d(e){e&&W(t)}}}function ia(o){let t,e;return{c(){t=O("option"),t.textContent=`${o[10]} `,t.__value=e=o[10],vi(t,t.__value)},m(r,i){Y(r,t,i)},p:re,d(r){r&&W(t)}}}function Fo(o){let t,e,r,i,n,a,s;t=new Co({props:{iconName:"arrow-right"}});function l(){o[4].call(i,o[8],o[9])}return{c(){_i(t.$$.fragment),e=Ue(),r=O("div"),i=O("input"),A(i,"type","text"),A(i,"spellcheck","false"),A(r,"class","media-db-plugin-property-mapping-to")},m(p,d){Jt(t,p,d),Y(p,e,d),Y(p,r,d),j(r,i),vi(i,o[7].newProperty),n=!0,a||(s=Xt(i,"input",l),a=!0)},p(p,d){o=p,d&1&&i.value!==o[7].newProperty&&vi(i,o[7].newProperty)},i(p){n||(G(t.$$.fragment,p),n=!0)},o(p){se(t.$$.fragment,p),n=!1},d(p){p&&(W(e),W(r)),Qt(t,p),a=!1,s()}}}function ko(o){let t,e,r,i,n=o[7].property+"",a,s,l,p,d,c,u=[ta,ea],m=[];function M(g,f){return g[7].locked?0:1}return l=M(o,-1),p=m[l]=u[l](o),{c(){t=O("div"),e=O("div"),r=O("pre"),i=O("code"),a=ot(n),s=Ue(),p.c(),d=Ue(),A(r,"class","media-db-plugin-property-mapping-element-property-name"),A(e,"class","media-db-plugin-property-mapping-element-property-name-wrapper"),A(t,"class","media-db-plugin-property-mapping-element")},m(g,f){Y(g,t,f),j(t,e),j(e,r),j(r,i),j(i,a),j(t,s),m[l].m(t,null),j(t,d),c=!0},p(g,f){(!c||f&1)&&n!==(n=g[7].property+"")&&bi(a,n);let T=l;l=M(g,f),l===T?m[l].p(g,f):(lt(),se(m[T],1,1,()=>{m[T]=null}),pt(),p=m[l],p?p.p(g,f):(p=m[l]=u[l](g),p.c()),G(p,1),p.m(t,d))},i(g){c||(G(p),c=!0)},o(g){se(p),c=!1},d(g){g&&W(t),m[l].d()}}}function $o(o){var i,n;let t,e=((n=(i=o[2])==null?void 0:i.err)==null?void 0:n.message)+"",r;return{c(){t=O("div"),r=ot(e),A(t,"class","media-db-plugin-property-mapping-validation")},m(a,s){Y(a,t,s),j(t,r)},p(a,s){var l,p;s&4&&e!==(e=((p=(l=a[2])==null?void 0:l.err)==null?void 0:p.message)+"")&&bi(r,e)},d(a){a&&W(t)}}}function ra(o){var D;let t,e,r=fr(o[0].type)+"",i,n,a,s,l,p,d,c,u,m,M,g=Be(o[0].properties),f=[];for(let h=0;hse(f[h],1,1,()=>{f[h]=null}),w=!((D=o[2])!=null&&D.res)&&$o(o);return{c(){var h;t=O("div"),e=O("div"),i=ot(r),n=Ue(),a=O("div");for(let y=0;y{r.validate().res&&i(r)};return o.$$set=d=>{"model"in d&&e(0,r=d.model),"save"in d&&e(1,i=d.save)},o.$$.update=()=>{o.$$.dirty&1&&a(r)},[r,i,n,s,l,p]}var _r=class extends Ie{constructor(t){super(),Pt(this,t,oa,ra,Dt,{model:0,save:1})}},Oo=_r;function Ao(o,t,e){let r=o.slice();return r[2]=t[e],r}function No(o){let t,e;return t=new Oo({props:{model:o[2],save:o[1]}}),{c(){_i(t.$$.fragment)},m(r,i){Jt(t,r,i),e=!0},p(r,i){let n={};i&1&&(n.model=r[2]),i&2&&(n.save=r[1]),t.$set(n)},i(r){e||(G(t.$$.fragment,r),e=!0)},o(r){se(t.$$.fragment,r),e=!1},d(r){Qt(t,r)}}}function na(o){let t,e,r=Be(o[0]),i=[];for(let a=0;ase(i[a],1,1,()=>{i[a]=null});return{c(){t=O("div");for(let a=0;a{"models"in n&&e(0,r=n.models),"save"in n&&e(1,i=n.save)},[r,i]}var Sr=class extends Ie{constructor(t){super(),Pt(this,t,aa,na,Dt,{models:0,save:1})}},Bo=Sr;var Io=require("obsidian");var Z=class{constructor(){this.type=void 0,this.subType=void 0,this.title=void 0,this.englishTitle=void 0,this.year=void 0,this.dataSource=void 0,this.url=void 0,this.id=void 0,this.userData={}}toMetaDataObject(){return{...this.getWithOutUserData(),...this.userData,tags:this.getTags().join("/")}}getWithOutUserData(){let t=Object.assign({},this);return delete t.userData,t}};var ue=class extends Z{constructor(e={}){super();this.plot=void 0,this.genres=void 0,this.director=void 0,this.writer=void 0,this.studio=void 0,this.duration=void 0,this.onlineRating=void 0,this.actors=void 0,this.image=void 0,this.released=void 0,this.streamingServices=void 0,this.premiere=void 0,this.userData={watched:void 0,lastWatched:void 0,personalRating:void 0},R(this,e,this),e.hasOwnProperty("userData")||R(this.userData,e,this.userData),this.type=this.getMediaType()}getTags(){return[ie,"tv","movie"]}getMediaType(){return"movie"}getSummary(){return this.englishTitle+" ("+this.year+")"}};var Ce=class extends Z{constructor(e={}){super();this.plot=void 0,this.genres=void 0,this.writer=void 0,this.studio=void 0,this.episodes=void 0,this.duration=void 0,this.onlineRating=void 0,this.actors=void 0,this.image=void 0,this.released=void 0,this.streamingServices=void 0,this.airing=void 0,this.airedFrom=void 0,this.airedTo=void 0,this.userData={watched:void 0,lastWatched:void 0,personalRating:void 0},R(this,e,this),e.hasOwnProperty("userData")||R(this.userData,e,this.userData),this.type=this.getMediaType()}getTags(){return[ie,"tv","series"]}getMediaType(){return"series"}getSummary(){return this.title+" ("+this.year+")"}};var ct=class extends Z{constructor(e={}){super();this.plot=void 0,this.genres=void 0,this.authors=void 0,this.alternateTitles=void 0,this.chapters=void 0,this.volumes=void 0,this.onlineRating=void 0,this.image=void 0,this.released=void 0,this.status=void 0,this.publishedFrom=void 0,this.publishedTo=void 0,this.userData={watched:void 0,lastWatched:void 0,personalRating:void 0},R(this,e,this),e.hasOwnProperty("userData")||R(this.userData,e,this.userData),this.type=this.getMediaType()}getTags(){return[ie,"manga","light-novel"]}getMediaType(){return"manga"}getSummary(){return this.title+" ("+this.year+")"}};var Pe=class extends Z{constructor(e={}){super();this.genres=void 0,this.onlineRating=void 0,this.image=void 0,this.released=void 0,this.releaseDate=void 0,this.userData={played:void 0,personalRating:void 0},R(this,e,this),e.hasOwnProperty("userData")||R(this.userData,e,this.userData),this.type=this.getMediaType()}getTags(){return[ie,"game"]}getMediaType(){return"game"}getSummary(){return this.englishTitle+" ("+this.year+")"}};var ut=class extends Z{constructor(e={}){super();this.wikiUrl=void 0,this.lastUpdated=void 0,this.length=void 0,this.article=void 0,this.userData={},R(this,e,this),e.hasOwnProperty("userData")||R(this.userData,e,this.userData),this.type=this.getMediaType()}getTags(){return[ie,"wiki"]}getMediaType(){return"wiki"}getWithOutUserData(){let e=Object.assign({},this);return delete e.userData,delete e.article,e}getSummary(){return this.title}};var mt=class extends Z{constructor(e={}){super();this.genres=void 0,this.artists=void 0,this.image=void 0,this.rating=void 0,this.userData={personalRating:void 0},R(this,e,this),e.hasOwnProperty("userData")||R(this.userData,e,this.userData),this.type=this.getMediaType()}getTags(){return[ie,"music",this.subType]}getMediaType(){return"musicRelease"}getSummary(){let e=this.title+" ("+this.year+")";return this.artists.length>0&&(e+=" - "+this.artists.join(", ")),e}};var ft=class extends Z{constructor(e={}){super();this.genres=void 0,this.onlineRating=void 0,this.minPlayers=void 0,this.maxPlayers=void 0,this.playtime=void 0,this.publishers=void 0,this.complexityRating=void 0,this.image=void 0,this.released=void 0,this.userData={played:void 0,personalRating:void 0},R(this,e,this),e.hasOwnProperty("userData")||R(this.userData,e,this.userData),this.type=this.getMediaType()}getTags(){return[ie,"boardgame"]}getMediaType(){return"boardgame"}getSummary(){return this.englishTitle+" ("+this.year+")"}};var ht=class extends Z{constructor(e={}){super();this.author=void 0,this.pages=void 0,this.image=void 0,this.onlineRating=void 0,this.released=void 0,this.userData={read:void 0,lastRead:void 0,personalRating:void 0},R(this,e,this),e.hasOwnProperty("userData")||R(this.userData,e,this.userData),this.type=this.getMediaType()}getTags(){return[ie,"book"]}getMediaType(){return"book"}getSummary(){return this.englishTitle+" ("+this.year+")"}};var Fe=["movie","series","manga","game","wiki","musicRelease","boardgame","book"],Si=class{constructor(){}updateTemplates(t){this.mediaFileNameTemplateMap=new Map,this.mediaFileNameTemplateMap.set("movie",t.movieFileNameTemplate),this.mediaFileNameTemplateMap.set("series",t.seriesFileNameTemplate),this.mediaFileNameTemplateMap.set("manga",t.mangaFileNameTemplate),this.mediaFileNameTemplateMap.set("game",t.gameFileNameTemplate),this.mediaFileNameTemplateMap.set("wiki",t.wikiFileNameTemplate),this.mediaFileNameTemplateMap.set("musicRelease",t.musicReleaseFileNameTemplate),this.mediaFileNameTemplateMap.set("boardgame",t.boardgameFileNameTemplate),this.mediaFileNameTemplateMap.set("book",t.bookFileNameTemplate),this.mediaTemplateMap=new Map,this.mediaTemplateMap.set("movie",t.movieTemplate),this.mediaTemplateMap.set("series",t.seriesTemplate),this.mediaTemplateMap.set("manga",t.mangaTemplate),this.mediaTemplateMap.set("game",t.gameTemplate),this.mediaTemplateMap.set("wiki",t.wikiTemplate),this.mediaTemplateMap.set("musicRelease",t.musicReleaseTemplate),this.mediaTemplateMap.set("boardgame",t.boardgameTemplate),this.mediaTemplateMap.set("book",t.bookTemplate)}updateFolders(t){this.mediaFolderMap=new Map,this.mediaFolderMap.set("movie",t.movieFolder),this.mediaFolderMap.set("series",t.seriesFolder),this.mediaFolderMap.set("manga",t.mangaFolder),this.mediaFolderMap.set("game",t.gameFolder),this.mediaFolderMap.set("wiki",t.wikiFolder),this.mediaFolderMap.set("musicRelease",t.musicReleaseFolder),this.mediaFolderMap.set("boardgame",t.boardgameFolder),this.mediaFolderMap.set("book",t.bookFolder)}getFileName(t){return mr(this.mediaFileNameTemplateMap.get(t.getMediaType()),t)}async getTemplate(t,e){let r=this.mediaTemplateMap.get(t.getMediaType());if(!r)return"";let i=e.vault.getFiles().filter(a=>a.name===r).first();if(!i)return"";let n=await e.vault.cachedRead(i);return mr(n,t)}async getFolder(t,e){let r=this.mediaFolderMap.get(t.getMediaType());r||(r="/"),await e.vault.adapter.exists(r)||await e.vault.createFolder(r);let i=e.vault.getAbstractFileByPath(r);if(!(i instanceof Io.TFolder))throw Error(`Expected ${i} to be instance of TFolder`);return i}createMediaTypeModelFromMediaType(t,e){if(e==="movie")return new ue(t);if(e==="series")return new Ce(t);if(e==="manga")return new ct(t);if(e==="game")return new Pe(t);if(e==="wiki")return new ut(t);if(e==="musicRelease")return new mt(t);if(e==="boardgame")return new ft(t);if(e==="book")return new ht(t)}};var U={OMDbKey:"",sfwFilter:!0,useCustomYamlStringifier:!0,templates:!0,customDateFormat:"L",movieTemplate:"",seriesTemplate:"",mangaTemplate:"",gameTemplate:"",wikiTemplate:"",musicReleaseTemplate:"",boardgameTemplate:"",bookTemplate:"",movieFileNameTemplate:"{{ title }} ({{ year }})",seriesFileNameTemplate:"{{ title }} ({{ year }})",mangaFileNameTemplate:"{{ title }} ({{ year }})",gameFileNameTemplate:"{{ title }} ({{ year }})",wikiFileNameTemplate:"{{ title }}",musicReleaseFileNameTemplate:"{{ title }} (by {{ ENUM:artists }} - {{ year }})",boardgameFileNameTemplate:"{{ title }} ({{ year }})",bookFileNameTemplate:"{{ title }} ({{ year }})",moviePropertyConversionRules:"",seriesPropertyConversionRules:"",mangaPropertyConversionRules:"",gamePropertyConversionRules:"",wikiPropertyConversionRules:"",musicReleasePropertyConversionRules:"",boardgamePropertyConversionRules:"",bookPropertyConversionRules:"",movieFolder:"Media DB/movies",seriesFolder:"Media DB/series",mangaFolder:"Media DB/manga",gameFolder:"Media DB/games",wikiFolder:"Media DB/wiki",musicReleaseFolder:"Media DB/music",boardgameFolder:"Media DB/boardgames",bookFolder:"Media DB/books",propertyMappingModels:[]},sa=["type","id","dataSource"];function Lo(o){let t=U,e=[];for(let r of Fe){let n=o.mediaTypeManager.createMediaTypeModelFromMediaType({},r).toMetaDataObject(),a=new Ft(r);for(let s of Object.keys(n))a.properties.push(new dt(s,"","default",sa.contains(s)));e.push(a)}return t.propertyMappingModels=e,t}var Di=class extends P.PluginSettingTab{constructor(e,r){super(e,r);this.plugin=r}display(){let{containerEl:e}=this;e.empty(),e.createEl("h2",{text:"Media DB Plugin Settings"}),new P.Setting(e).setName("OMDb API key").setDesc('API key for "www.omdbapi.com".').addText(i=>{i.setPlaceholder("API key").setValue(this.plugin.settings.OMDbKey).onChange(n=>{this.plugin.settings.OMDbKey=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("SFW filter").setDesc("Only shows SFW results for APIs that offer filtering.").addToggle(i=>{i.setValue(this.plugin.settings.sfwFilter).onChange(n=>{this.plugin.settings.sfwFilter=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("YAML formatter").setDesc("Add optional quotation marks around strings in the metadata block.").addToggle(i=>{i.setValue(this.plugin.settings.useCustomYamlStringifier).onChange(n=>{this.plugin.settings.useCustomYamlStringifier=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Resolve {{ tags }} in templates").setDesc("Whether to resolve {{ tags }} in templates. The spaces inside the curly braces are important.").addToggle(i=>{i.setValue(this.plugin.settings.templates).onChange(n=>{this.plugin.settings.templates=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Date format").setDesc(oo("Your custom date format. Use 'YYYY-MM-DD' for example.
For more syntax, refer to format reference.
Your current syntax looks like this: "+this.plugin.dateFormatter.getPreview()+"")).addText(i=>{i.setPlaceholder(U.customDateFormat).setValue(this.plugin.settings.customDateFormat===U.customDateFormat?"":this.plugin.settings.customDateFormat).onChange(n=>{let a=n||U.customDateFormat;this.plugin.settings.customDateFormat=a,document.getElementById("media-db-dateformat-preview").textContent=this.plugin.dateFormatter.getPreview(a),this.plugin.saveSettings()})}),e.createEl("h3",{text:"New File Location"}),new P.Setting(e).setName("Movie Folder").setDesc("Where newly imported movies should be placed.").addSearch(i=>{new ye(this.app,i.inputEl),i.setPlaceholder(U.movieFolder).setValue(this.plugin.settings.movieFolder).onChange(n=>{this.plugin.settings.movieFolder=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Series Folder").setDesc("Where newly imported series should be placed.").addSearch(i=>{new ye(this.app,i.inputEl),i.setPlaceholder(U.seriesFolder).setValue(this.plugin.settings.seriesFolder).onChange(n=>{this.plugin.settings.seriesFolder=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Manga Folder").setDesc("Where newly imported manga should be placed.").addSearch(i=>{new ye(this.app,i.inputEl),i.setPlaceholder(U.mangaFolder).setValue(this.plugin.settings.mangaFolder).onChange(n=>{this.plugin.settings.mangaFolder=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Game Folder").setDesc("Where newly imported games should be placed.").addSearch(i=>{new ye(this.app,i.inputEl),i.setPlaceholder(U.gameFolder).setValue(this.plugin.settings.gameFolder).onChange(n=>{this.plugin.settings.gameFolder=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Wiki Folder").setDesc("Where newly imported wiki articles should be placed.").addSearch(i=>{new ye(this.app,i.inputEl),i.setPlaceholder(U.wikiFolder).setValue(this.plugin.settings.wikiFolder).onChange(n=>{this.plugin.settings.wikiFolder=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Music Folder").setDesc("Where newly imported music should be placed.").addSearch(i=>{new ye(this.app,i.inputEl),i.setPlaceholder(U.musicReleaseFolder).setValue(this.plugin.settings.musicReleaseFolder).onChange(n=>{this.plugin.settings.musicReleaseFolder=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Board Game Folder").setDesc("Where newly imported board games should be places.").addSearch(i=>{new ye(this.app,i.inputEl),i.setPlaceholder(U.boardgameFolder).setValue(this.plugin.settings.boardgameFolder).onChange(n=>{this.plugin.settings.boardgameFolder=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Book Folder").setDesc("Where newly imported books should be placed.").addSearch(i=>{new ye(this.app,i.inputEl),i.setPlaceholder(U.bookFolder).setValue(this.plugin.settings.bookFolder).onChange(n=>{this.plugin.settings.bookFolder=n,this.plugin.saveSettings()})}),e.createEl("h3",{text:"Template Settings"}),new P.Setting(e).setName("Movie template").setDesc("Template file to be used when creating a new note for a movie.").addSearch(i=>{new Me(this.app,i.inputEl),i.setPlaceholder("Example: movieTemplate.md").setValue(this.plugin.settings.movieTemplate).onChange(n=>{this.plugin.settings.movieTemplate=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Series template").setDesc("Template file to be used when creating a new note for a series.").addSearch(i=>{new Me(this.app,i.inputEl),i.setPlaceholder("Example: seriesTemplate.md").setValue(this.plugin.settings.seriesTemplate).onChange(n=>{this.plugin.settings.seriesTemplate=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Manga template").setDesc("Template file to be used when creating a new note for a manga.").addSearch(i=>{new Me(this.app,i.inputEl),i.setPlaceholder("Example: mangaTemplate.md").setValue(this.plugin.settings.mangaTemplate).onChange(n=>{this.plugin.settings.mangaTemplate=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Game template").setDesc("Template file to be used when creating a new note for a game.").addSearch(i=>{new Me(this.app,i.inputEl),i.setPlaceholder("Example: gameTemplate.md").setValue(this.plugin.settings.gameTemplate).onChange(n=>{this.plugin.settings.gameTemplate=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Wiki template").setDesc("Template file to be used when creating a new note for a wiki entry.").addSearch(i=>{new Me(this.app,i.inputEl),i.setPlaceholder("Example: wikiTemplate.md").setValue(this.plugin.settings.wikiTemplate).onChange(n=>{this.plugin.settings.wikiTemplate=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Music Release template").setDesc("Template file to be used when creating a new note for a music release.").addSearch(i=>{new Me(this.app,i.inputEl),i.setPlaceholder("Example: musicReleaseTemplate.md").setValue(this.plugin.settings.musicReleaseTemplate).onChange(n=>{this.plugin.settings.musicReleaseTemplate=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Board Game template").setDesc("Template file to be used when creating a new note for a boardgame.").addSearch(i=>{new Me(this.app,i.inputEl),i.setPlaceholder("Example: boardgameTemplate.md").setValue(this.plugin.settings.boardgameTemplate).onChange(n=>{this.plugin.settings.boardgameTemplate=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Book template").setDesc("Template file to be used when creating a new note for a book.").addSearch(i=>{new Me(this.app,i.inputEl),i.setPlaceholder("Example: bookTemplate.md").setValue(this.plugin.settings.bookTemplate).onChange(n=>{this.plugin.settings.bookTemplate=n,this.plugin.saveSettings()})}),e.createEl("h3",{text:"File Name Settings"}),new P.Setting(e).setName("Movie file name template").setDesc("Template for the file name used when creating a new note for a movie.").addText(i=>{i.setPlaceholder(`Example: ${U.movieFileNameTemplate}`).setValue(this.plugin.settings.movieFileNameTemplate).onChange(n=>{this.plugin.settings.movieFileNameTemplate=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Series file name template").setDesc("Template for the file name used when creating a new note for a series.").addText(i=>{i.setPlaceholder(`Example: ${U.seriesFileNameTemplate}`).setValue(this.plugin.settings.seriesFileNameTemplate).onChange(n=>{this.plugin.settings.seriesFileNameTemplate=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Manga file name template").setDesc("Template for the file name used when creating a new note for a manga.").addText(i=>{i.setPlaceholder(`Example: ${U.mangaFileNameTemplate}`).setValue(this.plugin.settings.mangaFileNameTemplate).onChange(n=>{this.plugin.settings.mangaFileNameTemplate=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Game file name template").setDesc("Template for the file name used when creating a new note for a game.").addText(i=>{i.setPlaceholder(`Example: ${U.gameFileNameTemplate}`).setValue(this.plugin.settings.gameFileNameTemplate).onChange(n=>{this.plugin.settings.gameFileNameTemplate=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Wiki file name template").setDesc("Template for the file name used when creating a new note for a wiki entry.").addText(i=>{i.setPlaceholder(`Example: ${U.wikiFileNameTemplate}`).setValue(this.plugin.settings.wikiFileNameTemplate).onChange(n=>{this.plugin.settings.wikiFileNameTemplate=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Music Release file name template").setDesc("Template for the file name used when creating a new note for a music release.").addText(i=>{i.setPlaceholder(`Example: ${U.musicReleaseFileNameTemplate}`).setValue(this.plugin.settings.musicReleaseFileNameTemplate).onChange(n=>{this.plugin.settings.musicReleaseFileNameTemplate=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Board Game file name template").setDesc("Template for the file name used when creating a new note for a boardgame.").addText(i=>{i.setPlaceholder(`Example: ${U.boardgameFileNameTemplate}`).setValue(this.plugin.settings.boardgameFileNameTemplate).onChange(n=>{this.plugin.settings.boardgameFileNameTemplate=n,this.plugin.saveSettings()})}),new P.Setting(e).setName("Book file name template").setDesc("Template for the file name used when creating a new note for a book.").addText(i=>{i.setPlaceholder(`Example: ${U.bookFileNameTemplate}`).setValue(this.plugin.settings.bookFileNameTemplate).onChange(n=>{this.plugin.settings.bookFileNameTemplate=n,this.plugin.saveSettings()})}),e.createEl("h3",{text:"Property Mappings"});let r=e.createEl("div");r.innerHTML=`

Allow you to remap the metadata fields of newly created media db entries.

The different options are: @@ -3707,2200 +25,15 @@ var MediaDbSettingTab = class extends import_obsidian6.PluginSettingTab {

Don't forget to save your changes using the save button for each individual category. -

`; - new PropertyMappingModelsComponent_default({ - target: this.containerEl, - props: { - models: this.plugin.settings.propertyMappingModels.map((x) => x.copy()), - save: (model) => { - const propertyMappingModels = []; - for (const model2 of this.plugin.settings.propertyMappingModels) { - if (model2.type === model.type) { - propertyMappingModels.push(model); - } else { - propertyMappingModels.push(model2); - } - } - this.plugin.settings.propertyMappingModels = propertyMappingModels; - new import_obsidian6.Notice(`MDB: Property Mappings for ${model.type} saved successfully.`); - this.plugin.saveSettings(); - } - } - }); - } -}; - -// src/api/APIManager.ts -var APIManager = class { - constructor() { - this.apis = []; - } - query(query, apisToQuery) { - return __async(this, null, function* () { - console.debug(`MDB | api manager queried with "${query}"`); - let res = []; - for (const api of this.apis) { - if (apisToQuery.contains(api.apiName)) { - const apiRes = yield api.searchByTitle(query); - res = res.concat(apiRes); - } - } - return res; - }); - } - queryDetailedInfo(item) { - return __async(this, null, function* () { - return yield this.queryDetailedInfoById(item.id, item.dataSource); - }); - } - queryDetailedInfoById(id, apiName) { - return __async(this, null, function* () { - for (const api of this.apis) { - if (api.apiName === apiName) { - return api.getById(id); - } - } - }); - } - getApiByName(name) { - for (const api of this.apis) { - if (api.apiName === name) { - return api; - } - } - return null; - } - registerAPI(api) { - this.apis.push(api); - } -}; - -// src/api/APIModel.ts -var APIModel = class { - hasType(type) { - return this.types.contains(type); - } - hasTypeOverlap(types) { - for (const type of types) { - if (this.hasType(type)) { - return true; - } - } - return false; - } -}; - -// src/api/apis/OMDbAPI.ts -var OMDbAPI = class extends APIModel { - constructor(plugin) { - super(); - this.plugin = plugin; - this.apiName = "OMDbAPI"; - this.apiDescription = "A free API for Movies, Series and Games."; - this.apiUrl = "http://www.omdbapi.com/"; - this.types = [MediaType.Movie, MediaType.Series, MediaType.Game]; - this.typeMappings = new Map(); - this.typeMappings.set("movie", "movie"); - this.typeMappings.set("series", "series"); - this.typeMappings.set("game", "game"); - } - searchByTitle(title) { - return __async(this, null, function* () { - console.log(`MDB | api "${this.apiName}" queried by Title`); - const searchUrl = `http://www.omdbapi.com/?s=${encodeURIComponent(title)}&apikey=${this.plugin.settings.OMDbKey}`; - const fetchData = yield fetch(searchUrl); - if (fetchData.status === 401) { - throw Error(`MDB | Authentication for ${this.apiName} failed. Check the API key.`); - } - if (fetchData.status !== 200) { - throw Error(`MDB | Received status code ${fetchData.status} from an API.`); - } - const data = yield fetchData.json(); - if (data.Response === "False") { - if (data.Error === "Movie not found!") { - return []; - } - throw Error(`MDB | Received error from ${this.apiName}: -${JSON.stringify(data, void 0, 4)}`); - } - if (!data.Search) { - return []; - } - console.debug(data.Search); - const ret = []; - for (const result of data.Search) { - const type = this.typeMappings.get(result.Type.toLowerCase()); - if (type === void 0) { - continue; - } - if (type === "movie") { - ret.push(new MovieModel({ - type, - title: result.Title, - englishTitle: result.Title, - year: result.Year, - dataSource: this.apiName, - id: result.imdbID - })); - } else if (type === "series") { - ret.push(new SeriesModel({ - type, - title: result.Title, - englishTitle: result.Title, - year: result.Year, - dataSource: this.apiName, - id: result.imdbID - })); - } else if (type === "game") { - ret.push(new GameModel({ - type, - title: result.Title, - englishTitle: result.Title, - year: result.Year, - dataSource: this.apiName, - id: result.imdbID - })); - } - } - return ret; - }); - } - getById(id) { - return __async(this, null, function* () { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v; - console.log(`MDB | api "${this.apiName}" queried by ID`); - const searchUrl = `http://www.omdbapi.com/?i=${encodeURIComponent(id)}&apikey=${this.plugin.settings.OMDbKey}`; - const fetchData = yield fetch(searchUrl); - if (fetchData.status === 401) { - throw Error(`MDB | Authentication for ${this.apiName} failed. Check the API key.`); - } - if (fetchData.status !== 200) { - throw Error(`MDB | Received status code ${fetchData.status} from an API.`); - } - const result = yield fetchData.json(); - if (result.Response === "False") { - throw Error(`MDB | Received error from ${this.apiName}: ${result.Error}`); - } - const type = this.typeMappings.get(result.Type.toLowerCase()); - if (type === void 0) { - throw Error(`${result.type.toLowerCase()} is an unsupported type.`); - } - if (type === "movie") { - const model = new MovieModel({ - type, - title: result.Title, - englishTitle: result.Title, - year: result.Year, - dataSource: this.apiName, - url: `https://www.imdb.com/title/${result.imdbID}/`, - id: result.imdbID, - genres: (_b = (_a = result.Genre) == null ? void 0 : _a.split(", ")) != null ? _b : [], - producer: (_c = result.Director) != null ? _c : "unknown", - duration: (_d = result.Runtime) != null ? _d : "unknown", - onlineRating: Number.parseFloat((_e = result.imdbRating) != null ? _e : 0), - actors: (_g = (_f = result.Actors) == null ? void 0 : _f.split(", ")) != null ? _g : [], - image: (_h = result.Poster) != null ? _h : "", - released: true, - streamingServices: [], - premiere: (_i = new Date(result.Released).toLocaleDateString()) != null ? _i : "unknown", - userData: { - watched: false, - lastWatched: "", - personalRating: 0 - } - }); - return model; - } else if (type === "series") { - const model = new SeriesModel({ - type, - title: result.Title, - englishTitle: result.Title, - year: result.Year, - dataSource: this.apiName, - url: `https://www.imdb.com/title/${result.imdbID}/`, - id: result.imdbID, - genres: (_k = (_j = result.Genre) == null ? void 0 : _j.split(", ")) != null ? _k : [], - studios: [result.Director], - episodes: 0, - duration: (_l = result.Runtime) != null ? _l : "unknown", - onlineRating: Number.parseFloat((_m = result.imdbRating) != null ? _m : 0), - actors: (_o = (_n = result.Actors) == null ? void 0 : _n.split(", ")) != null ? _o : [], - image: (_p = result.Poster) != null ? _p : "", - released: true, - streamingServices: [], - airing: false, - airedFrom: (_q = new Date(result.Released).toLocaleDateString()) != null ? _q : "unknown", - airedTo: "unknown", - userData: { - watched: false, - lastWatched: "", - personalRating: 0 - } - }); - return model; - } else if (type === "game") { - const model = new GameModel({ - type, - title: result.Title, - englishTitle: result.Title, - year: result.Year, - dataSource: this.apiName, - url: `https://www.imdb.com/title/${result.imdbID}/`, - id: result.imdbID, - genres: (_s = (_r = result.Genre) == null ? void 0 : _r.split(", ")) != null ? _s : [], - onlineRating: Number.parseFloat((_t = result.imdbRating) != null ? _t : 0), - image: (_u = result.Poster) != null ? _u : "", - released: true, - releaseDate: (_v = new Date(result.Released).toLocaleDateString()) != null ? _v : "unknown", - userData: { - played: false, - personalRating: 0 - } - }); - return model; - } - return; - }); - } -}; - -// src/api/apis/MALAPI.ts -var MALAPI = class extends APIModel { - constructor(plugin) { - super(); - this.plugin = plugin; - this.apiName = "MALAPI"; - this.apiDescription = "A free API for Anime. Some results may take a long time to load."; - this.apiUrl = "https://jikan.moe/"; - this.types = [MediaType.Movie, MediaType.Series]; - this.typeMappings = new Map(); - this.typeMappings.set("movie", "movie"); - this.typeMappings.set("special", "special"); - this.typeMappings.set("tv", "series"); - this.typeMappings.set("ova", "ova"); - } - searchByTitle(title) { - return __async(this, null, function* () { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s; - console.log(`MDB | api "${this.apiName}" queried by Title`); - const searchUrl = `https://api.jikan.moe/v4/anime?q=${encodeURIComponent(title)}&limit=20${this.plugin.settings.sfwFilter ? "&sfw" : ""}`; - const fetchData = yield fetch(searchUrl); - console.debug(fetchData); - if (fetchData.status !== 200) { - throw Error(`MDB | Received status code ${fetchData.status} from an API.`); - } - const data = yield fetchData.json(); - console.debug(data); - const ret = []; - for (const result of data.data) { - const type = this.typeMappings.get((_a = result.type) == null ? void 0 : _a.toLowerCase()); - if (type === void 0) { - ret.push(new MovieModel({ - subType: "", - title: result.title, - englishTitle: (_b = result.title_english) != null ? _b : result.title, - year: (_g = (_f = result.year) != null ? _f : (_e = (_d = (_c = result.aired) == null ? void 0 : _c.prop) == null ? void 0 : _d.from) == null ? void 0 : _e.year) != null ? _g : "", - dataSource: this.apiName, - id: result.mal_id - })); - } - if (type === "movie" || type === "special") { - ret.push(new MovieModel({ - subType: type, - title: result.title, - englishTitle: (_h = result.title_english) != null ? _h : result.title, - year: (_m = (_l = result.year) != null ? _l : (_k = (_j = (_i = result.aired) == null ? void 0 : _i.prop) == null ? void 0 : _j.from) == null ? void 0 : _k.year) != null ? _m : "", - dataSource: this.apiName, - id: result.mal_id - })); - } else if (type === "series" || type === "ova") { - ret.push(new SeriesModel({ - subType: type, - title: result.title, - englishTitle: (_n = result.title_english) != null ? _n : result.title, - year: (_s = (_r = result.year) != null ? _r : (_q = (_p = (_o = result.aired) == null ? void 0 : _o.prop) == null ? void 0 : _p.from) == null ? void 0 : _q.year) != null ? _s : "", - dataSource: this.apiName, - id: result.mal_id - })); - } - } - return ret; - }); - } - getById(id) { - return __async(this, null, function* () { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa; - console.log(`MDB | api "${this.apiName}" queried by ID`); - const searchUrl = `https://api.jikan.moe/v4/anime/${encodeURIComponent(id)}/full`; - const fetchData = yield fetch(searchUrl); - if (fetchData.status !== 200) { - throw Error(`MDB | Received status code ${fetchData.status} from an API.`); - } - const data = yield fetchData.json(); - console.debug(data); - const result = data.data; - const type = this.typeMappings.get((_a = result.type) == null ? void 0 : _a.toLowerCase()); - if (type === void 0) { - const model = new MovieModel({ - subType: "", - title: result.title, - englishTitle: (_b = result.title_english) != null ? _b : result.title, - year: (_g = (_f = result.year) != null ? _f : (_e = (_d = (_c = result.aired) == null ? void 0 : _c.prop) == null ? void 0 : _d.from) == null ? void 0 : _e.year) != null ? _g : "", - dataSource: this.apiName, - url: result.url, - id: result.mal_id, - genres: (_i = (_h = result.genres) == null ? void 0 : _h.map((x) => x.name)) != null ? _i : [], - producer: (_k = (_j = result.studios) == null ? void 0 : _j.map((x) => x.name).join(", ")) != null ? _k : "unknown", - duration: (_l = result.duration) != null ? _l : "unknown", - onlineRating: (_m = result.score) != null ? _m : 0, - actors: [], - image: (_p = (_o = (_n = result.images) == null ? void 0 : _n.jpg) == null ? void 0 : _o.image_url) != null ? _p : "", - released: true, - premiere: (_r = new Date((_q = result.aired) == null ? void 0 : _q.from).toLocaleDateString()) != null ? _r : "unknown", - streamingServices: (_t = (_s = result.streaming) == null ? void 0 : _s.map((x) => x.name)) != null ? _t : [], - userData: { - watched: false, - lastWatched: "", - personalRating: 0 - } - }); - return model; - } - if (type === "movie" || type === "special") { - const model = new MovieModel({ - subType: type, - title: result.title, - englishTitle: (_u = result.title_english) != null ? _u : result.title, - year: (_z = (_y = result.year) != null ? _y : (_x = (_w = (_v = result.aired) == null ? void 0 : _v.prop) == null ? void 0 : _w.from) == null ? void 0 : _x.year) != null ? _z : "", - dataSource: this.apiName, - url: result.url, - id: result.mal_id, - genres: (_B = (_A = result.genres) == null ? void 0 : _A.map((x) => x.name)) != null ? _B : [], - producer: (_D = (_C = result.studios) == null ? void 0 : _C.map((x) => x.name).join(", ")) != null ? _D : "unknown", - duration: (_E = result.duration) != null ? _E : "unknown", - onlineRating: (_F = result.score) != null ? _F : 0, - actors: [], - image: (_I = (_H = (_G = result.images) == null ? void 0 : _G.jpg) == null ? void 0 : _H.image_url) != null ? _I : "", - released: true, - premiere: (_K = new Date((_J = result.aired) == null ? void 0 : _J.from).toLocaleDateString()) != null ? _K : "unknown", - streamingServices: (_M = (_L = result.streaming) == null ? void 0 : _L.map((x) => x.name)) != null ? _M : [], - userData: { - watched: false, - lastWatched: "", - personalRating: 0 - } - }); - return model; - } else if (type === "series" || type === "ova") { - const model = new SeriesModel({ - subType: type, - title: result.title, - englishTitle: (_N = result.title_english) != null ? _N : result.title, - year: (_S = (_R = result.year) != null ? _R : (_Q = (_P = (_O = result.aired) == null ? void 0 : _O.prop) == null ? void 0 : _P.from) == null ? void 0 : _Q.year) != null ? _S : "", - dataSource: this.apiName, - url: result.url, - id: result.mal_id, - genres: (_U = (_T = result.genres) == null ? void 0 : _T.map((x) => x.name)) != null ? _U : [], - studios: (_W = (_V = result.studios) == null ? void 0 : _V.map((x) => x.name)) != null ? _W : [], - episodes: result.episodes, - duration: (_X = result.duration) != null ? _X : "unknown", - onlineRating: (_Y = result.score) != null ? _Y : 0, - streamingServices: (__ = (_Z = result.streaming) == null ? void 0 : _Z.map((x) => x.name)) != null ? __ : [], - image: (_ba = (_aa = (_$ = result.images) == null ? void 0 : _$.jpg) == null ? void 0 : _aa.image_url) != null ? _ba : "", - released: true, - airedFrom: (_da = new Date((_ca = result.aired) == null ? void 0 : _ca.from).toLocaleDateString()) != null ? _da : "unknown", - airedTo: (_fa = new Date((_ea = result.aired) == null ? void 0 : _ea.to).toLocaleDateString()) != null ? _fa : "unknown", - airing: result.airing, - userData: { - watched: false, - lastWatched: "", - personalRating: 0 - } - }); - return model; - } - return; - }); - } -}; - -// src/api/apis/WikipediaAPI.ts -var WikipediaAPI = class extends APIModel { - constructor(plugin) { - super(); - this.plugin = plugin; - this.apiName = "Wikipedia API"; - this.apiDescription = "The API behind Wikipedia"; - this.apiUrl = "https://www.wikipedia.com"; - this.types = [MediaType.Wiki]; - } - searchByTitle(title) { - return __async(this, null, function* () { - console.log(`MDB | api "${this.apiName}" queried by Title`); - const searchUrl = `https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=${encodeURIComponent(title)}&srlimit=20&utf8=&format=json&origin=*`; - const fetchData = yield fetch(searchUrl); - console.debug(fetchData); - if (fetchData.status !== 200) { - throw Error(`MDB | Received status code ${fetchData.status} from an API.`); - } - const data = yield fetchData.json(); - console.debug(data); - const ret = []; - for (const result of data.query.search) { - ret.push(new WikiModel({ - type: "wiki", - title: result.title, - englishTitle: result.title, - year: "", - dataSource: this.apiName, - id: result.pageid - })); - } - return ret; - }); - } - getById(id) { - return __async(this, null, function* () { - var _a, _b; - console.log(`MDB | api "${this.apiName}" queried by ID`); - const searchUrl = `https://en.wikipedia.org/w/api.php?action=query&prop=info&pageids=${encodeURIComponent(id)}&inprop=url&format=json&origin=*`; - const fetchData = yield fetch(searchUrl); - if (fetchData.status !== 200) { - throw Error(`MDB | Received status code ${fetchData.status} from an API.`); - } - const data = yield fetchData.json(); - console.debug(data); - const result = Object.entries((_a = data == null ? void 0 : data.query) == null ? void 0 : _a.pages)[0][1]; - const model = new WikiModel({ - type: "wiki", - title: result.title, - englishTitle: result.title, - year: "", - dataSource: this.apiName, - url: result.fullurl, - id: result.pageid, - wikiUrl: result.fullurl, - lastUpdated: (_b = new Date(result.touched).toLocaleDateString()) != null ? _b : "unknown", - length: result.length, - userData: {} - }); - return model; - }); - } -}; - -// src/api/apis/MusicBrainzAPI.ts -var import_obsidian7 = __toModule(require("obsidian")); -var MusicBrainzAPI = class extends APIModel { - constructor(plugin) { - super(); - this.plugin = plugin; - this.apiName = "MusicBrainz API"; - this.apiDescription = "Free API for music albums."; - this.apiUrl = "https://musicbrainz.org/"; - this.types = [MediaType.MusicRelease]; - } - searchByTitle(title) { - return __async(this, null, function* () { - console.log(`MDB | api "${this.apiName}" queried by Title`); - const searchUrl = `https://musicbrainz.org/ws/2/release-group?query=${encodeURIComponent(title)}&limit=20&fmt=json`; - const fetchData = yield (0, import_obsidian7.requestUrl)({ - url: searchUrl, - headers: { - "User-Agent": `${pluginName}/${mediaDbVersion} (${contactEmail})` - } - }); - console.debug(fetchData); - if (fetchData.status !== 200) { - throw Error(`MDB | Received status code ${fetchData.status} from an API.`); - } - const data = yield fetchData.json; - console.debug(data); - const ret = []; - for (const result of data["release-groups"]) { - ret.push(new MusicReleaseModel({ - type: "musicRelease", - title: result.title, - englishTitle: result.title, - year: new Date(result["first-release-date"]).getFullYear().toString(), - dataSource: this.apiName, - url: "", - id: result.id, - artists: result["artist-credit"].map((a) => a.name), - subType: result["primary-type"] - })); - } - return ret; - }); - } - getById(id) { - return __async(this, null, function* () { - console.log(`MDB | api "${this.apiName}" queried by ID`); - const searchUrl = `https://musicbrainz.org/ws/2/release-group/${encodeURIComponent(id)}?inc=releases+artists+tags+ratings+genres&fmt=json`; - const fetchData = yield (0, import_obsidian7.requestUrl)({ - url: searchUrl, - headers: { - "User-Agent": `${pluginName}/${mediaDbVersion} (${contactEmail})` - } - }); - if (fetchData.status !== 200) { - throw Error(`MDB | Received status code ${fetchData.status} from an API.`); - } - const data = yield fetchData.json; - console.debug(data); - const result = data; - const model = new MusicReleaseModel({ - type: "musicRelease", - title: result.title, - englishTitle: result.title, - year: new Date(result["first-release-date"]).getFullYear().toString(), - dataSource: this.apiName, - url: "", - id: result.id, - artists: result["artist-credit"].map((a) => a.name), - genres: result.genres.map((g) => g.name), - subType: result["primary-type"], - rating: result.rating.value * 2, - userData: { - personalRating: 0 - } - }); - return model; - }); - } -}; - -// src/api/apis/SteamAPI.ts -var import_obsidian8 = __toModule(require("obsidian")); -var SteamAPI = class extends APIModel { - constructor(plugin) { - super(); - this.plugin = plugin; - this.apiName = "SteamAPI"; - this.apiDescription = "A free API for all Steam games."; - this.apiUrl = "http://www.steampowered.com/"; - this.types = [MediaType.Game]; - this.typeMappings = new Map(); - this.typeMappings.set("game", "game"); - } - searchByTitle(title) { - return __async(this, null, function* () { - console.log(`MDB | api "${this.apiName}" queried by Title`); - const searchUrl = `http://api.steampowered.com/ISteamApps/GetAppList/v0002/?format=json`; - const fetchData = yield (0, import_obsidian8.requestUrl)({ - url: searchUrl - }); - if (fetchData.status !== 200) { - throw Error(`MDB | Received status code ${fetchData.status} from an API.`); - } - const data = yield fetchData.json; - console.debug(data); - const filteredData = []; - for (const app of data.applist.apps) { - if (app.name.toLowerCase().includes(title.toLowerCase())) { - filteredData.push(app); - } - if (filteredData.length > 20) { - break; - } - } - const ret = []; - for (const result of filteredData) { - ret.push(new GameModel({ - type: MediaType.Game, - title: result.name, - englishTitle: result.name, - year: "", - dataSource: this.apiName, - id: result.appid - })); - } - return ret; - }); - } - getById(id) { - return __async(this, null, function* () { - var _a, _b, _c, _d, _e, _f, _g, _h; - console.log(`MDB | api "${this.apiName}" queried by ID`); - const searchUrl = `http://store.steampowered.com/api/appdetails?appids=${encodeURIComponent(id)}&l=en`; - const fetchData = yield (0, import_obsidian8.requestUrl)({ - url: searchUrl - }); - if (fetchData.status !== 200) { - throw Error(`MDB | Received status code ${fetchData.status} from an API.`); - } - console.debug(yield fetchData.json); - let result; - for (const [key, value] of Object.entries(yield fetchData.json)) { - if (key === String(id)) { - result = value.data; - } - } - if (!result) { - throw Error(`MDB | API returned invalid data.`); - } - console.debug(result); - const model = new GameModel({ - type: MediaType.Game, - title: result.name, - englishTitle: result.name, - year: new Date(result.release_date.date).getFullYear().toString(), - dataSource: this.apiName, - url: `https://store.steampowered.com/app/${result.steam_appid}`, - id: result.steam_appid, - genres: (_b = (_a = result.genres) == null ? void 0 : _a.map((x) => x.description)) != null ? _b : [], - onlineRating: Number.parseFloat((_d = (_c = result.metacritic) == null ? void 0 : _c.score) != null ? _d : 0), - image: (_e = result.header_image) != null ? _e : "", - released: !((_f = result.release_date) == null ? void 0 : _f.comming_soon), - releaseDate: (_h = new Date((_g = result.release_date) == null ? void 0 : _g.date).toLocaleDateString()) != null ? _h : "unknown", - userData: { - played: false, - personalRating: 0 - } - }); - return model; - }); - } -}; - -// src/api/apis/BoardGameGeekAPI.ts -var import_obsidian9 = __toModule(require("obsidian")); -var BoardGameGeekAPI = class extends APIModel { - constructor(plugin) { - super(); - this.plugin = plugin; - this.apiName = "BoardGameGeekAPI"; - this.apiDescription = "A free API for BoardGameGeek things."; - this.apiUrl = "https://api.geekdo.com/xmlapi"; - this.types = [MediaType.BoardGame]; - } - searchByTitle(title) { - return __async(this, null, function* () { - var _a, _b, _c, _d; - console.log(`MDB | api "${this.apiName}" queried by Title`); - const searchUrl = `${this.apiUrl}/search?search=${encodeURIComponent(title)}`; - const fetchData = yield (0, import_obsidian9.requestUrl)({ - url: searchUrl - }); - if (fetchData.status !== 200) { - throw Error(`MDB | Received status code ${fetchData.status} from an API.`); - } - const data = fetchData.text; - const response = new window.DOMParser().parseFromString(data, "text/xml"); - console.debug(response); - const ret = []; - for (const boardgame of Array.from(response.querySelectorAll("boardgame"))) { - const id = boardgame.attributes.getNamedItem("objectid").value; - const title2 = (_b = (_a = boardgame.querySelector("name[primary=true]")) == null ? void 0 : _a.textContent) != null ? _b : boardgame.querySelector("name").textContent; - const year = (_d = (_c = boardgame.querySelector("yearpublished")) == null ? void 0 : _c.textContent) != null ? _d : ""; - ret.push(new BoardGameModel({ - dataSource: this.apiName, - id, - title: title2, - englishTitle: title2, - year - })); - } - return ret; - }); - } - getById(id) { - return __async(this, null, function* () { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n; - console.log(`MDB | api "${this.apiName}" queried by ID`); - const searchUrl = `${this.apiUrl}/boardgame/${encodeURIComponent(id)}?stats=1`; - const fetchData = yield (0, import_obsidian9.requestUrl)({ - url: searchUrl - }); - if (fetchData.status !== 200) { - throw Error(`MDB | Received status code ${fetchData.status} from an API.`); - } - const data = fetchData.text; - const response = new window.DOMParser().parseFromString(data, "text/xml"); - console.debug(response); - const boardgame = response.querySelector("boardgame"); - const title = boardgame.querySelector("name[primary=true]").textContent; - const year = (_b = (_a = boardgame.querySelector("yearpublished")) == null ? void 0 : _a.textContent) != null ? _b : ""; - const image = (_d = (_c = boardgame.querySelector("image")) == null ? void 0 : _c.textContent) != null ? _d : void 0; - const onlineRating = Number.parseFloat((_f = (_e = boardgame.querySelector("statistics ratings average")) == null ? void 0 : _e.textContent) != null ? _f : "0"); - const genres = Array.from(boardgame.querySelectorAll("boardgamecategory")).map((n) => n.textContent); - const complexityRating = Number.parseFloat((_h = (_g = boardgame.querySelector("averageweight")) == null ? void 0 : _g.textContent) != null ? _h : "0"); - const minPlayers = Number.parseFloat((_j = (_i = boardgame.querySelector("minplayers")) == null ? void 0 : _i.textContent) != null ? _j : "0"); - const maxPlayers = Number.parseFloat((_l = (_k = boardgame.querySelector("maxplayers")) == null ? void 0 : _k.textContent) != null ? _l : "0"); - const playtime = ((_n = (_m = boardgame.querySelector("playingtime")) == null ? void 0 : _m.textContent) != null ? _n : "unknown") + " minutes"; - const publishers = Array.from(boardgame.querySelectorAll("boardgamepublisher")).map((n) => n.textContent); - const model = new BoardGameModel({ - title, - englishTitle: title, - year: year === "0" ? "" : year, - dataSource: this.apiName, - url: `https://boardgamegeek.com/boardgame/${id}`, - id, - genres, - onlineRating, - complexityRating, - minPlayers, - maxPlayers, - playtime, - publishers, - image, - released: true, - userData: { - played: false, - personalRating: 0 - } - }); - return model; - }); - } -}; - -// src/settings/PropertyMapper.ts -var PropertyMapper = class { - constructor(plugin) { - this.plugin = plugin; - } - convertObject(obj) { - if (!obj.hasOwnProperty("type")) { - return obj; - } - if (MEDIA_TYPES.filter((x) => x.toString() == obj.type).length < 1) { - return obj; - } - const propertyMappings = this.plugin.settings.propertyMappingModels.find((x) => x.type === obj.type).properties; - const newObj = {}; - for (const [key, value] of Object.entries(obj)) { - for (const propertyMapping of propertyMappings) { - if (propertyMapping.property === key) { - if (propertyMapping.mapping === PropertyMappingOption.Map) { - newObj[propertyMapping.newProperty] = value; - } else if (propertyMapping.mapping === PropertyMappingOption.Remove) { - } else if (propertyMapping.mapping === PropertyMappingOption.Default) { - newObj[key] = value; - } - break; - } - } - } - return newObj; - } - convertObjectBack(obj) { - if (!obj.hasOwnProperty("type")) { - return obj; - } - if (MEDIA_TYPES.contains(obj.type)) { - return obj; - } - const propertyMappings = this.plugin.settings.propertyMappingModels.find((x) => x.type === obj.type).properties; - const originalObj = {}; - objLoop: - for (const [key, value] of Object.entries(obj)) { - for (const propertyMapping of propertyMappings) { - if (propertyMapping.property === key) { - originalObj[key] = value; - continue objLoop; - } - } - for (const propertyMapping of propertyMappings) { - if (propertyMapping.newProperty === key) { - originalObj[propertyMapping.property] = value; - continue objLoop; - } - } - } - return originalObj; - } -}; - -// src/utils/YAMLConverter.ts -var YAMLConverter = class { - static toYaml(obj) { - let output = ""; - for (const [key, value] of Object.entries(obj)) { - output += `${key}: ${YAMLConverter.toYamlString(value, 0)} -`; - } - return output; - } - static toYamlString(value, indentation) { - if (value == null) { - return "null"; - } - if (typeof value === "boolean") { - return value ? "true" : "false"; - } else if (typeof value === "number") { - return value.toString(); - } else if (typeof value === "string") { - return '"' + value.replace('"', '\\"') + '"'; - } else if (typeof value === "object") { - let output = ""; - if (Array.isArray(value)) { - for (const valueElement of value) { - output += ` -${YAMLConverter.calculateSpacing(indentation)} - ${YAMLConverter.toYamlString(valueElement, indentation + 1)}`; - } - } else { - for (const [objKey, objValue] of Object.entries(value)) { - output += ` -${YAMLConverter.calculateSpacing(indentation)} ${objKey}: ${YAMLConverter.toYamlString(objValue, indentation + 1)}`; - } - } - return output; - } - } - static calculateSpacing(indentation) { - return " ".repeat(indentation * 4); - } -}; - -// src/modals/MediaDbFolderImportModal.ts -var import_obsidian10 = __toModule(require("obsidian")); -var MediaDbFolderImportModal = class extends import_obsidian10.Modal { - constructor(app, plugin, onSubmit) { - super(app); - this.plugin = plugin; - this.onSubmit = onSubmit; - this.selectedApi = plugin.apiManager.apis[0].apiName; - } - submit() { - this.onSubmit(this.selectedApi, this.titleFieldName, this.appendContent); - this.close(); - } - onOpen() { - const { contentEl } = this; - contentEl.createEl("h2", { text: "Import folder as Media DB entries" }); - const apiSelectorWrapper = contentEl.createEl("div", { cls: "media-db-plugin-list-wrapper" }); - const apiSelectorTextWrapper = apiSelectorWrapper.createEl("div", { cls: "media-db-plugin-list-text-wrapper" }); - apiSelectorTextWrapper.createEl("span", { text: "API to search", cls: "media-db-plugin-list-text" }); - const apiSelectorComponent = new import_obsidian10.DropdownComponent(apiSelectorWrapper); - apiSelectorComponent.onChange((value) => { - this.selectedApi = value; - }); - for (const api of this.plugin.apiManager.apis) { - apiSelectorComponent.addOption(api.apiName, api.apiName); - } - apiSelectorWrapper.appendChild(apiSelectorComponent.selectEl); - contentEl.createDiv({ cls: "media-db-plugin-spacer" }); - contentEl.createEl("h3", { text: "Append note content to Media DB entry." }); - const appendContentToggleElementWrapper = contentEl.createEl("div", { cls: "media-db-plugin-list-wrapper" }); - const appendContentToggleTextWrapper = appendContentToggleElementWrapper.createEl("div", { cls: "media-db-plugin-list-text-wrapper" }); - appendContentToggleTextWrapper.createEl("span", { - text: "If this is enabled, the plugin will override metadata fields with the same name.", - cls: "media-db-plugin-list-text" - }); - const appendContentToggleComponentWrapper = appendContentToggleElementWrapper.createEl("div", { cls: "media-db-plugin-list-toggle" }); - const appendContentToggle = new import_obsidian10.ToggleComponent(appendContentToggleElementWrapper); - appendContentToggle.setValue(false); - appendContentToggle.onChange((value) => this.appendContent = value); - appendContentToggleComponentWrapper.appendChild(appendContentToggle.toggleEl); - contentEl.createDiv({ cls: "media-db-plugin-spacer" }); - contentEl.createEl("h3", { text: "The name of the metadata field that should be used as the title to query." }); - const placeholder = "title"; - const titleFieldNameComponent = new import_obsidian10.TextComponent(contentEl); - titleFieldNameComponent.inputEl.style.width = "100%"; - titleFieldNameComponent.setPlaceholder(placeholder); - titleFieldNameComponent.onChange((value) => this.titleFieldName = value); - titleFieldNameComponent.inputEl.addEventListener("keydown", (ke) => { - if (ke.key === "Enter") { - this.submit(); - } - }); - contentEl.appendChild(titleFieldNameComponent.inputEl); - contentEl.createDiv({ cls: "media-db-plugin-spacer" }); - new import_obsidian10.Setting(contentEl).addButton((btn) => { - btn.setButtonText("Cancel"); - btn.onClick(() => this.close()); - btn.buttonEl.addClass("media-db-plugin-button"); - }).addButton((btn) => { - btn.setButtonText("Ok"); - btn.setCta(); - btn.onClick(() => { - this.submit(); - }); - btn.buttonEl.addClass("media-db-plugin-button"); - this.searchBtn = btn; - }); - } - onClose() { - const { contentEl } = this; - contentEl.empty(); - } -}; - -// src/modals/MediaDbAdvancedSearchModal.ts -var import_obsidian11 = __toModule(require("obsidian")); -var MediaDbAdvancedSearchModal = class extends import_obsidian11.Modal { - constructor(plugin, advancedSearchModalOptions) { - advancedSearchModalOptions = Object.assign({}, ADVANCED_SEARCH_MODAL_DEFAULT_OPTIONS, advancedSearchModalOptions); - super(plugin.app); - this.plugin = plugin; - this.selectedApis = []; - this.title = advancedSearchModalOptions.modalTitle; - this.query = advancedSearchModalOptions.prefilledSearchString; - for (const api of this.plugin.apiManager.apis) { - this.selectedApis.push({ name: api.apiName, selected: advancedSearchModalOptions.preselectedAPIs.contains(api.apiName) }); - } - } - setSubmitCallback(submitCallback) { - this.submitCallback = submitCallback; - } - setCloseCallback(closeCallback) { - this.closeCallback = closeCallback; - } - keyPressCallback(event) { - if (event.key === "Enter") { - this.search(); - } - } - search() { - return __async(this, null, function* () { - if (!this.query || this.query.length < 3) { - new import_obsidian11.Notice("MDB | Query too short"); - return; - } - const apis = this.selectedApis.filter((x) => x.selected).map((x) => x.name); - if (apis.length === 0) { - new import_obsidian11.Notice("MDB | No API selected"); - return; - } - if (!this.isBusy) { - this.isBusy = true; - this.searchBtn.setDisabled(false); - this.searchBtn.setButtonText("Searching..."); - this.submitCallback({ query: this.query, apis }); - } - }); - } - onOpen() { - const { contentEl } = this; - contentEl.createEl("h2", { text: this.title }); - const placeholder = "Search by title"; - const searchComponent = new import_obsidian11.TextComponent(contentEl); - searchComponent.inputEl.style.width = "100%"; - searchComponent.setPlaceholder(placeholder); - searchComponent.setValue(this.query); - searchComponent.onChange((value) => this.query = value); - searchComponent.inputEl.addEventListener("keydown", this.keyPressCallback.bind(this)); - contentEl.appendChild(searchComponent.inputEl); - searchComponent.inputEl.focus(); - contentEl.createDiv({ cls: "media-db-plugin-spacer" }); - contentEl.createEl("h3", { text: "APIs to search" }); - for (const api of this.plugin.apiManager.apis) { - const apiToggleListElementWrapper = contentEl.createEl("div", { cls: "media-db-plugin-list-wrapper" }); - const apiToggleTextWrapper = apiToggleListElementWrapper.createEl("div", { cls: "media-db-plugin-list-text-wrapper" }); - apiToggleTextWrapper.createEl("span", { text: api.apiName, cls: "media-db-plugin-list-text" }); - apiToggleTextWrapper.createEl("small", { text: api.apiDescription, cls: "media-db-plugin-list-text" }); - const apiToggleComponentWrapper = apiToggleListElementWrapper.createEl("div", { cls: "media-db-plugin-list-toggle" }); - const apiToggleComponent = new import_obsidian11.ToggleComponent(apiToggleComponentWrapper); - apiToggleComponent.setTooltip(api.apiName); - apiToggleComponent.setValue(this.selectedApis.find((x) => x.name === api.apiName).selected); - apiToggleComponent.onChange((value) => { - this.selectedApis.find((x) => x.name === api.apiName).selected = value; - }); - apiToggleComponentWrapper.appendChild(apiToggleComponent.toggleEl); - } - contentEl.createDiv({ cls: "media-db-plugin-spacer" }); - new import_obsidian11.Setting(contentEl).addButton((btn) => { - btn.setButtonText("Cancel"); - btn.onClick(() => this.close()); - btn.buttonEl.addClass("media-db-plugin-button"); - }).addButton((btn) => { - btn.setButtonText("Ok"); - btn.setCta(); - btn.onClick(() => { - this.search(); - }); - btn.buttonEl.addClass("media-db-plugin-button"); - this.searchBtn = btn; - }); - } - onClose() { - this.closeCallback(); - const { contentEl } = this; - contentEl.empty(); - } -}; - -// src/modals/MediaDbIdSearchModal.ts -var import_obsidian12 = __toModule(require("obsidian")); -var MediaDbIdSearchModal = class extends import_obsidian12.Modal { - constructor(plugin, idSearchModalOptions) { - idSearchModalOptions = Object.assign({}, ID_SEARCH_MODAL_DEFAULT_OPTIONS, idSearchModalOptions); - super(plugin.app); - this.plugin = plugin; - this.title = idSearchModalOptions.modalTitle; - this.selectedApi = idSearchModalOptions.preselectedAPI || plugin.apiManager.apis[0].apiName; - } - setSubmitCallback(submitCallback) { - this.submitCallback = submitCallback; - } - setCloseCallback(closeCallback) { - this.closeCallback = closeCallback; - } - keyPressCallback(event) { - if (event.key === "Enter") { - this.search(); - } - } - search() { - return __async(this, null, function* () { - if (!this.query) { - new import_obsidian12.Notice("MDB | no Id entered"); - return; - } - if (!this.selectedApi) { - new import_obsidian12.Notice("MDB | No API selected"); - return; - } - if (!this.isBusy) { - this.isBusy = true; - this.searchBtn.setDisabled(false); - this.searchBtn.setButtonText("Searching..."); - this.submitCallback({ query: this.query, api: this.selectedApi }); - } - }); - } - onOpen() { - const { contentEl } = this; - contentEl.createEl("h2", { text: this.title }); - const placeholder = "Search by id"; - const searchComponent = new import_obsidian12.TextComponent(contentEl); - searchComponent.inputEl.style.width = "100%"; - searchComponent.setPlaceholder(placeholder); - searchComponent.onChange((value) => this.query = value); - searchComponent.inputEl.addEventListener("keydown", this.keyPressCallback.bind(this)); - contentEl.appendChild(searchComponent.inputEl); - searchComponent.inputEl.focus(); - contentEl.createDiv({ cls: "media-db-plugin-spacer" }); - const apiSelectorWrapper = contentEl.createEl("div", { cls: "media-db-plugin-list-wrapper" }); - const apiSelectorTExtWrapper = apiSelectorWrapper.createEl("div", { cls: "media-db-plugin-list-text-wrapper" }); - apiSelectorTExtWrapper.createEl("span", { text: "API to search", cls: "media-db-plugin-list-text" }); - const apiSelectorComponent = new import_obsidian12.DropdownComponent(apiSelectorWrapper); - apiSelectorComponent.onChange((value) => { - this.selectedApi = value; - }); - for (const api of this.plugin.apiManager.apis) { - apiSelectorComponent.addOption(api.apiName, api.apiName); - } - apiSelectorWrapper.appendChild(apiSelectorComponent.selectEl); - contentEl.createDiv({ cls: "media-db-plugin-spacer" }); - new import_obsidian12.Setting(contentEl).addButton((btn) => { - btn.setButtonText("Cancel"); - btn.onClick(() => this.close()); - btn.buttonEl.addClass("media-db-plugin-button"); - }).addButton((btn) => { - btn.setButtonText("Ok"); - btn.setCta(); - btn.onClick(() => { - this.search(); - }); - btn.buttonEl.addClass("media-db-plugin-button"); - this.searchBtn = btn; - }); - } - onClose() { - this.closeCallback(); - const { contentEl } = this; - contentEl.empty(); - } -}; - -// src/modals/SelectModal.ts -var import_obsidian13 = __toModule(require("obsidian")); - -// src/modals/SelectModalElement.ts -var SelectModalElement = class { - constructor(value, parentElement, id, selectModal, active = false) { - this.value = value; - this.id = id; - this.active = active; - this.selectModal = selectModal; - this.cssClass = "media-db-plugin-select-element"; - this.activeClass = "media-db-plugin-select-element-selected"; - this.hoverClass = "media-db-plugin-select-element-hover"; - this.element = parentElement.createDiv({ cls: this.cssClass }); - this.element.id = this.getHTMLId(); - this.element.on("click", "#" + this.getHTMLId(), () => { - this.setActive(!this.active); - if (!this.selectModal.allowMultiSelect) { - this.selectModal.disableAllOtherElements(this.id); - } - }); - this.element.on("mouseenter", "#" + this.getHTMLId(), () => { - this.setHighlighted(true); - }); - this.element.on("mouseleave", "#" + this.getHTMLId(), () => { - this.setHighlighted(false); - }); - } - getHTMLId() { - return `media-db-plugin-select-element-${this.id}`; - } - isHighlighted() { - return this.highlighted; - } - setHighlighted(value) { - this.highlighted = value; - if (this.highlighted) { - this.addClass(this.hoverClass); - this.selectModal.deHighlightAllOtherElements(this.id); - } else { - this.removeClass(this.hoverClass); - } - } - isActive() { - return this.active; - } - setActive(active) { - this.active = active; - this.update(); - } - update() { - if (this.active) { - this.addClass(this.activeClass); - } else { - this.removeClass(this.activeClass); - } - } - addClass(cssClass) { - if (!this.element.hasClass(cssClass)) { - this.element.addClass(cssClass); - } - } - removeClass(cssClass) { - if (this.element.hasClass(cssClass)) { - this.element.removeClass(cssClass); - } - } -}; - -// src/modals/SelectModal.ts -var SelectModal = class extends import_obsidian13.Modal { - constructor(app, elements, allowMultiSelect = true) { - super(app); - this.allowMultiSelect = allowMultiSelect; - this.title = ""; - this.description = ""; - this.addSkipButton = false; - this.cancelButton = void 0; - this.skipButton = void 0; - this.submitButton = void 0; - this.elementWrapper = void 0; - this.elements = elements; - this.selectModalElements = []; - this.scope.register([], "ArrowUp", (evt) => { - this.highlightUp(); - evt.preventDefault(); - }); - this.scope.register([], "ArrowDown", (evt) => { - this.highlightDown(); - evt.preventDefault(); - }); - this.scope.register([], "ArrowRight", () => { - this.activateHighlighted(); - }); - this.scope.register([], " ", (evt) => { - if (this.elementWrapper && this.elementWrapper === document.activeElement) { - this.activateHighlighted(); - evt.preventDefault(); - } - }); - this.scope.register([], "Enter", () => this.submit()); - } - disableAllOtherElements(elementId) { - for (const selectModalElement of this.selectModalElements) { - if (selectModalElement.id !== elementId) { - selectModalElement.setActive(false); - } - } - } - deHighlightAllOtherElements(elementId) { - for (const selectModalElement of this.selectModalElements) { - if (selectModalElement.id !== elementId) { - selectModalElement.setHighlighted(false); - } - } - } - onOpen() { - return __async(this, null, function* () { - var _a; - const { contentEl, titleEl } = this; - titleEl.createEl("h2", { text: this.title }); - contentEl.addClass("media-db-plugin-select-modal"); - contentEl.createEl("p", { text: this.description }); - this.elementWrapper = contentEl.createDiv({ cls: "media-db-plugin-select-wrapper" }); - this.elementWrapper.tabIndex = 0; - let i = 0; - for (const element2 of this.elements) { - const selectModalElement = new SelectModalElement(element2, this.elementWrapper, i, this, false); - this.selectModalElements.push(selectModalElement); - this.renderElement(element2, selectModalElement.element); - i += 1; - } - (_a = this.selectModalElements.first()) == null ? void 0 : _a.element.scrollIntoView(); - const bottomSettingRow = new import_obsidian13.Setting(contentEl); - bottomSettingRow.addButton((btn) => { - btn.setButtonText("Cancel"); - btn.onClick(() => this.close()); - btn.buttonEl.addClass("media-db-plugin-button"); - this.cancelButton = btn; - }); - if (this.addSkipButton) { - bottomSettingRow.addButton((btn) => { - btn.setButtonText("Skip"); - btn.onClick(() => this.skip()); - btn.buttonEl.addClass("media-db-plugin-button"); - this.skipButton = btn; - }); - } - bottomSettingRow.addButton((btn) => { - btn.setButtonText("Ok"); - btn.setCta(); - btn.onClick(() => this.submit()); - btn.buttonEl.addClass("media-db-plugin-button"); - this.submitButton = btn; - }); - }); - } - activateHighlighted() { - for (const selectModalElement of this.selectModalElements) { - if (selectModalElement.isHighlighted()) { - selectModalElement.setActive(!selectModalElement.isActive()); - if (!this.allowMultiSelect) { - this.disableAllOtherElements(selectModalElement.id); - } - } - } - } - highlightUp() { - for (const selectModalElement of this.selectModalElements) { - if (selectModalElement.isHighlighted()) { - this.getPreviousSelectModalElement(selectModalElement).setHighlighted(true); - return; - } - } - this.selectModalElements.last().setHighlighted(true); - } - highlightDown() { - for (const selectModalElement of this.selectModalElements) { - if (selectModalElement.isHighlighted()) { - this.getNextSelectModalElement(selectModalElement).setHighlighted(true); - return; - } - } - this.selectModalElements.first().setHighlighted(true); - } - getNextSelectModalElement(selectModalElement) { - let nextId = selectModalElement.id + 1; - nextId = mod(nextId, this.selectModalElements.length); - return this.selectModalElements.filter((x) => x.id === nextId).first(); - } - getPreviousSelectModalElement(selectModalElement) { - let nextId = selectModalElement.id - 1; - nextId = mod(nextId, this.selectModalElements.length); - return this.selectModalElements.filter((x) => x.id === nextId).first(); - } -}; - -// src/modals/MediaDbSearchResultModal.ts -var MediaDbSearchResultModal = class extends SelectModal { - constructor(plugin, selectModalOptions) { - selectModalOptions = Object.assign({}, SELECT_MODAL_OPTIONS_DEFAULT, selectModalOptions); - super(plugin.app, selectModalOptions.elements, selectModalOptions.multiSelect); - this.plugin = plugin; - this.title = selectModalOptions.modalTitle; - this.description = "Select one or multiple search results."; - this.addSkipButton = selectModalOptions.skipButton; - this.busy = false; - this.sendCallback = false; - } - setSubmitCallback(submitCallback) { - this.submitCallback = submitCallback; - } - setCloseCallback(closeCallback) { - this.closeCallback = closeCallback; - } - setSkipCallback(skipCallback) { - this.skipCallback = skipCallback; - } - renderElement(item, el) { - el.createEl("div", { text: this.plugin.mediaTypeManager.getFileName(item) }); - el.createEl("small", { text: `${item.getSummary()} -` }); - el.createEl("small", { text: `${item.type.toUpperCase() + (item.subType ? ` (${item.subType})` : "")} from ${item.dataSource}` }); - } - submit() { - if (!this.busy) { - this.busy = true; - this.submitButton.setButtonText("Creating entry..."); - this.submitCallback({ selected: this.selectModalElements.filter((x) => x.isActive()).map((x) => x.value) }); - } - } - skip() { - this.skipButton.setButtonText("Skipping..."); - this.skipCallback(); - } - onClose() { - this.closeCallback(); - } -}; - -// src/utils/ModalHelper.ts -var import_obsidian16 = __toModule(require("obsidian")); - -// src/modals/MediaDbPreviewModal.ts -var import_obsidian14 = __toModule(require("obsidian")); -var MediaDbPreviewModal = class extends import_obsidian14.Modal { - constructor(plugin, previewModalOptions) { - previewModalOptions = Object.assign({}, PREVIEW_MODAL_DEFAULT_OPTIONS, previewModalOptions); - super(plugin.app); - this.plugin = plugin; - this.title = previewModalOptions.modalTitle; - this.elements = previewModalOptions.elements; - this.createNoteOptions = previewModalOptions.createNoteOptions; - this.markdownComponent = new import_obsidian14.Component(); - } - setSubmitCallback(submitCallback) { - this.submitCallback = submitCallback; - } - setCloseCallback(closeCallback) { - this.closeCallback = closeCallback; - } - preview() { - return __async(this, null, function* () { - const { contentEl } = this; - contentEl.addClass("media-db-plugin-preview-modal"); - contentEl.createEl("h2", { text: this.title }); - const previewWrapper = contentEl.createDiv({ cls: "media-db-plugin-preview-wrapper" }); - this.markdownComponent.load(); - for (const result of this.elements) { - previewWrapper.createEl("h3", { text: result.englishTitle }); - const fileDiv = previewWrapper.createDiv({ cls: "media-db-plugin-preview" }); - let fileContent = yield this.plugin.generateMediaDbNoteContents(result, this.createNoteOptions); - fileContent = ` -${fileContent} -`; - try { - yield import_obsidian14.MarkdownRenderer.renderMarkdown(fileContent, fileDiv, "", this.markdownComponent); - } catch (e) { - console.warn(`mdb | error during rendering of preview`, e); - } - } - contentEl.createDiv({ cls: "media-db-plugin-spacer" }); - const bottomSettingRow = new import_obsidian14.Setting(contentEl); - bottomSettingRow.addButton((btn) => { - btn.setButtonText("Cancel"); - btn.onClick(() => this.close()); - btn.buttonEl.addClass("media-db-plugin-button"); - this.cancelButton = btn; - }); - bottomSettingRow.addButton((btn) => { - btn.setButtonText("Ok"); - btn.setCta(); - btn.onClick(() => this.submitCallback({ confirmed: true })); - btn.buttonEl.addClass("media-db-plugin-button"); - this.submitButton = btn; - }); - }); - } - onOpen() { - this.preview(); - } - onClose() { - this.markdownComponent.unload(); - this.closeCallback(); - } -}; - -// src/modals/MediaDbSearchModal.ts -var import_obsidian15 = __toModule(require("obsidian")); -var MediaDbSearchModal = class extends import_obsidian15.Modal { - constructor(plugin, searchModalOptions) { - searchModalOptions = Object.assign({}, SEARCH_MODAL_DEFAULT_OPTIONS, searchModalOptions); - super(plugin.app); - this.plugin = plugin; - this.selectedTypes = []; - this.title = searchModalOptions.modalTitle; - this.query = searchModalOptions.prefilledSearchString; - for (const mediaType of MEDIA_TYPES) { - this.selectedTypes.push({ name: mediaType, selected: searchModalOptions.preselectedTypes.contains(mediaType) }); - } - } - setSubmitCallback(submitCallback) { - this.submitCallback = submitCallback; - } - setCloseCallback(closeCallback) { - this.closeCallback = closeCallback; - } - keyPressCallback(event) { - if (event.key === "Enter") { - this.search(); - } - } - search() { - return __async(this, null, function* () { - if (!this.query || this.query.length < 3) { - new import_obsidian15.Notice("MDB | Query too short"); - return; - } - const types = this.selectedTypes.filter((x) => x.selected).map((x) => x.name); - if (types.length === 0) { - new import_obsidian15.Notice("MDB | No Type selected"); - return; - } - if (!this.isBusy) { - this.isBusy = true; - this.searchBtn.setDisabled(false); - this.searchBtn.setButtonText("Searching..."); - this.submitCallback({ query: this.query, types }); - } - }); - } - onOpen() { - const { contentEl } = this; - contentEl.createEl("h2", { text: this.title }); - const placeholder = "Search by title"; - const searchComponent = new import_obsidian15.TextComponent(contentEl); - searchComponent.inputEl.style.width = "100%"; - searchComponent.setPlaceholder(placeholder); - searchComponent.setValue(this.query); - searchComponent.onChange((value) => this.query = value); - searchComponent.inputEl.addEventListener("keydown", this.keyPressCallback.bind(this)); - contentEl.appendChild(searchComponent.inputEl); - searchComponent.inputEl.focus(); - contentEl.createDiv({ cls: "media-db-plugin-spacer" }); - contentEl.createEl("h3", { text: "APIs to search" }); - for (const mediaType of MEDIA_TYPES) { - const apiToggleListElementWrapper = contentEl.createEl("div", { cls: "media-db-plugin-list-wrapper" }); - const apiToggleTextWrapper = apiToggleListElementWrapper.createEl("div", { cls: "media-db-plugin-list-text-wrapper" }); - apiToggleTextWrapper.createEl("span", { text: unCamelCase(mediaType), cls: "media-db-plugin-list-text" }); - const apiToggleComponentWrapper = apiToggleListElementWrapper.createEl("div", { cls: "media-db-plugin-list-toggle" }); - const apiToggleComponent = new import_obsidian15.ToggleComponent(apiToggleComponentWrapper); - apiToggleComponent.setTooltip(unCamelCase(mediaType)); - apiToggleComponent.setValue(this.selectedTypes.find((x) => x.name === mediaType).selected); - apiToggleComponent.onChange((value) => { - this.selectedTypes.find((x) => x.name === mediaType).selected = value; - }); - apiToggleComponentWrapper.appendChild(apiToggleComponent.toggleEl); - } - contentEl.createDiv({ cls: "media-db-plugin-spacer" }); - new import_obsidian15.Setting(contentEl).addButton((btn) => { - btn.setButtonText("Cancel"); - btn.onClick(() => this.close()); - btn.buttonEl.addClass("media-db-plugin-button"); - }).addButton((btn) => { - btn.setButtonText("Ok"); - btn.setCta(); - btn.onClick(() => { - this.search(); - }); - btn.buttonEl.addClass("media-db-plugin-button"); - this.searchBtn = btn; - }); - } - onClose() { - this.closeCallback(); - const { contentEl } = this; - contentEl.empty(); - } -}; - -// src/utils/ModalHelper.ts -var ModalResultCode; -(function(ModalResultCode2) { - ModalResultCode2[ModalResultCode2["SUCCESS"] = 0] = "SUCCESS"; - ModalResultCode2[ModalResultCode2["SKIP"] = 1] = "SKIP"; - ModalResultCode2[ModalResultCode2["CLOSE"] = 2] = "CLOSE"; - ModalResultCode2[ModalResultCode2["ERROR"] = 3] = "ERROR"; -})(ModalResultCode || (ModalResultCode = {})); -var SEARCH_MODAL_DEFAULT_OPTIONS = { - modalTitle: "Media DB Search", - preselectedTypes: [], - prefilledSearchString: "" -}; -var ADVANCED_SEARCH_MODAL_DEFAULT_OPTIONS = { - modalTitle: "Media DB Advanced Search", - preselectedAPIs: [], - prefilledSearchString: "" -}; -var ID_SEARCH_MODAL_DEFAULT_OPTIONS = { - modalTitle: "Media DB Id Search", - preselectedAPI: "", - prefilledSearchString: "" -}; -var SELECT_MODAL_OPTIONS_DEFAULT = { - modalTitle: "Media DB Search Results", - elements: [], - multiSelect: true, - skipButton: false -}; -var PREVIEW_MODAL_DEFAULT_OPTIONS = { - modalTitle: "Media DB Preview", - elements: [], - createNoteOptions: { attachTemplate: true } -}; -var ModalHelper = class { - constructor(plugin) { - this.plugin = plugin; - } - createSearchModal(searchModalOptions) { - return __async(this, null, function* () { - const modal = new MediaDbSearchModal(this.plugin, searchModalOptions); - const res = yield new Promise((resolve) => { - modal.setSubmitCallback((res2) => resolve({ code: 0, data: res2 })); - modal.setCloseCallback((err) => { - if (err) { - resolve({ code: 3, error: err }); - } - resolve({ code: 2 }); - }); - modal.open(); - }); - return { searchModalResult: res, searchModal: modal }; - }); - } - openSearchModal(searchModalOptions, submitCallback) { - return __async(this, null, function* () { - const { searchModalResult, searchModal } = yield this.createSearchModal(searchModalOptions); - console.debug(`MDB | searchModal closed with code ${searchModalResult.code}`); - if (searchModalResult.code === 3) { - console.warn(searchModalResult.error); - new import_obsidian16.Notice(searchModalResult.error.toString()); - searchModal.close(); - return void 0; - } - if (searchModalResult.code === 2) { - return void 0; - } - try { - const callbackRes = yield submitCallback(searchModalResult.data); - searchModal.close(); - return callbackRes; - } catch (e) { - console.warn(e); - new import_obsidian16.Notice(e.toString()); - searchModal.close(); - return void 0; - } - }); - } - createAdvancedSearchModal(advancedSearchModalOptions) { - return __async(this, null, function* () { - const modal = new MediaDbAdvancedSearchModal(this.plugin, advancedSearchModalOptions); - const res = yield new Promise((resolve) => { - modal.setSubmitCallback((res2) => resolve({ code: 0, data: res2 })); - modal.setCloseCallback((err) => { - if (err) { - resolve({ code: 3, error: err }); - } - resolve({ code: 2 }); - }); - modal.open(); - }); - return { advancedSearchModalResult: res, advancedSearchModal: modal }; - }); - } - openAdvancedSearchModal(advancedSearchModalOptions, submitCallback) { - return __async(this, null, function* () { - const { advancedSearchModalResult, advancedSearchModal } = yield this.createAdvancedSearchModal(advancedSearchModalOptions); - console.debug(`MDB | advencedSearchModal closed with code ${advancedSearchModalResult.code}`); - if (advancedSearchModalResult.code === 3) { - console.warn(advancedSearchModalResult.error); - new import_obsidian16.Notice(advancedSearchModalResult.error.toString()); - advancedSearchModal.close(); - return void 0; - } - if (advancedSearchModalResult.code === 2) { - return void 0; - } - try { - const callbackRes = yield submitCallback(advancedSearchModalResult.data); - advancedSearchModal.close(); - return callbackRes; - } catch (e) { - console.warn(e); - new import_obsidian16.Notice(e.toString()); - advancedSearchModal.close(); - return void 0; - } - }); - } - createIdSearchModal(idSearchModalOptions) { - return __async(this, null, function* () { - const modal = new MediaDbIdSearchModal(this.plugin, idSearchModalOptions); - const res = yield new Promise((resolve) => { - modal.setSubmitCallback((res2) => resolve({ code: 0, data: res2 })); - modal.setCloseCallback((err) => { - if (err) { - resolve({ code: 3, error: err }); - } - resolve({ code: 2 }); - }); - modal.open(); - }); - return { idSearchModalResult: res, idSearchModal: modal }; - }); - } - openIdSearchModal(idSearchModalOptions, submitCallback) { - return __async(this, null, function* () { - const { idSearchModalResult, idSearchModal } = yield this.createIdSearchModal(idSearchModalOptions); - console.debug(`MDB | idSearchModal closed with code ${idSearchModalResult.code}`); - if (idSearchModalResult.code === 3) { - console.warn(idSearchModalResult.error); - new import_obsidian16.Notice(idSearchModalResult.error.toString()); - idSearchModal.close(); - return void 0; - } - if (idSearchModalResult.code === 2) { - return void 0; - } - try { - const callbackRes = yield submitCallback(idSearchModalResult.data); - idSearchModal.close(); - return callbackRes; - } catch (e) { - console.warn(e); - new import_obsidian16.Notice(e.toString()); - idSearchModal.close(); - return void 0; - } - }); - } - createSelectModal(selectModalOptions) { - return __async(this, null, function* () { - const modal = new MediaDbSearchResultModal(this.plugin, selectModalOptions); - const res = yield new Promise((resolve) => { - modal.setSubmitCallback((res2) => resolve({ code: 0, data: res2 })); - modal.setSkipCallback(() => resolve({ code: 1 })); - modal.setCloseCallback((err) => { - if (err) { - resolve({ code: 3, error: err }); - } - resolve({ code: 2 }); - }); - modal.open(); - }); - return { selectModalResult: res, selectModal: modal }; - }); - } - openSelectModal(selectModalOptions, submitCallback) { - return __async(this, null, function* () { - const { selectModalResult, selectModal } = yield this.createSelectModal(selectModalOptions); - console.debug(`MDB | selectModal closed with code ${selectModalResult.code}`); - if (selectModalResult.code === 3) { - console.warn(selectModalResult.error); - new import_obsidian16.Notice(selectModalResult.error.toString()); - selectModal.close(); - return void 0; - } - if (selectModalResult.code === 2) { - return void 0; - } - if (selectModalResult.code === 1) { - return void 0; - } - try { - const callbackRes = yield submitCallback(selectModalResult.data); - selectModal.close(); - return callbackRes; - } catch (e) { - console.warn(e); - new import_obsidian16.Notice(e.toString()); - selectModal.close(); - return; - } - }); - } - createPreviewModal(previewModalOptions) { - return __async(this, null, function* () { - const modal = new MediaDbPreviewModal(this.plugin, previewModalOptions); - const res = yield new Promise((resolve) => { - modal.setSubmitCallback((res2) => resolve({ code: 0, data: res2 })); - modal.setCloseCallback((err) => { - if (err) { - resolve({ code: 3, error: err }); - } - resolve({ code: 2 }); - }); - modal.open(); - }); - return { previewModalResult: res, previewModal: modal }; - }); - } - openPreviewModal(previewModalOptions, submitCallback) { - return __async(this, null, function* () { - const { previewModalResult, previewModal } = yield this.createPreviewModal(previewModalOptions); - console.debug(`MDB | previewModal closed with code ${previewModalResult.code}`); - if (previewModalResult.code === 3) { - console.warn(previewModalResult.error); - new import_obsidian16.Notice(previewModalResult.error.toString()); - previewModal.close(); - return void 0; - } - if (previewModalResult.code === 2) { - return void 0; - } - try { - const callbackRes = yield submitCallback(previewModalResult.data); - previewModal.close(); - return callbackRes; - } catch (e) { - console.warn(e); - new import_obsidian16.Notice(e.toString()); - previewModal.close(); - return; - } - }); - } -}; - -// src/main.ts -var MediaDbPlugin = class extends import_obsidian17.Plugin { - constructor() { - super(...arguments); - this.frontMatterRexExpPattern = "^(---)\\n[\\s\\S]*?\\n---"; - } - onload() { - return __async(this, null, function* () { - this.apiManager = new APIManager(); - this.apiManager.registerAPI(new OMDbAPI(this)); - this.apiManager.registerAPI(new MALAPI(this)); - this.apiManager.registerAPI(new WikipediaAPI(this)); - this.apiManager.registerAPI(new MusicBrainzAPI(this)); - this.apiManager.registerAPI(new SteamAPI(this)); - this.apiManager.registerAPI(new BoardGameGeekAPI(this)); - this.mediaTypeManager = new MediaTypeManager(); - this.modelPropertyMapper = new PropertyMapper(this); - this.modalHelper = new ModalHelper(this); - yield this.loadSettings(); - this.addSettingTab(new MediaDbSettingTab(this.app, this)); - this.mediaTypeManager.updateTemplates(this.settings); - this.mediaTypeManager.updateFolders(this.settings); - const ribbonIconEl = this.addRibbonIcon("database", "Add new Media DB entry", () => this.createEntryWithAdvancedSearchModal()); - ribbonIconEl.addClass("obsidian-media-db-plugin-ribbon-class"); - this.registerEvent(this.app.workspace.on("file-menu", (menu, file) => { - if (file instanceof import_obsidian17.TFolder) { - menu.addItem((item) => { - item.setTitle("Import folder as Media DB entries").setIcon("database").onClick(() => this.createEntriesFromFolder(file)); - }); - } - })); - this.addCommand({ - id: "open-media-db-search-modal", - name: "Create Media DB entry", - callback: () => this.createEntryWithSearchModal() - }); - for (const mediaType of MEDIA_TYPES) { - this.addCommand({ - id: `open-media-db-search-modal-with-${mediaType}`, - name: `Create Media DB entry (${unCamelCase(mediaType)})`, - callback: () => this.createEntryWithSearchModal({ preselectedTypes: [mediaType] }) - }); - } - this.addCommand({ - id: "open-media-db-advanced-search-modal", - name: "Create Media DB entry (advanced search)", - callback: () => this.createEntryWithAdvancedSearchModal() - }); - this.addCommand({ - id: "open-media-db-id-search-modal", - name: "Create Media DB entry by id", - callback: () => this.createEntryWithIdSearchModal() - }); - this.addCommand({ - id: "update-media-db-note", - name: "Update open note (this will recreate the note)", - checkCallback: (checking) => { - if (!this.app.workspace.getActiveFile()) { - return false; - } - if (!checking) { - this.updateActiveNote(false); - } - return true; - } - }); - this.addCommand({ - id: "update-media-db-note-metadata", - name: "Update metadata", - checkCallback: (checking) => { - if (!this.app.workspace.getActiveFile()) { - return false; - } - if (!checking) { - this.updateActiveNote(true); - } - return true; - } - }); - this.addCommand({ - id: "add-media-db-link", - name: "Insert link", - checkCallback: (checking) => { - if (!this.app.workspace.getActiveFile()) { - return false; - } - if (!checking) { - this.createLinkWithSearchModal(); - } - return true; - } - }); - }); - } - createLinkWithSearchModal() { - return __async(this, null, function* () { - const apiSearchResults = yield this.modalHelper.openAdvancedSearchModal({}, (advancedSearchModalData) => __async(this, null, function* () { - return yield this.apiManager.query(advancedSearchModalData.query, advancedSearchModalData.apis); - })); - if (!apiSearchResults) { - return; - } - const selectResults = yield this.modalHelper.openSelectModal({ elements: apiSearchResults, multiSelect: false }, (selectModalData) => __async(this, null, function* () { - return yield this.queryDetails(selectModalData.selected); - })); - if (!selectResults || selectResults.length < 1) { - return; - } - const link = `[${selectResults[0].title}](${selectResults[0].url})`; - const view = this.app.workspace.getActiveViewOfType(import_obsidian17.MarkdownView); - if (view) { - view.editor.replaceRange(link, view.editor.getCursor()); - } - }); - } - createEntryWithSearchModal(searchModalOptions) { - return __async(this, null, function* () { - let types = []; - let apiSearchResults = yield this.modalHelper.openSearchModal(searchModalOptions != null ? searchModalOptions : {}, (searchModalData) => __async(this, null, function* () { - types = searchModalData.types; - const apis = this.apiManager.apis.filter((x) => x.hasTypeOverlap(searchModalData.types)).map((x) => x.apiName); - return yield this.apiManager.query(searchModalData.query, apis); - })); - if (!apiSearchResults) { - return; - } - apiSearchResults = apiSearchResults.filter((x) => types.contains(x.type)); - let selectResults; - let proceed; - while (!proceed) { - selectResults = yield this.modalHelper.openSelectModal({ elements: apiSearchResults }, (selectModalData) => __async(this, null, function* () { - return yield this.queryDetails(selectModalData.selected); - })); - if (!selectResults) { - return; - } - proceed = yield this.modalHelper.openPreviewModal({ elements: selectResults }, (previewModalData) => __async(this, null, function* () { - return previewModalData.confirmed; - })); - } - yield this.createMediaDbNotes(selectResults); - }); - } - createEntryWithAdvancedSearchModal() { - return __async(this, null, function* () { - const apiSearchResults = yield this.modalHelper.openAdvancedSearchModal({}, (advancedSearchModalData) => __async(this, null, function* () { - return yield this.apiManager.query(advancedSearchModalData.query, advancedSearchModalData.apis); - })); - if (!apiSearchResults) { - return; - } - let selectResults; - let proceed; - while (!proceed) { - selectResults = yield this.modalHelper.openSelectModal({ elements: apiSearchResults }, (selectModalData) => __async(this, null, function* () { - return yield this.queryDetails(selectModalData.selected); - })); - if (!selectResults) { - return; - } - proceed = yield this.modalHelper.openPreviewModal({ elements: selectResults }, (previewModalData) => __async(this, null, function* () { - return previewModalData.confirmed; - })); - } - yield this.createMediaDbNotes(selectResults); - }); - } - createEntryWithIdSearchModal() { - return __async(this, null, function* () { - let idSearchResult; - let proceed; - while (!proceed) { - idSearchResult = yield this.modalHelper.openIdSearchModal({}, (idSearchModalData) => __async(this, null, function* () { - return yield this.apiManager.queryDetailedInfoById(idSearchModalData.query, idSearchModalData.api); - })); - if (!idSearchResult) { - return; - } - proceed = yield this.modalHelper.openPreviewModal({ elements: [idSearchResult] }, (previewModalData) => __async(this, null, function* () { - return previewModalData.confirmed; - })); - } - yield this.createMediaDbNoteFromModel(idSearchResult, { attachTemplate: true, openNote: true }); - }); - } - createMediaDbNotes(models, attachFile) { - return __async(this, null, function* () { - for (const model of models) { - yield this.createMediaDbNoteFromModel(model, { attachTemplate: true, attachFile }); - } - }); - } - queryDetails(models) { - return __async(this, null, function* () { - const detailModels = []; - for (const model of models) { - try { - detailModels.push(yield this.apiManager.queryDetailedInfo(model)); - } catch (e) { - console.warn(e); - new import_obsidian17.Notice(e.toString()); - } - } - return detailModels; - }); - } - createMediaDbNoteFromModel(mediaTypeModel, options) { - return __async(this, null, function* () { - try { - console.debug("MDB | creating new note"); - const fileContent = yield this.generateMediaDbNoteContents(mediaTypeModel, options); - if (!options.folder) { - options.folder = yield this.mediaTypeManager.getFolder(mediaTypeModel, this.app); - } - yield this.createNote(this.mediaTypeManager.getFileName(mediaTypeModel), fileContent, options); - } catch (e) { - console.warn(e); - new import_obsidian17.Notice(e.toString()); - } - }); - } - generateMediaDbNoteContents(mediaTypeModel, options) { - return __async(this, null, function* () { - let fileMetadata = this.modelPropertyMapper.convertObject(mediaTypeModel.toMetaDataObject()); - let fileContent = ""; - const template = options.attachTemplate ? yield this.mediaTypeManager.getTemplate(mediaTypeModel, this.app) : ""; - ({ fileMetadata, fileContent } = yield this.attachFile(fileMetadata, fileContent, options.attachFile)); - ({ fileMetadata, fileContent } = yield this.attachTemplate(fileMetadata, fileContent, template)); - fileContent = `--- -${this.settings.useCustomYamlStringifier ? YAMLConverter.toYaml(fileMetadata) : (0, import_obsidian17.stringifyYaml)(fileMetadata)}--- -` + fileContent; - return fileContent; - }); - } - attachFile(fileMetadata, fileContent, fileToAttach) { - return __async(this, null, function* () { - if (!fileToAttach) { - return { fileMetadata, fileContent }; - } - const attachFileMetadata = this.getMetadataFromFileCache(fileToAttach); - fileMetadata = Object.assign(attachFileMetadata, fileMetadata); - let attachFileContent = yield this.app.vault.read(fileToAttach); - const regExp = new RegExp(this.frontMatterRexExpPattern); - attachFileContent = attachFileContent.replace(regExp, ""); - attachFileContent = attachFileContent.startsWith("\n") ? attachFileContent.substring(1) : attachFileContent; - fileContent += attachFileContent; - return { fileMetadata, fileContent }; - }); - } - attachTemplate(fileMetadata, fileContent, template) { - return __async(this, null, function* () { - if (!template) { - return { fileMetadata, fileContent }; - } - const templateMetadata = this.getMetaDataFromFileContent(template); - fileMetadata = Object.assign(templateMetadata, fileMetadata); - const regExp = new RegExp(this.frontMatterRexExpPattern); - const attachFileContent = template.replace(regExp, ""); - fileContent += attachFileContent; - return { fileMetadata, fileContent }; - }); - } - getMetaDataFromFileContent(fileContent) { - let metadata; - const regExp = new RegExp(this.frontMatterRexExpPattern); - const frontMatterRegExpResult = regExp.exec(fileContent); - if (!frontMatterRegExpResult) { - return {}; - } - let frontMatter = frontMatterRegExpResult[0]; - if (!frontMatter) { - return {}; - } - frontMatter = frontMatter.substring(4); - frontMatter = frontMatter.substring(0, frontMatter.length - 3); - metadata = (0, import_obsidian17.parseYaml)(frontMatter); - if (!metadata) { - metadata = {}; - } - console.debug(`MDB | metadata read from file content`, metadata); - return metadata; - } - getMetadataFromFileCache(file) { - let metadata = this.app.metadataCache.getFileCache(file).frontmatter; - if (metadata) { - metadata = Object.assign({}, metadata); - delete metadata.position; - } else { - metadata = {}; - } - return metadata; - } - createNote(fileName, fileContent, options) { - return __async(this, null, function* () { - var _a; - const folder = (_a = options.folder) != null ? _a : this.app.vault.getAbstractFileByPath("/"); - fileName = replaceIllegalFileNameCharactersInString(fileName); - const filePath = `${folder.path}/${fileName}.md`; - const file = this.app.vault.getAbstractFileByPath(filePath); - if (file) { - yield this.app.vault.delete(file); - } - const targetFile = yield this.app.vault.create(filePath, fileContent); - console.debug(`MDB | created new file at ${filePath}`); - if (options.openNote) { - const activeLeaf = this.app.workspace.getUnpinnedLeaf(); - if (!activeLeaf) { - console.warn("MDB | no active leaf, not opening newly created note"); - return; - } - yield activeLeaf.openFile(targetFile, { state: { mode: "source" } }); - } - }); - } - updateActiveNote(onlyMetadata = false) { - return __async(this, null, function* () { - const activeFile = this.app.workspace.getActiveFile(); - if (!activeFile) { - throw new Error("MDB | there is no active note"); - } - let metadata = this.getMetadataFromFileCache(activeFile); - metadata = this.modelPropertyMapper.convertObjectBack(metadata); - console.debug(`MDB | read metadata`, metadata); - if (!(metadata == null ? void 0 : metadata.type) || !(metadata == null ? void 0 : metadata.dataSource) || !(metadata == null ? void 0 : metadata.id)) { - throw new Error("MDB | active note is not a Media DB entry or is missing metadata"); - } - const oldMediaTypeModel = this.mediaTypeManager.createMediaTypeModelFromMediaType(metadata, metadata.type); - let newMediaTypeModel = yield this.apiManager.queryDetailedInfoById(metadata.id, metadata.dataSource); - if (!newMediaTypeModel) { - return; - } - newMediaTypeModel = Object.assign(oldMediaTypeModel, newMediaTypeModel.getWithOutUserData()); - console.debug("MDB | deleting old entry"); - if (onlyMetadata) { - yield this.createMediaDbNoteFromModel(newMediaTypeModel, { attachFile: activeFile, folder: activeFile.parent, openNote: true }); - } else { - yield this.createMediaDbNoteFromModel(newMediaTypeModel, { attachTemplate: true, folder: activeFile.parent, openNote: true }); - } - }); - } - createEntriesFromFolder(folder) { - return __async(this, null, function* () { - const erroredFiles = []; - let canceled = false; - const { selectedAPI, titleFieldName, appendContent } = yield new Promise((resolve) => { - new MediaDbFolderImportModal(this.app, this, (selectedAPI2, titleFieldName2, appendContent2) => { - resolve({ selectedAPI: selectedAPI2, titleFieldName: titleFieldName2, appendContent: appendContent2 }); - }).open(); - }); - for (const child of folder.children) { - if (child instanceof import_obsidian17.TFile) { - const file = child; - if (canceled) { - erroredFiles.push({ filePath: file.path, error: "user canceled" }); - continue; - } - const metadata = this.getMetadataFromFileCache(file); - const title = metadata[titleFieldName]; - if (!title) { - erroredFiles.push({ filePath: file.path, error: `metadata field '${titleFieldName}' not found or empty` }); - continue; - } - let results = []; - try { - results = yield this.apiManager.query(title, [selectedAPI]); - } catch (e) { - erroredFiles.push({ filePath: file.path, error: e.toString() }); - continue; - } - if (!results || results.length === 0) { - erroredFiles.push({ filePath: file.path, error: `no search results` }); - continue; - } - const { selectModalResult, selectModal } = yield this.modalHelper.createSelectModal({ elements: results, skipButton: true, modalTitle: `Results for '${title}'` }); - if (selectModalResult.code === ModalResultCode.ERROR) { - erroredFiles.push({ filePath: file.path, error: selectModalResult.error.message }); - selectModal.close(); - continue; - } - if (selectModalResult.code === ModalResultCode.CLOSE) { - erroredFiles.push({ filePath: file.path, error: "user canceled" }); - selectModal.close(); - canceled = true; - continue; - } - if (selectModalResult.code === ModalResultCode.SKIP) { - erroredFiles.push({ filePath: file.path, error: "user skipped" }); - selectModal.close(); - continue; - } - if (selectModalResult.data.selected.length === 0) { - erroredFiles.push({ filePath: file.path, error: `no search results selected` }); - continue; - } - const detailedResults = yield this.queryDetails(selectModalResult.data.selected); - yield this.createMediaDbNotes(detailedResults, appendContent ? file : null); - selectModal.close(); - } - } - if (erroredFiles.length > 0) { - yield this.createErroredFilesReport(erroredFiles); - } - }); - } - createErroredFilesReport(erroredFiles) { - return __async(this, null, function* () { - const title = `MDB - bulk import error report ${dateTimeToString(new Date())}`; - const filePath = `${title}.md`; - const table = [["file", "error"]].concat(erroredFiles.map((x) => [x.filePath, x.error])); - const fileContent = `# ${title} - -${markdownTable(table)}`; - yield this.app.vault.create(filePath, fileContent); - }); - } - loadSettings() { - return __async(this, null, function* () { - const diskSettings = yield this.loadData(); - const defaultSettings = getDefaultSettings(this); - const loadedSettings = Object.assign({}, defaultSettings, diskSettings); - const newPropertyMappings = []; - for (const defaultPropertyMappingModel of defaultSettings.propertyMappingModels) { - const newPropertyMappingModel = loadedSettings.propertyMappingModels.find((x) => x.type === defaultPropertyMappingModel.type); - if (newPropertyMappingModel === void 0) { - newPropertyMappings.push(defaultPropertyMappingModel); - } else { - const newProperties = []; - for (const defaultProperty of defaultPropertyMappingModel.properties) { - const newProperty = newPropertyMappingModel.properties.find((x) => x.property === defaultProperty.property); - if (newProperty === void 0) { - newProperties.push(defaultProperty); - } else { - newProperties.push(new PropertyMapping(newProperty.property, newProperty.newProperty, newProperty.mapping, defaultProperty.locked)); - } - } - newPropertyMappings.push(new PropertyMappingModel(newPropertyMappingModel.type, newProperties)); - } - } - loadedSettings.propertyMappingModels = newPropertyMappings; - this.settings = loadedSettings; - }); - } - saveSettings() { - return __async(this, null, function* () { - this.mediaTypeManager.updateTemplates(this.settings); - this.mediaTypeManager.updateFolders(this.settings); - yield this.saveData(this.settings); - }); - } -}; +

`,new Bo({target:this.containerEl,props:{models:this.plugin.settings.propertyMappingModels.map(i=>i.copy()),save:i=>{let n=[];for(let a of this.plugin.settings.propertyMappingModels)a.type===i.type?n.push(i):n.push(a);this.plugin.settings.propertyMappingModels=n,new P.Notice(`MDB: Property Mappings for ${i.type} saved successfully.`),this.plugin.saveSettings()}}})}};var Ei=class{constructor(){this.apis=[]}async query(t,e){console.debug(`MDB | api manager queried with "${t}"`);let r=[];for(let i of this.apis)if(e.contains(i.apiName)){let n=await i.searchByTitle(t);r=r.concat(n)}return r}async queryDetailedInfo(t){return await this.queryDetailedInfoById(t.id,t.dataSource)}async queryDetailedInfoById(t,e){for(let r of this.apis)if(r.apiName===e)return r.getById(t)}getApiByName(t){for(let e of this.apis)if(e.apiName===t)return e;return null}registerAPI(t){this.apis.push(t)}};var J=class{hasType(t){return this.types.contains(t)}hasTypeOverlap(t){for(let e of t)if(this.hasType(e))return!0;return!1}};var Ci=class extends J{constructor(e){super();this.apiDateFormat="DD MMM YYYY";this.plugin=e,this.apiName="OMDbAPI",this.apiDescription="A free API for Movies, Series and Games.",this.apiUrl="http://www.omdbapi.com/",this.types=["movie","series","game"],this.typeMappings=new Map,this.typeMappings.set("movie","movie"),this.typeMappings.set("series","series"),this.typeMappings.set("game","game")}async searchByTitle(e){console.log(`MDB | api "${this.apiName}" queried by Title`);let r=`http://www.omdbapi.com/?s=${encodeURIComponent(e)}&apikey=${this.plugin.settings.OMDbKey}`,i=await fetch(r);if(i.status===401)throw Error(`MDB | Authentication for ${this.apiName} failed. Check the API key.`);if(i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);let n=await i.json();if(n.Response==="False"){if(n.Error==="Movie not found!")return[];throw Error(`MDB | Received error from ${this.apiName}: +${JSON.stringify(n,void 0,4)}`)}if(!n.Search)return[];console.debug(n.Search);let a=[];for(let s of n.Search){let l=this.typeMappings.get(s.Type.toLowerCase());l!==void 0&&(l==="movie"?a.push(new ue({type:l,title:s.Title,englishTitle:s.Title,year:s.Year,dataSource:this.apiName,id:s.imdbID})):l==="series"?a.push(new Ce({type:l,title:s.Title,englishTitle:s.Title,year:s.Year,dataSource:this.apiName,id:s.imdbID})):l==="game"&&a.push(new Pe({type:l,title:s.Title,englishTitle:s.Title,year:s.Year,dataSource:this.apiName,id:s.imdbID})))}return a}async getById(e){var s,l,p,d,c,u,m,M,g,f,T,w,D,h,y,b,_,x,E,v,C,S,F,k,te,N,I,Te,le;console.log(`MDB | api "${this.apiName}" queried by ID`);let r=`http://www.omdbapi.com/?i=${encodeURIComponent(e)}&apikey=${this.plugin.settings.OMDbKey}`,i=await fetch(r);if(i.status===401)throw Error(`MDB | Authentication for ${this.apiName} failed. Check the API key.`);if(i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);let n=await i.json();if(n.Response==="False")throw Error(`MDB | Received error from ${this.apiName}: ${n.Error}`);let a=this.typeMappings.get(n.Type.toLowerCase());if(a===void 0)throw Error(`${n.type.toLowerCase()} is an unsupported type.`);if(a==="movie")return new ue({type:a,title:n.Title,englishTitle:n.Title,year:n.Year,dataSource:this.apiName,url:`https://www.imdb.com/title/${n.imdbID}/`,id:n.imdbID,plot:(s=n.Plot)!=null?s:"",genres:(p=(l=n.Genre)==null?void 0:l.split(", "))!=null?p:[],director:(c=(d=n.Director)==null?void 0:d.split(", "))!=null?c:[],writer:(m=(u=n.Writer)==null?void 0:u.split(", "))!=null?m:[],studio:["N/A"],duration:(M=n.Runtime)!=null?M:"unknown",onlineRating:Number.parseFloat((g=n.imdbRating)!=null?g:0),actors:(T=(f=n.Actors)==null?void 0:f.split(", "))!=null?T:[],image:(w=n.Poster)!=null?w:"",released:!0,streamingServices:[],premiere:(D=this.plugin.dateFormatter.format(n.Released,this.apiDateFormat))!=null?D:"unknown",userData:{watched:!1,lastWatched:"",personalRating:0}});if(a==="series")return new Ce({type:a,title:n.Title,englishTitle:n.Title,year:n.Year,dataSource:this.apiName,url:`https://www.imdb.com/title/${n.imdbID}/`,id:n.imdbID,plot:(h=n.Plot)!=null?h:"",genres:(b=(y=n.Genre)==null?void 0:y.split(", "))!=null?b:[],writer:(x=(_=n.Writer)==null?void 0:_.split(", "))!=null?x:[],studio:[],episodes:0,duration:(E=n.Runtime)!=null?E:"unknown",onlineRating:Number.parseFloat((v=n.imdbRating)!=null?v:0),actors:(S=(C=n.Actors)==null?void 0:C.split(", "))!=null?S:[],image:(F=n.Poster)!=null?F:"",released:!0,streamingServices:[],airing:!1,airedFrom:(k=this.plugin.dateFormatter.format(n.Released,this.apiDateFormat))!=null?k:"unknown",airedTo:"unknown",userData:{watched:!1,lastWatched:"",personalRating:0}});if(a==="game")return new Pe({type:a,title:n.Title,englishTitle:n.Title,year:n.Year,dataSource:this.apiName,url:`https://www.imdb.com/title/${n.imdbID}/`,id:n.imdbID,genres:(N=(te=n.Genre)==null?void 0:te.split(", "))!=null?N:[],onlineRating:Number.parseFloat((I=n.imdbRating)!=null?I:0),image:(Te=n.Poster)!=null?Te:"",released:!0,releaseDate:(le=this.plugin.dateFormatter.format(n.Released,this.apiDateFormat))!=null?le:"unknown",userData:{played:!1,personalRating:0}})}};var Pi=class extends J{constructor(e){super();this.apiDateFormat="YYYY-MM-DDTHH:mm:ssZ";this.plugin=e,this.apiName="MALAPI",this.apiDescription="A free API for Anime. Some results may take a long time to load.",this.apiUrl="https://jikan.moe/",this.types=["movie","series"],this.typeMappings=new Map,this.typeMappings.set("movie","movie"),this.typeMappings.set("special","special"),this.typeMappings.set("tv","series"),this.typeMappings.set("ova","ova")}async searchByTitle(e){var s,l,p,d,c,u,m,M,g,f,T,w,D,h,y,b,_,x,E;console.log(`MDB | api "${this.apiName}" queried by Title`);let r=`https://api.jikan.moe/v4/anime?q=${encodeURIComponent(e)}&limit=20${this.plugin.settings.sfwFilter?"&sfw":""}`,i=await fetch(r);if(console.debug(i),i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);let n=await i.json();console.debug(n);let a=[];for(let v of n.data){let C=this.typeMappings.get((s=v.type)==null?void 0:s.toLowerCase());C===void 0&&a.push(new ue({subType:"",title:v.title,englishTitle:(l=v.title_english)!=null?l:v.title,year:(m=(u=v.year)!=null?u:(c=(d=(p=v.aired)==null?void 0:p.prop)==null?void 0:d.from)==null?void 0:c.year)!=null?m:"",dataSource:this.apiName,id:v.mal_id})),C==="movie"||C==="special"?a.push(new ue({subType:C,title:v.title,englishTitle:(M=v.title_english)!=null?M:v.title,year:(D=(w=v.year)!=null?w:(T=(f=(g=v.aired)==null?void 0:g.prop)==null?void 0:f.from)==null?void 0:T.year)!=null?D:"",dataSource:this.apiName,id:v.mal_id})):(C==="series"||C==="ova")&&a.push(new Ce({subType:C,title:v.title,englishTitle:(h=v.title_english)!=null?h:v.title,year:(E=(x=v.year)!=null?x:(_=(b=(y=v.aired)==null?void 0:y.prop)==null?void 0:b.from)==null?void 0:_.year)!=null?E:"",dataSource:this.apiName,id:v.mal_id}))}return a}async getById(e){var l,p,d,c,u,m,M,g,f,T,w,D,h,y,b,_,x,E,v,C,S,F,k,te,N,I,Te,le,_e,gt,Le,Ye,$e,me,je,Ge,Se,yt,ti,Mt,ii,$t,ri,oi,Rt,Ot,ni,ai,De,ze,At,Nt,bt,Bt,It,Lt,jt,Pr,Fr,kr;console.log(`MDB | api "${this.apiName}" queried by ID`);let r=`https://api.jikan.moe/v4/anime/${encodeURIComponent(e)}/full`,i=await fetch(r);if(i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);let n=await i.json();console.debug(n);let a=n.data,s=this.typeMappings.get((l=a.type)==null?void 0:l.toLowerCase());if(s===void 0)return new ue({subType:"",title:a.title,englishTitle:(p=a.title_english)!=null?p:a.title,year:(M=(m=a.year)!=null?m:(u=(c=(d=a.aired)==null?void 0:d.prop)==null?void 0:c.from)==null?void 0:u.year)!=null?M:"",dataSource:this.apiName,url:a.url,id:a.mal_id,plot:a.synopsis,genres:(f=(g=a.genres)==null?void 0:g.map(Q=>Q.name))!=null?f:[],director:[],writer:[],studio:(w=(T=a.studios)==null?void 0:T.map(Q=>Q.name).join(", "))!=null?w:"unknown",duration:(D=a.duration)!=null?D:"unknown",onlineRating:(h=a.score)!=null?h:0,actors:[],image:(_=(b=(y=a.images)==null?void 0:y.jpg)==null?void 0:b.image_url)!=null?_:"",released:!0,premiere:(E=this.plugin.dateFormatter.format((x=a.aired)==null?void 0:x.from,this.apiDateFormat))!=null?E:"unknown",streamingServices:(C=(v=a.streaming)==null?void 0:v.map(Q=>Q.name))!=null?C:[],userData:{watched:!1,lastWatched:"",personalRating:0}});if(s==="movie"||s==="special")return new ue({subType:s,title:a.title,englishTitle:(S=a.title_english)!=null?S:a.title,year:(I=(N=a.year)!=null?N:(te=(k=(F=a.aired)==null?void 0:F.prop)==null?void 0:k.from)==null?void 0:te.year)!=null?I:"",dataSource:this.apiName,url:a.url,id:a.mal_id,plot:a.synopsis,genres:(le=(Te=a.genres)==null?void 0:Te.map(Q=>Q.name))!=null?le:[],director:[],writer:[],studio:(gt=(_e=a.studios)==null?void 0:_e.map(Q=>Q.name).join(", "))!=null?gt:"unknown",duration:(Le=a.duration)!=null?Le:"unknown",onlineRating:(Ye=a.score)!=null?Ye:0,actors:[],image:(je=(me=($e=a.images)==null?void 0:$e.jpg)==null?void 0:me.image_url)!=null?je:"",released:!0,premiere:(Se=this.plugin.dateFormatter.format((Ge=a.aired)==null?void 0:Ge.from,this.apiDateFormat))!=null?Se:"unknown",streamingServices:(ti=(yt=a.streaming)==null?void 0:yt.map(Q=>Q.name))!=null?ti:[],userData:{watched:!1,lastWatched:"",personalRating:0}});if(s==="series"||s==="ova")return new Ce({subType:s,title:a.title,englishTitle:(Mt=a.title_english)!=null?Mt:a.title,year:(Rt=(oi=a.year)!=null?oi:(ri=($t=(ii=a.aired)==null?void 0:ii.prop)==null?void 0:$t.from)==null?void 0:ri.year)!=null?Rt:"",dataSource:this.apiName,url:a.url,id:a.mal_id,genres:(ni=(Ot=a.genres)==null?void 0:Ot.map(Q=>Q.name))!=null?ni:[],writer:[],studio:(De=(ai=a.studios)==null?void 0:ai.map(Q=>Q.name))!=null?De:[],episodes:a.episodes,duration:(ze=a.duration)!=null?ze:"unknown",onlineRating:(At=a.score)!=null?At:0,streamingServices:(bt=(Nt=a.streaming)==null?void 0:Nt.map(Q=>Q.name))!=null?bt:[],image:(Lt=(It=(Bt=a.images)==null?void 0:Bt.jpg)==null?void 0:It.image_url)!=null?Lt:"",released:!0,airedFrom:(Pr=this.plugin.dateFormatter.format((jt=a.aired)==null?void 0:jt.from,this.apiDateFormat))!=null?Pr:"unknown",airedTo:(kr=this.plugin.dateFormatter.format((Fr=a.aired)==null?void 0:Fr.to,this.apiDateFormat))!=null?kr:"unknown",airing:a.airing,userData:{watched:!1,lastWatched:"",personalRating:0}})}};var Fi=class extends J{constructor(e){super();this.plugin=e,this.apiName="MALAPI Manga",this.apiDescription="A free API for Manga. Some results may take a long time to load.",this.apiUrl="https://jikan.moe/",this.types=["manga"],this.typeMappings=new Map,this.typeMappings.set("manga","manga"),this.typeMappings.set("manhwa","manhwa"),this.typeMappings.set("doujinshi","doujin"),this.typeMappings.set("one-shot","oneshot"),this.typeMappings.set("manhua","manhua"),this.typeMappings.set("light novel","light-novel"),this.typeMappings.set("novel","novel")}async searchByTitle(e){var s,l,p,d,c,u,m,M,g,f,T,w,D,h,y,b,_,x,E,v,C;console.log(`MDB | api "${this.apiName}" queried by Title`);let r=`https://api.jikan.moe/v4/manga?q=${encodeURIComponent(e)}&limit=20${this.plugin.settings.sfwFilter?"&sfw":""}`,i=await fetch(r);if(console.debug(i),i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);let n=await i.json();console.debug(n);let a=[];for(let S of n.data){let F=this.typeMappings.get((s=S.type)==null?void 0:s.toLowerCase());a.push(new ct({subType:F,title:S.title,plot:S.synopsis,englishTitle:(l=S.title_english)!=null?l:S.title,alternateTitles:(d=(p=S.titles)==null?void 0:p.map(k=>k.title))!=null?d:[],year:(g=(M=S.year)!=null?M:(m=(u=(c=S.published)==null?void 0:c.prop)==null?void 0:u.from)==null?void 0:m.year)!=null?g:"",dataSource:this.apiName,url:S.url,id:S.mal_id,genres:(T=(f=S.genres)==null?void 0:f.map(k=>k.name))!=null?T:[],authors:(D=(w=S.authors)==null?void 0:w.map(k=>k.name))!=null?D:[],chapters:S.chapters,volumes:S.volumes,onlineRating:(h=S.score)!=null?h:0,image:(_=(b=(y=S.images)==null?void 0:y.jpg)==null?void 0:b.image_url)!=null?_:"",released:!0,publishedFrom:(E=new Date((x=S.published)==null?void 0:x.from).toLocaleDateString())!=null?E:"unknown",publishedTo:(C=new Date((v=S.published)==null?void 0:v.to).toLocaleDateString())!=null?C:"unknown",status:S.status,userData:{watched:!1,lastWatched:"",personalRating:0}}))}return a}async getById(e){var p,d,c,u,m,M,g,f,T,w,D,h,y,b,_,x,E,v,C,S,F;console.log(`MDB | api "${this.apiName}" queried by ID`);let r=`https://api.jikan.moe/v4/manga/${encodeURIComponent(e)}/full`,i=await fetch(r);if(i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);let n=await i.json();console.debug(n);let a=n.data,s=this.typeMappings.get((p=a.type)==null?void 0:p.toLowerCase());return new ct({subType:s,title:a.title,englishTitle:(d=a.title_english)!=null?d:a.title,alternateTitles:(u=(c=a.titles)==null?void 0:c.map(k=>k.title))!=null?u:[],year:(T=(f=a.year)!=null?f:(g=(M=(m=a.published)==null?void 0:m.prop)==null?void 0:M.from)==null?void 0:g.year)!=null?T:"",dataSource:this.apiName,url:a.url,id:a.mal_id,plot:a.synopsis,genres:(D=(w=a.genres)==null?void 0:w.map(k=>k.name))!=null?D:[],authors:(y=(h=a.authors)==null?void 0:h.map(k=>k.name))!=null?y:[],chapters:a.chapters,volumes:a.volumes,onlineRating:(b=a.score)!=null?b:0,image:(E=(x=(_=a.images)==null?void 0:_.jpg)==null?void 0:x.image_url)!=null?E:"",released:!0,publishedFrom:(C=new Date((v=a.published)==null?void 0:v.from).toLocaleDateString())!=null?C:"unknown",publishedTo:(F=new Date((S=a.published)==null?void 0:S.to).toLocaleDateString())!=null?F:"unknown",status:a.status,userData:{watched:!1,lastWatched:"",personalRating:0}})}};var ki=class extends J{constructor(e){super();this.apiDateFormat="YYYY-MM-DDTHH:mm:ssZ";this.plugin=e,this.apiName="Wikipedia API",this.apiDescription="The API behind Wikipedia",this.apiUrl="https://www.wikipedia.com",this.types=["wiki"]}async searchByTitle(e){console.log(`MDB | api "${this.apiName}" queried by Title`);let r=`https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=${encodeURIComponent(e)}&srlimit=20&utf8=&format=json&origin=*`,i=await fetch(r);if(console.debug(i),i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);let n=await i.json();console.debug(n);let a=[];for(let s of n.query.search)a.push(new ut({type:"wiki",title:s.title,englishTitle:s.title,year:"",dataSource:this.apiName,id:s.pageid}));return a}async getById(e){var l;console.log(`MDB | api "${this.apiName}" queried by ID`);let r=`https://en.wikipedia.org/w/api.php?action=query&prop=info&pageids=${encodeURIComponent(e)}&inprop=url&format=json&origin=*`,i=await fetch(r);if(i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);let n=await i.json();console.debug(n);let a=Object.entries((l=n==null?void 0:n.query)==null?void 0:l.pages)[0][1];return new ut({type:"wiki",title:a.title,englishTitle:a.title,year:"",dataSource:this.apiName,url:a.fullurl,id:a.pageid,wikiUrl:a.fullurl,lastUpdated:this.plugin.dateFormatter.format(a.touched,this.apiDateFormat),length:a.length,userData:{}})}};var Dr=require("obsidian");var $i=class extends J{constructor(e){super();this.plugin=e,this.apiName="MusicBrainz API",this.apiDescription="Free API for music albums.",this.apiUrl="https://musicbrainz.org/",this.types=["musicRelease"]}async searchByTitle(e){console.log(`MDB | api "${this.apiName}" queried by Title`);let r=`https://musicbrainz.org/ws/2/release-group?query=${encodeURIComponent(e)}&limit=20&fmt=json`,i=await(0,Dr.requestUrl)({url:r,headers:{"User-Agent":`${pr}/${cr} (${dr})`}});if(console.debug(i),i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);let n=await i.json;console.debug(n);let a=[];for(let s of n["release-groups"])a.push(new mt({type:"musicRelease",title:s.title,englishTitle:s.title,year:new Date(s["first-release-date"]).getFullYear().toString(),dataSource:this.apiName,url:"https://musicbrainz.org/release-group/"+s.id,id:s.id,image:"https://coverartarchive.org/release-group/"+s.id+"/front",artists:s["artist-credit"].map(l=>l.name),subType:s["primary-type"]}));return a}async getById(e){console.log(`MDB | api "${this.apiName}" queried by ID`);let r=`https://musicbrainz.org/ws/2/release-group/${encodeURIComponent(e)}?inc=releases+artists+tags+ratings+genres&fmt=json`,i=await(0,Dr.requestUrl)({url:r,headers:{"User-Agent":`${pr}/${cr} (${dr})`}});if(i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);let n=await i.json;console.debug(n);let a=n;return new mt({type:"musicRelease",title:a.title,englishTitle:a.title,year:new Date(a["first-release-date"]).getFullYear().toString(),dataSource:this.apiName,url:"https://musicbrainz.org/release-group/"+a.id,id:a.id,image:"https://coverartarchive.org/release-group/"+a.id+"/front",artists:a["artist-credit"].map(l=>l.name),genres:a.genres.map(l=>l.name),subType:a["primary-type"],rating:a.rating.value*2,userData:{personalRating:0}})}};var Er=require("obsidian");var Ri=class extends J{constructor(e){super();this.apiDateFormat="DD MMM, YYYY";this.plugin=e,this.apiName="SteamAPI",this.apiDescription="A free API for all Steam games.",this.apiUrl="http://www.steampowered.com/",this.types=["game"],this.typeMappings=new Map,this.typeMappings.set("game","game")}async searchByTitle(e){console.log(`MDB | api "${this.apiName}" queried by Title`);let i=await(0,Er.requestUrl)({url:"http://api.steampowered.com/ISteamApps/GetAppList/v0002/?format=json"});if(i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);let n=await i.json;console.debug(n);let a=[];for(let l of n.applist.apps)if(l.name.toLowerCase().includes(e.toLowerCase())&&a.push(l),a.length>20)break;let s=[];for(let l of a)s.push(new Pe({type:"game",title:l.name,englishTitle:l.name,year:"",dataSource:this.apiName,id:l.appid}));return s}async getById(e){var s,l,p,d,c,u,m,M;console.log(`MDB | api "${this.apiName}" queried by ID`);let r=`http://store.steampowered.com/api/appdetails?appids=${encodeURIComponent(e)}&l=en`,i=await(0,Er.requestUrl)({url:r});if(i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);console.debug(await i.json);let n;for(let[g,f]of Object.entries(await i.json))g===String(e)&&(n=f.data);if(!n)throw Error("MDB | API returned invalid data.");return console.debug(n),new Pe({type:"game",title:n.name,englishTitle:n.name,year:new Date(n.release_date.date).getFullYear().toString(),dataSource:this.apiName,url:`https://store.steampowered.com/app/${n.steam_appid}`,id:n.steam_appid,genres:(l=(s=n.genres)==null?void 0:s.map(g=>g.description))!=null?l:[],onlineRating:Number.parseFloat((d=(p=n.metacritic)==null?void 0:p.score)!=null?d:0),image:(c=n.header_image)!=null?c:"",released:!((u=n.release_date)!=null&&u.comming_soon),releaseDate:(M=this.plugin.dateFormatter.format((m=n.release_date)==null?void 0:m.date,this.apiDateFormat))!=null?M:"unknown",userData:{played:!1,personalRating:0}})}};var Cr=require("obsidian");var Oi=class extends J{constructor(e){super();this.plugin=e,this.apiName="BoardGameGeekAPI",this.apiDescription="A free API for BoardGameGeek things.",this.apiUrl="https://api.geekdo.com/xmlapi",this.types=["boardgame"]}async searchByTitle(e){var l,p,d,c;console.log(`MDB | api "${this.apiName}" queried by Title`);let r=`${this.apiUrl}/search?search=${encodeURIComponent(e)}`,i=await(0,Cr.requestUrl)({url:r});if(i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);let n=i.text,a=new window.DOMParser().parseFromString(n,"text/xml");console.debug(a);let s=[];for(let u of Array.from(a.querySelectorAll("boardgame"))){let m=u.attributes.getNamedItem("objectid").value,M=(p=(l=u.querySelector("name[primary=true]"))==null?void 0:l.textContent)!=null?p:u.querySelector("name").textContent,g=(c=(d=u.querySelector("yearpublished"))==null?void 0:d.textContent)!=null?c:"";s.push(new ft({dataSource:this.apiName,id:m,title:M,englishTitle:M,year:g}))}return s}async getById(e){var D,h,y,b,_,x,E,v,C,S,F,k,te,N;console.log(`MDB | api "${this.apiName}" queried by ID`);let r=`${this.apiUrl}/boardgame/${encodeURIComponent(e)}?stats=1`,i=await(0,Cr.requestUrl)({url:r});if(i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);let n=i.text,a=new window.DOMParser().parseFromString(n,"text/xml");console.debug(a);let s=a.querySelector("boardgame"),l=s.querySelector("name[primary=true]").textContent,p=(h=(D=s.querySelector("yearpublished"))==null?void 0:D.textContent)!=null?h:"",d=(b=(y=s.querySelector("image"))==null?void 0:y.textContent)!=null?b:void 0,c=Number.parseFloat((x=(_=s.querySelector("statistics ratings average"))==null?void 0:_.textContent)!=null?x:"0"),u=Array.from(s.querySelectorAll("boardgamecategory")).map(I=>I.textContent),m=Number.parseFloat((v=(E=s.querySelector("averageweight"))==null?void 0:E.textContent)!=null?v:"0"),M=Number.parseFloat((S=(C=s.querySelector("minplayers"))==null?void 0:C.textContent)!=null?S:"0"),g=Number.parseFloat((k=(F=s.querySelector("maxplayers"))==null?void 0:F.textContent)!=null?k:"0"),f=((N=(te=s.querySelector("playingtime"))==null?void 0:te.textContent)!=null?N:"unknown")+" minutes",T=Array.from(s.querySelectorAll("boardgamepublisher")).map(I=>I.textContent);return new ft({title:l,englishTitle:l,year:p==="0"?"":p,dataSource:this.apiName,url:`https://boardgamegeek.com/boardgame/${e}`,id:e,genres:u,onlineRating:c,complexityRating:m,minPlayers:M,maxPlayers:g,playtime:f,publishers:T,image:d,released:!0,userData:{played:!1,personalRating:0}})}};var Ai=class extends J{constructor(e){super();this.plugin=e,this.apiName="OpenLibraryAPI",this.apiDescription="A free API for books",this.apiUrl="https://openlibrary.org/",this.types=["book"]}async searchByTitle(e){var s;console.log(`MDB | api "${this.apiName}" queried by Title`);let r=`https://openlibrary.org/search.json?title=${encodeURIComponent(e)}`,i=await fetch(r);if(console.debug(i),i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);let n=await i.json();console.debug(n);let a=[];for(let l of n.docs)a.push(new ht({title:l.title,englishTitle:(s=l.title_english)!=null?s:l.title,year:l.first_publish_year,dataSource:this.apiName,id:l.key}));return a}async getById(e){var l,p,d,c,u;console.log(`MDB | api "${this.apiName}" queried by ID`);let r=`https://openlibrary.org/search.json?q=key:${encodeURIComponent(e)}`,i=await fetch(r);if(console.debug(i),i.status!==200)throw Error(`MDB | Received status code ${i.status} from an API.`);let n=await i.json();console.debug(n);let a=n.docs[0];return new ht({title:a.title,year:a.first_publish_year,dataSource:this.apiName,url:"https://openlibrary.org"+a.key,id:a.key,englishTitle:(l=a.title_english)!=null?l:a.title,author:(p=a.author_name)!=null?p:"unknown",plot:(d=a.description)!=null?d:"unknown",pages:(c=a.number_of_pages_median)!=null?c:"unknown",onlineRating:Number.parseFloat(Number((u=a.ratings_average)!=null?u:0).toFixed(2)),image:"https://covers.openlibrary.org/b/OLID/"+a.cover_edition_key+"-L.jpg",released:!0,userData:{read:!1,lastRead:"",personalRating:0}})}};var Ni=class{constructor(t){this.plugin=t}convertObject(t){if(!t.hasOwnProperty("type")||Fe.filter(i=>i.toString()==t.type).length<1)return t;let e=this.plugin.settings.propertyMappingModels.find(i=>i.type===t.type).properties,r={};for(let[i,n]of Object.entries(t))for(let a of e)if(a.property===i){a.mapping==="remap"?r[a.newProperty]=n:a.mapping==="remove"||a.mapping==="default"&&(r[i]=n);break}return r}convertObjectBack(t){if(!t.hasOwnProperty("type")||Fe.contains(t.type))return t;let e=this.plugin.settings.propertyMappingModels.find(i=>i.type===t.type).properties,r={};e:for(let[i,n]of Object.entries(t)){for(let a of e)if(a.property===i){r[i]=n;continue e}for(let a of e)if(a.newProperty===i){r[a.property]=n;continue e}}return r}};var ei=class o{static toYaml(t){let e="";for(let[r,i]of Object.entries(t))e+=`${r}: ${o.toYamlString(i,0)} +`;return e}static toYamlString(t,e){if(t==null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number")return t.toString();if(typeof t=="string")return'"'+t.replace('"','\\"')+'"';if(typeof t=="object"){let r="";if(Array.isArray(t))for(let i of t)r+=` +${o.calculateSpacing(e)} - ${o.toYamlString(i,e+1)}`;else for(let[i,n]of Object.entries(t))r+=` +${o.calculateSpacing(e)} ${i}: ${o.toYamlString(n,e+1)}`;return r}}static calculateSpacing(t){return" ".repeat(t*4)}};var ke=require("obsidian"),Bi=class extends ke.Modal{constructor(e,r,i){super(e);this.plugin=r,this.onSubmit=i,this.selectedApi=r.apiManager.apis[0].apiName}submit(){this.onSubmit(this.selectedApi,this.titleFieldName,this.appendContent),this.close()}onOpen(){let{contentEl:e}=this;e.createEl("h2",{text:"Import folder as Media DB entries"});let r=e.createEl("div",{cls:"media-db-plugin-list-wrapper"});r.createEl("div",{cls:"media-db-plugin-list-text-wrapper"}).createEl("span",{text:"API to search",cls:"media-db-plugin-list-text"});let n=new ke.DropdownComponent(r);n.onChange(u=>{this.selectedApi=u});for(let u of this.plugin.apiManager.apis)n.addOption(u.apiName,u.apiName);r.appendChild(n.selectEl),e.createDiv({cls:"media-db-plugin-spacer"}),e.createEl("h3",{text:"Append note content to Media DB entry."});let a=e.createEl("div",{cls:"media-db-plugin-list-wrapper"});a.createEl("div",{cls:"media-db-plugin-list-text-wrapper"}).createEl("span",{text:"If this is enabled, the plugin will override metadata fields with the same name.",cls:"media-db-plugin-list-text"});let l=a.createEl("div",{cls:"media-db-plugin-list-toggle"}),p=new ke.ToggleComponent(a);p.setValue(!1),p.onChange(u=>this.appendContent=u),l.appendChild(p.toggleEl),e.createDiv({cls:"media-db-plugin-spacer"}),e.createEl("h3",{text:"The name of the metadata field that should be used as the title to query."});let d="title",c=new ke.TextComponent(e);c.inputEl.style.width="100%",c.setPlaceholder(d),c.onChange(u=>this.titleFieldName=u),c.inputEl.addEventListener("keydown",u=>{u.key==="Enter"&&this.submit()}),e.appendChild(c.inputEl),e.createDiv({cls:"media-db-plugin-spacer"}),new ke.Setting(e).addButton(u=>{u.setButtonText("Cancel"),u.onClick(()=>this.close()),u.buttonEl.addClass("media-db-plugin-button")}).addButton(u=>{u.setButtonText("Ok"),u.setCta(),u.onClick(()=>{this.submit()}),u.buttonEl.addClass("media-db-plugin-button"),this.searchBtn=u})}onClose(){let{contentEl:e}=this;e.empty()}};var be=require("obsidian");var Ii=class extends be.Modal{constructor(e,r){r=Object.assign({},jo,r);super(e.app);this.plugin=e,this.selectedApis=[],this.title=r.modalTitle,this.query=r.prefilledSearchString;for(let i of this.plugin.apiManager.apis)this.selectedApis.push({name:i.apiName,selected:r.preselectedAPIs.contains(i.apiName)})}setSubmitCallback(e){this.submitCallback=e}setCloseCallback(e){this.closeCallback=e}keyPressCallback(e){e.key==="Enter"&&this.search()}async search(){if(!this.query||this.query.length<3){new be.Notice("MDB | Query too short");return}let e=this.selectedApis.filter(r=>r.selected).map(r=>r.name);if(e.length===0){new be.Notice("MDB | No API selected");return}this.isBusy||(this.isBusy=!0,this.searchBtn.setDisabled(!1),this.searchBtn.setButtonText("Searching..."),this.submitCallback({query:this.query,apis:e}))}onOpen(){let{contentEl:e}=this;e.createEl("h2",{text:this.title});let r="Search by title",i=new be.TextComponent(e);i.inputEl.style.width="100%",i.setPlaceholder(r),i.setValue(this.query),i.onChange(n=>this.query=n),i.inputEl.addEventListener("keydown",this.keyPressCallback.bind(this)),e.appendChild(i.inputEl),i.inputEl.focus(),e.createDiv({cls:"media-db-plugin-spacer"}),e.createEl("h3",{text:"APIs to search"});for(let n of this.plugin.apiManager.apis){let a=e.createEl("div",{cls:"media-db-plugin-list-wrapper"}),s=a.createEl("div",{cls:"media-db-plugin-list-text-wrapper"});s.createEl("span",{text:n.apiName,cls:"media-db-plugin-list-text"}),s.createEl("small",{text:n.apiDescription,cls:"media-db-plugin-list-text"});let l=a.createEl("div",{cls:"media-db-plugin-list-toggle"}),p=new be.ToggleComponent(l);p.setTooltip(n.apiName),p.setValue(this.selectedApis.find(d=>d.name===n.apiName).selected),p.onChange(d=>{this.selectedApis.find(c=>c.name===n.apiName).selected=d}),l.appendChild(p.toggleEl)}e.createDiv({cls:"media-db-plugin-spacer"}),new be.Setting(e).addButton(n=>{n.setButtonText("Cancel"),n.onClick(()=>this.close()),n.buttonEl.addClass("media-db-plugin-button")}).addButton(n=>{n.setButtonText("Ok"),n.setCta(),n.onClick(()=>{this.search()}),n.buttonEl.addClass("media-db-plugin-button"),this.searchBtn=n})}onClose(){this.closeCallback();let{contentEl:e}=this;e.empty()}};var ve=require("obsidian");var Li=class extends ve.Modal{constructor(e,r){r=Object.assign({},Wo,r);super(e.app);this.plugin=e,this.title=r.modalTitle,this.selectedApi=r.preselectedAPI||e.apiManager.apis[0].apiName}setSubmitCallback(e){this.submitCallback=e}setCloseCallback(e){this.closeCallback=e}keyPressCallback(e){e.key==="Enter"&&this.search()}async search(){if(!this.query){new ve.Notice("MDB | no Id entered");return}if(!this.selectedApi){new ve.Notice("MDB | No API selected");return}this.isBusy||(this.isBusy=!0,this.searchBtn.setDisabled(!1),this.searchBtn.setButtonText("Searching..."),this.submitCallback({query:this.query,api:this.selectedApi}))}onOpen(){let{contentEl:e}=this;e.createEl("h2",{text:this.title});let r="Search by id",i=new ve.TextComponent(e);i.inputEl.style.width="100%",i.setPlaceholder(r),i.onChange(l=>this.query=l),i.inputEl.addEventListener("keydown",this.keyPressCallback.bind(this)),e.appendChild(i.inputEl),i.inputEl.focus(),e.createDiv({cls:"media-db-plugin-spacer"});let n=e.createEl("div",{cls:"media-db-plugin-list-wrapper"});n.createEl("div",{cls:"media-db-plugin-list-text-wrapper"}).createEl("span",{text:"API to search",cls:"media-db-plugin-list-text"});let s=new ve.DropdownComponent(n);s.onChange(l=>{this.selectedApi=l});for(let l of this.plugin.apiManager.apis)s.addOption(l.apiName,l.apiName);n.appendChild(s.selectEl),e.createDiv({cls:"media-db-plugin-spacer"}),new ve.Setting(e).addButton(l=>{l.setButtonText("Cancel"),l.onClick(()=>this.close()),l.buttonEl.addClass("media-db-plugin-button")}).addButton(l=>{l.setButtonText("Ok"),l.setCta(),l.onClick(()=>{this.search()}),l.buttonEl.addClass("media-db-plugin-button"),this.searchBtn=l})}onClose(){this.closeCallback();let{contentEl:e}=this;e.empty()}};var qi=require("obsidian");var ji=class{constructor(t,e,r,i,n=!1){this.value=t,this.id=r,this.active=n,this.selectModal=i,this.cssClass="media-db-plugin-select-element",this.activeClass="media-db-plugin-select-element-selected",this.hoverClass="media-db-plugin-select-element-hover",this.element=e.createDiv({cls:this.cssClass}),this.element.id=this.getHTMLId(),this.element.on("click","#"+this.getHTMLId(),()=>{this.setActive(!this.active),this.selectModal.allowMultiSelect||this.selectModal.disableAllOtherElements(this.id)}),this.element.on("mouseenter","#"+this.getHTMLId(),()=>{this.setHighlighted(!0)}),this.element.on("mouseleave","#"+this.getHTMLId(),()=>{this.setHighlighted(!1)})}getHTMLId(){return`media-db-plugin-select-element-${this.id}`}isHighlighted(){return this.highlighted}setHighlighted(t){this.highlighted=t,this.highlighted?(this.addClass(this.hoverClass),this.selectModal.deHighlightAllOtherElements(this.id)):this.removeClass(this.hoverClass)}isActive(){return this.active}setActive(t){this.active=t,this.update()}update(){this.active?this.addClass(this.activeClass):this.removeClass(this.activeClass)}addClass(t){this.element.hasClass(t)||this.element.addClass(t)}removeClass(t){this.element.hasClass(t)&&this.element.removeClass(t)}};var Wi=class extends qi.Modal{constructor(e,r,i=!0){super(e);this.allowMultiSelect=i,this.title="",this.description="",this.addSkipButton=!1,this.cancelButton=void 0,this.skipButton=void 0,this.submitButton=void 0,this.elementWrapper=void 0,this.elements=r,this.selectModalElements=[],this.scope.register([],"ArrowUp",n=>{this.highlightUp(),n.preventDefault()}),this.scope.register([],"ArrowDown",n=>{this.highlightDown(),n.preventDefault()}),this.scope.register([],"ArrowRight",()=>{this.activateHighlighted()}),this.scope.register([]," ",n=>{this.elementWrapper&&this.elementWrapper===document.activeElement&&(this.activateHighlighted(),n.preventDefault())}),this.scope.register([],"Enter",()=>this.submit())}disableAllOtherElements(e){for(let r of this.selectModalElements)r.id!==e&&r.setActive(!1)}deHighlightAllOtherElements(e){for(let r of this.selectModalElements)r.id!==e&&r.setHighlighted(!1)}async onOpen(){var a;let{contentEl:e,titleEl:r}=this;r.createEl("h2",{text:this.title}),e.addClass("media-db-plugin-select-modal"),e.createEl("p",{text:this.description}),this.elementWrapper=e.createDiv({cls:"media-db-plugin-select-wrapper"}),this.elementWrapper.tabIndex=0;let i=0;for(let s of this.elements){let l=new ji(s,this.elementWrapper,i,this,!1);this.selectModalElements.push(l),this.renderElement(s,l.element),i+=1}(a=this.selectModalElements.first())==null||a.element.scrollIntoView();let n=new qi.Setting(e);n.addButton(s=>{s.setButtonText("Cancel"),s.onClick(()=>this.close()),s.buttonEl.addClass("media-db-plugin-button"),this.cancelButton=s}),this.addSkipButton&&n.addButton(s=>{s.setButtonText("Skip"),s.onClick(()=>this.skip()),s.buttonEl.addClass("media-db-plugin-button"),this.skipButton=s}),n.addButton(s=>{s.setButtonText("Ok"),s.setCta(),s.onClick(()=>this.submit()),s.buttonEl.addClass("media-db-plugin-button"),this.submitButton=s})}activateHighlighted(){for(let e of this.selectModalElements)e.isHighlighted()&&(e.setActive(!e.isActive()),this.allowMultiSelect||this.disableAllOtherElements(e.id))}highlightUp(){for(let e of this.selectModalElements)if(e.isHighlighted()){this.getPreviousSelectModalElement(e).setHighlighted(!0);return}this.selectModalElements.last().setHighlighted(!0)}highlightDown(){for(let e of this.selectModalElements)if(e.isHighlighted()){this.getNextSelectModalElement(e).setHighlighted(!0);return}this.selectModalElements.first().setHighlighted(!0)}getNextSelectModalElement(e){let r=e.id+1;return r=fi(r,this.selectModalElements.length),this.selectModalElements.filter(i=>i.id===r).first()}getPreviousSelectModalElement(e){let r=e.id-1;return r=fi(r,this.selectModalElements.length),this.selectModalElements.filter(i=>i.id===r).first()}};var Ui=class extends Wi{constructor(e,r){r=Object.assign({},qo,r);super(e.app,r.elements,r.multiSelect);this.plugin=e,this.title=r.modalTitle,this.description="Select one or multiple search results.",this.addSkipButton=r.skipButton,this.busy=!1,this.sendCallback=!1}setSubmitCallback(e){this.submitCallback=e}setCloseCallback(e){this.closeCallback=e}setSkipCallback(e){this.skipCallback=e}renderElement(e,r){r.createEl("div",{text:this.plugin.mediaTypeManager.getFileName(e)}),r.createEl("small",{text:`${e.getSummary()} +`}),r.createEl("small",{text:`${e.type.toUpperCase()+(e.subType?` (${e.subType})`:"")} from ${e.dataSource}`})}submit(){this.busy||(this.busy=!0,this.submitButton.setButtonText("Creating entry..."),this.submitCallback({selected:this.selectModalElements.filter(e=>e.isActive()).map(e=>e.value)}))}skip(){this.skipButton.setButtonText("Skipping..."),this.skipCallback()}onClose(){this.closeCallback()}};var xe=require("obsidian");var Ve=require("obsidian");var Hi=class extends Ve.Modal{constructor(e,r){r=Object.assign({},Uo,r);super(e.app);this.plugin=e,this.title=r.modalTitle,this.elements=r.elements,this.markdownComponent=new Ve.Component}setSubmitCallback(e){this.submitCallback=e}setCloseCallback(e){this.closeCallback=e}async preview(){let{contentEl:e}=this;e.addClass("media-db-plugin-preview-modal"),e.createEl("h2",{text:this.title});let r=e.createDiv({cls:"media-db-plugin-preview-wrapper"});this.markdownComponent.load();for(let n of this.elements){r.createEl("h3",{text:n.englishTitle});let a=r.createDiv({cls:"media-db-plugin-preview"}),s=this.plugin.generateMediaDbNoteFrontmatterPreview(n);s=`\`\`\`yaml +${s}\`\`\``;try{await Ve.MarkdownRenderer.render(this.app,s,a,"",this.markdownComponent)}catch(l){console.warn("mdb | error during rendering of preview",l)}}e.createDiv({cls:"media-db-plugin-spacer"});let i=new Ve.Setting(e);i.addButton(n=>{n.setButtonText("Cancel"),n.onClick(()=>this.close()),n.buttonEl.addClass("media-db-plugin-button"),this.cancelButton=n}),i.addButton(n=>{n.setButtonText("Ok"),n.setCta(),n.onClick(()=>this.submitCallback({confirmed:!0})),n.buttonEl.addClass("media-db-plugin-button"),this.submitButton=n})}onOpen(){this.preview()}onClose(){this.markdownComponent.unload(),this.closeCallback()}};var we=require("obsidian");var Vi=class extends we.Modal{constructor(e,r){r=Object.assign({},Ho,r);super(e.app);this.plugin=e,this.selectedTypes=[],this.title=r.modalTitle,this.query=r.prefilledSearchString;for(let i of Fe)this.selectedTypes.push({name:i,selected:r.preselectedTypes.contains(i)})}setSubmitCallback(e){this.submitCallback=e}setCloseCallback(e){this.closeCallback=e}keyPressCallback(e){e.key==="Enter"&&this.search()}async search(){if(!this.query||this.query.length<3){new we.Notice("MDB | Query too short");return}let e=this.selectedTypes.filter(r=>r.selected).map(r=>r.name);if(e.length===0){new we.Notice("MDB | No Type selected");return}this.isBusy||(this.isBusy=!0,this.searchBtn.setDisabled(!1),this.searchBtn.setButtonText("Searching..."),this.submitCallback({query:this.query,types:e}))}onOpen(){let{contentEl:e}=this;e.createEl("h2",{text:this.title});let r="Search by title",i=new we.TextComponent(e);i.inputEl.style.width="100%",i.setPlaceholder(r),i.setValue(this.query),i.onChange(n=>this.query=n),i.inputEl.addEventListener("keydown",this.keyPressCallback.bind(this)),e.appendChild(i.inputEl),i.inputEl.focus(),e.createDiv({cls:"media-db-plugin-spacer"}),e.createEl("h3",{text:"APIs to search"});for(let n of Fe){let a=e.createEl("div",{cls:"media-db-plugin-list-wrapper"});a.createEl("div",{cls:"media-db-plugin-list-text-wrapper"}).createEl("span",{text:zt(n),cls:"media-db-plugin-list-text"});let l=a.createEl("div",{cls:"media-db-plugin-list-toggle"}),p=new we.ToggleComponent(l);p.setTooltip(zt(n)),p.setValue(this.selectedTypes.find(d=>d.name===n).selected),p.onChange(d=>{this.selectedTypes.find(c=>c.name===n).selected=d}),l.appendChild(p.toggleEl)}e.createDiv({cls:"media-db-plugin-spacer"}),new we.Setting(e).addButton(n=>{n.setButtonText("Cancel"),n.onClick(()=>this.close()),n.buttonEl.addClass("media-db-plugin-button")}).addButton(n=>{n.setButtonText("Ok"),n.setCta(),n.onClick(()=>{this.search()}),n.buttonEl.addClass("media-db-plugin-button"),this.searchBtn=n})}onClose(){this.closeCallback();let{contentEl:e}=this;e.empty()}};var Ho={modalTitle:"Media DB Search",preselectedTypes:[],prefilledSearchString:""},jo={modalTitle:"Media DB Advanced Search",preselectedAPIs:[],prefilledSearchString:""},Wo={modalTitle:"Media DB Id Search",preselectedAPI:"",prefilledSearchString:""},qo={modalTitle:"Media DB Search Results",elements:[],multiSelect:!0,skipButton:!1},Uo={modalTitle:"Media DB Preview",elements:[]},Yi=class{constructor(t){this.plugin=t}async createSearchModal(t){let e=new Vi(this.plugin,t);return{searchModalResult:await new Promise(i=>{e.setSubmitCallback(n=>i({code:0,data:n})),e.setCloseCallback(n=>{n&&i({code:3,error:n}),i({code:2})}),e.open()}),searchModal:e}}async openSearchModal(t,e){let{searchModalResult:r,searchModal:i}=await this.createSearchModal(t);if(console.debug(`MDB | searchModal closed with code ${r.code}`),r.code===3){console.warn(r.error),new xe.Notice(r.error.toString()),i.close();return}if(r.code!==2)try{let n=await e(r.data);return i.close(),n}catch(n){console.warn(n),new xe.Notice(n.toString()),i.close();return}}async createAdvancedSearchModal(t){let e=new Ii(this.plugin,t);return{advancedSearchModalResult:await new Promise(i=>{e.setSubmitCallback(n=>i({code:0,data:n})),e.setCloseCallback(n=>{n&&i({code:3,error:n}),i({code:2})}),e.open()}),advancedSearchModal:e}}async openAdvancedSearchModal(t,e){let{advancedSearchModalResult:r,advancedSearchModal:i}=await this.createAdvancedSearchModal(t);if(console.debug(`MDB | advencedSearchModal closed with code ${r.code}`),r.code===3){console.warn(r.error),new xe.Notice(r.error.toString()),i.close();return}if(r.code!==2)try{let n=await e(r.data);return i.close(),n}catch(n){console.warn(n),new xe.Notice(n.toString()),i.close();return}}async createIdSearchModal(t){let e=new Li(this.plugin,t);return{idSearchModalResult:await new Promise(i=>{e.setSubmitCallback(n=>i({code:0,data:n})),e.setCloseCallback(n=>{n&&i({code:3,error:n}),i({code:2})}),e.open()}),idSearchModal:e}}async openIdSearchModal(t,e){let{idSearchModalResult:r,idSearchModal:i}=await this.createIdSearchModal(t);if(console.debug(`MDB | idSearchModal closed with code ${r.code}`),r.code===3){console.warn(r.error),new xe.Notice(r.error.toString()),i.close();return}if(r.code!==2)try{let n=await e(r.data);return i.close(),n}catch(n){console.warn(n),new xe.Notice(n.toString()),i.close();return}}async createSelectModal(t){let e=new Ui(this.plugin,t);return{selectModalResult:await new Promise(i=>{e.setSubmitCallback(n=>i({code:0,data:n})),e.setSkipCallback(()=>i({code:1})),e.setCloseCallback(n=>{n&&i({code:3,error:n}),i({code:2})}),e.open()}),selectModal:e}}async openSelectModal(t,e){let{selectModalResult:r,selectModal:i}=await this.createSelectModal(t);if(console.debug(`MDB | selectModal closed with code ${r.code}`),r.code===3){console.warn(r.error),new xe.Notice(r.error.toString()),i.close();return}if(r.code!==2&&r.code!==1)try{let n=await e(r.data);return i.close(),n}catch(n){console.warn(n),new xe.Notice(n.toString()),i.close();return}}async createPreviewModal(t){let e=new Hi(this.plugin,t);return{previewModalResult:await new Promise(i=>{e.setSubmitCallback(n=>i({code:0,data:n})),e.setCloseCallback(n=>{n&&i({code:3,error:n}),i({code:2})}),e.open()}),previewModal:e}}async openPreviewModal(t,e){let{previewModalResult:r,previewModal:i}=await this.createPreviewModal(t);if(console.debug(`MDB | previewModal closed with code ${r.code}`),r.code===3){console.warn(r.error),new xe.Notice(r.error.toString()),i.close();return}if(r.code!==2)try{let n=await e(r.data);return i.close(),n}catch(n){console.warn(n),new xe.Notice(n.toString()),i.close();return}}};var kt=require("obsidian"),Gi=class{constructor(){this.toFormat="YYYY-MM-DD",this.locale=new Intl.DateTimeFormat().resolvedOptions().locale}setFormat(t){this.toFormat=t}getPreview(t){let e=(0,kt.moment)();return t||(t=this.toFormat),e.locale(this.locale).format(t)}format(t,e,r="en"){if(!t)return null;let i;return e?i=(0,kt.moment)(t,e,r):this.hasMomentFormat(t)?i=(0,kt.moment)(t):i=(0,kt.moment)(new Date(t)),i.isValid()?i.locale(this.locale).format(this.toFormat):null}hasMomentFormat(t){return(0,kt.moment)(t,!0).isValid()}};var zi=class extends ne.Plugin{constructor(){super(...arguments);this.frontMatterRexExpPattern="^(---)\\n[\\s\\S]*?\\n---"}async onload(){this.apiManager=new Ei,this.apiManager.registerAPI(new Ci(this)),this.apiManager.registerAPI(new Pi(this)),this.apiManager.registerAPI(new Fi(this)),this.apiManager.registerAPI(new ki(this)),this.apiManager.registerAPI(new $i(this)),this.apiManager.registerAPI(new Ri(this)),this.apiManager.registerAPI(new Oi(this)),this.apiManager.registerAPI(new Ai(this)),this.mediaTypeManager=new Si,this.modelPropertyMapper=new Ni(this),this.modalHelper=new Yi(this),this.dateFormatter=new Gi,await this.loadSettings(),this.addSettingTab(new Di(this.app,this)),this.mediaTypeManager.updateTemplates(this.settings),this.mediaTypeManager.updateFolders(this.settings),this.dateFormatter.setFormat(this.settings.customDateFormat),this.addRibbonIcon("database","Add new Media DB entry",()=>this.createEntryWithAdvancedSearchModal()).addClass("obsidian-media-db-plugin-ribbon-class"),this.registerEvent(this.app.workspace.on("file-menu",(r,i)=>{i instanceof ne.TFolder&&r.addItem(n=>{n.setTitle("Import folder as Media DB entries").setIcon("database").onClick(()=>this.createEntriesFromFolder(i))})})),this.addCommand({id:"open-media-db-search-modal",name:"Create Media DB entry",callback:()=>this.createEntryWithSearchModal()});for(let r of Fe)this.addCommand({id:`open-media-db-search-modal-with-${r}`,name:`Create Media DB entry (${zt(r)})`,callback:()=>this.createEntryWithSearchModal({preselectedTypes:[r]})});this.addCommand({id:"open-media-db-advanced-search-modal",name:"Create Media DB entry (advanced search)",callback:()=>this.createEntryWithAdvancedSearchModal()}),this.addCommand({id:"open-media-db-id-search-modal",name:"Create Media DB entry by id",callback:()=>this.createEntryWithIdSearchModal()}),this.addCommand({id:"update-media-db-note",name:"Update open note (this will recreate the note)",checkCallback:r=>this.app.workspace.getActiveFile()?(r||this.updateActiveNote(!1),!0):!1}),this.addCommand({id:"update-media-db-note-metadata",name:"Update metadata",checkCallback:r=>this.app.workspace.getActiveFile()?(r||this.updateActiveNote(!0),!0):!1}),this.addCommand({id:"add-media-db-link",name:"Insert link",checkCallback:r=>this.app.workspace.getActiveFile()?(r||this.createLinkWithSearchModal(),!0):!1})}async createLinkWithSearchModal(){let e=await this.modalHelper.openAdvancedSearchModal({},async a=>await this.apiManager.query(a.query,a.apis));if(!e)return;let r=await this.modalHelper.openSelectModal({elements:e,multiSelect:!1},async a=>await this.queryDetails(a.selected));if(!r||r.length<1)return;let i=`[${r[0].title}](${r[0].url})`,n=this.app.workspace.getActiveViewOfType(ne.MarkdownView);n&&n.editor.replaceRange(i,n.editor.getCursor())}async createEntryWithSearchModal(e){let r=[],i=await this.modalHelper.openSearchModal(e!=null?e:{},async s=>{r=s.types;let l=this.apiManager.apis.filter(p=>p.hasTypeOverlap(s.types)).map(p=>p.apiName);return await this.apiManager.query(s.query,l)});if(!i)return;i=i.filter(s=>r.contains(s.type));let n,a;for(;!a;){if(n=await this.modalHelper.openSelectModal({elements:i},async s=>await this.queryDetails(s.selected)),!n)return;a=await this.modalHelper.openPreviewModal({elements:n},async s=>s.confirmed)}await this.createMediaDbNotes(n)}async createEntryWithAdvancedSearchModal(){let e=await this.modalHelper.openAdvancedSearchModal({},async n=>await this.apiManager.query(n.query,n.apis));if(!e)return;let r,i;for(;!i;){if(r=await this.modalHelper.openSelectModal({elements:e},async n=>await this.queryDetails(n.selected)),!r)return;i=await this.modalHelper.openPreviewModal({elements:r},async n=>n.confirmed)}await this.createMediaDbNotes(r)}async createEntryWithIdSearchModal(){let e,r;for(;!r;){if(e=await this.modalHelper.openIdSearchModal({},async i=>await this.apiManager.queryDetailedInfoById(i.query,i.api)),!e)return;r=await this.modalHelper.openPreviewModal({elements:[e]},async i=>i.confirmed)}await this.createMediaDbNoteFromModel(e,{attachTemplate:!0,openNote:!0})}async createMediaDbNotes(e,r){for(let i of e)await this.createMediaDbNoteFromModel(i,{attachTemplate:!0,attachFile:r})}async queryDetails(e){let r=[];for(let i of e)try{r.push(await this.apiManager.queryDetailedInfo(i))}catch(n){console.warn(n),new ne.Notice(n.toString())}return r}async createMediaDbNoteFromModel(e,r){try{console.debug("MDB | creating new note");let i=await this.generateMediaDbNoteContents(e,r);r.folder||(r.folder=await this.mediaTypeManager.getFolder(e,this.app)),await this.createNote(this.mediaTypeManager.getFileName(e),i,r)}catch(i){console.warn(i),new ne.Notice(i.toString())}}generateMediaDbNoteFrontmatterPreview(e){let r=this.modelPropertyMapper.convertObject(e.toMetaDataObject());return this.settings.useCustomYamlStringifier?ei.toYaml(r):(0,ne.stringifyYaml)(r)}async generateMediaDbNoteContents(e,r){let i=this.modelPropertyMapper.convertObject(e.toMetaDataObject()),n="",a=r.attachTemplate?await this.mediaTypeManager.getTemplate(e,this.app):"";return{fileMetadata:i,fileContent:n}=await this.attachFile(i,n,r.attachFile),{fileMetadata:i,fileContent:n}=await this.attachTemplate(i,n,a),n=`--- +${this.settings.useCustomYamlStringifier?ei.toYaml(i):(0,ne.stringifyYaml)(i)}--- +`+n,n}async attachFile(e,r,i){if(!i)return{fileMetadata:e,fileContent:r};let n=this.getMetadataFromFileCache(i);e=Object.assign(n,e);let a=await this.app.vault.read(i),s=new RegExp(this.frontMatterRexExpPattern);return a=a.replace(s,""),a=a.startsWith(` +`)?a.substring(1):a,r+=a,{fileMetadata:e,fileContent:r}}async attachTemplate(e,r,i){if(!i)return{fileMetadata:e,fileContent:r};let n=this.getMetaDataFromFileContent(i);e=Object.assign(n,e);let a=new RegExp(this.frontMatterRexExpPattern),s=i.replace(a,"");return r+=s,{fileMetadata:e,fileContent:r}}getMetaDataFromFileContent(e){let r,n=new RegExp(this.frontMatterRexExpPattern).exec(e);if(!n)return{};let a=n[0];return a?(a=a.substring(4),a=a.substring(0,a.length-3),r=(0,ne.parseYaml)(a),r||(r={}),console.debug("MDB | metadata read from file content",r),r):{}}getMetadataFromFileCache(e){let r=this.app.metadataCache.getFileCache(e).frontmatter;return r?(r=Object.assign({},r),delete r.position):r={},r}async createNote(e,r,i){var p;let n=(p=i.folder)!=null?p:this.app.vault.getAbstractFileByPath("/");e=io(e);let a=`${n.path}/${e}.md`,s=this.app.vault.getAbstractFileByPath(a);s&&await this.app.vault.delete(s);let l=await this.app.vault.create(a,r);if(console.debug(`MDB | created new file at ${a}`),i.openNote){let d=this.app.workspace.getUnpinnedLeaf();if(!d){console.warn("MDB | no active leaf, not opening newly created note");return}await d.openFile(l,{state:{mode:"source"}})}}async updateActiveNote(e=!1){let r=this.app.workspace.getActiveFile();if(!r)throw new Error("MDB | there is no active note");let i=this.getMetadataFromFileCache(r);if(i=this.modelPropertyMapper.convertObjectBack(i),console.debug("MDB | read metadata",i),!(i!=null&&i.type)||!(i!=null&&i.dataSource)||!(i!=null&&i.id))throw new Error("MDB | active note is not a Media DB entry or is missing metadata");let n=this.mediaTypeManager.createMediaTypeModelFromMediaType(i,i.type),a=await this.apiManager.queryDetailedInfoById(i.id,i.dataSource);a&&(a=Object.assign(n,a.getWithOutUserData()),console.debug("MDB | deleting old entry"),e?await this.createMediaDbNoteFromModel(a,{attachFile:r,folder:r.parent,openNote:!0}):await this.createMediaDbNoteFromModel(a,{attachTemplate:!0,folder:r.parent,openNote:!0}))}async createEntriesFromFolder(e){let r=[],i=!1,{selectedAPI:n,titleFieldName:a,appendContent:s}=await new Promise(l=>{new Bi(this.app,this,(p,d,c)=>{l({selectedAPI:p,titleFieldName:d,appendContent:c})}).open()});for(let l of e.children)if(l instanceof ne.TFile){let p=l;if(i){r.push({filePath:p.path,error:"user canceled"});continue}let c=this.getMetadataFromFileCache(p)[a];if(!c){r.push({filePath:p.path,error:`metadata field '${a}' not found or empty`});continue}let u=[];try{u=await this.apiManager.query(c,[n])}catch(f){r.push({filePath:p.path,error:f.toString()});continue}if(!u||u.length===0){r.push({filePath:p.path,error:"no search results"});continue}let{selectModalResult:m,selectModal:M}=await this.modalHelper.createSelectModal({elements:u,skipButton:!0,modalTitle:`Results for '${c}'`});if(m.code===3){r.push({filePath:p.path,error:m.error.message}),M.close();continue}if(m.code===2){r.push({filePath:p.path,error:"user canceled"}),M.close(),i=!0;continue}if(m.code===1){r.push({filePath:p.path,error:"user skipped"}),M.close();continue}if(m.data.selected.length===0){r.push({filePath:p.path,error:"no search results selected"});continue}let g=await this.queryDetails(m.data.selected);await this.createMediaDbNotes(g,s?p:null),M.close()}r.length>0&&await this.createErroredFilesReport(r)}async createErroredFilesReport(e){let r=`MDB - bulk import error report ${no(new Date)}`,i=`${r}.md`,n=[["file","error"]].concat(e.map(s=>[s.filePath,s.error])),a=`# ${r} + +${ro(n)}`;await this.app.vault.create(i,a)}async loadSettings(){let e=await this.loadData(),r=Lo(this),i=Object.assign({},r,e),n=[];for(let a of r.propertyMappingModels){let s=i.propertyMappingModels.find(l=>l.type===a.type);if(s===void 0)n.push(a);else{let l=[];for(let p of a.properties){let d=s.properties.find(c=>c.property===p.property);d===void 0?l.push(p):l.push(new dt(d.property,d.newProperty,d.mapping,p.locked))}n.push(new Ft(s.type,l))}}i.propertyMappingModels=n,this.settings=i}async saveSettings(){this.mediaTypeManager.updateTemplates(this.settings),this.mediaTypeManager.updateFolders(this.settings),this.dateFormatter.setFormat(this.settings.customDateFormat),await this.saveData(this.settings)}}; diff --git a/.obsidian/plugins/obsidian-media-db-plugin/manifest.json b/.obsidian/plugins/obsidian-media-db-plugin/manifest.json index 0d95f21e..abee943d 100644 --- a/.obsidian/plugins/obsidian-media-db-plugin/manifest.json +++ b/.obsidian/plugins/obsidian-media-db-plugin/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-media-db-plugin", "name": "Media DB Plugin", - "version": "0.5.2", + "version": "0.6.0", "minAppVersion": "0.14.0", "description": "A plugin that can query multiple APIs for movies, series, anime, games, music and wiki articles, and import them into your vault.", "author": "Moritz Jung", diff --git a/.obsidian/plugins/obsidian-reminder-plugin/data.json b/.obsidian/plugins/obsidian-reminder-plugin/data.json index a2bef7fd..13988ac7 100644 --- a/.obsidian/plugins/obsidian-reminder-plugin/data.json +++ b/.obsidian/plugins/obsidian-reminder-plugin/data.json @@ -2,11 +2,6 @@ "scanned": true, "reminders": { "05.01 Computer setup/Storage and Syncing.md": [ - { - "title": ":cloud: [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] %%done_del%%", - "time": "2023-12-11", - "rowNumber": 185 - }, { "title": "Backup [[Storage and Syncing#Instructions for Anchor|Anchor Wallet]] %%done_del%%", "time": "2024-01-04", @@ -25,7 +20,12 @@ { "title": ":camera: [[Storage and Syncing|Storage & Sync]]: Transfer pictures to ED %%done_del%%", "time": "2024-01-11", - "rowNumber": 188 + "rowNumber": 189 + }, + { + "title": ":cloud: [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] %%done_del%%", + "time": "2024-03-11", + "rowNumber": 185 } ], "06.01 Finances/hLedger.md": [ @@ -339,16 +339,6 @@ } ], "01.02 Home/Household.md": [ - { - "title": "♻ [[Household]]: *Cardboard* recycling collection %%done_del%%", - "time": "2023-12-12", - "rowNumber": 77 - }, - { - "title": "🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%%", - "time": "2023-12-18", - "rowNumber": 85 - }, { "title": "♻ [[Household]]: *Paper* recycling collection %%done_del%%", "time": "2023-12-19", @@ -357,22 +347,32 @@ { "title": ":bed: [[Household]] Change bedsheets %%done_del%%", "time": "2023-12-23", - "rowNumber": 88 + "rowNumber": 90 + }, + { + "title": "🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%%", + "time": "2023-12-25", + "rowNumber": 86 + }, + { + "title": "♻ [[Household]]: *Cardboard* recycling collection %%done_del%%", + "time": "2023-12-26", + "rowNumber": 77 }, { "title": "🛎️ :house: [[Household]]: Pay rent %%done_del%%", "time": "2023-12-31", - "rowNumber": 84 + "rowNumber": 85 }, { "title": ":blue_car: [[Household]]: Change to Summer tyres %%done_del%%", "time": "2024-04-15", - "rowNumber": 95 + "rowNumber": 97 }, { "title": ":blue_car: [[Household]]: Change to Winter tyres %%done_del%%", "time": "2024-10-15", - "rowNumber": 96 + "rowNumber": 98 } ], "01.03 Family/Pia Bousquié.md": [ @@ -390,20 +390,20 @@ } ], "01.01 Life Orga/@Finances.md": [ - { - "title": ":heavy_dollar_sign: [[@Finances|Finances]]: update crypto prices within Obsidian %%done_del%%", - "time": "2023-12-12", - "rowNumber": 114 - }, { "title": ":heavy_dollar_sign: [[@Finances|Finances]]: Close yearly accounts %%done_del%%", "time": "2024-01-07", - "rowNumber": 125 + "rowNumber": 126 }, { "title": ":heavy_dollar_sign: [[@Finances|Finances]]: Swiss tax self declaration %%done_del%%", "time": "2024-01-07", - "rowNumber": 126 + "rowNumber": 127 + }, + { + "title": ":heavy_dollar_sign: [[@Finances|Finances]]: update crypto prices within Obsidian %%done_del%%", + "time": "2024-01-09", + "rowNumber": 114 }, { "title": ":moneybag: [[@Finances]]: Transfer UK pension to CH %%done_del%%", @@ -441,27 +441,27 @@ } ], "06.02 Investments/Crypto Tasks.md": [ - { - "title": ":chart: Check [[Nimbus]] earnings %%done_del%%", - "time": "2023-12-11", - "rowNumber": 85 - }, { "title": ":ballot_box: [[Crypto Tasks]]: Vote for [[EOS]] block producers %%done_del%%", "time": "2024-01-02", "rowNumber": 72 + }, + { + "title": ":chart: Check [[Nimbus]] earnings %%done_del%%", + "time": "2024-01-08", + "rowNumber": 85 } ], "05.02 Networks/Configuring UFW.md": [ { "title": "🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%%", - "time": "2023-12-16", + "time": "2023-12-23", "rowNumber": 239 }, { "title": "🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%%", - "time": "2023-12-16", - "rowNumber": 287 + "time": "2023-12-23", + "rowNumber": 288 } ], "01.03 Family/Amélie Solanet.md": [ @@ -523,7 +523,7 @@ "00.08 Bookmarks/Bookmarks - Work.md": [ { "title": ":label: [[Bookmarks - Work]]: review bookmarks %%done_del%%", - "time": "2023-12-16", + "time": "2024-03-16", "rowNumber": 71 } ], @@ -544,7 +544,7 @@ "02.02 Paris/@@Paris.md": [ { "title": ":birthday: **Virginie Parent**, [[@@Paris|Paris]] %%done_del%%", - "time": "2023-12-12", + "time": "2024-12-12", "rowNumber": 116 } ], @@ -775,7 +775,7 @@ "00.01 Admin/Calendars/2023-10-30.md": [ { "title": "14:46 :man_in_tuxedo: [[Polo Park Zürich|PPZ]]: recontacte Katja pour un verre", - "time": "2023-12-14", + "time": "2024-01-14", "rowNumber": 103 } ], @@ -801,11 +801,6 @@ } ], "00.01 Admin/Calendars/2023-12-02.md": [ - { - "title": "18:27 :racehorse: [[@Sally|Sally]]: Organise trip on 22nd December", - "time": "2023-12-15", - "rowNumber": 105 - }, { "title": "15:02 :bowl_with_spoon: [[Household]]: Acheter des bols (Depot ou en face sur Rennweg)", "time": "2023-12-30", @@ -813,11 +808,6 @@ } ], "00.01 Admin/Calendars/2023-12-09.md": [ - { - "title": "15:18 :train2: [[@Life Admin|Admin]]: Buy train tickets for Paris", - "time": "2023-12-15", - "rowNumber": 105 - }, { "title": "13:58 :family: [[Amaury de Villeneuve]]: Buy a set of knives for Xmas", "time": "2023-12-21", diff --git a/.obsidian/plugins/obsidian-tasks-plugin/main.js b/.obsidian/plugins/obsidian-tasks-plugin/main.js index 347b5a20..a2a1bd40 100644 --- a/.obsidian/plugins/obsidian-tasks-plugin/main.js +++ b/.obsidian/plugins/obsidian-tasks-plugin/main.js @@ -122,14 +122,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -"use strict";var z_=Object.create;var is=Object.defineProperty,V_=Object.defineProperties,K_=Object.getOwnPropertyDescriptor,Q_=Object.getOwnPropertyDescriptors,X_=Object.getOwnPropertyNames,Vp=Object.getOwnPropertySymbols,Z_=Object.getPrototypeOf,Qp=Object.prototype.hasOwnProperty,J_=Object.prototype.propertyIsEnumerable;var Kp=(r,e,t)=>e in r?is(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,De=(r,e)=>{for(var t in e||(e={}))Qp.call(e,t)&&Kp(r,t,e[t]);if(Vp)for(var t of Vp(e))J_.call(e,t)&&Kp(r,t,e[t]);return r},Tt=(r,e)=>V_(r,Q_(e));var T=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ev=(r,e)=>{for(var t in e)is(r,t,{get:e[t],enumerable:!0})},Xp=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of X_(e))!Qp.call(r,i)&&i!==t&&is(r,i,{get:()=>e[i],enumerable:!(n=K_(e,i))||n.enumerable});return r};var ss=(r,e,t)=>(t=r!=null?z_(Z_(r)):{},Xp(e||!r||!r.__esModule?is(t,"default",{value:r,enumerable:!0}):t,r)),tv=r=>Xp(is({},"__esModule",{value:!0}),r);var q=(r,e,t)=>new Promise((n,i)=>{var s=u=>{try{o(t.next(u))}catch(l){i(l)}},a=u=>{try{o(t.throw(u))}catch(l){i(l)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,a);o((t=t.apply(r,e)).next())});var ve=T(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.matchAnyPattern=tn.extractTerms=tn.repeatedTimeunitPattern=void 0;function sv(r,e){let t=e.replace(/\((?!\?)/g,"(?:");return`${r}${t}\\s{0,5}(?:,?\\s{0,5}${t}){0,10}`}tn.repeatedTimeunitPattern=sv;function Zp(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}tn.extractTerms=Zp;function av(r){return`(?:${Zp(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}tn.matchAnyPattern=av});var ye=T((ju,Bu)=>{(function(r,e){typeof ju=="object"&&typeof Bu!="undefined"?Bu.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(ju,function(){"use strict";var r=1e3,e=6e4,t=36e5,n="millisecond",i="second",s="minute",a="hour",o="day",u="week",l="month",c="quarter",p="year",h="date",_="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},C=function(B,A,E){var H=String(B);return!H||H.length>=A?B:""+Array(A+1-H.length).join(E)+B},N={s:C,z:function(B){var A=-B.utcOffset(),E=Math.abs(A),H=Math.floor(E/60),P=E%60;return(A<=0?"+":"-")+C(H,2,"0")+":"+C(P,2,"0")},m:function B(A,E){if(A.date(){"use strict";var ov=rn&&rn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(rn,"__esModule",{value:!0});rn.findYearClosestToRef=rn.findMostLikelyADYear=void 0;var uv=ov(ye());function lv(r){return r<100&&(r>50?r=r+1900:r=r+2e3),r}rn.findMostLikelyADYear=lv;function cv(r,e,t){let n=uv.default(r),i=n;i=i.month(t-1),i=i.date(e),i=i.year(n.year());let s=i.add(1,"y"),a=i.add(-1,"y");return Math.abs(s.diff(n)){"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.parseTimeUnits=re.TIME_UNITS_PATTERN=re.parseYear=re.YEAR_PATTERN=re.parseOrdinalNumberPattern=re.ORDINAL_NUMBER_PATTERN=re.parseNumberPattern=re.NUMBER_PATTERN=re.TIME_UNIT_DICTIONARY=re.ORDINAL_WORD_DICTIONARY=re.INTEGER_WORD_DICTIONARY=re.MONTH_DICTIONARY=re.FULL_MONTH_NAME_DICTIONARY=re.WEEKDAY_DICTIONARY=void 0;var qa=ve(),dv=nt();re.WEEKDAY_DICTIONARY={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6};re.FULL_MONTH_NAME_DICTIONARY={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12};re.MONTH_DICTIONARY=Object.assign(Object.assign({},re.FULL_MONTH_NAME_DICTIONARY),{jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12});re.INTEGER_WORD_DICTIONARY={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12};re.ORDINAL_WORD_DICTIONARY={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31};re.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconds:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",day:"d",days:"d",week:"week",weeks:"week",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year"};re.NUMBER_PATTERN=`(?:${qa.matchAnyPattern(re.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function eh(r){let e=r.toLowerCase();return re.INTEGER_WORD_DICTIONARY[e]!==void 0?re.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}re.parseNumberPattern=eh;re.ORDINAL_NUMBER_PATTERN=`(?:${qa.matchAnyPattern(re.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function fv(r){let e=r.toLowerCase();return re.ORDINAL_WORD_DICTIONARY[e]!==void 0?re.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}re.parseOrdinalNumberPattern=fv;re.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9])";function pv(r){if(/BE/i.test(r))return r=r.replace(/BE/i,""),parseInt(r)-543;if(/BCE?/i.test(r))return r=r.replace(/BCE?/i,""),-parseInt(r);if(/(AD|CE)/i.test(r))return r=r.replace(/(AD|CE)/i,""),parseInt(r);let e=parseInt(r);return dv.findMostLikelyADYear(e)}re.parseYear=pv;var th=`(${re.NUMBER_PATTERN})\\s{0,3}(${qa.matchAnyPattern(re.TIME_UNIT_DICTIONARY)})`,Jp=new RegExp(th,"i");re.TIME_UNITS_PATTERN=qa.repeatedTimeunitPattern("(?:(?:about|around)\\s{0,3})?",th);function hv(r){let e={},t=r,n=Jp.exec(t);for(;n;)mv(e,n),t=t.substring(n[0].length).trim(),n=Jp.exec(t);return e}re.parseTimeUnits=hv;function mv(r,e){let t=eh(e[1]),n=re.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var rh=T((Hu,zu)=>{(function(r,e){typeof Hu=="object"&&typeof zu!="undefined"?zu.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs_plugin_quarterOfYear=e()})(Hu,function(){"use strict";var r="month",e="quarter";return function(t,n){var i=n.prototype;i.quarter=function(o){return this.$utils().u(o)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(o-1))};var s=i.add;i.add=function(o,u){return o=Number(o),this.$utils().p(u)===e?this.add(3*o,r):s.bind(this)(o,u)};var a=i.startOf;i.startOf=function(o,u){var l=this.$utils(),c=!!l.u(u)||u;if(l.p(o)===e){var p=this.quarter()-1;return c?this.month(3*p).startOf(r).startOf("day"):this.month(3*p+2).endOf(r).endOf("day")}return a.bind(this)(o,u)}}})});var jt=T(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.implySimilarTime=mr.assignSimilarTime=mr.assignSimilarDate=mr.assignTheNextDay=void 0;var nh=Be();function gv(r,e){e=e.add(1,"day"),ih(r,e),sh(r,e)}mr.assignTheNextDay=gv;function ih(r,e){r.assign("day",e.date()),r.assign("month",e.month()+1),r.assign("year",e.year())}mr.assignSimilarDate=ih;function yv(r,e){r.assign("hour",e.hour()),r.assign("minute",e.minute()),r.assign("second",e.second()),r.assign("millisecond",e.millisecond()),r.get("hour")<12?r.assign("meridiem",nh.Meridiem.AM):r.assign("meridiem",nh.Meridiem.PM)}mr.assignSimilarTime=yv;function sh(r,e){r.imply("hour",e.hour()),r.imply("minute",e.minute()),r.imply("second",e.second()),r.imply("millisecond",e.millisecond())}mr.implySimilarTime=sh});var ah=T(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.toTimezoneOffset=kn.TIMEZONE_ABBR_MAP=void 0;kn.TIMEZONE_ABBR_MAP={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function bv(r){var e;return r==null?null:typeof r=="number"?r:(e=kn.TIMEZONE_ABBR_MAP[r])!==null&&e!==void 0?e:null}kn.toTimezoneOffset=bv});var Ne=T(gr=>{"use strict";var oh=gr&&gr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(gr,"__esModule",{value:!0});gr.ParsingResult=gr.ParsingComponents=gr.ReferenceWithTimezone=void 0;var Tv=oh(rh()),$a=oh(ye()),Vu=jt(),_v=ah();$a.default.extend(Tv.default);var Ku=class{constructor(e){var t;e=e!=null?e:new Date,e instanceof Date?this.instant=e:(this.instant=(t=e.instant)!==null&&t!==void 0?t:new Date,this.timezoneOffset=_v.toTimezoneOffset(e.timezone))}};gr.ReferenceWithTimezone=Ku;var Sn=class{constructor(e,t){if(this.reference=e,this.knownValues={},this.impliedValues={},t)for(let i in t)this.knownValues[i]=t[i];let n=$a.default(e.instant);this.imply("day",n.date()),this.imply("month",n.month()+1),this.imply("year",n.year()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}get(e){return e in this.knownValues?this.knownValues[e]:e in this.impliedValues?this.impliedValues[e]:null}isCertain(e){return e in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(e,t){return e in this.knownValues?this:(this.impliedValues[e]=t,this)}assign(e,t){return this.knownValues[e]=t,delete this.impliedValues[e],this}delete(e){delete this.knownValues[e],delete this.impliedValues[e]}clone(){let e=new Sn(this.reference);e.knownValues={},e.impliedValues={};for(let t in this.knownValues)e.knownValues[t]=this.knownValues[t];for(let t in this.impliedValues)e.impliedValues[t]=this.impliedValues[t];return e}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyDayMonthComponent(){return this.isCertain("day")&&this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let e=this.dateWithoutTimezoneAdjustment();return!(e.getFullYear()!==this.get("year")||e.getMonth()!==this.get("month")-1||e.getDate()!==this.get("day")||this.get("hour")!=null&&e.getHours()!=this.get("hour")||this.get("minute")!=null&&e.getMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents {knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}, reference: ${JSON.stringify(this.reference)}]`}dayjs(){return $a.default(this.date())}date(){let e=this.dateWithoutTimezoneAdjustment();return new Date(e.getTime()+this.getSystemTimezoneAdjustmentMinute(e)*6e4)}dateWithoutTimezoneAdjustment(){let e=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return e.setFullYear(this.get("year")),e}getSystemTimezoneAdjustmentMinute(e){var t,n;(!e||e.getTime()<0)&&(e=new Date);let i=-e.getTimezoneOffset(),s=(n=(t=this.get("timezoneOffset"))!==null&&t!==void 0?t:this.reference.timezoneOffset)!==null&&n!==void 0?n:i;return i-s}static createRelativeFromReference(e,t){let n=$a.default(e.instant);for(let s in t)n=n.add(t[s],s);let i=new Sn(e);return t.hour||t.minute||t.second?(Vu.assignSimilarTime(i,n),Vu.assignSimilarDate(i,n),e.timezoneOffset!==null&&i.assign("timezoneOffset",-e.instant.getTimezoneOffset())):(Vu.implySimilarTime(i,n),e.timezoneOffset!==null&&i.imply("timezoneOffset",-e.instant.getTimezoneOffset()),t.d?(i.assign("day",n.date()),i.assign("month",n.month()+1),i.assign("year",n.year())):(t.week&&i.imply("weekday",n.day()),i.imply("day",n.date()),t.month?(i.assign("month",n.month()+1),i.assign("year",n.year())):(i.imply("month",n.month()+1),t.year?i.assign("year",n.year()):i.imply("year",n.year())))),i}};gr.ParsingComponents=Sn;var as=class{constructor(e,t,n,i,s){this.reference=e,this.refDate=e.instant,this.index=t,this.text=n,this.start=i||new Sn(e),this.end=s}clone(){let e=new as(this.reference,this.index,this.text);return e.start=this.start?this.start.clone():null,e.end=this.end?this.end.clone():null,e}date(){return this.start.date()}toString(){return`[ParsingResult {index: ${this.index}, text: '${this.text}', ...}]`}};gr.ParsingResult=as});var W=T(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.AbstractParserWithWordBoundaryChecking=void 0;var Qu=class{constructor(){this.cachedInnerPattern=null,this.cachedPattern=null}patternLeftBoundary(){return"(\\W|^)"}pattern(e){let t=this.innerPattern(e);return t==this.cachedInnerPattern?this.cachedPattern:(this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${t.source}`,t.flags),this.cachedInnerPattern=t,this.cachedPattern)}extract(e,t){var n;let i=(n=t[1])!==null&&n!==void 0?n:"";t.index=t.index+i.length,t[0]=t[0].substring(i.length);for(let s=2;s{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});var Zu=it(),vv=Ne(),wv=W(),Ev=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Zu.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),kv=new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Zu.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Xu=class extends wv.AbstractParserWithWordBoundaryChecking{innerPattern(e){return e.option.forwardDate?kv:Ev}innerExtract(e,t){let n=Zu.parseTimeUnits(t[1]);return vv.ParsingComponents.createRelativeFromReference(e.reference,n)}};Ju.default=Xu});var hh=T(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});var Sv=nt(),fh=it(),ph=it(),Ga=it(),Ov=ve(),Dv=W(),Rv=new RegExp(`(?:on\\s{0,3})?(${Ga.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${Ga.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${Ov.matchAnyPattern(fh.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s{0,3})(${ph.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),lh=1,ch=2,xv=3,dh=4,el=class extends Dv.AbstractParserWithWordBoundaryChecking{innerPattern(){return Rv}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=fh.MONTH_DICTIONARY[t[xv].toLowerCase()],s=Ga.parseOrdinalNumberPattern(t[lh]);if(s>31)return t.index=t.index+t[lh].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[dh]){let a=ph.parseYear(t[dh]);n.start.assign("year",a)}else{let a=Sv.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[ch]){let a=Ga.parseOrdinalNumberPattern(t[ch]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};tl.default=el});var Th=T(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});var Mv=nt(),yh=it(),ja=it(),bh=it(),Cv=ve(),Av=W(),Pv=new RegExp(`(${Cv.matchAnyPattern(yh.MONTH_DICTIONARY)})(?:-|/|\\s*,?\\s*)(${ja.ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${ja.ORDINAL_NUMBER_PATTERN})\\s*)?(?:(?:-|/|\\s*,?\\s*)(${bh.YEAR_PATTERN}))?(?=\\W|$)(?!\\:\\d)`,"i"),Nv=1,Iv=2,mh=3,gh=4,rl=class extends Av.AbstractParserWithWordBoundaryChecking{innerPattern(){return Pv}innerExtract(e,t){let n=yh.MONTH_DICTIONARY[t[Nv].toLowerCase()],i=ja.parseOrdinalNumberPattern(t[Iv]);if(i>31)return null;let s=e.createParsingComponents({day:i,month:n});if(t[gh]){let u=bh.parseYear(t[gh]);s.assign("year",u)}else{let u=Mv.findYearClosestToRef(e.refDate,i,n);s.imply("year",u)}if(!t[mh])return s;let a=ja.parseOrdinalNumberPattern(t[mh]),o=e.createParsingResult(t.index,t[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}};nl.default=rl});var wh=T(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});var il=it(),Fv=nt(),Lv=ve(),vh=it(),Uv=W(),Wv=new RegExp(`((?:in)\\s*)?(${Lv.matchAnyPattern(il.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${vh.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),qv=1,$v=2,_h=3,sl=class extends Uv.AbstractParserWithWordBoundaryChecking{innerPattern(){return Wv}innerExtract(e,t){let n=t[$v].toLowerCase();if(t[0].length<=3&&!il.FULL_MONTH_NAME_DICTIONARY[n])return null;let i=e.createParsingResult(t.index+(t[qv]||"").length,t.index+t[0].length);i.start.imply("day",1);let s=il.MONTH_DICTIONARY[n];if(i.start.assign("month",s),t[_h]){let a=vh.parseYear(t[_h]);i.start.assign("year",a)}else{let a=Fv.findYearClosestToRef(e.refDate,1,s);i.start.imply("year",a)}return i}};al.default=sl});var Sh=T(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});var kh=it(),Yv=ve(),Gv=W(),jv=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${Yv.matchAnyPattern(kh.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),Bv=1,Hv=2,Eh=3,zv=4,ol=class extends Gv.AbstractParserWithWordBoundaryChecking{innerPattern(){return jv}innerExtract(e,t){let n=t[Eh]?parseInt(t[Eh]):kh.MONTH_DICTIONARY[t[Hv].toLowerCase()];if(n<1||n>12)return null;let i=parseInt(t[Bv]);return{day:parseInt(t[zv]),month:n,year:i}}};ul.default=ol});var Oh=T(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});var Vv=W(),Kv=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),Qv=1,Xv=2,ll=class extends Vv.AbstractParserWithWordBoundaryChecking{innerPattern(){return Kv}innerExtract(e,t){let n=parseInt(t[Xv]),i=parseInt(t[Qv]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}};cl.default=ll});var On=T(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.AbstractTimeExpressionParser=void 0;var _t=Be();function Zv(r,e,t,n){return new RegExp(`${r}${e}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,n)}function Jv(r,e){return new RegExp(`^(${r})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${e}`,"i")}var Dh=2,ai=3,Ba=4,Ha=5,os=6,dl=class{constructor(e=!1){this.cachedPrimaryPrefix=null,this.cachedPrimarySuffix=null,this.cachedPrimaryTimePattern=null,this.cachedFollowingPhase=null,this.cachedFollowingSuffix=null,this.cachedFollowingTimePatten=null,this.strictMode=e}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?=\\W|$)"}followingSuffix(){return"(?=\\W|$)"}pattern(e){return this.getPrimaryTimePatternThroughCache()}extract(e,t){let n=this.extractPrimaryTimeComponents(e,t);if(!n)return t.index+=t[0].length,null;let i=t.index+t[1].length,s=t[0].substring(t[1].length),a=e.createParsingResult(i,s,n);t.index+=t[0].length;let o=e.text.substring(t.index),l=this.getFollowingTimePatternThroughCache().exec(o);return s.match(/^\d{3,4}/)&&l&&l[0].match(/^\s*([+-])\s*\d{2,4}$/)?null:!l||l[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(a):(a.end=this.extractFollowingTimeComponents(e,l,a),a.end&&(a.text+=l[0]),this.checkAndReturnWithFollowingPattern(a))}extractPrimaryTimeComponents(e,t,n=!1){let i=e.createParsingComponents(),s=0,a=null,o=parseInt(t[Dh]);if(o>100){if(this.strictMode||t[ai]!=null)return null;s=o%100,o=Math.floor(o/100)}if(o>24)return null;if(t[ai]!=null){if(t[ai].length==1&&!t[os])return null;s=parseInt(t[ai])}if(s>=60)return null;if(o>12&&(a=_t.Meridiem.PM),t[os]!=null){if(o>12)return null;let u=t[os][0].toLowerCase();u=="a"&&(a=_t.Meridiem.AM,o==12&&(o=0)),u=="p"&&(a=_t.Meridiem.PM,o!=12&&(o+=12))}if(i.assign("hour",o),i.assign("minute",s),a!==null?i.assign("meridiem",a):o<12?i.imply("meridiem",_t.Meridiem.AM):i.imply("meridiem",_t.Meridiem.PM),t[Ha]!=null){let u=parseInt(t[Ha].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(t[Ba]!=null){let u=parseInt(t[Ba]);if(u>=60)return null;i.assign("second",u)}return i}extractFollowingTimeComponents(e,t,n){let i=e.createParsingComponents();if(t[Ha]!=null){let u=parseInt(t[Ha].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(t[Ba]!=null){let u=parseInt(t[Ba]);if(u>=60)return null;i.assign("second",u)}let s=parseInt(t[Dh]),a=0,o=-1;if(t[ai]!=null?a=parseInt(t[ai]):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=_t.Meridiem.PM),t[os]!=null){if(s>12)return null;let u=t[os][0].toLowerCase();u=="a"&&(o=_t.Meridiem.AM,s==12&&(s=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),u=="p"&&(o=_t.Meridiem.PM,s!=12&&(s+=12)),n.start.isCertain("meridiem")||(o==_t.Meridiem.AM?(n.start.imply("meridiem",_t.Meridiem.AM),n.start.get("hour")==12&&n.start.assign("hour",0)):(n.start.imply("meridiem",_t.Meridiem.PM),n.start.get("hour")!=12&&n.start.assign("hour",n.start.get("hour")+12)))}return i.assign("hour",s),i.assign("minute",a),o>=0?i.assign("meridiem",o):n.start.isCertain("meridiem")&&n.start.get("hour")>12?n.start.get("hour")-12>s?i.imply("meridiem",_t.Meridiem.AM):s<=12&&(i.assign("hour",s+12),i.assign("meridiem",_t.Meridiem.PM)):s>12?i.imply("meridiem",_t.Meridiem.PM):s<=12&&i.imply("meridiem",_t.Meridiem.AM),i.date().getTime()24)return null}return e}checkAndReturnWithFollowingPattern(e){if(e.text.match(/^\d+-\d+$/))return null;let t=e.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(t){if(this.strictMode)return null;let n=t[1],i=t[2];if(i.includes(".")&&!i.match(/\d(\.\d{2})+$/))return null;let s=parseInt(i),a=parseInt(n);if(s>24||a>24)return null}return e}getPrimaryTimePatternThroughCache(){let e=this.primaryPrefix(),t=this.primarySuffix();return this.cachedPrimaryPrefix===e&&this.cachedPrimarySuffix===t?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=Zv(this.primaryPatternLeftBoundary(),e,t,this.patternFlags()),this.cachedPrimaryPrefix=e,this.cachedPrimarySuffix=t,this.cachedPrimaryTimePattern)}getFollowingTimePatternThroughCache(){let e=this.followingPhase(),t=this.followingSuffix();return this.cachedFollowingPhase===e&&this.cachedFollowingSuffix===t?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=Jv(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}};za.AbstractTimeExpressionParser=dl});var Rh=T(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});var Va=Be(),ew=On(),fl=class extends ew.AbstractTimeExpressionParser{constructor(e){super(e)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("night")){let i=n.get("hour");i>=6&&i<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",Va.Meridiem.PM)):i<6&&n.assign("meridiem",Va.Meridiem.AM)}if(t[0].endsWith("afternoon")){n.assign("meridiem",Va.Meridiem.PM);let i=n.get("hour");i>=0&&i<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("morning")&&(n.assign("meridiem",Va.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};pl.default=fl});var Bt=T(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.addImpliedTimeUnits=oi.reverseTimeUnits=void 0;function tw(r){let e={};for(let t in r)e[t]=-r[t];return e}oi.reverseTimeUnits=tw;function rw(r,e){let t=r.clone(),n=r.dayjs();for(let i in e)n=n.add(e[i],i);return("day"in e||"d"in e||"week"in e||"month"in e||"year"in e)&&(t.imply("day",n.date()),t.imply("month",n.month()+1),t.imply("year",n.year())),("second"in e||"minute"in e||"hour"in e)&&(t.imply("second",n.second()),t.imply("minute",n.minute()),t.imply("hour",n.hour())),t}oi.addImpliedTimeUnits=rw});var xh=T(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});var ml=it(),nw=Ne(),iw=W(),sw=Bt(),aw=new RegExp(`(${ml.TIME_UNITS_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=(?:\\W|$))`,"i"),ow=new RegExp(`(${ml.TIME_UNITS_PATTERN})\\s{0,5}ago(?=(?:\\W|$))`,"i"),hl=class extends iw.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?ow:aw}innerExtract(e,t){let n=ml.parseTimeUnits(t[1]),i=sw.reverseTimeUnits(n);return nw.ParsingComponents.createRelativeFromReference(e.reference,i)}};gl.default=hl});var Mh=T(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});var bl=it(),uw=Ne(),lw=W(),cw=new RegExp(`(${bl.TIME_UNITS_PATTERN})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),dw=new RegExp("("+bl.TIME_UNITS_PATTERN+")(later|from now)(?=(?:\\W|$))","i"),fw=1,yl=class extends lw.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?dw:cw}innerExtract(e,t){let n=bl.parseTimeUnits(t[fw]);return uw.ParsingComponents.createRelativeFromReference(e.reference,n)}};Tl.default=yl});var li=T(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.MergingRefiner=ui.Filter=void 0;var _l=class{refine(e,t){return t.filter(n=>this.isValid(e,n))}};ui.Filter=_l;var vl=class{refine(e,t){if(t.length<2)return t;let n=[],i=t[0],s=null;for(let a=1;a{console.log(`${this.constructor.name} merged ${u} and ${l} into ${c}`)}),i=c}}return i!=null&&n.push(i),n}};ui.MergingRefiner=vl});var yr=T(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});var pw=li(),wl=class extends pw.MergingRefiner{shouldMergeResults(e,t,n){return!t.end&&!n.end&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){if(!t.start.isOnlyWeekdayComponent()&&!n.start.isOnlyWeekdayComponent()&&(n.start.getCertainComponents().forEach(s=>{t.start.isCertain(s)||t.start.assign(s,n.start.get(s))}),t.start.getCertainComponents().forEach(s=>{n.start.isCertain(s)||n.start.assign(s,t.start.get(s))})),t.start.date().getTime()>n.start.date().getTime()){let s=t.start.dayjs(),a=n.start.dayjs();t.start.isOnlyWeekdayComponent()&&s.add(-7,"days").isBefore(a)?(s=s.add(-7,"days"),t.start.imply("day",s.date()),t.start.imply("month",s.month()+1),t.start.imply("year",s.year())):n.start.isOnlyWeekdayComponent()&&a.add(7,"days").isAfter(s)?(a=a.add(7,"days"),n.start.imply("day",a.date()),n.start.imply("month",a.month()+1),n.start.imply("year",a.year())):[n,t]=[t,n]}let i=t.clone();return i.start=t.start,i.end=n.start,i.index=Math.min(t.index,n.index),t.index{"use strict";var hw=us&&us.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(us,"__esModule",{value:!0});var mw=hw(yr()),kl=class extends mw.default{patternBetween(){return/^\s*(to|-)\s*$/i}};us.default=kl});var Ah=T(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.mergeDateTimeComponent=ci.mergeDateTimeResult=void 0;var gw=Be();function yw(r,e){let t=r.clone(),n=r.start,i=e.start;if(t.start=Sl(n,i),r.end!=null||e.end!=null){let s=r.end==null?r.start:r.end,a=e.end==null?e.start:e.end,o=Sl(s,a);r.end==null&&o.date().getTime(){"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});var bw=li(),Ph=Ah(),Ol=class extends bw.MergingRefiner{shouldMergeResults(e,t,n){return(t.start.isOnlyDate()&&n.start.isOnlyTime()||n.start.isOnlyDate()&&t.start.isOnlyTime())&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){let i=t.start.isOnlyDate()?Ph.mergeDateTimeResult(t,n):Ph.mergeDateTimeResult(n,t);return i.index=t.index,i.text=t.text+e+n.text,i}};Dl.default=Ol});var Nh=T(ls=>{"use strict";var Tw=ls&&ls.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ls,"__esModule",{value:!0});var _w=Tw(Mr()),Rl=class extends _w.default{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$")}};ls.default=Rl});var Ih=T(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});var vw=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),ww={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:240,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360},xl=class{constructor(e){this.timezone=Object.assign(Object.assign({},ww),e)}refine(e,t){var n;let i=(n=e.option.timezones)!==null&&n!==void 0?n:{};return t.forEach(s=>{var a,o;let u=e.text.substring(s.index+s.text.length),l=vw.exec(u);if(!l)return;let c=l[1].toUpperCase(),p=(o=(a=i[c])!==null&&a!==void 0?a:this.timezone[c])!==null&&o!==void 0?o:null;if(p===null)return;e.debug(()=>{console.log(`Extracting timezone: '${c}' into: ${p} for: ${s.start}`)});let h=s.start.get("timezoneOffset");h!==null&&p!=h&&(s.start.isCertain("timezoneOffset")||c!=l[1])||s.start.isOnlyDate()&&c!=l[1]||(s.text+=l[0],s.start.isCertain("timezoneOffset")||s.start.assign("timezoneOffset",p),s.end!=null&&!s.end.isCertain("timezoneOffset")&&s.end.assign("timezoneOffset",p))}),t}};Ml.default=xl});var Ka=T(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});var Ew=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),kw=1,Sw=2,Ow=3,Cl=class{refine(e,t){return t.forEach(function(n){if(n.start.isCertain("timezoneOffset"))return;let i=e.text.substring(n.index+n.text.length),s=Ew.exec(i);if(!s)return;e.debug(()=>{console.log(`Extracting timezone: '${s[0]}' into : ${n}`)});let a=parseInt(s[Sw]),o=parseInt(s[Ow]||"0"),u=a*60+o;u>14*60||(s[kw]==="-"&&(u=-u),n.end!=null&&n.end.assign("timezoneOffset",u),n.start.assign("timezoneOffset",u),n.text+=s[0])}),t}};Al.default=Cl});var Fh=T(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});var Pl=class{refine(e,t){if(t.length<2)return t;let n=[],i=t[0];for(let s=1;si.text.length&&(i=a):(n.push(i),i=a)}return i!=null&&n.push(i),n}};Nl.default=Pl});var Lh=T(cs=>{"use strict";var Dw=cs&&cs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(cs,"__esModule",{value:!0});var Rw=Dw(ye()),Il=class{refine(e,t){return e.option.forwardDate&&t.forEach(function(n){let i=Rw.default(e.refDate);if(n.start.isOnlyDayMonthComponent()&&i.isAfter(n.start.dayjs()))for(let s=0;s<3&&i.isAfter(n.start.dayjs());s++)n.start.imply("year",n.start.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.start})`)}),n.end&&!n.end.isCertain("year")&&(n.end.imply("year",n.end.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.end})`)}));n.start.isOnlyWeekdayComponent()&&i.isAfter(n.start.dayjs())&&(i.day()>=n.start.get("weekday")?i=i.day(n.start.get("weekday")+7):i=i.day(n.start.get("weekday")),n.start.imply("day",i.date()),n.start.imply("month",i.month()+1),n.start.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.start})`)}),n.end&&n.end.isOnlyWeekdayComponent()&&(i.day()>n.end.get("weekday")?i=i.day(n.end.get("weekday")+7):i=i.day(n.end.get("weekday")),n.end.imply("day",i.date()),n.end.imply("month",i.month()+1),n.end.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.end})`)})))}),t}};cs.default=Il});var Uh=T(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});var xw=li(),Fl=class extends xw.Filter{constructor(e){super(),this.strictMode=e}isValid(e,t){return t.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(e.debug(()=>{console.log(`Removing unlikely result '${t.text}'`)}),!1):t.start.isValidDate()?t.end&&!t.end.isValidDate()?(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.end})`)}),!1):this.strictMode?this.isStrictModeValid(e,t):!0:(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.start})`)}),!1)}isStrictModeValid(e,t){return t.start.isOnlyWeekdayComponent()?(e.debug(()=>{console.log(`(Strict) Removing weekday only component: ${t} (${t.end})`)}),!1):t.start.isOnlyTime()&&(!t.start.isCertain("hour")||!t.start.isCertain("minute"))?(e.debug(()=>{console.log(`(Strict) Removing uncertain time component: ${t} (${t.end})`)}),!1):!0}};Ll.default=Fl});var ql=T(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});var Mw=W(),Cw=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(?:Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),Aw=1,Pw=2,Nw=3,Wh=4,Iw=5,qh=6,$h=7,Yh=8,Gh=9,Ul=class extends Mw.AbstractParserWithWordBoundaryChecking{innerPattern(){return Cw}innerExtract(e,t){let n={};if(n.year=parseInt(t[Aw]),n.month=parseInt(t[Pw]),n.day=parseInt(t[Nw]),t[Wh]!=null)if(n.hour=parseInt(t[Wh]),n.minute=parseInt(t[Iw]),t[qh]!=null&&(n.second=parseInt(t[qh])),t[$h]!=null&&(n.millisecond=parseInt(t[$h])),t[Yh]==null)n.timezoneOffset=0;else{let i=parseInt(t[Yh]),s=0;t[Gh]!=null&&(s=parseInt(t[Gh]));let a=i*60;a<0?a-=s:a+=s,n.timezoneOffset=a}return n}};Wl.default=Ul});var jh=T(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});var Fw=li(),$l=class extends Fw.MergingRefiner{mergeResults(e,t,n){let i=n.clone();return i.index=t.index,i.text=t.text+e+i.text,i.start.assign("weekday",t.start.get("weekday")),i.end&&i.end.assign("weekday",t.start.get("weekday")),i}shouldMergeResults(e,t,n){return t.start.isOnlyWeekdayComponent()&&!t.start.isCertain("hour")&&n.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}};Yl.default=$l});var Cr=T(di=>{"use strict";var Dn=di&&di.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(di,"__esModule",{value:!0});di.includeCommonConfiguration=void 0;var Lw=Dn(Ih()),Uw=Dn(Ka()),Bh=Dn(Fh()),Ww=Dn(Lh()),qw=Dn(Uh()),$w=Dn(ql()),Yw=Dn(jh());function Gw(r,e=!1){return r.parsers.unshift(new $w.default),r.refiners.unshift(new Yw.default),r.refiners.unshift(new Lw.default),r.refiners.unshift(new Uw.default),r.refiners.unshift(new Bh.default),r.refiners.push(new Bh.default),r.refiners.push(new Ww.default),r.refiners.push(new qw.default(e)),r}di.includeCommonConfiguration=Gw});var Pr=T(_e=>{"use strict";var jw=_e&&_e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_e,"__esModule",{value:!0});_e.noon=_e.morning=_e.midnight=_e.yesterdayEvening=_e.evening=_e.lastNight=_e.tonight=_e.theDayAfter=_e.tomorrow=_e.theDayBefore=_e.yesterday=_e.today=_e.now=void 0;var br=Ne(),fi=jw(ye()),Ar=jt(),ds=Be();function Bw(r){let e=fi.default(r.instant),t=new br.ParsingComponents(r,{});return Ar.assignSimilarDate(t,e),Ar.assignSimilarTime(t,e),r.timezoneOffset!==null&&t.assign("timezoneOffset",e.utcOffset()),t}_e.now=Bw;function Hw(r){let e=fi.default(r.instant),t=new br.ParsingComponents(r,{});return Ar.assignSimilarDate(t,e),Ar.implySimilarTime(t,e),t}_e.today=Hw;function zw(r){return Hh(r,1)}_e.yesterday=zw;function Hh(r,e){return Gl(r,-e)}_e.theDayBefore=Hh;function Vw(r){return Gl(r,1)}_e.tomorrow=Vw;function Gl(r,e){let t=fi.default(r.instant),n=new br.ParsingComponents(r,{});return t=t.add(e,"day"),Ar.assignSimilarDate(n,t),Ar.implySimilarTime(n,t),n}_e.theDayAfter=Gl;function Kw(r,e=22){let t=fi.default(r.instant),n=new br.ParsingComponents(r,{});return n.imply("hour",e),n.imply("meridiem",ds.Meridiem.PM),Ar.assignSimilarDate(n,t),n}_e.tonight=Kw;function Qw(r,e=0){let t=fi.default(r.instant),n=new br.ParsingComponents(r,{});return t.hour()<6&&(t=t.add(-1,"day")),Ar.assignSimilarDate(n,t),n.imply("hour",e),n}_e.lastNight=Qw;function Xw(r,e=20){let t=new br.ParsingComponents(r,{});return t.imply("meridiem",ds.Meridiem.PM),t.imply("hour",e),t}_e.evening=Xw;function Zw(r,e=20){let t=fi.default(r.instant),n=new br.ParsingComponents(r,{});return t=t.add(-1,"day"),Ar.assignSimilarDate(n,t),n.imply("hour",e),n.imply("meridiem",ds.Meridiem.PM),n}_e.yesterdayEvening=Zw;function Jw(r){let e=new br.ParsingComponents(r,{});return e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e}_e.midnight=Jw;function eE(r,e=6){let t=new br.ParsingComponents(r,{});return t.imply("meridiem",ds.Meridiem.AM),t.imply("hour",e),t}_e.morning=eE;function tE(r){let e=new br.ParsingComponents(r,{});return e.imply("meridiem",ds.Meridiem.AM),e.imply("hour",12),e}_e.noon=tE});var zh=T(rr=>{"use strict";var rE=rr&&rr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),nE=rr&&rr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),iE=rr&&rr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&rE(e,r,t);return nE(e,r),e},sE=rr&&rr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(rr,"__esModule",{value:!0});var aE=sE(ye()),oE=W(),uE=jt(),fs=iE(Pr()),lE=/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,jl=class extends oE.AbstractParserWithWordBoundaryChecking{innerPattern(e){return lE}innerExtract(e,t){let n=aE.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();switch(i){case"now":return fs.now(e.reference);case"today":return fs.today(e.reference);case"yesterday":return fs.yesterday(e.reference);case"tomorrow":case"tmr":case"tmrw":return fs.tomorrow(e.reference);case"tonight":return fs.tonight(e.reference);default:i.match(/last\s*night/)&&(n.hour()>6&&(n=n.add(-1,"day")),uE.assignSimilarDate(s,n),s.imply("hour",0));break}return s}};rr.default=jl});var Vh=T(ps=>{"use strict";var cE=ps&&ps.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ps,"__esModule",{value:!0});var Qa=Be(),dE=W(),fE=cE(ye()),pE=jt(),hE=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i,Bl=class extends dE.AbstractParserWithWordBoundaryChecking{innerPattern(){return hE}innerExtract(e,t){let n=fE.default(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"afternoon":i.imply("meridiem",Qa.Meridiem.PM),i.imply("hour",15);break;case"evening":case"night":i.imply("meridiem",Qa.Meridiem.PM),i.imply("hour",20);break;case"midnight":pE.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"morning":i.imply("meridiem",Qa.Meridiem.AM),i.imply("hour",6);break;case"noon":i.imply("meridiem",Qa.Meridiem.AM),i.imply("hour",12);break}return i}};ps.default=Bl});var Rn=T(nn=>{"use strict";var mE=nn&&nn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(nn,"__esModule",{value:!0});nn.toDayJSClosestWeekday=nn.toDayJSWeekday=void 0;var Kh=mE(ye());function gE(r,e,t){if(!t)return Qh(r,e);let n=Kh.default(r);switch(t){case"this":n=n.day(e);break;case"next":n=n.day(e+7);break;case"last":n=n.day(e-7);break}return n}nn.toDayJSWeekday=gE;function Qh(r,e){let t=Kh.default(r),n=t.day();return Math.abs(e-7-n){"use strict";Object.defineProperty(zl,"__esModule",{value:!0});var Xh=it(),yE=ve(),bE=W(),TE=Rn(),_E=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${yE.matchAnyPattern(Xh.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),vE=1,wE=2,EE=3,Hl=class extends bE.AbstractParserWithWordBoundaryChecking{innerPattern(){return _E}innerExtract(e,t){let n=t[wE].toLowerCase(),i=Xh.WEEKDAY_DICTIONARY[n],s=t[vE],a=t[EE],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="last"||o=="past"?u="last":o=="next"?u="next":o=="this"&&(u="this");let l=TE.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};zl.default=Hl});var tm=T(hs=>{"use strict";var kE=hs&&hs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(hs,"__esModule",{value:!0});var em=it(),Jh=Ne(),SE=kE(ye()),OE=W(),DE=ve(),RE=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${DE.matchAnyPattern(em.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),xE=1,ME=2,Vl=class extends OE.AbstractParserWithWordBoundaryChecking{innerPattern(){return RE}innerExtract(e,t){let n=t[xE].toLowerCase(),i=t[ME].toLowerCase(),s=em.TIME_UNIT_DICTIONARY[i];if(n=="next"||n.startsWith("after")){let u={};return u[s]=1,Jh.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="last"||n=="past"){let u={};return u[s]=-1,Jh.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=SE.default(e.reference.instant);return i.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):i.match(/month/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):i.match(/year/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};hs.default=Vl});var nr=T(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.ParsingContext=mi.Chrono=void 0;var pi=Ne(),CE=Kl(),hi=class{constructor(e){e=e||CE.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new hi({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,t,n){let i=this.parse(e,t,n);return i.length>0?i[0].start.date():null}parse(e,t,n){let i=new Xa(e,t,n),s=[];return this.parsers.forEach(a=>{let o=hi.executeParser(i,a);s=s.concat(o)}),s.sort((a,o)=>a.index-o.index),this.refiners.forEach(function(a){s=a.refine(i,s)}),s}static executeParser(e,t){let n=[],i=t.pattern(e),s=e.text,a=e.text,o=i.exec(a);for(;o;){let u=o.index+s.length-a.length;o.index=u;let l=t.extract(e,o);if(!l){a=s.substring(o.index+1),o=i.exec(a);continue}let c=null;l instanceof pi.ParsingResult?c=l:l instanceof pi.ParsingComponents?(c=e.createParsingResult(o.index,o[0]),c.start=l):c=e.createParsingResult(o.index,o[0],l),e.debug(()=>console.log(`${t.constructor.name} extracted result ${c}`)),n.push(c),a=s.substring(u+c.text.length),o=i.exec(a)}return n}};mi.Chrono=hi;var Xa=class{constructor(e,t,n){this.text=e,this.reference=new pi.ReferenceWithTimezone(t),this.option=n!=null?n:{},this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof pi.ParsingComponents?e:new pi.ParsingComponents(this.reference,e)}createParsingResult(e,t,n,i){let s=typeof t=="string"?t:this.text.substring(e,t),a=n?this.createParsingComponents(n):null,o=i?this.createParsingComponents(i):null;return new pi.ParsingResult(this.reference,e,s,a,o)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}};mi.ParsingContext=Xa});var xn=T(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});var rm=nt(),AE=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),Za=1,nm=5,im=2,sm=3,Ql=4,Xl=class{constructor(e){this.groupNumberMonth=e?sm:im,this.groupNumberDay=e?im:sm}pattern(){return AE}extract(e,t){if(t[Za]=="/"||t[nm]=="/"){t.index+=t[0].length;return}let n=t.index+t[Za].length,i=t[0].substr(t[Za].length,t[0].length-t[Za].length-t[nm].length);if(i.match(/^\d\.\d$/)||i.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!t[Ql]&&t[0].indexOf("/")<0)return;let s=e.createParsingResult(n,i),a=parseInt(t[this.groupNumberMonth]),o=parseInt(t[this.groupNumberDay]);if((a<1||a>12)&&a>12)if(o>=1&&o<=12&&a<=31)[o,a]=[a,o];else return null;if(o<1||o>31)return null;if(s.start.assign("day",o),s.start.assign("month",a),t[Ql]){let u=parseInt(t[Ql]),l=rm.findMostLikelyADYear(u);s.start.assign("year",l)}else{let u=rm.findYearClosestToRef(e.refDate,o,a);s.start.imply("year",u)}return s}};Zl.default=Xl});var om=T(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});var am=it(),PE=Ne(),NE=W(),IE=Bt(),FE=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${am.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Jl=class extends NE.AbstractParserWithWordBoundaryChecking{innerPattern(){return FE}innerExtract(e,t){let n=t[1].toLowerCase(),i=am.parseTimeUnits(t[2]);switch(n){case"last":case"past":case"-":i=IE.reverseTimeUnits(i);break}return PE.ParsingComponents.createRelativeFromReference(e.reference,i)}};ec.default=Jl});var lm=T(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});var LE=li(),tc=Ne(),UE=it(),WE=Bt();function um(r){return r.text.match(/\s+(before|from)$/i)!=null}function qE(r){return r.text.match(/\s+(after|since)$/i)!=null}var rc=class extends LE.MergingRefiner{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,n){return!e.match(this.patternBetween())||!um(t)&&!qE(t)?!1:!!n.start.get("day")&&!!n.start.get("month")&&!!n.start.get("year")}mergeResults(e,t,n){let i=UE.parseTimeUnits(t.text);um(t)&&(i=WE.reverseTimeUnits(i));let s=tc.ParsingComponents.createRelativeFromReference(new tc.ReferenceWithTimezone(n.start.date()),i);return new tc.ParsingResult(n.reference,t.index,`${t.text}${e}${n.text}`,s)}};nc.default=rc});var Kl=T($e=>{"use strict";var He=$e&&$e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($e,"__esModule",{value:!0});$e.createConfiguration=$e.createCasualConfiguration=$e.parseDate=$e.parse=$e.GB=$e.strict=$e.casual=void 0;var $E=He(uh()),YE=He(hh()),GE=He(Th()),jE=He(wh()),BE=He(Sh()),HE=He(Oh()),zE=He(Rh()),VE=He(xh()),KE=He(Mh()),QE=He(Ch()),XE=He(Nh()),ZE=Cr(),JE=He(zh()),ek=He(Vh()),tk=He(Zh()),rk=He(tm()),ic=nr(),nk=He(xn()),ik=He(om()),sk=He(lm());$e.casual=new ic.Chrono(cm(!1));$e.strict=new ic.Chrono(Ja(!0,!1));$e.GB=new ic.Chrono(Ja(!1,!0));function ak(r,e,t){return $e.casual.parse(r,e,t)}$e.parse=ak;function ok(r,e,t){return $e.casual.parseDate(r,e,t)}$e.parseDate=ok;function cm(r=!1){let e=Ja(!1,r);return e.parsers.unshift(new JE.default),e.parsers.unshift(new ek.default),e.parsers.unshift(new jE.default),e.parsers.unshift(new rk.default),e.parsers.unshift(new ik.default),e}$e.createCasualConfiguration=cm;function Ja(r=!0,e=!1){return ZE.includeCommonConfiguration({parsers:[new nk.default(e),new $E.default,new YE.default,new GE.default,new tk.default,new BE.default,new HE.default,new zE.default(r),new VE.default(r),new KE.default(r)],refiners:[new sk.default,new XE.default,new QE.default]},r)}$e.createConfiguration=Ja});var dm=T(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});var uk=On(),sc=class extends uk.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:um|von)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|bis)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};ac.default=sc});var ms=T(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.parseTimeUnits=ke.TIME_UNITS_PATTERN=ke.parseYear=ke.YEAR_PATTERN=ke.parseNumberPattern=ke.NUMBER_PATTERN=ke.TIME_UNIT_DICTIONARY=ke.INTEGER_WORD_DICTIONARY=ke.MONTH_DICTIONARY=ke.WEEKDAY_DICTIONARY=void 0;var oc=ve(),lk=nt();ke.WEEKDAY_DICTIONARY={sonntag:0,so:0,montag:1,mo:1,dienstag:2,di:2,mittwoch:3,mi:3,donnerstag:4,do:4,freitag:5,fr:5,samstag:6,sa:6};ke.MONTH_DICTIONARY={januar:1,j\u00E4nner:1,janner:1,jan:1,"jan.":1,februar:2,feber:2,feb:2,"feb.":2,m\u00E4rz:3,maerz:3,m\u00E4r:3,"m\xE4r.":3,mrz:3,"mrz.":3,april:4,apr:4,"apr.":4,mai:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,august:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,dezember:12,dez:12,"dez.":12};ke.INTEGER_WORD_DICTIONARY={eins:1,eine:1,einem:1,einen:1,einer:1,zwei:2,drei:3,vier:4,f\u00FCnf:5,fuenf:5,sechs:6,sieben:7,acht:8,neun:9,zehn:10,elf:11,zw\u00F6lf:12,zwoelf:12};ke.TIME_UNIT_DICTIONARY={sek:"second",sekunde:"second",sekunden:"second",min:"minute",minute:"minute",minuten:"minute",h:"hour",std:"hour",stunde:"hour",stunden:"hour",tag:"d",tage:"d",tagen:"d",woche:"week",wochen:"week",monat:"month",monate:"month",monaten:"month",monats:"month",quartal:"quarter",quartals:"quarter",quartale:"quarter",quartalen:"quarter",a:"year",j:"year",jr:"year",jahr:"year",jahre:"year",jahren:"year",jahres:"year"};ke.NUMBER_PATTERN=`(?:${oc.matchAnyPattern(ke.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s*an?)?|an?\\b(?:\\s*few)?|few|several|a?\\s*couple\\s*(?:of)?)`;function pm(r){let e=r.toLowerCase();return ke.INTEGER_WORD_DICTIONARY[e]!==void 0?ke.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}ke.parseNumberPattern=pm;ke.YEAR_PATTERN="(?:[0-9]{1,4}(?:\\s*[vn]\\.?\\s*(?:C(?:hr)?|(?:u\\.?|d\\.?(?:\\s*g\\.?)?)?\\s*Z)\\.?|\\s*(?:u\\.?|d\\.?(?:\\s*g\\.)?)\\s*Z\\.?)?)";function ck(r){if(/v/i.test(r))return-parseInt(r.replace(/[^0-9]+/gi,""));if(/n/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));if(/z/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));let e=parseInt(r);return lk.findMostLikelyADYear(e)}ke.parseYear=ck;var hm=`(${ke.NUMBER_PATTERN})\\s{0,5}(${oc.matchAnyPattern(ke.TIME_UNIT_DICTIONARY)})\\s{0,5}`,fm=new RegExp(hm,"i");ke.TIME_UNITS_PATTERN=oc.repeatedTimeunitPattern("",hm);function dk(r){let e={},t=r,n=fm.exec(t);for(;n;)fk(e,n),t=t.substring(n[0].length),n=fm.exec(t);return e}ke.parseTimeUnits=dk;function fk(r,e){let t=pm(e[1]),n=ke.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var gm=T(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});var mm=ms(),pk=ve(),hk=W(),mk=Rn(),gk=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:a[mn]\\s*?)?(?:(diese[mn]|letzte[mn]|n(?:\xE4|ae)chste[mn])\\s*)?(${pk.matchAnyPattern(mm.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(diese|letzte|n(?:\xE4|ae)chste)\\s*woche)?(?=\\W|$)`,"i"),yk=1,bk=3,Tk=2,uc=class extends hk.AbstractParserWithWordBoundaryChecking{innerPattern(){return gk}innerExtract(e,t){let n=t[Tk].toLowerCase(),i=mm.WEEKDAY_DICTIONARY[n],s=t[yk],a=t[bk],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o.match(/letzte/)?u="last":o.match(/chste/)?u="next":o.match(/diese/)&&(u="this");let l=mk.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};lc.default=uc});var _m=T(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});var sn=Be(),_k=new RegExp("(^|\\s|T)(?:(?:um|von)\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),vk=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|bis(?:\\s+um)?|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),wk=2,ym=3,bm=4,Tm=5,gi=class{pattern(e){return _k}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=gi.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let i=e.text.substring(t.index+t[0].length),s=vk.exec(i);return s&&(n.end=gi.extractTimeComponent(n.start.clone(),s),n.end&&(n.text+=s[0])),n}static extractTimeComponent(e,t){let n=0,i=0,s=null;if(n=parseInt(t[wk]),t[ym]!=null&&(i=parseInt(t[ym])),i>=60||n>24)return null;if(n>=12&&(s=sn.Meridiem.PM),t[Tm]!=null){if(n>12)return null;let a=t[Tm].toLowerCase();a.match(/morgen|vormittag/)&&(s=sn.Meridiem.AM,n==12&&(n=0)),a.match(/nachmittag|abend/)&&(s=sn.Meridiem.PM,n!=12&&(n+=12)),a.match(/nacht/)&&(n==12?(s=sn.Meridiem.AM,n=0):n<6?s=sn.Meridiem.AM:(s=sn.Meridiem.PM,n+=12))}if(e.assign("hour",n),e.assign("minute",i),s!==null?e.assign("meridiem",s):n<12?e.imply("meridiem",sn.Meridiem.AM):e.imply("meridiem",sn.Meridiem.PM),t[bm]!=null){let a=parseInt(t[bm]);if(a>=60)return null;e.assign("second",a)}return e}};cc.default=gi});var vm=T(gs=>{"use strict";var Ek=gs&&gs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(gs,"__esModule",{value:!0});var kk=Ek(yr()),dc=class extends kk.default{patternBetween(){return/^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i}};gs.default=dc});var wm=T(ys=>{"use strict";var Sk=ys&&ys.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ys,"__esModule",{value:!0});var Ok=Sk(Mr()),fc=class extends Ok.default{patternBetween(){return new RegExp("^\\s*(T|um|am|,|-)?\\s*$")}};ys.default=fc});var pc=T(Ts=>{"use strict";var Dk=Ts&&Ts.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ts,"__esModule",{value:!0});var Rk=Dk(ye()),Mn=Be(),xk=W(),Mk=jt(),Ck=Bt(),bs=class extends xk.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i}innerExtract(e,t){let n=Rk.default(e.refDate),i=t[2].toLowerCase(),s=e.createParsingComponents();return Mk.implySimilarTime(s,n),bs.extractTimeComponents(s,i)}static extractTimeComponents(e,t){switch(t){case"morgen":e.imply("hour",6),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Mn.Meridiem.AM);break;case"vormittag":e.imply("hour",9),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Mn.Meridiem.AM);break;case"mittag":case"mittags":e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Mn.Meridiem.AM);break;case"nachmittag":e.imply("hour",15),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Mn.Meridiem.PM);break;case"abend":e.imply("hour",18),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Mn.Meridiem.PM);break;case"nacht":e.imply("hour",22),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Mn.Meridiem.PM);break;case"mitternacht":e.get("hour")>1&&(e=Ck.addImpliedTimeUnits(e,{day:1})),e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Mn.Meridiem.AM);break}return e}};Ts.default=bs});var Sm=T(ir=>{"use strict";var Ak=ir&&ir.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Pk=ir&&ir.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Nk=ir&&ir.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Ak(e,r,t);return Pk(e,r),e},km=ir&&ir.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ir,"__esModule",{value:!0});var Ik=km(ye()),Fk=W(),Cn=jt(),Lk=km(pc()),Em=Nk(Pr()),Uk=new RegExp("(jetzt|heute|morgen|\xFCbermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?(?=\\W|$)","i"),Wk=1,qk=2,hc=class extends Fk.AbstractParserWithWordBoundaryChecking{innerPattern(e){return Uk}innerExtract(e,t){let n=Ik.default(e.refDate),i=(t[Wk]||"").toLowerCase(),s=(t[qk]||"").toLowerCase(),a=e.createParsingComponents();switch(i){case"jetzt":a=Em.now(e.reference);break;case"heute":a=Em.today(e.reference);break;case"morgen":Cn.assignTheNextDay(a,n);break;case"\xFCbermorgen":case"uebermorgen":n=n.add(1,"day"),Cn.assignTheNextDay(a,n);break;case"gestern":n=n.add(-1,"day"),Cn.assignSimilarDate(a,n),Cn.implySimilarTime(a,n);break;case"vorgestern":n=n.add(-2,"day"),Cn.assignSimilarDate(a,n),Cn.implySimilarTime(a,n);break;default:i.match(/letzte\s*nacht/)&&(n.hour()>6&&(n=n.add(-1,"day")),Cn.assignSimilarDate(a,n),a.imply("hour",0));break}return s&&(a=Lk.default.extractTimeComponents(a,s)),a}};ir.default=hc});var Cm=T(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});var $k=nt(),xm=ms(),Mm=ms(),Yk=ve(),Gk=W(),jk=new RegExp(`(?:am\\s*?)?(?:den\\s*?)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\\u2013|\\s)\\s*([0-9]{1,2})\\.?)?\\s*(${Yk.matchAnyPattern(xm.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${Mm.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Om=1,Dm=2,Bk=3,Rm=4,mc=class extends Gk.AbstractParserWithWordBoundaryChecking{innerPattern(){return jk}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=xm.MONTH_DICTIONARY[t[Bk].toLowerCase()],s=parseInt(t[Om]);if(s>31)return t.index=t.index+t[Om].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[Rm]){let a=Mm.parseYear(t[Rm]);n.start.assign("year",a)}else{let a=$k.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[Dm]){let a=parseInt(t[Dm]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};gc.default=mc});var Am=T(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});var eo=ms(),Hk=Ne(),zk=W(),Vk=Bt(),Kk=ve(),yc=class extends zk.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:\\s*((?:n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?|vor|in)\\s*)?(${eo.NUMBER_PATTERN})?(?:\\s*(n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?\\s*(${Kk.matchAnyPattern(eo.TIME_UNIT_DICTIONARY)})`,"i")}innerExtract(e,t){let n=t[2]?eo.parseNumberPattern(t[2]):1,i=eo.TIME_UNIT_DICTIONARY[t[4].toLowerCase()],s={};s[i]=n;let a=t[1]||t[3]||"";if(a=a.toLowerCase(),!!a)return(/vor/.test(a)||/letzte/.test(a)||/vergangen/.test(a))&&(s=Vk.reverseTimeUnits(s)),Hk.ParsingComponents.createRelativeFromReference(e.reference,s)}};bc.default=yc});var Im=T(ze=>{"use strict";var sr=ze&&ze.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ze,"__esModule",{value:!0});ze.createConfiguration=ze.createCasualConfiguration=ze.parseDate=ze.parse=ze.strict=ze.casual=void 0;var Qk=Cr(),Pm=nr(),Xk=sr(xn()),Zk=sr(ql()),Jk=sr(dm()),e1=sr(gm()),t1=sr(_m()),r1=sr(vm()),n1=sr(wm()),i1=sr(Sm()),s1=sr(pc()),a1=sr(Cm()),o1=sr(Am());ze.casual=new Pm.Chrono(Nm());ze.strict=new Pm.Chrono(Tc(!0));function u1(r,e,t){return ze.casual.parse(r,e,t)}ze.parse=u1;function l1(r,e,t){return ze.casual.parseDate(r,e,t)}ze.parseDate=l1;function Nm(r=!0){let e=Tc(!1,r);return e.parsers.unshift(new s1.default),e.parsers.unshift(new i1.default),e.parsers.unshift(new o1.default),e}ze.createCasualConfiguration=Nm;function Tc(r=!0,e=!0){return Qk.includeCommonConfiguration({parsers:[new Zk.default,new Xk.default(e),new Jk.default,new t1.default,new a1.default,new e1.default],refiners:[new r1.default,new n1.default]},r)}ze.createConfiguration=Tc});var Lm=T(ar=>{"use strict";var c1=ar&&ar.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),d1=ar&&ar.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),f1=ar&&ar.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&c1(e,r,t);return d1(e,r),e},p1=ar&&ar.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ar,"__esModule",{value:!0});var h1=p1(ye()),m1=Be(),g1=W(),Fm=jt(),to=f1(Pr()),_c=class extends g1.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i}innerExtract(e,t){let n=h1.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();switch(i){case"maintenant":return to.now(e.reference);case"aujourd'hui":return to.today(e.reference);case"hier":return to.yesterday(e.reference);case"demain":return to.tomorrow(e.reference);default:i.match(/cette\s*nuit/)?(Fm.assignSimilarDate(s,n),s.imply("hour",22),s.imply("meridiem",m1.Meridiem.PM)):i.match(/la\s*veille/)&&(n=n.add(-1,"day"),Fm.assignSimilarDate(s,n),s.imply("hour",0))}return s}};ar.default=_c});var Um=T(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});var _s=Be(),y1=W(),vc=class extends y1.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(cet?)?\s*(matin|soir|après-midi|aprem|a midi|à minuit)(?=\W|$)/i}innerExtract(e,t){let n=t[2].toLowerCase(),i=e.createParsingComponents();switch(n){case"apr\xE8s-midi":case"aprem":i.imply("hour",14),i.imply("minute",0),i.imply("meridiem",_s.Meridiem.PM);break;case"soir":i.imply("hour",18),i.imply("minute",0),i.imply("meridiem",_s.Meridiem.PM);break;case"matin":i.imply("hour",8),i.imply("minute",0),i.imply("meridiem",_s.Meridiem.AM);break;case"a midi":i.imply("hour",12),i.imply("minute",0),i.imply("meridiem",_s.Meridiem.AM);break;case"\xE0 minuit":i.imply("hour",0),i.imply("meridiem",_s.Meridiem.AM);break}return i}};wc.default=vc});var Wm=T(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});var b1=On(),Ec=class extends b1.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:[\xE0a])\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};kc.default=Ec});var qm=T(vs=>{"use strict";var T1=vs&&vs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(vs,"__esModule",{value:!0});var _1=T1(Mr()),Sc=class extends _1.default{patternBetween(){return new RegExp("^\\s*(T|\xE0|a|vers|de|,|-)?\\s*$")}};vs.default=Sc});var $m=T(ws=>{"use strict";var v1=ws&&ws.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ws,"__esModule",{value:!0});var w1=v1(yr()),Oc=class extends w1.default{patternBetween(){return/^\s*(à|a|-)\s*$/i}};ws.default=Oc});var an=T(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.parseTimeUnits=be.TIME_UNITS_PATTERN=be.parseYear=be.YEAR_PATTERN=be.parseOrdinalNumberPattern=be.ORDINAL_NUMBER_PATTERN=be.parseNumberPattern=be.NUMBER_PATTERN=be.TIME_UNIT_DICTIONARY=be.INTEGER_WORD_DICTIONARY=be.MONTH_DICTIONARY=be.WEEKDAY_DICTIONARY=void 0;var Dc=ve();be.WEEKDAY_DICTIONARY={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6};be.MONTH_DICTIONARY={janvier:1,jan:1,"jan.":1,f\u00E9vrier:2,f\u00E9v:2,"f\xE9v.":2,fevrier:2,fev:2,"fev.":2,mars:3,mar:3,"mar.":3,avril:4,avr:4,"avr.":4,mai:5,juin:6,jun:6,juillet:7,juil:7,jul:7,"jul.":7,ao\u00FBt:8,aout:8,septembre:9,sep:9,"sep.":9,sept:9,"sept.":9,octobre:10,oct:10,"oct.":10,novembre:11,nov:11,"nov.":11,d\u00E9cembre:12,decembre:12,dec:12,"dec.":12};be.INTEGER_WORD_DICTIONARY={un:1,deux:2,trois:3,quatre:4,cinq:5,six:6,sept:7,huit:8,neuf:9,dix:10,onze:11,douze:12,treize:13};be.TIME_UNIT_DICTIONARY={sec:"second",seconde:"second",secondes:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",heure:"hour",heures:"hour",jour:"d",jours:"d",semaine:"week",semaines:"week",mois:"month",trimestre:"quarter",trimestres:"quarter",ans:"year",ann\u00E9e:"year",ann\u00E9es:"year"};be.NUMBER_PATTERN=`(?:${Dc.matchAnyPattern(be.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`;function Gm(r){let e=r.toLowerCase();return be.INTEGER_WORD_DICTIONARY[e]!==void 0?be.INTEGER_WORD_DICTIONARY[e]:e==="une"||e==="un"?1:e.match(/quelques?/)?3:e.match(/demi-?/)?.5:parseFloat(e)}be.parseNumberPattern=Gm;be.ORDINAL_NUMBER_PATTERN="(?:[0-9]{1,2}(?:er)?)";function E1(r){let e=r.toLowerCase();return e=e.replace(/(?:er)$/i,""),parseInt(e)}be.parseOrdinalNumberPattern=E1;be.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:AC|AD|p\\.\\s*C(?:hr?)?\\.\\s*n\\.)|[1-2][0-9]{3}|[5-9][0-9])";function k1(r){if(/AC/i.test(r))return r=r.replace(/BC/i,""),-parseInt(r);if(/AD/i.test(r)||/C/i.test(r))return r=r.replace(/[^\d]+/i,""),parseInt(r);let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}be.parseYear=k1;var jm=`(${be.NUMBER_PATTERN})\\s{0,5}(${Dc.matchAnyPattern(be.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Ym=new RegExp(jm,"i");be.TIME_UNITS_PATTERN=Dc.repeatedTimeunitPattern("",jm);function S1(r){let e={},t=r,n=Ym.exec(t);for(;n;)O1(e,n),t=t.substring(n[0].length),n=Ym.exec(t);return e}be.parseTimeUnits=S1;function O1(r,e){let t=Gm(e[1]),n=be.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Hm=T(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});var Bm=an(),D1=ve(),R1=W(),x1=Rn(),M1=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(?:ce)\\s*)?(${D1.matchAnyPattern(Bm.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(dernier|prochain)\\s*)?(?=\\W|\\d|$)`,"i"),C1=1,A1=2,Rc=class extends R1.AbstractParserWithWordBoundaryChecking{innerPattern(){return M1}innerExtract(e,t){let n=t[C1].toLowerCase(),i=Bm.WEEKDAY_DICTIONARY[n];if(i===void 0)return null;let s=t[A1];s=s||"",s=s.toLowerCase();let a=null;s=="dernier"?a="last":s=="prochain"&&(a="next");let o=x1.toDayJSWeekday(e.refDate,i,a);return e.createParsingComponents().assign("weekday",i).imply("day",o.date()).imply("month",o.month()+1).imply("year",o.year())}};xc.default=Rc});var Qm=T(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});var Es=Be(),P1=new RegExp("(^|\\s|T)(?:(?:[\xE0a])\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),N1=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),I1=2,zm=3,Vm=4,Km=5,yi=class{pattern(e){return P1}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=yi.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let i=e.text.substring(t.index+t[0].length),s=N1.exec(i);return s&&(n.end=yi.extractTimeComponent(n.start.clone(),s),n.end&&(n.text+=s[0])),n}static extractTimeComponent(e,t){let n=0,i=0,s=null;if(n=parseInt(t[I1]),t[zm]!=null&&(i=parseInt(t[zm])),i>=60||n>24)return null;if(n>=12&&(s=Es.Meridiem.PM),t[Km]!=null){if(n>12)return null;let a=t[Km][0].toLowerCase();a=="a"&&(s=Es.Meridiem.AM,n==12&&(n=0)),a=="p"&&(s=Es.Meridiem.PM,n!=12&&(n+=12))}if(e.assign("hour",n),e.assign("minute",i),s!==null?e.assign("meridiem",s):n<12?e.imply("meridiem",Es.Meridiem.AM):e.imply("meridiem",Es.Meridiem.PM),t[Vm]!=null){let a=parseInt(t[Vm]);if(a>=60)return null;e.assign("second",a)}return e}};Mc.default=yi});var rg=T(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});var F1=nt(),eg=an(),tg=an(),ro=an(),L1=ve(),U1=W(),W1=new RegExp(`(?:on\\s*?)?(${ro.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:au|\\-|\\\u2013|jusqu'au?|\\s)\\s*(${ro.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:de)?\\s*)(${L1.matchAnyPattern(eg.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${tg.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Xm=1,Zm=2,q1=3,Jm=4,Cc=class extends U1.AbstractParserWithWordBoundaryChecking{innerPattern(){return W1}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=eg.MONTH_DICTIONARY[t[q1].toLowerCase()],s=ro.parseOrdinalNumberPattern(t[Xm]);if(s>31)return t.index=t.index+t[Xm].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[Jm]){let a=tg.parseYear(t[Jm]);n.start.assign("year",a)}else{let a=F1.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[Zm]){let a=ro.parseOrdinalNumberPattern(t[Zm]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Ac.default=Cc});var ig=T(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});var ng=an(),$1=Ne(),Y1=W(),G1=Bt(),Pc=class extends Y1.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`il y a\\s*(${ng.TIME_UNITS_PATTERN})(?=(?:\\W|$))`,"i")}innerExtract(e,t){let n=ng.parseTimeUnits(t[1]),i=G1.reverseTimeUnits(n);return $1.ParsingComponents.createRelativeFromReference(e.reference,i)}};Nc.default=Pc});var ag=T(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});var sg=an(),j1=Ne(),B1=W(),Ic=class extends B1.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${sg.TIME_UNITS_PATTERN})(?=\\W|$)`,"i")}innerExtract(e,t){let n=sg.parseTimeUnits(t[1]);return j1.ParsingComponents.createRelativeFromReference(e.reference,n)}};Fc.default=Ic});var og=T(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});var no=an(),H1=Ne(),z1=W(),V1=Bt(),K1=ve(),Lc=class extends z1.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:les?|la|l'|du|des?)\\s*(${no.NUMBER_PATTERN})?(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?\\s*(${K1.matchAnyPattern(no.TIME_UNIT_DICTIONARY)})(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?`,"i")}innerExtract(e,t){let n=t[1]?no.parseNumberPattern(t[1]):1,i=no.TIME_UNIT_DICTIONARY[t[3].toLowerCase()],s={};s[i]=n;let a=t[2]||t[4]||"";if(a=a.toLowerCase(),!!a)return(/derni[eè]re?s?/.test(a)||/pass[ée]e?s?/.test(a)||/pr[ée]c[ée]dents?/.test(a))&&(s=V1.reverseTimeUnits(s)),H1.ParsingComponents.createRelativeFromReference(e.reference,s)}};Uc.default=Lc});var cg=T(Ve=>{"use strict";var Ht=Ve&&Ve.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.createConfiguration=Ve.createCasualConfiguration=Ve.parseDate=Ve.parse=Ve.strict=Ve.casual=void 0;var Q1=Cr(),ug=nr(),X1=Ht(Lm()),Z1=Ht(Um()),J1=Ht(xn()),eS=Ht(Wm()),tS=Ht(qm()),rS=Ht($m()),nS=Ht(Hm()),iS=Ht(Qm()),sS=Ht(rg()),aS=Ht(ig()),oS=Ht(ag()),uS=Ht(og());Ve.casual=new ug.Chrono(lg());Ve.strict=new ug.Chrono(Wc(!0));function lS(r,e,t){return Ve.casual.parse(r,e,t)}Ve.parse=lS;function cS(r,e,t){return Ve.casual.parseDate(r,e,t)}Ve.parseDate=cS;function lg(r=!0){let e=Wc(!1,r);return e.parsers.unshift(new X1.default),e.parsers.unshift(new Z1.default),e.parsers.unshift(new uS.default),e}Ve.createCasualConfiguration=lg;function Wc(r=!0,e=!0){return Q1.includeCommonConfiguration({parsers:[new J1.default(e),new sS.default,new eS.default,new iS.default,new aS.default,new oS.default,new nS.default],refiners:[new tS.default,new rS.default]},r)}Ve.createConfiguration=Wc});var dg=T(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.toHankaku=void 0;function dS(r){return String(r).replace(/\u2019/g,"'").replace(/\u201D/g,'"').replace(/\u3000/g," ").replace(/\uFFE5/g,"\xA5").replace(/[\uFF01\uFF03-\uFF06\uFF08\uFF09\uFF0C-\uFF19\uFF1C-\uFF1F\uFF21-\uFF3B\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5E]/g,fS)}io.toHankaku=dS;function fS(r){return String.fromCharCode(r.charCodeAt(0)-65248)}});var pg=T(ks=>{"use strict";var pS=ks&&ks.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ks,"__esModule",{value:!0});var qc=dg(),hS=nt(),mS=pS(ye()),gS=/(?:(?:([同今本])|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i,fg=1,yS=2,$c=3,bS=4,TS=5,_S=6,Yc=class{pattern(){return gS}extract(e,t){let n=parseInt(qc.toHankaku(t[TS])),i=parseInt(qc.toHankaku(t[_S])),s=e.createParsingComponents({day:i,month:n});if(t[fg]&&t[fg].match("\u540C|\u4ECA|\u672C")){let a=mS.default(e.refDate);s.assign("year",a.year())}if(t[yS]){let a=t[bS],o=a=="\u5143"?1:parseInt(qc.toHankaku(a));t[$c]=="\u4EE4\u548C"?o+=2018:t[$c]=="\u5E73\u6210"?o+=1988:t[$c]=="\u662D\u548C"&&(o+=1925),s.assign("year",o)}else{let a=hS.findYearClosestToRef(e.refDate,i,n);s.imply("year",a)}return s}};ks.default=Yc});var hg=T(Ss=>{"use strict";var vS=Ss&&Ss.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ss,"__esModule",{value:!0});var wS=vS(yr()),Gc=class extends wS.default{patternBetween(){return/^\s*(から|ー|-)\s*$/i}};Ss.default=Gc});var gg=T(or=>{"use strict";var ES=or&&or.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),kS=or&&or.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),SS=or&&or.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&ES(e,r,t);return kS(e,r),e},OS=or&&or.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(or,"__esModule",{value:!0});var DS=OS(ye()),mg=Be(),jc=SS(Pr()),RS=/今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i,Bc=class{pattern(){return RS}extract(e,t){let n=t[0],i=DS.default(e.refDate),s=e.createParsingComponents();switch(n){case"\u6628\u65E5":return jc.yesterday(e.reference);case"\u660E\u65E5":return jc.tomorrow(e.reference);case"\u4ECA\u65E5":case"\u5F53\u65E5":return jc.today(e.reference)}return n=="\u4ECA\u591C"||n=="\u4ECA\u5915"||n=="\u4ECA\u6669"?(s.imply("hour",22),s.assign("meridiem",mg.Meridiem.PM)):n.match("\u4ECA\u671D")&&(s.imply("hour",6),s.assign("meridiem",mg.Meridiem.AM)),s.assign("day",i.date()),s.assign("month",i.month()+1),s.assign("year",i.year()),s}};or.default=Bc});var Tg=T(Ke=>{"use strict";var Hc=Ke&&Ke.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.createConfiguration=Ke.createCasualConfiguration=Ke.parseDate=Ke.parse=Ke.strict=Ke.casual=void 0;var xS=Hc(pg()),MS=Hc(hg()),CS=Hc(gg()),yg=nr();Ke.casual=new yg.Chrono(bg());Ke.strict=new yg.Chrono(zc());function AS(r,e,t){return Ke.casual.parse(r,e,t)}Ke.parse=AS;function PS(r,e,t){return Ke.casual.parseDate(r,e,t)}Ke.parseDate=PS;function bg(){let r=zc();return r.parsers.unshift(new CS.default),r}Ke.createCasualConfiguration=bg;function zc(){return{parsers:[new xS.default],refiners:[new MS.default]}}Ke.createConfiguration=zc});var so=T(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.parseYear=Tr.YEAR_PATTERN=Tr.MONTH_DICTIONARY=Tr.WEEKDAY_DICTIONARY=void 0;Tr.WEEKDAY_DICTIONARY={domingo:0,dom:0,segunda:1,"segunda-feira":1,seg:1,ter\u00E7a:2,"ter\xE7a-feira":2,ter:2,quarta:3,"quarta-feira":3,qua:3,quinta:4,"quinta-feira":4,qui:4,sexta:5,"sexta-feira":5,sex:5,s\u00E1bado:6,sabado:6,sab:6};Tr.MONTH_DICTIONARY={janeiro:1,jan:1,"jan.":1,fevereiro:2,fev:2,"fev.":2,mar\u00E7o:3,mar:3,"mar.":3,abril:4,abr:4,"abr.":4,maio:5,mai:5,"mai.":5,junho:6,jun:6,"jun.":6,julho:7,jul:7,"jul.":7,agosto:8,ago:8,"ago.":8,setembro:9,set:9,"set.":9,outubro:10,out:10,"out.":10,novembro:11,nov:11,"nov.":11,dezembro:12,dez:12,"dez.":12};Tr.YEAR_PATTERN="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";function NS(r){if(r.match(/^[0-9]{1,4}$/)){let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}return r.match(/a\.?\s*c\.?/i)?(r=r.replace(/a\.?\s*c\.?/i,""),-parseInt(r)):parseInt(r)}Tr.parseYear=NS});var vg=T(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});var _g=so(),IS=ve(),FS=W(),LS=Rn(),US=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|passado|pr[o\xF3]ximo)\\s*)?(${IS.matchAnyPattern(_g.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|passado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),WS=1,qS=2,$S=3,Vc=class extends FS.AbstractParserWithWordBoundaryChecking{innerPattern(){return US}innerExtract(e,t){let n=t[qS].toLowerCase(),i=_g.WEEKDAY_DICTIONARY[n];if(i===void 0)return null;let s=t[WS],a=t[$S],o=s||a||"";o=o.toLowerCase();let u=null;o=="passado"?u="this":o=="pr\xF3ximo"||o=="proximo"?u="next":o=="este"&&(u="this");let l=LS.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Kc.default=Vc});var wg=T(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});var YS=On(),Qc=class extends YS.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:ao?|\xE0s?|das|da|de|do)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:o)?|\\?)\\s*"}};Xc.default=Qc});var Eg=T(Os=>{"use strict";var GS=Os&&Os.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Os,"__esModule",{value:!0});var jS=GS(Mr()),Zc=class extends jS.default{patternBetween(){return new RegExp("^\\s*(?:,|\xE0)?\\s*$")}};Os.default=Zc});var kg=T(Ds=>{"use strict";var BS=Ds&&Ds.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ds,"__esModule",{value:!0});var HS=BS(yr()),Jc=class extends HS.default{patternBetween(){return/^\s*(?:-)\s*$/i}};Ds.default=Jc});var Mg=T(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});var zS=nt(),Rg=so(),xg=so(),VS=ve(),KS=W(),QS=new RegExp(`([0-9]{1,2})(?:\xBA|\xAA|\xB0)?(?:\\s*(?:desde|de|\\-|\\\u2013|ao?|\\s)\\s*([0-9]{1,2})(?:\xBA|\xAA|\xB0)?)?\\s*(?:de)?\\s*(?:-|/|\\s*(?:de|,)?\\s*)(${VS.matchAnyPattern(Rg.MONTH_DICTIONARY)})(?:\\s*(?:de|,)?\\s*(${xg.YEAR_PATTERN}))?(?=\\W|$)`,"i"),Sg=1,Og=2,XS=3,Dg=4,ed=class extends KS.AbstractParserWithWordBoundaryChecking{innerPattern(){return QS}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Rg.MONTH_DICTIONARY[t[XS].toLowerCase()],s=parseInt(t[Sg]);if(s>31)return t.index=t.index+t[Sg].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[Dg]){let a=xg.parseYear(t[Dg]);n.start.assign("year",a)}else{let a=zS.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[Og]){let a=parseInt(t[Og]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};td.default=ed});var Cg=T(Nr=>{"use strict";var ZS=Nr&&Nr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),JS=Nr&&Nr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),eO=Nr&&Nr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&ZS(e,r,t);return JS(e,r),e};Object.defineProperty(Nr,"__esModule",{value:!0});var tO=W(),ao=eO(Pr()),rd=class extends tO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),i=e.createParsingComponents();switch(n){case"agora":return ao.now(e.reference);case"hoje":return ao.today(e.reference);case"amanha":case"amanh\xE3":return ao.tomorrow(e.reference);case"ontem":return ao.yesterday(e.reference)}return i}};Nr.default=rd});var Ag=T(Rs=>{"use strict";var rO=Rs&&Rs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Rs,"__esModule",{value:!0});var oo=Be(),nO=W(),iO=jt(),sO=rO(ye()),nd=class extends nO.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i}innerExtract(e,t){let n=sO.default(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":i.imply("meridiem",oo.Meridiem.PM),i.imply("hour",15);break;case"noite":i.imply("meridiem",oo.Meridiem.PM),i.imply("hour",22);break;case"manha":case"manh\xE3":i.imply("meridiem",oo.Meridiem.AM),i.imply("hour",6);break;case"meia-noite":iO.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"meio-dia":i.imply("meridiem",oo.Meridiem.AM),i.imply("hour",12);break}return i}};Rs.default=nd});var Ig=T(Qe=>{"use strict";var on=Qe&&Qe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.createConfiguration=Qe.createCasualConfiguration=Qe.parseDate=Qe.parse=Qe.strict=Qe.casual=void 0;var aO=Cr(),Pg=nr(),oO=on(xn()),uO=on(vg()),lO=on(wg()),cO=on(Eg()),dO=on(kg()),fO=on(Mg()),pO=on(Cg()),hO=on(Ag());Qe.casual=new Pg.Chrono(Ng());Qe.strict=new Pg.Chrono(id(!0));function mO(r,e,t){return Qe.casual.parse(r,e,t)}Qe.parse=mO;function gO(r,e,t){return Qe.casual.parseDate(r,e,t)}Qe.parseDate=gO;function Ng(r=!0){let e=id(!1,r);return e.parsers.push(new pO.default),e.parsers.push(new hO.default),e}Qe.createCasualConfiguration=Ng;function id(r=!0,e=!0){return aO.includeCommonConfiguration({parsers:[new oO.default(e),new uO.default,new lO.default,new fO.default],refiners:[new cO.default,new dO.default]},r)}Qe.createConfiguration=id});var Fg=T(xs=>{"use strict";var yO=xs&&xs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xs,"__esModule",{value:!0});var bO=yO(yr()),sd=class extends bO.default{patternBetween(){return/^\s*(tot|-)\s*$/i}};xs.default=sd});var Lg=T(Ms=>{"use strict";var TO=Ms&&Ms.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ms,"__esModule",{value:!0});var _O=TO(Mr()),ad=class extends _O.default{patternBetween(){return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$")}};Ms.default=ad});var Ug=T(Ir=>{"use strict";var vO=Ir&&Ir.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),wO=Ir&&Ir.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),EO=Ir&&Ir.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&vO(e,r,t);return wO(e,r),e};Object.defineProperty(Ir,"__esModule",{value:!0});var kO=W(),uo=EO(Pr()),od=class extends kO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(nu|vandaag|morgen|morgend|gisteren)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),i=e.createParsingComponents();switch(n){case"nu":return uo.now(e.reference);case"vandaag":return uo.today(e.reference);case"morgen":case"morgend":return uo.tomorrow(e.reference);case"gisteren":return uo.yesterday(e.reference)}return i}};Ir.default=od});var Wg=T(Cs=>{"use strict";var SO=Cs&&Cs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cs,"__esModule",{value:!0});var lo=Be(),OO=W(),DO=SO(ye()),RO=jt(),xO=1,MO=2,ud=class extends OO.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i}innerExtract(e,t){let n=DO.default(e.refDate),i=e.createParsingComponents();switch(t[xO]==="deze"&&(i.assign("day",e.refDate.getDate()),i.assign("month",e.refDate.getMonth()+1),i.assign("year",e.refDate.getFullYear())),t[MO].toLowerCase()){case"namiddag":case"'s namiddags":i.imply("meridiem",lo.Meridiem.PM),i.imply("hour",15);break;case"avond":case"'s avonds'":i.imply("meridiem",lo.Meridiem.PM),i.imply("hour",20);break;case"middernacht":RO.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"ochtend":case"'s ochtends":i.imply("meridiem",lo.Meridiem.AM),i.imply("hour",6);break;case"middag":case"'s middags":i.imply("meridiem",lo.Meridiem.AM),i.imply("hour",12);break}return i}};Cs.default=ud});var Ct=T(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.parseTimeUnits=ue.TIME_UNITS_PATTERN=ue.parseYear=ue.YEAR_PATTERN=ue.parseOrdinalNumberPattern=ue.ORDINAL_NUMBER_PATTERN=ue.parseNumberPattern=ue.NUMBER_PATTERN=ue.TIME_UNIT_DICTIONARY=ue.ORDINAL_WORD_DICTIONARY=ue.INTEGER_WORD_DICTIONARY=ue.MONTH_DICTIONARY=ue.WEEKDAY_DICTIONARY=void 0;var co=ve(),CO=nt();ue.WEEKDAY_DICTIONARY={zondag:0,zon:0,"zon.":0,zo:0,"zo.":0,maandag:1,ma:1,"ma.":1,dinsdag:2,din:2,"din.":2,di:2,"di.":2,woensdag:3,woe:3,"woe.":3,wo:3,"wo.":3,donderdag:4,dond:4,"dond.":4,do:4,"do.":4,vrijdag:5,vrij:5,"vrij.":5,vr:5,"vr.":5,zaterdag:6,zat:6,"zat.":6,za:6,"za.":6};ue.MONTH_DICTIONARY={januari:1,jan:1,"jan.":1,februari:2,feb:2,"feb.":2,maart:3,mar:3,"mar.":3,april:4,apr:4,"apr.":4,mei:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,augustus:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,december:12,dec:12,"dec.":12};ue.INTEGER_WORD_DICTIONARY={een:1,twee:2,drie:3,vier:4,vijf:5,zes:6,zeven:7,acht:8,negen:9,tien:10,elf:11,twaalf:12};ue.ORDINAL_WORD_DICTIONARY={eerste:1,tweede:2,derde:3,vierde:4,vijfde:5,zesde:6,zevende:7,achtste:8,negende:9,tiende:10,elfde:11,twaalfde:12,dertiende:13,veertiende:14,vijftiende:15,zestiende:16,zeventiende:17,achttiende:18,negentiende:19,twintigste:20,eenentwintigste:21,twee\u00EBntwintigste:22,drieentwintigste:23,vierentwintigste:24,vijfentwintigste:25,zesentwintigste:26,zevenentwintigste:27,achtentwintig:28,negenentwintig:29,dertigste:30,eenendertigste:31};ue.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconden:"second",min:"minute",mins:"minute",minute:"minute",minuut:"minute",minuten:"minute",minuutje:"minute",h:"hour",hr:"hour",hrs:"hour",uur:"hour",u:"hour",uren:"hour",dag:"d",dagen:"d",week:"week",weken:"week",maand:"month",maanden:"month",jaar:"year",jr:"year",jaren:"year"};ue.NUMBER_PATTERN=`(?:${co.matchAnyPattern(ue.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`;function $g(r){let e=r.toLowerCase();return ue.INTEGER_WORD_DICTIONARY[e]!==void 0?ue.INTEGER_WORD_DICTIONARY[e]:e==="paar"?2:e==="half"||e.match(/halve?/)?.5:parseFloat(e.replace(",","."))}ue.parseNumberPattern=$g;ue.ORDINAL_NUMBER_PATTERN=`(?:${co.matchAnyPattern(ue.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`;function AO(r){let e=r.toLowerCase();return ue.ORDINAL_WORD_DICTIONARY[e]!==void 0?ue.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:ste|de)$/i,""),parseInt(e))}ue.parseOrdinalNumberPattern=AO;ue.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])";function PO(r){if(/voor Christus/i.test(r))return r=r.replace(/voor Christus/i,""),-parseInt(r);if(/na Christus/i.test(r))return r=r.replace(/na Christus/i,""),parseInt(r);let e=parseInt(r);return CO.findMostLikelyADYear(e)}ue.parseYear=PO;var Yg=`(${ue.NUMBER_PATTERN})\\s{0,5}(${co.matchAnyPattern(ue.TIME_UNIT_DICTIONARY)})\\s{0,5}`,qg=new RegExp(Yg,"i");ue.TIME_UNITS_PATTERN=co.repeatedTimeunitPattern("(?:(?:binnen|in)\\s*)?",Yg);function NO(r){let e={},t=r,n=qg.exec(t);for(;n;)IO(e,n),t=t.substring(n[0].length),n=qg.exec(t);return e}ue.parseTimeUnits=NO;function IO(r,e){let t=$g(e[1]),n=ue.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var jg=T(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});var Gg=Ct(),FO=Ne(),LO=W(),ld=class extends LO.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(?:binnen|in|binnen de|voor)\\s*("+Gg.TIME_UNITS_PATTERN+")(?=\\W|$)","i")}innerExtract(e,t){let n=Gg.parseTimeUnits(t[1]);return FO.ParsingComponents.createRelativeFromReference(e.reference,n)}};cd.default=ld});var Hg=T(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});var Bg=Ct(),UO=ve(),WO=W(),qO=Rn(),$O=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:op\\s*?)?(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?(${UO.matchAnyPattern(Bg.WEEKDAY_DICTIONARY)})(?=\\W|$)`,"i"),YO=1,GO=2,jO=3,dd=class extends WO.AbstractParserWithWordBoundaryChecking{innerPattern(){return $O}innerExtract(e,t){let n=t[GO].toLowerCase(),i=Bg.WEEKDAY_DICTIONARY[n],s=t[YO],a=t[jO],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="vorige"?u="last":o=="volgende"?u="next":o=="deze"&&(u="this");let l=qO.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};fd.default=dd});var Zg=T(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});var BO=nt(),Qg=Ct(),fo=Ct(),Xg=Ct(),HO=ve(),zO=W(),VO=new RegExp(`(?:on\\s*?)?(${fo.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:tot|\\-|\\\u2013|until|through|till|\\s)\\s*(${fo.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:of)?\\s*)(`+HO.matchAnyPattern(Qg.MONTH_DICTIONARY)+`)(?:(?:-|/|,?\\s*)(${Xg.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),KO=3,zg=1,Vg=2,Kg=4,pd=class extends zO.AbstractParserWithWordBoundaryChecking{innerPattern(){return VO}innerExtract(e,t){let n=Qg.MONTH_DICTIONARY[t[KO].toLowerCase()],i=fo.parseOrdinalNumberPattern(t[zg]);if(i>31)return t.index=t.index+t[zg].length,null;let s=e.createParsingComponents({day:i,month:n});if(t[Kg]){let u=Xg.parseYear(t[Kg]);s.assign("year",u)}else{let u=BO.findYearClosestToRef(e.refDate,i,n);s.imply("year",u)}if(!t[Vg])return s;let a=fo.parseOrdinalNumberPattern(t[Vg]),o=e.createParsingResult(t.index,t[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}};hd.default=pd});var ry=T(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});var ey=Ct(),QO=nt(),XO=ve(),ty=Ct(),ZO=W(),JO=new RegExp(`(${XO.matchAnyPattern(ey.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${ty.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),e0=1,Jg=2,md=class extends ZO.AbstractParserWithWordBoundaryChecking{innerPattern(){return JO}innerExtract(e,t){let n=e.createParsingComponents();n.imply("day",1);let i=t[e0],s=ey.MONTH_DICTIONARY[i.toLowerCase()];if(n.assign("month",s),t[Jg]){let a=ty.parseYear(t[Jg]);n.assign("year",a)}else{let a=QO.findYearClosestToRef(e.refDate,1,s);n.imply("year",a)}return n}};gd.default=md});var ny=T(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});var t0=W(),r0=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),n0=1,i0=2,yd=class extends t0.AbstractParserWithWordBoundaryChecking{innerPattern(){return r0}innerExtract(e,t){let n=parseInt(t[i0]),i=parseInt(t[n0]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}};bd.default=yd});var iy=T(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});var s0=On(),Td=class extends s0.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:om)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|om|\\?)\\s*"}primarySuffix(){return"(?:\\s*(?:uur))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};_d.default=Td});var oy=T(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});var ay=Ct(),a0=ve(),o0=W(),u0=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${a0.matchAnyPattern(ay.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),l0=1,c0=2,sy=3,d0=4,vd=class extends o0.AbstractParserWithWordBoundaryChecking{innerPattern(){return u0}innerExtract(e,t){let n=t[sy]?parseInt(t[sy]):ay.MONTH_DICTIONARY[t[c0].toLowerCase()];if(n<1||n>12)return null;let i=parseInt(t[l0]);return{day:parseInt(t[d0]),month:n,year:i}}};wd.default=vd});var uy=T(As=>{"use strict";var f0=As&&As.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(As,"__esModule",{value:!0});var p0=W(),po=Be(),Ed=jt(),h0=f0(ye()),m0=1,g0=2,kd=class extends p0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i}innerExtract(e,t){let n=t[m0].toLowerCase(),i=t[g0].toLowerCase(),s=e.createParsingComponents(),a=h0.default(e.refDate);switch(n){case"gisteren":Ed.assignSimilarDate(s,a.add(-1,"day"));break;case"van":Ed.assignSimilarDate(s,a);break;case"morgen":Ed.assignTheNextDay(s,a);break}switch(i){case"ochtend":s.imply("meridiem",po.Meridiem.AM),s.imply("hour",6);break;case"middag":s.imply("meridiem",po.Meridiem.AM),s.imply("hour",12);break;case"namiddag":s.imply("meridiem",po.Meridiem.PM),s.imply("hour",15);break;case"avond":s.imply("meridiem",po.Meridiem.PM),s.imply("hour",20);break}return s}};As.default=kd});var cy=T(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});var ly=Ct(),y0=Ne(),b0=W(),T0=Bt(),_0=new RegExp(`(deze|vorige|afgelopen|komende|over|\\+|-)\\s*(${ly.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Sd=class extends b0.AbstractParserWithWordBoundaryChecking{innerPattern(){return _0}innerExtract(e,t){let n=t[1].toLowerCase(),i=ly.parseTimeUnits(t[2]);switch(n){case"vorige":case"afgelopen":case"-":i=T0.reverseTimeUnits(i);break}return y0.ParsingComponents.createRelativeFromReference(e.reference,i)}};Od.default=Sd});var py=T(Ps=>{"use strict";var v0=Ps&&Ps.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ps,"__esModule",{value:!0});var fy=Ct(),dy=Ne(),w0=v0(ye()),E0=W(),k0=ve(),S0=new RegExp(`(dit|deze|komende|volgend|volgende|afgelopen|vorige)\\s*(${k0.matchAnyPattern(fy.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),O0=1,D0=2,Dd=class extends E0.AbstractParserWithWordBoundaryChecking{innerPattern(){return S0}innerExtract(e,t){let n=t[O0].toLowerCase(),i=t[D0].toLowerCase(),s=fy.TIME_UNIT_DICTIONARY[i];if(n=="volgend"||n=="volgende"||n=="komende"){let u={};return u[s]=1,dy.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="afgelopen"||n=="vorige"){let u={};return u[s]=-1,dy.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=w0.default(e.reference.instant);return i.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):i.match(/maand/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):i.match(/jaar/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};Ps.default=Dd});var hy=T(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var xd=Ct(),R0=Ne(),x0=W(),M0=Bt(),C0=new RegExp("("+xd.TIME_UNITS_PATTERN+")(?:geleden|voor|eerder)(?=(?:\\W|$))","i"),A0=new RegExp("("+xd.TIME_UNITS_PATTERN+")geleden(?=(?:\\W|$))","i"),Rd=class extends x0.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?A0:C0}innerExtract(e,t){let n=xd.parseTimeUnits(t[1]),i=M0.reverseTimeUnits(n);return R0.ParsingComponents.createRelativeFromReference(e.reference,i)}};Md.default=Rd});var my=T(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});var Ad=Ct(),P0=Ne(),N0=W(),I0=new RegExp("("+Ad.TIME_UNITS_PATTERN+")(later|na|vanaf nu|voortaan|vooruit|uit)(?=(?:\\W|$))","i"),F0=new RegExp("("+Ad.TIME_UNITS_PATTERN+")(later|vanaf nu)(?=(?:\\W|$))","i"),L0=1,Cd=class extends N0.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?F0:I0}innerExtract(e,t){let n=Ad.parseTimeUnits(t[L0]);return P0.ParsingComponents.createRelativeFromReference(e.reference,n)}};Pd.default=Cd});var Ty=T(Xe=>{"use strict";var st=Xe&&Xe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.createConfiguration=Xe.createCasualConfiguration=Xe.parseDate=Xe.parse=Xe.strict=Xe.casual=void 0;var U0=Cr(),gy=nr(),W0=st(Fg()),q0=st(Lg()),$0=st(Ug()),Y0=st(Wg()),G0=st(xn()),j0=st(jg()),B0=st(Hg()),H0=st(Zg()),yy=st(ry()),z0=st(ny()),V0=st(iy()),K0=st(oy()),Q0=st(uy()),X0=st(cy()),Z0=st(py()),J0=st(hy()),eD=st(my());Xe.casual=new gy.Chrono(by());Xe.strict=new gy.Chrono(Nd(!0));function tD(r,e,t){return Xe.casual.parse(r,e,t)}Xe.parse=tD;function rD(r,e,t){return Xe.casual.parseDate(r,e,t)}Xe.parseDate=rD;function by(r=!0){let e=Nd(!1,r);return e.parsers.unshift(new $0.default),e.parsers.unshift(new Y0.default),e.parsers.unshift(new Q0.default),e.parsers.unshift(new yy.default),e.parsers.unshift(new Z0.default),e.parsers.unshift(new X0.default),e}Xe.createCasualConfiguration=by;function Nd(r=!0,e=!0){return U0.includeCommonConfiguration({parsers:[new G0.default(e),new j0.default,new H0.default,new yy.default,new B0.default,new K0.default,new z0.default,new V0.default(r),new J0.default(r),new eD.default(r)],refiners:[new q0.default,new W0.default]},r)}Xe.createConfiguration=Nd});var Ey=T(Ns=>{"use strict";var nD=Ns&&Ns.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ns,"__esModule",{value:!0});var iD=nD(ye()),sD=W(),aD=1,_y=2,oD=3,vy=4,wy=5,uD=6,Id=class extends sD.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u800C\u5BB6|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,i=e.createParsingResult(n,t[0]),s=iD.default(e.refDate),a=s;if(t[aD])i.start.imply("hour",s.hour()),i.start.imply("minute",s.minute()),i.start.imply("second",s.second()),i.start.imply("millisecond",s.millisecond());else if(t[_y]){let o=t[_y],u=t[oD];o=="\u660E"||o=="\u807D"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u5F8C"?a=a.add(2,"day"):o=="\u5927\u5F8C"&&(a=a.add(3,"day")),u=="\u65E9"||u=="\u671D"?i.start.imply("hour",6):u=="\u665A"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(t[vy]){let u=t[vy][0];u=="\u65E9"||u=="\u671D"||u=="\u4E0A"?i.start.imply("hour",6):u=="\u4E0B"||u=="\u664F"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):u=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):u=="\u51CC"&&i.start.imply("hour",0)}else if(t[wy]){let o=t[wy];o=="\u660E"||o=="\u807D"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u5F8C"?a=a.add(2,"day"):o=="\u5927\u5F8C"&&(a=a.add(3,"day"));let u=t[uD];if(u){let l=u[0];l=="\u65E9"||l=="\u671D"||l=="\u4E0A"?i.start.imply("hour",6):l=="\u4E0B"||l=="\u664F"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):l=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):l=="\u51CC"&&i.start.imply("hour",0)}}return i.start.assign("day",a.date()),i.start.assign("month",a.month()+1),i.start.assign("year",a.year()),i}};Ns.default=Id});var bi=T(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.zhStringToYear=St.zhStringToNumber=St.WEEKDAY_OFFSET=St.NUMBER=void 0;St.NUMBER={\u96F6:0,\u4E00:1,\u4E8C:2,\u5169:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10,\u5EFF:20,\u5345:30};St.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function lD(r){let e=0;for(let t=0;t{"use strict";var dD=Is&&Is.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Is,"__esModule",{value:!0});var fD=dD(ye()),pD=W(),An=bi(),Fd=1,ky=2,Ld=3,Ud=class extends pD.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(An.NUMBER).join("")+"]{4}|["+Object.keys(An.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(An.NUMBER).join("")+"]{1,2})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(An.NUMBER).join("")+"]{1,2})?(?:\\s*)(?:\u65E5|\u865F)?")}innerExtract(e,t){let n=fD.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[ky]);if(isNaN(s)&&(s=An.zhStringToNumber(t[ky])),i.start.assign("month",s),t[Ld]){let a=parseInt(t[Ld]);isNaN(a)&&(a=An.zhStringToNumber(t[Ld])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[Fd]){let a=parseInt(t[Fd]);isNaN(a)&&(a=An.zhStringToYear(t[Fd])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}};Is.default=Ud});var Dy=T(Fs=>{"use strict";var hD=Fs&&Fs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fs,"__esModule",{value:!0});var mD=hD(ye()),gD=W(),Oy=bi(),yD=new RegExp("(\\d+|["+Object.keys(Oy.NUMBER).join("")+"]+|\u534A|\u5E7E)(?:\\s*)(?:\u500B)?(\u79D2(?:\u9418)?|\u5206\u9418|\u5C0F\u6642|\u9418|\u65E5|\u5929|\u661F\u671F|\u79AE\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u904E)?\u5F8C|(?:\u4E4B)?\u5167)","i"),Wd=1,bD=2,qd=class extends gD.AbstractParserWithWordBoundaryChecking{innerPattern(){return yD}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[Wd]);if(isNaN(i)&&(i=Oy.zhStringToNumber(t[Wd])),isNaN(i)){let u=t[Wd];if(u==="\u5E7E")i=3;else if(u==="\u534A")i=.5;else return null}let s=mD.default(e.refDate),o=t[bD][0];return o.match(/[日天星禮月年]/)?(o=="\u65E5"||o=="\u5929"?s=s.add(i,"d"):o=="\u661F"||o=="\u79AE"?s=s.add(i*7,"d"):o=="\u6708"?s=s.add(i,"month"):o=="\u5E74"&&(s=s.add(i,"year")),n.start.assign("year",s.year()),n.start.assign("month",s.month()+1),n.start.assign("day",s.date()),n):(o=="\u79D2"?s=s.add(i,"second"):o=="\u5206"?s=s.add(i,"minute"):(o=="\u5C0F"||o=="\u9418")&&(s=s.add(i,"hour")),n.start.imply("year",s.year()),n.start.imply("month",s.month()+1),n.start.imply("day",s.date()),n.start.assign("hour",s.hour()),n.start.assign("minute",s.minute()),n.start.assign("second",s.second()),n)}};Fs.default=qd});var xy=T(Ls=>{"use strict";var TD=Ls&&Ls.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ls,"__esModule",{value:!0});var _D=TD(ye()),vD=W(),Ry=bi(),wD=new RegExp("(?\u4E0A|\u4ECA|\u4E0B|\u9019|\u5462)(?:\u500B)?(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(Ry.WEEKDAY_OFFSET).join("|")+")"),$d=class extends vD.AbstractParserWithWordBoundaryChecking{innerPattern(){return wD}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=Ry.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=null,o=t.groups.prefix;o=="\u4E0A"?a="last":o=="\u4E0B"?a="next":(o=="\u4ECA"||o=="\u9019"||o=="\u5462")&&(a="this");let u=_D.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(s-7),l=!0):a=="next"?(u=u.day(s+7),l=!0):a=="this"?u=u.day(s):Math.abs(s-7-c){"use strict";var ED=Us&&Us.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Us,"__esModule",{value:!0});var kD=ED(ye()),SD=W(),Vt=bi(),OD=new RegExp("(?:\u7531|\u5F9E|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(Vt.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Vt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Vt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),DD=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(Vt.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Vt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Vt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),ho=1,mo=2,go=3,yo=4,bo=5,To=6,zt=7,Ti=8,_o=9,Yd=class extends SD.AbstractParserWithWordBoundaryChecking{innerPattern(){return OD}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=kD.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[ho]){var a=t[ho];a=="\u660E"||a=="\u807D"?n.hour()>1&&s.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?s.add(-1,"day"):a=="\u524D"?s.add(-2,"day"):a=="\u5927\u524D"?s.add(-3,"day"):a=="\u5F8C"?s.add(2,"day"):a=="\u5927\u5F8C"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else if(t[yo]){var o=t[yo];o=="\u660E"||o=="\u807D"?s.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?s.add(-1,"day"):o=="\u524D"?s.add(-2,"day"):o=="\u5927\u524D"?s.add(-3,"day"):o=="\u5F8C"?s.add(2,"day"):o=="\u5927\u5F8C"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else i.start.imply("day",s.date()),i.start.imply("month",s.month()+1),i.start.imply("year",s.year());let u=0,l=0,c=-1;if(t[Ti]){var p=parseInt(t[Ti]);if(isNaN(p)&&(p=Vt.zhStringToNumber(t[Ti])),p>=60)return null;i.start.assign("second",p)}if(u=parseInt(t[To]),isNaN(u)&&(u=Vt.zhStringToNumber(t[To])),t[zt]?t[zt]=="\u534A"?l=30:t[zt]=="\u6B63"||t[zt]=="\u6574"?l=0:(l=parseInt(t[zt]),isNaN(l)&&(l=Vt.zhStringToNumber(t[zt]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[_o]){if(u>12)return null;var h=t[_o][0].toLowerCase();h=="a"&&(c=0,u==12&&(u=0)),h=="p"&&(c=1,u!=12&&(u+=12))}else if(t[mo]){var _=t[mo],y=_[0];y=="\u671D"||y=="\u65E9"?(c=0,u==12&&(u=0)):y=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[go]){var w=t[go],R=w[0];R=="\u4E0A"||R=="\u671D"||R=="\u65E9"||R=="\u51CC"?(c=0,u==12&&(u=0)):(R=="\u4E0B"||R=="\u664F"||R=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[bo]){var C=t[bo],N=C[0];N=="\u4E0A"||N=="\u671D"||N=="\u65E9"||N=="\u51CC"?(c=0,u==12&&(u=0)):(N=="\u4E0B"||N=="\u664F"||N=="\u665A")&&(c=1,u!=12&&(u+=12))}if(i.start.assign("hour",u),i.start.assign("minute",l),c>=0?i.start.assign("meridiem",c):u<12?i.start.imply("meridiem",0):i.start.imply("meridiem",1),t=DD.exec(e.text.substring(i.index+i.text.length)),!t)return i.text.match(/^\d+$/)?null:i;let F=s.clone();if(i.end=e.createParsingComponents(),t[ho]){var a=t[ho];a=="\u660E"||a=="\u807D"?n.hour()>1&&F.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?F.add(-1,"day"):a=="\u524D"?F.add(-2,"day"):a=="\u5927\u524D"?F.add(-3,"day"):a=="\u5F8C"?F.add(2,"day"):a=="\u5927\u5F8C"&&F.add(3,"day"),i.end.assign("day",F.date()),i.end.assign("month",F.month()+1),i.end.assign("year",F.year())}else if(t[yo]){var o=t[yo];o=="\u660E"||o=="\u807D"?F.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?F.add(-1,"day"):o=="\u524D"?F.add(-2,"day"):o=="\u5927\u524D"?F.add(-3,"day"):o=="\u5F8C"?F.add(2,"day"):o=="\u5927\u5F8C"&&F.add(3,"day"),i.end.assign("day",F.date()),i.end.assign("month",F.month()+1),i.end.assign("year",F.year())}else i.end.imply("day",F.date()),i.end.imply("month",F.month()+1),i.end.imply("year",F.year());if(u=0,l=0,c=-1,t[Ti]){var p=parseInt(t[Ti]);if(isNaN(p)&&(p=Vt.zhStringToNumber(t[Ti])),p>=60)return null;i.end.assign("second",p)}if(u=parseInt(t[To]),isNaN(u)&&(u=Vt.zhStringToNumber(t[To])),t[zt]?t[zt]=="\u534A"?l=30:t[zt]=="\u6B63"||t[zt]=="\u6574"?l=0:(l=parseInt(t[zt]),isNaN(l)&&(l=Vt.zhStringToNumber(t[zt]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[_o]){if(u>12)return null;var h=t[_o][0].toLowerCase();h=="a"&&(c=0,u==12&&(u=0)),h=="p"&&(c=1,u!=12&&(u+=12)),i.start.isCertain("meridiem")||(c==0?(i.start.imply("meridiem",0),i.start.get("hour")==12&&i.start.assign("hour",0)):(i.start.imply("meridiem",1),i.start.get("hour")!=12&&i.start.assign("hour",i.start.get("hour")+12)))}else if(t[mo]){var _=t[mo],y=_[0];y=="\u671D"||y=="\u65E9"?(c=0,u==12&&(u=0)):y=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[go]){var w=t[go],R=w[0];R=="\u4E0A"||R=="\u671D"||R=="\u65E9"||R=="\u51CC"?(c=0,u==12&&(u=0)):(R=="\u4E0B"||R=="\u664F"||R=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[bo]){var C=t[bo],N=C[0];N=="\u4E0A"||N=="\u671D"||N=="\u65E9"||N=="\u51CC"?(c=0,u==12&&(u=0)):(N=="\u4E0B"||N=="\u664F"||N=="\u665A")&&(c=1,u!=12&&(u+=12))}return i.text=i.text+t[0],i.end.assign("hour",u),i.end.assign("minute",l),c>=0?i.end.assign("meridiem",c):i.start.isCertain("meridiem")&&i.start.get("meridiem")==1&&i.start.get("hour")>u?i.end.imply("meridiem",0):u>12&&i.end.imply("meridiem",1),i.end.date().getTime(){"use strict";var RD=Ws&&Ws.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ws,"__esModule",{value:!0});var xD=RD(ye()),MD=W(),Cy=bi(),CD=new RegExp("(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(Cy.WEEKDAY_OFFSET).join("|")+")"),Gd=class extends MD.AbstractParserWithWordBoundaryChecking{innerPattern(){return CD}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=Cy.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=xD.default(e.refDate),o=!1,u=a.day();return Math.abs(s-7-u){"use strict";var AD=qs&&qs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qs,"__esModule",{value:!0});var PD=AD(yr()),jd=class extends PD.default{patternBetween(){return/^\s*(至|到|\-|\~|~|-|ー)\s*$/i}};qs.default=jd});var Ny=T($s=>{"use strict";var ND=$s&&$s.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($s,"__esModule",{value:!0});var ID=ND(Mr()),Bd=class extends ID.default{patternBetween(){return/^\s*$/i}};$s.default=Bd});var Iy=T(Ye=>{"use strict";var Fr=Ye&&Ye.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.createConfiguration=Ye.createCasualConfiguration=Ye.parseDate=Ye.parse=Ye.strict=Ye.casual=Ye.hant=void 0;var Hd=nr(),FD=Fr(Ka()),LD=Cr(),UD=Fr(Ey()),WD=Fr(Sy()),qD=Fr(Dy()),$D=Fr(xy()),YD=Fr(My()),GD=Fr(Ay()),jD=Fr(Py()),BD=Fr(Ny());Ye.hant=new Hd.Chrono(zd());Ye.casual=new Hd.Chrono(zd());Ye.strict=new Hd.Chrono(Vd());function HD(r,e,t){return Ye.casual.parse(r,e,t)}Ye.parse=HD;function zD(r,e,t){return Ye.casual.parseDate(r,e,t)}Ye.parseDate=zD;function zd(){let r=Vd();return r.parsers.unshift(new UD.default),r}Ye.createCasualConfiguration=zd;function Vd(){let r=LD.includeCommonConfiguration({parsers:[new WD.default,new $D.default,new GD.default,new YD.default,new qD.default],refiners:[new jD.default,new BD.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof FD.default)),r}Ye.createConfiguration=Vd});var Wy=T(Ys=>{"use strict";var VD=Ys&&Ys.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ys,"__esModule",{value:!0});var KD=VD(ye()),QD=W(),XD=1,Fy=2,ZD=3,Ly=4,Uy=5,JD=6,Kd=class extends QD.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u73B0\u5728|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,i=e.createParsingResult(n,t[0]),s=KD.default(e.refDate),a=s;if(t[XD])i.start.imply("hour",s.hour()),i.start.imply("minute",s.minute()),i.start.imply("second",s.second()),i.start.imply("millisecond",s.millisecond());else if(t[Fy]){let o=t[Fy],u=t[ZD];o=="\u660E"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u540E"?a=a.add(2,"day"):o=="\u5927\u540E"&&(a=a.add(3,"day")),u=="\u65E9"?i.start.imply("hour",6):u=="\u665A"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(t[Ly]){let u=t[Ly][0];u=="\u65E9"||u=="\u4E0A"?i.start.imply("hour",6):u=="\u4E0B"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):u=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):u=="\u51CC"&&i.start.imply("hour",0)}else if(t[Uy]){let o=t[Uy];o=="\u660E"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u540E"?a=a.add(2,"day"):o=="\u5927\u540E"&&(a=a.add(3,"day"));let u=t[JD];if(u){let l=u[0];l=="\u65E9"||l=="\u4E0A"?i.start.imply("hour",6):l=="\u4E0B"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):l=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):l=="\u51CC"&&i.start.imply("hour",0)}}return i.start.assign("day",a.date()),i.start.assign("month",a.month()+1),i.start.assign("year",a.year()),i}};Ys.default=Kd});var _i=T(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.zhStringToYear=Ot.zhStringToNumber=Ot.WEEKDAY_OFFSET=Ot.NUMBER=void 0;Ot.NUMBER={\u96F6:0,"\u3007":0,\u4E00:1,\u4E8C:2,\u4E24:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10};Ot.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function eR(r){let e=0;for(let t=0;t{"use strict";var rR=Gs&&Gs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gs,"__esModule",{value:!0});var nR=rR(ye()),iR=W(),Pn=_i(),Qd=1,qy=2,Xd=3,Zd=class extends iR.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(Pn.NUMBER).join("")+"]{4}|["+Object.keys(Pn.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(Pn.NUMBER).join("")+"]{1,3})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(Pn.NUMBER).join("")+"]{1,3})?(?:\\s*)(?:\u65E5|\u53F7)?")}innerExtract(e,t){let n=nR.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[qy]);if(isNaN(s)&&(s=Pn.zhStringToNumber(t[qy])),i.start.assign("month",s),t[Xd]){let a=parseInt(t[Xd]);isNaN(a)&&(a=Pn.zhStringToNumber(t[Xd])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[Qd]){let a=parseInt(t[Qd]);isNaN(a)&&(a=Pn.zhStringToYear(t[Qd])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}};Gs.default=Zd});var Gy=T(js=>{"use strict";var sR=js&&js.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(js,"__esModule",{value:!0});var aR=sR(ye()),oR=W(),Yy=_i(),uR=new RegExp("(\\d+|["+Object.keys(Yy.NUMBER).join("")+"]+|\u534A|\u51E0)(?:\\s*)(?:\u4E2A)?(\u79D2(?:\u949F)?|\u5206\u949F|\u5C0F\u65F6|\u949F|\u65E5|\u5929|\u661F\u671F|\u793C\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u8FC7)?\u540E|(?:\u4E4B)?\u5185)","i"),Jd=1,lR=2,ef=class extends oR.AbstractParserWithWordBoundaryChecking{innerPattern(){return uR}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[Jd]);if(isNaN(i)&&(i=Yy.zhStringToNumber(t[Jd])),isNaN(i)){let u=t[Jd];if(u==="\u51E0")i=3;else if(u==="\u534A")i=.5;else return null}let s=aR.default(e.refDate),o=t[lR][0];return o.match(/[日天星礼月年]/)?(o=="\u65E5"||o=="\u5929"?s=s.add(i,"d"):o=="\u661F"||o=="\u793C"?s=s.add(i*7,"d"):o=="\u6708"?s=s.add(i,"month"):o=="\u5E74"&&(s=s.add(i,"year")),n.start.assign("year",s.year()),n.start.assign("month",s.month()+1),n.start.assign("day",s.date()),n):(o=="\u79D2"?s=s.add(i,"second"):o=="\u5206"?s=s.add(i,"minute"):(o=="\u5C0F"||o=="\u949F")&&(s=s.add(i,"hour")),n.start.imply("year",s.year()),n.start.imply("month",s.month()+1),n.start.imply("day",s.date()),n.start.assign("hour",s.hour()),n.start.assign("minute",s.minute()),n.start.assign("second",s.second()),n)}};js.default=ef});var By=T(Bs=>{"use strict";var cR=Bs&&Bs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Bs,"__esModule",{value:!0});var dR=cR(ye()),fR=W(),jy=_i(),pR=new RegExp("(?\u4E0A|\u4E0B|\u8FD9)(?:\u4E2A)?(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(jy.WEEKDAY_OFFSET).join("|")+")"),tf=class extends fR.AbstractParserWithWordBoundaryChecking{innerPattern(){return pR}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=jy.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=null,o=t.groups.prefix;o=="\u4E0A"?a="last":o=="\u4E0B"?a="next":o=="\u8FD9"&&(a="this");let u=dR.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(s-7),l=!0):a=="next"?(u=u.day(s+7),l=!0):a=="this"?u=u.day(s):Math.abs(s-7-c){"use strict";var hR=Hs&&Hs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Hs,"__esModule",{value:!0});var mR=hR(ye()),gR=W(),Qt=_i(),yR=new RegExp("(?:\u4ECE|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(Qt.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Qt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Qt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),bR=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(Qt.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Qt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Qt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),vo=1,wo=2,Eo=3,ko=4,So=5,Oo=6,Kt=7,vi=8,Do=9,rf=class extends gR.AbstractParserWithWordBoundaryChecking{innerPattern(){return yR}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=mR.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[vo]){let c=t[vo];c=="\u660E"?n.hour()>1&&s.add(1,"day"):c=="\u6628"?s.add(-1,"day"):c=="\u524D"?s.add(-2,"day"):c=="\u5927\u524D"?s.add(-3,"day"):c=="\u540E"?s.add(2,"day"):c=="\u5927\u540E"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else if(t[ko]){let c=t[ko];c=="\u660E"?s.add(1,"day"):c=="\u6628"?s.add(-1,"day"):c=="\u524D"?s.add(-2,"day"):c=="\u5927\u524D"?s.add(-3,"day"):c=="\u540E"?s.add(2,"day"):c=="\u5927\u540E"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else i.start.imply("day",s.date()),i.start.imply("month",s.month()+1),i.start.imply("year",s.year());let a=0,o=0,u=-1;if(t[vi]){let c=parseInt(t[vi]);if(isNaN(c)&&(c=Qt.zhStringToNumber(t[vi])),c>=60)return null;i.start.assign("second",c)}if(a=parseInt(t[Oo]),isNaN(a)&&(a=Qt.zhStringToNumber(t[Oo])),t[Kt]?t[Kt]=="\u534A"?o=30:t[Kt]=="\u6B63"||t[Kt]=="\u6574"?o=0:(o=parseInt(t[Kt]),isNaN(o)&&(o=Qt.zhStringToNumber(t[Kt]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[Do]){if(a>12)return null;let c=t[Do][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12))}else if(t[wo]){let p=t[wo][0];p=="\u65E9"?(u=0,a==12&&(a=0)):p=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Eo]){let p=t[Eo][0];p=="\u4E0A"||p=="\u65E9"||p=="\u51CC"?(u=0,a==12&&(a=0)):(p=="\u4E0B"||p=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[So]){let p=t[So][0];p=="\u4E0A"||p=="\u65E9"||p=="\u51CC"?(u=0,a==12&&(a=0)):(p=="\u4E0B"||p=="\u665A")&&(u=1,a!=12&&(a+=12))}if(i.start.assign("hour",a),i.start.assign("minute",o),u>=0?i.start.assign("meridiem",u):a<12?i.start.imply("meridiem",0):i.start.imply("meridiem",1),t=bR.exec(e.text.substring(i.index+i.text.length)),!t)return i.text.match(/^\d+$/)?null:i;let l=s.clone();if(i.end=e.createParsingComponents(),t[vo]){let c=t[vo];c=="\u660E"?n.hour()>1&&l.add(1,"day"):c=="\u6628"?l.add(-1,"day"):c=="\u524D"?l.add(-2,"day"):c=="\u5927\u524D"?l.add(-3,"day"):c=="\u540E"?l.add(2,"day"):c=="\u5927\u540E"&&l.add(3,"day"),i.end.assign("day",l.date()),i.end.assign("month",l.month()+1),i.end.assign("year",l.year())}else if(t[ko]){let c=t[ko];c=="\u660E"?l.add(1,"day"):c=="\u6628"?l.add(-1,"day"):c=="\u524D"?l.add(-2,"day"):c=="\u5927\u524D"?l.add(-3,"day"):c=="\u540E"?l.add(2,"day"):c=="\u5927\u540E"&&l.add(3,"day"),i.end.assign("day",l.date()),i.end.assign("month",l.month()+1),i.end.assign("year",l.year())}else i.end.imply("day",l.date()),i.end.imply("month",l.month()+1),i.end.imply("year",l.year());if(a=0,o=0,u=-1,t[vi]){let c=parseInt(t[vi]);if(isNaN(c)&&(c=Qt.zhStringToNumber(t[vi])),c>=60)return null;i.end.assign("second",c)}if(a=parseInt(t[Oo]),isNaN(a)&&(a=Qt.zhStringToNumber(t[Oo])),t[Kt]?t[Kt]=="\u534A"?o=30:t[Kt]=="\u6B63"||t[Kt]=="\u6574"?o=0:(o=parseInt(t[Kt]),isNaN(o)&&(o=Qt.zhStringToNumber(t[Kt]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[Do]){if(a>12)return null;let c=t[Do][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12)),i.start.isCertain("meridiem")||(u==0?(i.start.imply("meridiem",0),i.start.get("hour")==12&&i.start.assign("hour",0)):(i.start.imply("meridiem",1),i.start.get("hour")!=12&&i.start.assign("hour",i.start.get("hour")+12)))}else if(t[wo]){let p=t[wo][0];p=="\u65E9"?(u=0,a==12&&(a=0)):p=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Eo]){let p=t[Eo][0];p=="\u4E0A"||p=="\u65E9"||p=="\u51CC"?(u=0,a==12&&(a=0)):(p=="\u4E0B"||p=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[So]){let p=t[So][0];p=="\u4E0A"||p=="\u65E9"||p=="\u51CC"?(u=0,a==12&&(a=0)):(p=="\u4E0B"||p=="\u665A")&&(u=1,a!=12&&(a+=12))}return i.text=i.text+t[0],i.end.assign("hour",a),i.end.assign("minute",o),u>=0?i.end.assign("meridiem",u):i.start.isCertain("meridiem")&&i.start.get("meridiem")==1&&i.start.get("hour")>a?i.end.imply("meridiem",0):a>12&&i.end.imply("meridiem",1),i.end.date().getTime(){"use strict";var TR=zs&&zs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(zs,"__esModule",{value:!0});var _R=TR(ye()),vR=W(),zy=_i(),wR=new RegExp("(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(zy.WEEKDAY_OFFSET).join("|")+")"),nf=class extends vR.AbstractParserWithWordBoundaryChecking{innerPattern(){return wR}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=zy.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=_R.default(e.refDate),o=!1,u=a.day();return Math.abs(s-7-u){"use strict";var ER=Vs&&Vs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vs,"__esModule",{value:!0});var kR=ER(yr()),sf=class extends kR.default{patternBetween(){return/^\s*(至|到|-|~|~|-|ー)\s*$/i}};Vs.default=sf});var Qy=T(Ks=>{"use strict";var SR=Ks&&Ks.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ks,"__esModule",{value:!0});var OR=SR(Mr()),af=class extends OR.default{patternBetween(){return/^\s*$/i}};Ks.default=af});var Xy=T(Ge=>{"use strict";var Lr=Ge&&Ge.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.createConfiguration=Ge.createCasualConfiguration=Ge.parseDate=Ge.parse=Ge.strict=Ge.casual=Ge.hans=void 0;var of=nr(),DR=Lr(Ka()),RR=Cr(),xR=Lr(Wy()),MR=Lr($y()),CR=Lr(Gy()),AR=Lr(By()),PR=Lr(Hy()),NR=Lr(Vy()),IR=Lr(Ky()),FR=Lr(Qy());Ge.hans=new of.Chrono(uf());Ge.casual=new of.Chrono(uf());Ge.strict=new of.Chrono(lf());function LR(r,e,t){return Ge.casual.parse(r,e,t)}Ge.parse=LR;function UR(r,e,t){return Ge.casual.parseDate(r,e,t)}Ge.parseDate=UR;function uf(){let r=lf();return r.parsers.unshift(new xR.default),r}Ge.createCasualConfiguration=uf;function lf(){let r=RR.includeCommonConfiguration({parsers:[new MR.default,new AR.default,new NR.default,new PR.default,new CR.default],refiners:[new IR.default,new FR.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof DR.default)),r}Ge.createConfiguration=lf});var Jy=T(At=>{"use strict";var Zy=At&&At.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),WR=At&&At.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),qR=At&&At.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Zy(e,r,t)},$R=At&&At.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Zy(e,r,t);return WR(e,r),e};Object.defineProperty(At,"__esModule",{value:!0});At.hans=void 0;qR(Iy(),At);At.hans=$R(Xy())});var Dt=T(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.parseTimeUnits=ee.TIME_UNITS_PATTERN=ee.parseYear=ee.YEAR_PATTERN=ee.parseOrdinalNumberPattern=ee.ORDINAL_NUMBER_PATTERN=ee.parseNumberPattern=ee.NUMBER_PATTERN=ee.TIME_UNIT_DICTIONARY=ee.ORDINAL_WORD_DICTIONARY=ee.INTEGER_WORD_DICTIONARY=ee.MONTH_DICTIONARY=ee.FULL_MONTH_NAME_DICTIONARY=ee.WEEKDAY_DICTIONARY=ee.REGEX_PARTS=void 0;var Ro=ve(),YR=nt();ee.REGEX_PARTS={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"};ee.WEEKDAY_DICTIONARY={\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435:0,\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u044F:0,\u0432\u0441\u043A:0,"\u0432\u0441\u043A.":0,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A:1,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A\u0430:1,\u043F\u043D:1,"\u043F\u043D.":1,\u0432\u0442\u043E\u0440\u043D\u0438\u043A:2,\u0432\u0442\u043E\u0440\u043D\u0438\u043A\u0430:2,\u0432\u0442:2,"\u0432\u0442.":2,\u0441\u0440\u0435\u0434\u0430:3,\u0441\u0440\u0435\u0434\u044B:3,\u0441\u0440\u0435\u0434\u0443:3,\u0441\u0440:3,"\u0441\u0440.":3,\u0447\u0435\u0442\u0432\u0435\u0440\u0433:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430:4,\u0447\u0442:4,"\u0447\u0442.":4,\u043F\u044F\u0442\u043D\u0438\u0446\u0430:5,\u043F\u044F\u0442\u043D\u0438\u0446\u0443:5,\u043F\u044F\u0442\u043D\u0438\u0446\u044B:5,\u043F\u0442:5,"\u043F\u0442.":5,\u0441\u0443\u0431\u0431\u043E\u0442\u0430:6,\u0441\u0443\u0431\u0431\u043E\u0442\u0443:6,\u0441\u0443\u0431\u0431\u043E\u0442\u044B:6,\u0441\u0431:6,"\u0441\u0431.":6};ee.FULL_MONTH_NAME_DICTIONARY={\u044F\u043D\u0432\u0430\u0440\u044C:1,\u044F\u043D\u0432\u0430\u0440\u044F:1,\u044F\u043D\u0432\u0430\u0440\u0435:1,\u0444\u0435\u0432\u0440\u044F\u043B\u044C:2,\u0444\u0435\u0432\u0440\u044F\u043B\u044F:2,\u0444\u0435\u0432\u0440\u044F\u043B\u0435:2,\u043C\u0430\u0440\u0442:3,\u043C\u0430\u0440\u0442\u0430:3,\u043C\u0430\u0440\u0442\u0435:3,\u0430\u043F\u0440\u0435\u043B\u044C:4,\u0430\u043F\u0440\u0435\u043B\u044F:4,\u0430\u043F\u0440\u0435\u043B\u0435:4,\u043C\u0430\u0439:5,\u043C\u0430\u044F:5,\u043C\u0430\u0435:5,\u0438\u044E\u043D\u044C:6,\u0438\u044E\u043D\u044F:6,\u0438\u044E\u043D\u0435:6,\u0438\u044E\u043B\u044C:7,\u0438\u044E\u043B\u044F:7,\u0438\u044E\u043B\u0435:7,\u0430\u0432\u0433\u0443\u0441\u0442:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0430:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0435:8,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044C:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044F:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u0435:9,\u043E\u043A\u0442\u044F\u0431\u0440\u044C:10,\u043E\u043A\u0442\u044F\u0431\u0440\u044F:10,\u043E\u043A\u0442\u044F\u0431\u0440\u0435:10,\u043D\u043E\u044F\u0431\u0440\u044C:11,\u043D\u043E\u044F\u0431\u0440\u044F:11,\u043D\u043E\u044F\u0431\u0440\u0435:11,\u0434\u0435\u043A\u0430\u0431\u0440\u044C:12,\u0434\u0435\u043A\u0430\u0431\u0440\u044F:12,\u0434\u0435\u043A\u0430\u0431\u0440\u0435:12};ee.MONTH_DICTIONARY=Object.assign(Object.assign({},ee.FULL_MONTH_NAME_DICTIONARY),{\u044F\u043D\u0432:1,"\u044F\u043D\u0432.":1,\u0444\u0435\u0432:2,"\u0444\u0435\u0432.":2,\u043C\u0430\u0440:3,"\u043C\u0430\u0440.":3,\u0430\u043F\u0440:4,"\u0430\u043F\u0440.":4,\u0430\u0432\u0433:8,"\u0430\u0432\u0433.":8,\u0441\u0435\u043D:9,"\u0441\u0435\u043D.":9,\u043E\u043A\u0442:10,"\u043E\u043A\u0442.":10,\u043D\u043E\u044F:11,"\u043D\u043E\u044F.":11,\u0434\u0435\u043A:12,"\u0434\u0435\u043A.":12});ee.INTEGER_WORD_DICTIONARY={\u043E\u0434\u0438\u043D:1,\u043E\u0434\u043D\u0430:1,\u043E\u0434\u043D\u043E\u0439:1,\u043E\u0434\u043D\u0443:1,\u0434\u0432\u0435:2,\u0434\u0432\u0430:2,\u0434\u0432\u0443\u0445:2,\u0442\u0440\u0438:3,\u0442\u0440\u0435\u0445:3,\u0442\u0440\u0451\u0445:3,\u0447\u0435\u0442\u044B\u0440\u0435:4,\u0447\u0435\u0442\u044B\u0440\u0435\u0445:4,\u0447\u0435\u0442\u044B\u0440\u0451\u0445:4,\u043F\u044F\u0442\u044C:5,\u043F\u044F\u0442\u0438:5,\u0448\u0435\u0441\u0442\u044C:6,\u0448\u0435\u0441\u0442\u0438:6,\u0441\u0435\u043C\u044C:7,\u0441\u0435\u043C\u0438:7,\u0432\u043E\u0441\u0435\u043C\u044C:8,\u0432\u043E\u0441\u0435\u043C\u044C\u043C\u0438:8,\u0434\u0435\u0432\u044F\u0442\u044C:9,\u0434\u0435\u0432\u044F\u0442\u0438:9,\u0434\u0435\u0441\u044F\u0442\u044C:10,\u0434\u0435\u0441\u044F\u0442\u0438:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u044C:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u0438:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u044C:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u0438:12};ee.ORDINAL_WORD_DICTIONARY={\u043F\u0435\u0440\u0432\u043E\u0435:1,\u043F\u0435\u0440\u0432\u043E\u0433\u043E:1,\u0432\u0442\u043E\u0440\u043E\u0435:2,\u0432\u0442\u043E\u0440\u043E\u0433\u043E:2,\u0442\u0440\u0435\u0442\u044C\u0435:3,\u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E:3,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E:4,\u043F\u044F\u0442\u043E\u0435:5,\u043F\u044F\u0442\u043E\u0433\u043E:5,\u0448\u0435\u0441\u0442\u043E\u0435:6,\u0448\u0435\u0441\u0442\u043E\u0433\u043E:6,\u0441\u0435\u0434\u044C\u043C\u043E\u0435:7,\u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E:7,\u0432\u043E\u0441\u044C\u043C\u043E\u0435:8,\u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E:8,\u0434\u0435\u0432\u044F\u0442\u043E\u0435:9,\u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E:9,\u0434\u0435\u0441\u044F\u0442\u043E\u0435:10,\u0434\u0435\u0441\u044F\u0442\u043E\u0433\u043E:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:12,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:13,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:13,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:14,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:14,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:15,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:15,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:16,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:16,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:17,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:17,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:18,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:18,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:19,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:19,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0435:20,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:20,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0435":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0433\u043E":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0435":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0433\u043E":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0435":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0433\u043E":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0435":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0435":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0435":29,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E":29,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0435:30,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0433\u043E:30,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":31,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":31};ee.TIME_UNIT_DICTIONARY={\u0441\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u044B:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0443:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0443:"second",\u043C\u0438\u043D:"minute",\u043C\u0438\u043D\u0443\u0442\u0430:"minute",\u043C\u0438\u043D\u0443\u0442:"minute",\u043C\u0438\u043D\u0443\u0442\u044B:"minute",\u043C\u0438\u043D\u0443\u0442\u0443:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u043A:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0438:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0443:"minute",\u0447\u0430\u0441:"hour",\u0447\u0430\u0441\u043E\u0432:"hour",\u0447\u0430\u0441\u0430:"hour",\u0447\u0430\u0441\u0443:"hour",\u0447\u0430\u0441\u0438\u043A\u043E\u0432:"hour",\u0447\u0430\u0441\u0438\u043A\u0430:"hour",\u0447\u0430\u0441\u0438\u043A\u0435:"hour",\u0447\u0430\u0441\u0438\u043A:"hour",\u0434\u0435\u043D\u044C:"d",\u0434\u043D\u044F:"d",\u0434\u043D\u0435\u0439:"d",\u0441\u0443\u0442\u043E\u043A:"d",\u0441\u0443\u0442\u043A\u0438:"d",\u043D\u0435\u0434\u0435\u043B\u044F:"week",\u043D\u0435\u0434\u0435\u043B\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u044E:"week",\u043D\u0435\u0434\u0435\u043B\u044C:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u0435\u043A:"week",\u043C\u0435\u0441\u044F\u0446:"month",\u043C\u0435\u0441\u044F\u0446\u0435:"month",\u043C\u0435\u0441\u044F\u0446\u0435\u0432:"month",\u043C\u0435\u0441\u044F\u0446\u0430:"month",\u043A\u0432\u0430\u0440\u0442\u0430\u043B:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0435:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u043E\u0432:"quarter",\u0433\u043E\u0434:"year",\u0433\u043E\u0434\u0430:"year",\u0433\u043E\u0434\u0443:"year",\u0433\u043E\u0434\u043E\u0432:"year",\u043B\u0435\u0442:"year",\u0433\u043E\u0434\u0438\u043A:"year",\u0433\u043E\u0434\u0438\u043A\u0430:"year",\u0433\u043E\u0434\u0438\u043A\u043E\u0432:"year"};ee.NUMBER_PATTERN=`(?:${Ro.matchAnyPattern(ee.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|\u043F\u043E\u043B|\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E|\u043F\u0430\u0440(?:\u044B|\u0443)|\\s{0,3})`;function tb(r){let e=r.toLowerCase();return ee.INTEGER_WORD_DICTIONARY[e]!==void 0?ee.INTEGER_WORD_DICTIONARY[e]:e.match(/несколько/)?3:e.match(/пол/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}ee.parseNumberPattern=tb;ee.ORDINAL_NUMBER_PATTERN=`(?:${Ro.matchAnyPattern(ee.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435|\u043E\u0435)?)`;function GR(r){let e=r.toLowerCase();return ee.ORDINAL_WORD_DICTIONARY[e]!==void 0?ee.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}ee.parseOrdinalNumberPattern=GR;var cf="(?:\\s+(?:\u0433\u043E\u0434\u0443|\u0433\u043E\u0434\u0430|\u0433\u043E\u0434|\u0433|\u0433.))?";ee.YEAR_PATTERN=`(?:[1-9][0-9]{0,3}${cf}\\s*(?:\u043D.\u044D.|\u0434\u043E \u043D.\u044D.|\u043D. \u044D.|\u0434\u043E \u043D. \u044D.)|[1-2][0-9]{3}${cf}|[5-9][0-9]${cf})`;function jR(r){if(/(год|года|г|г.)/i.test(r)&&(r=r.replace(/(год|года|г|г.)/i,"")),/(до н.э.|до н. э.)/i.test(r))return r=r.replace(/(до н.э.|до н. э.)/i,""),-parseInt(r);if(/(н. э.|н.э.)/i.test(r))return r=r.replace(/(н. э.|н.э.)/i,""),parseInt(r);let e=parseInt(r);return YR.findMostLikelyADYear(e)}ee.parseYear=jR;var rb=`(${ee.NUMBER_PATTERN})\\s{0,3}(${Ro.matchAnyPattern(ee.TIME_UNIT_DICTIONARY)})`,eb=new RegExp(rb,"i");ee.TIME_UNITS_PATTERN=Ro.repeatedTimeunitPattern("(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s{0,3})?",rb);function BR(r){let e={},t=r,n=eb.exec(t);for(;n;)HR(e,n),t=t.substring(n[0].length).trim(),n=eb.exec(t);return e}ee.parseTimeUnits=BR;function HR(r,e){let t=tb(e[1]),n=ee.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var ib=T(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});var Qs=Dt(),zR=Ne(),VR=W(),nb=`(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s*(?:~\\s*)?)?(${Qs.TIME_UNITS_PATTERN})${Qs.REGEX_PARTS.rightBoundary}`,KR=new RegExp(`(?:\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435|\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0438)\\s*${nb}`,Qs.REGEX_PARTS.flags),QR=new RegExp(nb,"i"),df=class extends VR.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Qs.REGEX_PARTS.leftBoundary}innerPattern(e){return e.option.forwardDate?QR:KR}innerExtract(e,t){let n=Qs.parseTimeUnits(t[1]);return zR.ParsingComponents.createRelativeFromReference(e.reference,n)}};ff.default=df});var lb=T(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});var XR=nt(),Xs=Dt(),ub=Dt(),xo=Dt(),ZR=ve(),JR=W(),ex=new RegExp(`(?:\u0441)?\\s*(${xo.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${xo.ORDINAL_NUMBER_PATTERN}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${ZR.matchAnyPattern(Xs.MONTH_DICTIONARY)})(?:(?:-|\\/|,?\\s{0,3})(${ub.YEAR_PATTERN}(?![^\\s]\\d)))?${Xs.REGEX_PARTS.rightBoundary}`,Xs.REGEX_PARTS.flags),sb=1,ab=2,tx=3,ob=4,pf=class extends JR.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Xs.REGEX_PARTS.leftBoundary}innerPattern(){return ex}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Xs.MONTH_DICTIONARY[t[tx].toLowerCase()],s=xo.parseOrdinalNumberPattern(t[sb]);if(s>31)return t.index=t.index+t[sb].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[ob]){let a=ub.parseYear(t[ob]);n.start.assign("year",a)}else{let a=XR.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[ab]){let a=xo.parseOrdinalNumberPattern(t[ab]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};hf.default=pf});var fb=T(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});var Zs=Dt(),rx=nt(),nx=ve(),db=Dt(),ix=W(),sx=new RegExp(`((?:\u0432)\\s*)?(${nx.matchAnyPattern(Zs.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${db.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,Zs.REGEX_PARTS.flags),ax=2,cb=3,mf=class extends ix.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Zs.REGEX_PARTS.leftBoundary}innerPattern(){return sx}innerExtract(e,t){let n=t[ax].toLowerCase();if(t[0].length<=3&&!Zs.FULL_MONTH_NAME_DICTIONARY[n])return null;let i=e.createParsingResult(t.index,t.index+t[0].length);i.start.imply("day",1);let s=Zs.MONTH_DICTIONARY[n];if(i.start.assign("month",s),t[cb]){let a=db.parseYear(t[cb]);i.start.assign("year",a)}else{let a=rx.findYearClosestToRef(e.refDate,1,s);i.start.imply("year",a)}return i}};gf.default=mf});var hb=T(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});var Mo=Be(),ox=On(),pb=Dt(),yf=class extends ox.AbstractTimeExpressionParser{constructor(e){super(e)}patternFlags(){return pb.REGEX_PARTS.flags}primaryPatternLeftBoundary(){return"(^|\\s|T|(?:[^\\p{L}\\p{N}_]))"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|\u0434\u043E|\u0438|\u043F\u043E|\\?)\\s*"}primaryPrefix(){return"(?:(?:\u0432|\u0441)\\s*)??"}primarySuffix(){return`(?:\\s*(?:\u0443\u0442\u0440\u0430|\u0432\u0435\u0447\u0435\u0440\u0430|\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F))?(?!\\/)${pb.REGEX_PARTS.rightBoundary}`}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("\u0432\u0435\u0447\u0435\u0440\u0430")){let i=n.get("hour");i>=6&&i<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",Mo.Meridiem.PM)):i<6&&n.assign("meridiem",Mo.Meridiem.AM)}if(t[0].endsWith("\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F")){n.assign("meridiem",Mo.Meridiem.PM);let i=n.get("hour");i>=0&&i<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("\u0443\u0442\u0440\u0430")&&(n.assign("meridiem",Mo.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};bf.default=yf});var mb=T(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});var Co=Dt(),ux=Ne(),lx=W(),cx=Bt(),dx=new RegExp(`(${Co.TIME_UNITS_PATTERN})\\s{0,5}\u043D\u0430\u0437\u0430\u0434(?=(?:\\W|$))`,Co.REGEX_PARTS.flags),Tf=class extends lx.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Co.REGEX_PARTS.leftBoundary}innerPattern(){return dx}innerExtract(e,t){let n=Co.parseTimeUnits(t[1]),i=cx.reverseTimeUnits(n);return ux.ParsingComponents.createRelativeFromReference(e.reference,i)}};_f.default=Tf});var gb=T(Js=>{"use strict";var fx=Js&&Js.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Js,"__esModule",{value:!0});var px=fx(yr()),vf=class extends px.default{patternBetween(){return/^\s*(и до|и по|до|по|-)\s*$/i}};Js.default=vf});var yb=T(ea=>{"use strict";var hx=ea&&ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ea,"__esModule",{value:!0});var mx=hx(Mr()),wf=class extends mx.default{patternBetween(){return new RegExp("^\\s*(T|\u0432|,|-)?\\s*$")}};ea.default=wf});var bb=T(Ur=>{"use strict";var gx=Ur&&Ur.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),yx=Ur&&Ur.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),bx=Ur&&Ur.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&gx(e,r,t);return yx(e,r),e};Object.defineProperty(Ur,"__esModule",{value:!0});var Tx=W(),ta=bx(Pr()),Ef=Dt(),_x=new RegExp(`(?:\u0441|\u0441\u043E)?\\s*(\u0441\u0435\u0433\u043E\u0434\u043D\u044F|\u0432\u0447\u0435\u0440\u0430|\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430)${Ef.REGEX_PARTS.rightBoundary}`,Ef.REGEX_PARTS.flags),kf=class extends Tx.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Ef.REGEX_PARTS.leftBoundary}innerPattern(e){return _x}innerExtract(e,t){let n=t[1].toLowerCase(),i=e.createParsingComponents();switch(n){case"\u0441\u0435\u0433\u043E\u0434\u043D\u044F":return ta.today(e.reference);case"\u0432\u0447\u0435\u0440\u0430":return ta.yesterday(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return ta.tomorrow(e.reference);case"\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return ta.theDayAfter(e.reference,2);case"\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return ta.theDayBefore(e.reference,2)}return i}};Ur.default=kf});var Tb=T(ur=>{"use strict";var vx=ur&&ur.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),wx=ur&&ur.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Ex=ur&&ur.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&vx(e,r,t);return wx(e,r),e},kx=ur&&ur.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ur,"__esModule",{value:!0});var Sx=W(),Nn=Ex(Pr()),Ox=jt(),Dx=kx(ye()),Sf=Dt(),Rx=new RegExp(`(\u0441\u0435\u0439\u0447\u0430\u0441|\u043F\u0440\u043E\u0448\u043B\u044B\u043C\\s*\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u043F\u0440\u043E\u0448\u043B\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u0435\u0433\u043E\u0434\u043D\u044F\\s*\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u0438\u043C \u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u0434\u0435\u043D\u044C|\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u0432\u0435\u0447\u0435\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u043D\u043E\u0447\u044C)${Sf.REGEX_PARTS.rightBoundary}`,Sf.REGEX_PARTS.flags),Of=class extends Sx.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Sf.REGEX_PARTS.leftBoundary}innerPattern(){return Rx}innerExtract(e,t){let n=Dx.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();if(i==="\u0441\u0435\u0439\u0447\u0430\u0441")return Nn.now(e.reference);if(i==="\u0432\u0435\u0447\u0435\u0440\u043E\u043C"||i==="\u0432\u0435\u0447\u0435\u0440\u0430")return Nn.evening(e.reference);if(i.endsWith("\u0443\u0442\u0440\u043E\u043C")||i.endsWith("\u0443\u0442\u0440\u0430"))return Nn.morning(e.reference);if(i.match(/в\s*полдень/))return Nn.noon(e.reference);if(i.match(/прошлой\s*ночью/))return Nn.lastNight(e.reference);if(i.match(/прошлым\s*вечером/))return Nn.yesterdayEvening(e.reference);if(i.match(/следующей\s*ночью/)){let a=n.hour()<22?1:2;n=n.add(a,"day"),Ox.assignSimilarDate(s,n),s.imply("hour",0)}return i.match(/в\s*полночь/)||i.endsWith("\u043D\u043E\u0447\u044C\u044E")?Nn.midnight(e.reference):s}};ur.default=Of});var _b=T(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});var ra=Dt(),xx=ve(),Mx=W(),Cx=Rn(),Ax=new RegExp(`(?:(?:,|\\(|\uFF08)\\s*)?(?:\u0432\\s*?)?(?:(\u044D\u0442\u0443|\u044D\u0442\u043E\u0442|\u043F\u0440\u043E\u0448\u043B\u044B\u0439|\u043F\u0440\u043E\u0448\u043B\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E)\\s*)?(${xx.matchAnyPattern(ra.WEEKDAY_DICTIONARY)})(?:\\s*(?:,|\\)|\uFF09))?(?:\\s*\u043D\u0430\\s*(\u044D\u0442\u043E\u0439|\u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439)\\s*\u043D\u0435\u0434\u0435\u043B\u0435)?${ra.REGEX_PARTS.rightBoundary}`,ra.REGEX_PARTS.flags),Px=1,Nx=2,Ix=3,Df=class extends Mx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Ax}patternLeftBoundary(){return ra.REGEX_PARTS.leftBoundary}innerExtract(e,t){let n=t[Nx].toLowerCase(),i=ra.WEEKDAY_DICTIONARY[n],s=t[Px],a=t[Ix],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="\u043F\u0440\u043E\u0448\u043B\u044B\u0439"||o=="\u043F\u0440\u043E\u0448\u043B\u0443\u044E"||o=="\u043F\u0440\u043E\u0448\u043B\u043E\u0439"?u="last":o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E"?u="next":(o=="\u044D\u0442\u043E\u0442"||o=="\u044D\u0442\u0443"||o=="\u044D\u0442\u043E\u0439")&&(u="this");let l=Cx.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Rf.default=Df});var wb=T(ia=>{"use strict";var Fx=ia&&ia.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ia,"__esModule",{value:!0});var na=Dt(),vb=Ne(),Lx=Fx(ye()),Ux=W(),Wx=ve(),qx=new RegExp(`(\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C|\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439|\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C|\u043D\u0430 \u044D\u0442\u043E\u0439|\u0432 \u044D\u0442\u043E\u043C)\\s*(${Wx.matchAnyPattern(na.TIME_UNIT_DICTIONARY)})(?=\\s*)${na.REGEX_PARTS.rightBoundary}`,na.REGEX_PARTS.flags),$x=1,Yx=2,xf=class extends Ux.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return na.REGEX_PARTS.leftBoundary}innerPattern(){return qx}innerExtract(e,t){let n=t[$x].toLowerCase(),i=t[Yx].toLowerCase(),s=na.TIME_UNIT_DICTIONARY[i];if(n=="\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||n=="\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C"){let u={};return u[s]=1,vb.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C"||n=="\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439"){let u={};return u[s]=-1,vb.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=Lx.default(e.reference.instant);return s.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):s.match(/month/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):s.match(/year/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};ia.default=xf});var Eb=T(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});var sa=Dt(),Gx=Ne(),jx=W(),Bx=Bt(),Hx=new RegExp(`(\u044D\u0442\u0438|\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435|\u043F\u0440\u043E\u0448\u043B\u044B\u0435|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0435|\u043F\u043E\u0441\u043B\u0435|\u0447\u0435\u0440\u0435\u0437|\\+|-)\\s*(${sa.TIME_UNITS_PATTERN})${sa.REGEX_PARTS.rightBoundary}`,sa.REGEX_PARTS.flags),Mf=class extends jx.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return sa.REGEX_PARTS.leftBoundary}innerPattern(){return Hx}innerExtract(e,t){let n=t[1].toLowerCase(),i=sa.parseTimeUnits(t[2]);switch(n){case"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435":case"\u043F\u0440\u043E\u0448\u043B\u044B\u0435":case"-":i=Bx.reverseTimeUnits(i);break}return Gx.ParsingComponents.createRelativeFromReference(e.reference,i)}};Cf.default=Mf});var Ob=T(Ze=>{"use strict";var Pt=Ze&&Ze.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.createConfiguration=Ze.createCasualConfiguration=Ze.parseDate=Ze.parse=Ze.strict=Ze.casual=void 0;var zx=Pt(ib()),Vx=Pt(lb()),Kx=Pt(fb()),Qx=Pt(hb()),Xx=Pt(mb()),Zx=Pt(gb()),Jx=Pt(yb()),eM=Cr(),tM=Pt(bb()),rM=Pt(Tb()),nM=Pt(_b()),iM=Pt(wb()),kb=nr(),sM=Pt(xn()),aM=Pt(Eb());Ze.casual=new kb.Chrono(Sb());Ze.strict=new kb.Chrono(Af(!0));function oM(r,e,t){return Ze.casual.parse(r,e,t)}Ze.parse=oM;function uM(r,e,t){return Ze.casual.parseDate(r,e,t)}Ze.parseDate=uM;function Sb(){let r=Af(!1);return r.parsers.unshift(new tM.default),r.parsers.unshift(new rM.default),r.parsers.unshift(new Kx.default),r.parsers.unshift(new iM.default),r.parsers.unshift(new aM.default),r}Ze.createCasualConfiguration=Sb;function Af(r=!0){return eM.includeCommonConfiguration({parsers:[new sM.default(!0),new zx.default,new Vx.default,new nM.default,new Qx.default(r),new Xx.default],refiners:[new Jx.default,new Zx.default]},r)}Ze.createConfiguration=Af});var Be=T(ne=>{"use strict";var lM=ne&&ne.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),cM=ne&&ne.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),un=ne&&ne.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&lM(e,r,t);return cM(e,r),e};Object.defineProperty(ne,"__esModule",{value:!0});ne.parseDate=ne.parse=ne.casual=ne.strict=ne.ru=ne.zh=ne.nl=ne.pt=ne.ja=ne.fr=ne.de=ne.Meridiem=ne.Chrono=ne.en=void 0;var Pf=un(Kl());ne.en=Pf;var dM=nr();Object.defineProperty(ne,"Chrono",{enumerable:!0,get:function(){return dM.Chrono}});var fM;(function(r){r[r.AM=0]="AM",r[r.PM=1]="PM"})(fM=ne.Meridiem||(ne.Meridiem={}));var pM=un(Im());ne.de=pM;var hM=un(cg());ne.fr=hM;var mM=un(Tg());ne.ja=mM;var gM=un(Ig());ne.pt=gM;var yM=un(Ty());ne.nl=yM;var bM=un(Jy());ne.zh=bM;var TM=un(Ob());ne.ru=TM;ne.strict=Pf.strict;ne.casual=Pf.casual;function _M(r,e,t){return ne.casual.parse(r,e,t)}ne.parse=_M;function vM(r,e,t){return ne.casual.parseDate(r,e,t)}ne.parseDate=vM});var wT=T((_T,vT)=>{(function(r){var e=Object.hasOwnProperty,t=Array.isArray?Array.isArray:function(f){return Object.prototype.toString.call(f)==="[object Array]"},n=10,i=typeof process=="object"&&typeof process.nextTick=="function",s=typeof Symbol=="function",a=typeof Reflect=="object",o=typeof setImmediate=="function",u=o?setImmediate:setTimeout,l=s?a&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(d){var f=Object.getOwnPropertyNames(d);return f.push.apply(f,Object.getOwnPropertySymbols(d)),f}:Object.keys;function c(){this._events={},this._conf&&p.call(this,this._conf)}function p(d){d&&(this._conf=d,d.delimiter&&(this.delimiter=d.delimiter),d.maxListeners!==r&&(this._maxListeners=d.maxListeners),d.wildcard&&(this.wildcard=d.wildcard),d.newListener&&(this._newListener=d.newListener),d.removeListener&&(this._removeListener=d.removeListener),d.verboseMemoryLeak&&(this.verboseMemoryLeak=d.verboseMemoryLeak),d.ignoreErrors&&(this.ignoreErrors=d.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function h(d,f){var m="(node) warning: possible EventEmitter memory leak detected. "+d+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(m+=" Event name: "+f+"."),typeof process!="undefined"&&process.emitWarning){var g=new Error(m);g.name="MaxListenersExceededWarning",g.emitter=this,g.count=d,process.emitWarning(g)}else console.error(m),console.trace&&console.trace()}var _=function(d,f,m){var g=arguments.length;switch(g){case 0:return[];case 1:return[d];case 2:return[d,f];case 3:return[d,f,m];default:for(var b=new Array(g);g--;)b[g]=arguments[g];return b}};function y(d,f){for(var m={},g,b=d.length,v=f?f.length:0,k=0;k0;)d=v[S],k.call(D,d,m[d]);this._listeners={},this._listenersCount=0,O()}}});function R(d,f,m,g){var b=Object.assign({},f);if(!d)return b;if(typeof d!="object")throw TypeError("options must be an object");var v=Object.keys(d),k=v.length,D,S,O;function I(se){throw Error('Invalid "'+D+'" option value'+(se?". Reason: "+se:""))}for(var he=0;he0;)if(D===d[S])return v;k(f)}}var F=N(["function"]),oe=N(["object","function"]);function z(d,f,m){var g,b,v=0,k,D=new d(function(S,O,I){m=R(m,{timeout:0,overload:!1},{timeout:function(Oe,U){return Oe*=1,(typeof Oe!="number"||Oe<0||!Number.isFinite(Oe))&&U("timeout must be a positive number"),Oe}}),g=!m.overload&&typeof d.prototype.cancel=="function"&&typeof I=="function";function he(){b&&(b=null),v&&(clearTimeout(v),v=0)}var se=function(Oe){he(),S(Oe)},te=function(Oe){he(),O(Oe)};g?f(se,te,I):(b=[function(Oe){te(Oe||Error("canceled"))}],f(se,te,function(Oe){if(k)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof Oe!="function")throw TypeError("onCancel callback must be a function");b.push(Oe)}),k=!0),m.timeout>0&&(v=setTimeout(function(){var Oe=Error("timeout");Oe.code="ETIMEDOUT",v=0,D.cancel(Oe),O(Oe)},m.timeout))});return g||(D.cancel=function(S){if(!!b){for(var O=b.length,I=1;I0;)te=qe[D],te!=="_listeners"&&(Ue=G(d,f,m[te],g+1,b),Ue&&(se?se.push.apply(se,Ue):se=Ue));return se}else if(rt==="**"){for(Ae=g+1===b||g+2===b&&xr==="*",Ae&&m._listeners&&(se=G(d,f,m,b,b)),qe=l(m),D=qe.length;D-- >0;)te=qe[D],te!=="_listeners"&&(te==="*"||te==="**"?(m[te]._listeners&&!Ae&&(Ue=G(d,f,m[te],b,b),Ue&&(se?se.push.apply(se,Ue):se=Ue)),Ue=G(d,f,m[te],g,b)):te===xr?Ue=G(d,f,m[te],g+2,b):Ue=G(d,f,m[te],g,b),Ue&&(se?se.push.apply(se,Ue):se=Ue));return se}else m[rt]&&(se=G(d,f,m[rt],g+1,b));if(Oe=m["*"],Oe&&G(d,f,Oe,g+1,b),U=m["**"],U)if(g0;)te=qe[D],te!=="_listeners"&&(te===xr?G(d,f,U[te],g+2,b):te===rt?G(d,f,U[te],g+1,b):(xe={},xe[te]=U[te],G(d,f,{"**":xe},g+1,b)));else U._listeners?G(d,f,U,b,b):U["*"]&&U["*"]._listeners&&G(d,f,U["*"],b,b);return se}function j(d,f,m){var g=0,b=0,v,k=this.delimiter,D=k.length,S;if(typeof d=="string")if((v=d.indexOf(k))!==-1){S=new Array(5);do S[g++]=d.slice(b,v),b=v+D;while((v=d.indexOf(k,b))!==-1);S[g++]=d.slice(b)}else S=[d],g=1;else S=d,g=d.length;if(g>1){for(v=0;v+10&&O._listeners.length>this._maxListeners&&(O._listeners.warned=!0,h.call(this,O._listeners.length,I))):O._listeners=f,!0;return!0}function Pe(d,f,m,g){for(var b=l(d),v=b.length,k,D,S,O=d._listeners,I;v-- >0;)D=b[v],k=d[D],D==="_listeners"?S=m:S=m?m.concat(D):[D],I=g||typeof D=="symbol",O&&f.push(I?S:S.join(this.delimiter)),typeof k=="object"&&Pe.call(this,k,f,S,I);return f}function Le(d){for(var f=l(d),m=f.length,g,b,v;m-- >0;)b=f[m],g=d[b],g&&(v=!0,b!=="_listeners"&&!Le(g)&&delete d[b]);return v}function B(d,f,m){this.emitter=d,this.event=f,this.listener=m}B.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function A(d,f,m){if(m===!0)b=!0;else if(m===!1)g=!0;else{if(!m||typeof m!="object")throw TypeError("options should be an object or true");var g=m.async,b=m.promisify,v=m.nextTick,k=m.objectify}if(g||v||b){var D=f,S=f._origin||f;if(v&&!i)throw Error("process.nextTick is not supported");b===r&&(b=f.constructor.name==="AsyncFunction"),f=function(){var O=arguments,I=this,he=this.event;return b?v?Promise.resolve():new Promise(function(se){u(se)}).then(function(){return I.event=he,D.apply(I,O)}):(v?process.nextTick:u)(function(){I.event=he,D.apply(I,O)})},f._async=!0,f._origin=S}return[f,k?new B(this,d,f):this]}function E(d){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,p.call(this,d)}E.EventEmitter2=E,E.prototype.listenTo=function(d,f,m){if(typeof d!="object")throw TypeError("target musts be an object");var g=this;m=R(m,{on:r,off:r,reducers:r},{on:F,off:F,reducers:oe});function b(v){if(typeof v!="object")throw TypeError("events must be an object");var k=m.reducers,D=ie.call(g,d),S;D===-1?S=new w(g,d,m):S=g._observers[D];for(var O=l(v),I=O.length,he,se=typeof k=="function",te=0;te0;)b=m[g],(!d||b._target===d)&&(b.unsubscribe(f),v=!0);return v},E.prototype.delimiter=".",E.prototype.setMaxListeners=function(d){d!==r&&(this._maxListeners=d,this._conf||(this._conf={}),this._conf.maxListeners=d)},E.prototype.getMaxListeners=function(){return this._maxListeners},E.prototype.event="",E.prototype.once=function(d,f,m){return this._once(d,f,!1,m)},E.prototype.prependOnceListener=function(d,f,m){return this._once(d,f,!0,m)},E.prototype._once=function(d,f,m,g){return this._many(d,1,f,m,g)},E.prototype.many=function(d,f,m,g){return this._many(d,f,m,!1,g)},E.prototype.prependMany=function(d,f,m,g){return this._many(d,f,m,!0,g)},E.prototype._many=function(d,f,m,g,b){var v=this;if(typeof m!="function")throw new Error("many only accepts instances of Function");function k(){return--f===0&&v.off(d,k),m.apply(this,arguments)}return k._origin=m,this._on(d,k,g,b)},E.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||c.call(this);var d=arguments[0],f,m=this.wildcard,g,b,v,k,D;if(d==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(m&&(f=d,d!=="newListener"&&d!=="removeListener"&&typeof d=="object")){if(b=d.length,s){for(v=0;v3)for(g=new Array(S-1),k=1;k3)for(b=new Array(O-1),D=1;D0&&this._events[d].length>this._maxListeners&&(this._events[d].warned=!0,h.call(this,this._events[d].length,d))):this._events[d]=f,b)},E.prototype.off=function(d,f){if(typeof f!="function")throw new Error("removeListener only takes instances of Function");var m,g=[];if(this.wildcard){var b=typeof d=="string"?d.split(this.delimiter):d.slice();if(g=G.call(this,null,b,this.listenerTree,0),!g)return this}else{if(!this._events[d])return this;m=this._events[d],g.push({_listeners:m})}for(var v=0;v0){for(g=this._all,f=0,m=g.length;f0;)g=f[m[v]],typeof g=="function"?b.push(g):b.push.apply(b,g);return b}else{if(this.wildcard){if(k=this.listenerTree,!k)return[];var D=[],S=typeof d=="string"?d.split(this.delimiter):d.slice();return G.call(this,D,S,k,0),D}return f?(g=f[d],g?typeof g=="function"?[g]:g:[]):[]}},E.prototype.eventNames=function(d){var f=this._events;return this.wildcard?Pe.call(this,this.listenerTree,[],null,d):f?l(f):[]},E.prototype.listenerCount=function(d){return this.listeners(d).length},E.prototype.hasListeners=function(d){if(this.wildcard){var f=[],m=typeof d=="string"?d.split(this.delimiter):d.slice();return G.call(this,f,m,this.listenerTree,0),f.length>0}var g=this._events,b=this._all;return!!(b&&b.length||g&&(d===r?l(g).length:g[d]))},E.prototype.listenersAny=function(){return this._all?this._all:[]},E.prototype.waitFor=function(d,f){var m=this,g=typeof f;return g==="number"?f={timeout:f}:g==="function"&&(f={filter:f}),f=R(f,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:F,Promise:C}),z(f.Promise,function(b,v,k){function D(){var S=f.filter;if(!(S&&!S.apply(m,arguments)))if(m.off(d,D),f.handleError){var O=arguments[0];O?v(O):b(_.apply(null,arguments).slice(1))}else b(_.apply(null,arguments))}k(function(){m.off(d,D)}),m._on(d,D,!1)},{timeout:f.timeout,overload:f.overload})};function H(d,f,m){m=R(m,{Promise,timeout:0,overload:!1},{Promise:C});var g=m.Promise;return z(g,function(b,v,k){var D;if(typeof d.addEventListener=="function"){D=function(){b(_.apply(null,arguments))},k(function(){d.removeEventListener(f,D)}),d.addEventListener(f,D,{once:!0});return}var S=function(){O&&d.removeListener("error",O),b(_.apply(null,arguments))},O;f!=="error"&&(O=function(I){d.removeListener(f,S),v(I)},d.once("error",O)),k(function(){O&&d.removeListener("error",O),d.removeListener(f,S)}),d.once(f,S)},{timeout:m.timeout,overload:m.overload})}var P=E.prototype;if(Object.defineProperties(E,{defaultMaxListeners:{get:function(){return P._maxListeners},set:function(d){if(typeof d!="number"||d<0||Number.isNaN(d))throw TypeError("n must be a non-negative number");P._maxListeners=d},enumerable:!0},once:{value:H,writable:!0,configurable:!0}}),Object.defineProperties(P,{_maxListeners:{value:n,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define=="function"&&define.amd)define(function(){return E});else if(typeof _T=="object")vT.exports=E;else{var Z=new Function("","return this")();Z.EventEmitter2=E}})()});var KT=T(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});var zT=Symbol("MustacheDataPath");function HT({target:r,propertyName:e}){return[...r[zT]||[],e]}function VT(r,e){return typeof r!="object"?r:new Proxy(r,{get(t,n){let i=t[n];if(i===void 0&&!(n in t)){let s=HT({target:t,propertyName:n});if(e!=null&&e.handleError)return e.handleError(s),i;throw Error(`Missing Mustache data property: ${s.join(" > ")}`)}return i&&typeof i=="object"?(i[zT]=HT({target:t,propertyName:n}),VT(i,e)):i}})}pp.default=VT});var Sr=T(fr=>{"use strict";fr.__esModule=!0;fr.Tokens=fr.StructuralCharacters=fr.Operators=void 0;var ZC;(function(r){r.AND="AND",r.OR="OR",r.XOR="XOR",r.NOT="NOT"})(ZC=fr.Operators||(fr.Operators={}));var JC;(function(r){r.OPEN_PARENTHESIS="(",r.CLOSE_PARENTHESIS=")"})(JC=fr.StructuralCharacters||(fr.StructuralCharacters={}));var eA;(function(r){r.IDENTIFIER="IDENTIFIER",r.OPERATOR="OPERATOR",r.STRUCTURAL_CHARACTER="STRUCTURAL_CHARACTER",r.EOF="EOF",r.COMMENT="COMMENT"})(eA=fr.Tokens||(fr.Tokens={}))});var bp=T(Gi=>{"use strict";Gi.__esModule=!0;Gi.VALID_TOKENS=Gi.OPERATOR_PRECEDENCE=void 0;var Fe=Sr();Gi.OPERATOR_PRECEDENCE={NOT:0,XOR:1,AND:2,OR:3};Gi.VALID_TOKENS={identifierOnly:[{name:Fe.Tokens.IDENTIFIER},{name:Fe.Tokens.STRUCTURAL_CHARACTER,value:Fe.StructuralCharacters.OPEN_PARENTHESIS}],identifierOrNot:[{name:Fe.Tokens.IDENTIFIER},{name:Fe.Tokens.STRUCTURAL_CHARACTER,value:Fe.StructuralCharacters.OPEN_PARENTHESIS},{name:Fe.Tokens.OPERATOR,value:Fe.Operators.NOT}],binaryOperator:[{name:Fe.Tokens.OPERATOR,value:Fe.Operators.AND},{name:Fe.Tokens.OPERATOR,value:Fe.Operators.OR},{name:Fe.Tokens.OPERATOR,value:Fe.Operators.XOR}],binaryOperatorOrClose:[{name:Fe.Tokens.OPERATOR,value:Fe.Operators.AND},{name:Fe.Tokens.OPERATOR,value:Fe.Operators.OR},{name:Fe.Tokens.OPERATOR,value:Fe.Operators.XOR},{name:Fe.Tokens.STRUCTURAL_CHARACTER,value:Fe.StructuralCharacters.CLOSE_PARENTHESIS}]}});var Tp=T(mt=>{"use strict";mt.__esModule=!0;mt.ESCAPE_CHARACTER=mt.EOL=mt.COMMENT_DELIMITER=mt.QUOTED_IDENTIFIER_DELIMITER=mt.SEPARATORS=mt.OPERATORS=mt.STRUCTURAL_CHARACTERS=void 0;var ji=Sr();mt.STRUCTURAL_CHARACTERS={"(":ji.StructuralCharacters.OPEN_PARENTHESIS,")":ji.StructuralCharacters.CLOSE_PARENTHESIS};mt.OPERATORS={AND:ji.Operators.AND,OR:ji.Operators.OR,XOR:ji.Operators.XOR,NOT:ji.Operators.NOT};mt.SEPARATORS=new Set([32,9,10,13].map(function(r){return String.fromCodePoint(r)}));mt.QUOTED_IDENTIFIER_DELIMITER=String.fromCodePoint(34);mt.COMMENT_DELIMITER=String.fromCodePoint(35);mt.EOL=String.fromCodePoint(10);mt.ESCAPE_CHARACTER=String.fromCodePoint(92)});var e_=T(er=>{"use strict";var _p=er&&er.__assign||function(){return _p=Object.assign||function(r){for(var e,t=1,n=arguments.length;t{"use strict";yu.__esModule=!0;yu.lex=void 0;var Bi=Sr(),Wt=Tp(),Hi=e_(),iA=function(r){for(var e=null,t=null,n=null,i=0;i{"use strict";var r_=qt&&qt.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n{"use strict";var Or=Vi&&Vi.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n{"use strict";gt.__esModule=!0;gt.throwInvalidExpression=gt.isOperator=gt.isIdentifier=gt.notUtil=gt.xorUtil=gt.orUtil=gt.andUtil=void 0;var a_=Sr(),dA=function(r,e){return r&&e};gt.andUtil=dA;var fA=function(r,e){return r||e};gt.orUtil=fA;var pA=function(r,e){return r!==e};gt.xorUtil=pA;var hA=function(r){return!r};gt.notUtil=hA;var mA=function(r){var e=r.name,t=r.value;return e===a_.Tokens.IDENTIFIER&&typeof t=="string"};gt.isIdentifier=mA;var gA=function(r){var e=r.name,t=r.value;return e===a_.Tokens.OPERATOR&&typeof t=="string"};gt.isOperator=gA;var yA=function(r){throw new TypeError("Invalid postfix expression: ".concat(r))};gt.throwInvalidExpression=yA});var o_=T(_u=>{"use strict";var ka;_u.__esModule=!0;_u.OPERATOR_MAP=void 0;var kp=Sr(),Sp=Ep();_u.OPERATOR_MAP=(ka={},ka[kp.Operators.AND]=Sp.andUtil,ka[kp.Operators.OR]=Sp.orUtil,ka[kp.Operators.XOR]=Sp.xorUtil,ka)});var l_=T(Xr=>{"use strict";var Ki=Xr&&Xr.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n{"use strict";var Op=Dr&&Dr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]});Dr.__esModule=!0;Dr.parse=Dr.evaluate=Dr.getEvaluator=void 0;var c_=l_();Op(Dr,c_,"getEvaluator");Op(Dr,c_,"evaluate");var wA=wp();Op(Dr,wA,"parse")});var GA={};ev(GA,{default:()=>Wu});module.exports=tv(GA);var H_=require("obsidian");var xi=require("obsidian");var BA=new Error("timeout while waiting for mutex to become available"),HA=new Error("mutex already locked"),rv=new Error("request for lock canceled"),nv=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(p){a(p)}}function u(c){try{l(n.throw(c))}catch(p){a(p)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},Gu=class{constructor(e,t=rv){this._value=e,this._cancelError=t,this._weightedQueues=[],this._weightedWaiters=[]}acquire(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((t,n)=>{this._weightedQueues[e-1]||(this._weightedQueues[e-1]=[]),this._weightedQueues[e-1].push({resolve:t,reject:n}),this._dispatch()})}runExclusive(e,t=1){return nv(this,void 0,void 0,function*(){let[n,i]=yield this.acquire(t);try{return yield e(n)}finally{i()}})}waitForUnlock(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(t=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),this._weightedWaiters[e-1].push(t),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatch()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatch()}cancel(){this._weightedQueues.forEach(e=>e.forEach(t=>t.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var e;for(let t=this._value;t>0;t--){let n=(e=this._weightedQueues[t-1])===null||e===void 0?void 0:e.shift();if(!n)continue;let i=this._value,s=t;this._value-=t,t=this._value+1,n.resolve([i,this._newReleaser(s)])}this._drainUnlockWaiters()}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){for(let e=this._value;e>0;e--)!this._weightedWaiters[e-1]||(this._weightedWaiters[e-1].forEach(t=>t()),this._weightedWaiters[e-1]=[])}},iv=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(p){a(p)}}function u(c){try{l(n.throw(c))}catch(p){a(p)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},Wa=class{constructor(e){this._semaphore=new Gu(1,e)}acquire(){return iv(this,void 0,void 0,function*(){let[,e]=yield this._semaphore.acquire();return e})}runExclusive(e){return this._semaphore.runExclusive(()=>e())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var Ao=ss(Be());var vt=class{constructor(e,t){this.start=e,this.end=t,t.isBefore(e)&&(this.start=t,this.end=e),this.start=this.start.startOf("day"),this.end=this.end.startOf("day")}static buildRelative(e){let t=e==="week"?"isoWeek":e;return new vt(window.moment().startOf(t).startOf("day"),window.moment().endOf(t).startOf("day"))}static buildInvalid(){return new vt(window.moment.invalid(),window.moment.invalid())}isValid(){return this.start.isValid()&&this.end.isValid()}moveToPrevious(e){let t=window.moment.duration(1,e);this.start.subtract(t),this.end.subtract(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}moveToNext(e){let t=window.moment.duration(1,e);this.start.add(t),this.end.add(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}};var Nt=class{static parseDate(e,t=!1){return window.moment(Ao.parseDate(e,void 0,{forwardDate:t})).startOf("day")}static parseDateRange(e,t=!1){let n=[Nt.parseRelativeDateRange,Nt.parseNumberedDateRange,Nt.parseAbsoluteDateRange];for(let i of n){let s=i(e,t);if(s.isValid())return s}return vt.buildInvalid()}static parseAbsoluteDateRange(e,t){let n=Ao.parse(e,void 0,{forwardDate:t});if(n.length===0)return vt.buildInvalid();let i=n[0].start,s=n[1]&&n[1].start?n[1].start:i,a=window.moment(i.date()),o=window.moment(s.date());return new vt(a,o)}static parseRelativeDateRange(e,t){let n=/(last|this|next) (week|month|quarter|year)/,i=e.match(n);if(i&&i.length===3){let s=i[1],a=i[2],o=vt.buildRelative(a);switch(s){case"last":o.moveToPrevious(a);break;case"next":o.moveToNext(a);break}return o}return vt.buildInvalid()}static parseNumberedDateRange(e,t){let n=[[/^\s*[0-9]{4}\s*$/,"YYYY","year"],[/^\s*[0-9]{4}-Q[1-4]\s*$/,"YYYY-Q","quarter"],[/^\s*[0-9]{4}-[0-9]{2}\s*$/,"YYYY-MM","month"],[/^\s*[0-9]{4}-W[0-9]{2}\s*$/,"YYYY-WW","isoWeek"]];for(let[i,s,a]of n){let o=e.match(i);if(o){let u=o[0].trim();return new vt(window.moment(u,s).startOf(a),window.moment(u,s).endOf(a))}}return vt.buildInvalid()}};var wM={td:"today",tm:"tomorrow",yd:"yesterday",tw:"this week",nw:"next week",weekend:"sat",we:"sat"};function wi(r){for(let[e,t]of Object.entries(wM))r=r.replace(RegExp(`\\b${e}\\s`,"i"),t);return r}var Po=["MO","TU","WE","TH","FR","SA","SU"],je=function(){function r(e,t){if(t===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=t}return r.fromStr=function(e){return new r(Po.indexOf(e))},r.prototype.nth=function(e){return this.n===e?this:new r(this.weekday,e)},r.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},r.prototype.toString=function(){var e=Po[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},r.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},r}();var Re=function(r){return r!=null},It=function(r){return typeof r=="number"},Nf=function(r){return typeof r=="string"&&Po.includes(r)},at=Array.isArray,Xt=function(r,e){e===void 0&&(e=r),arguments.length===1&&(e=r,r=0);for(var t=[],n=r;n>0,n.length>e?String(n):(e=e-n.length,e>t.length&&(t+=le(t,e/t.length)),t.slice(0,e)+String(n))}var Rb=function(r,e,t){var n=r.split(e);return t?n.slice(0,t).concat([n.slice(t).join(e)]):n},lt=function(r,e){var t=r%e;return t*e<0?t+e:t},No=function(r,e){return{div:Math.floor(r/e),mod:lt(r,e)}},Ft=function(r){return!Re(r)||r.length===0},We=function(r){return!Ft(r)},de=function(r,e){return We(r)&&r.indexOf(e)!==-1};var _r=function(r,e,t,n,i,s){return n===void 0&&(n=0),i===void 0&&(i=0),s===void 0&&(s=0),new Date(Date.UTC(r,e-1,t,n,i,s))},EM=[31,28,31,30,31,30,31,31,30,31,30,31],Cb=1e3*60*60*24,Io=9999,Ab=_r(1970,1,1),kM=[6,0,1,2,3,4,5];var Ei=function(r){return r%4===0&&r%100!==0||r%400===0},If=function(r){return r instanceof Date},Fn=function(r){return If(r)&&!isNaN(r.getTime())},xb=function(r){return r.getTimezoneOffset()*60*1e3},SM=function(r,e){var t=r.getTime()-xb(r),n=e.getTime()-xb(e),i=t-n;return Math.round(i/Cb)},aa=function(r){return SM(r,Ab)},Fo=function(r){return new Date(Ab.getTime()+r*Cb)},OM=function(r){var e=r.getUTCMonth();return e===1&&Ei(r.getUTCFullYear())?29:EM[e]},Wr=function(r){return kM[r.getUTCDay()]},Ff=function(r,e){var t=_r(r,e+1,1);return[Wr(t),OM(t)]},Lo=function(r,e){return e=e||r,new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},Uo=function(r){var e=new Date(r.getTime());return e},Lf=function(r){for(var e=[],t=0;tthis.maxDate;if(this.method==="between"){if(t)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return t?!0:(this.add(e),!1);return this.add(e)},r.prototype.add=function(e){return this._result.push(e),!0},r.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":default:return e.length?e[e.length-1]:null}},r.prototype.clone=function(){return new r(this.method,this.args)},r}(),$r=DM;var Uf=function(r,e){return Uf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Uf(r,e)};function Si(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Uf(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ot=function(){return ot=Object.assign||function(e){for(var t,n=1,i=arguments.length;ne[0].length)&&(e=s,t=i)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(t==="SKIP");return this.symbol=t,this.value=e,!0},r.prototype.accept=function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},r.prototype.acceptNumber=function(){return this.accept("number")},r.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},r}();function ua(r,e){e===void 0&&(e=Ln);var t={},n=new PM(e.tokens);if(!n.start(r))return null;return i(),t;function i(){n.expect("every");var h=n.acceptNumber();if(h&&(t.interval=parseInt(h[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":t.freq=$.DAILY,n.nextSymbol()&&(a(),p());break;case"weekday(s)":t.freq=$.WEEKLY,t.byweekday=[$.MO,$.TU,$.WE,$.TH,$.FR],n.nextSymbol(),p();break;case"week(s)":t.freq=$.WEEKLY,n.nextSymbol()&&(s(),p());break;case"hour(s)":t.freq=$.HOURLY,n.nextSymbol()&&(s(),p());break;case"minute(s)":t.freq=$.MINUTELY,n.nextSymbol()&&(s(),p());break;case"month(s)":t.freq=$.MONTHLY,n.nextSymbol()&&(s(),p());break;case"year(s)":t.freq=$.YEARLY,n.nextSymbol()&&(s(),p());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=$.WEEKLY;var _=n.symbol.substr(0,2).toUpperCase();if(t.byweekday=[$[_]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var y=u();if(!y)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push($[y]),n.nextSymbol()}c(),p();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(t.freq=$.YEARLY,t.bymonth=[o()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var w=o();if(!w)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(w),n.nextSymbol()}s(),p();break;default:throw new Error("Unknown symbol")}}function s(){var h=n.accept("on"),_=n.accept("the");if(!!(h||_))do{var y=l(),w=u(),R=o();if(y)w?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push($[w].nth(y))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(y),n.accept("day(s)"));else if(w)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push($[w]);else if(n.symbol==="weekday(s)")n.nextSymbol(),t.byweekday||(t.byweekday=[$.MO,$.TU,$.WE,$.TH,$.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var C=n.acceptNumber();if(!C)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt(C[0],10)];n.accept("comma");){if(C=n.acceptNumber(),!C)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt(C[0],10))}}else if(R)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(R);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function a(){var h=n.accept("at");if(!!h)do{var _=n.acceptNumber();if(!_)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(t.byhour=[parseInt(_[0],10)];n.accept("comma");){if(_=n.acceptNumber(),!_)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");t.byhour.push(parseInt(_[0],10))}}while(n.accept("comma")||n.accept("at"))}function o(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function u(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function l(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var h=parseInt(n.value[1],10);if(h<-366||h>366)throw new Error("Nth out of range: "+h);return n.nextSymbol(),n.accept("last")?-h:h;default:return!1}}function c(){n.accept("on"),n.accept("the");var h=l();if(!!h)for(t.bymonthday=[h],n.nextSymbol();n.accept("comma");){if(h=l(),!h)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(h),n.nextSymbol()}}function p(){if(n.symbol==="until"){var h=Date.parse(n.text);if(!h)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(h)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}var ae;(function(r){r[r.YEARLY=0]="YEARLY",r[r.MONTHLY=1]="MONTHLY",r[r.WEEKLY=2]="WEEKLY",r[r.DAILY=3]="DAILY",r[r.HOURLY=4]="HOURLY",r[r.MINUTELY=5]="MINUTELY",r[r.SECONDLY=6]="SECONDLY"})(ae||(ae={}));function la(r){return r12){var n=Math.floor(this.month/12),i=lt(this.month,12);this.month=i,this.year+=n,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+t*7:this.day+=-(this.getWeekday()-n)+t*7,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,n,i){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var s=No(this.hour,24),a=s.div,o=s.mod;if(a&&(this.hour=o,this.addDaily(a)),Ft(i)||de(i,this.hour))break}},e.prototype.addMinutes=function(t,n,i,s){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/t)*t);;){this.minute+=t;var a=No(this.minute,60),o=a.div,u=a.mod;if(o&&(this.minute=u,this.addHours(o,!1,i)),(Ft(i)||de(i,this.hour))&&(Ft(s)||de(s,this.minute)))break}},e.prototype.addSeconds=function(t,n,i,s,a){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var o=No(this.second,60),u=o.div,l=o.mod;if(u&&(this.second=l,this.addMinutes(u,!1,i,s)),(Ft(i)||de(i,this.hour))&&(Ft(s)||de(s,this.minute))&&(Ft(a)||de(a,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=Ff(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,this.month===13&&(this.month=1,++this.year,this.year>Io))return;t=Ff(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var i=t.freq,s=t.interval,a=t.wkst,o=t.byhour,u=t.byminute,l=t.bysecond;switch(i){case ae.YEARLY:return this.addYears(s);case ae.MONTHLY:return this.addMonths(s);case ae.WEEKLY:return this.addWeekly(s,a);case ae.DAILY:return this.addDaily(s);case ae.HOURLY:return this.addHours(s,n,o);case ae.MINUTELY:return this.addMinutes(s,n,o,u);case ae.SECONDLY:return this.addSeconds(s,n,o,u,l)}},e}(Di);function qf(r){for(var e=[],t=Object.keys(r),n=0,i=t;n=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||We(e.byweekno)||We(e.byyearday)||Boolean(e.bymonthday)||We(e.bymonthday)||Re(e.byweekday)||Re(e.byeaster)))switch(e.freq){case $.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case $.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case $.WEEKLY:e.byweekday=[Wr(e.dtstart)];break}if(Re(e.bymonth)&&!at(e.bymonth)&&(e.bymonth=[e.bymonth]),Re(e.byyearday)&&!at(e.byyearday)&&It(e.byyearday)&&(e.byyearday=[e.byyearday]),!Re(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(at(e.bymonthday)){for(var i=[],s=[],t=0;t0?i.push(n):n<0&&s.push(n)}e.bymonthday=i,e.bynmonthday=s}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(Re(e.byweekno)&&!at(e.byweekno)&&(e.byweekno=[e.byweekno]),!Re(e.byweekday))e.bynweekday=null;else if(It(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(Nf(e.byweekday))e.byweekday=[je.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof je)!e.byweekday.n||e.freq>$.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var a=[],o=[],t=0;t$.MONTHLY?a.push(u.weekday):o.push([u.weekday,u.n])}e.byweekday=We(a)?a:null,e.bynweekday=We(o)?o:null}return Re(e.byhour)?It(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<$.HOURLY?[e.dtstart.getUTCHours()]:null,Re(e.byminute)?It(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<$.MINUTELY?[e.dtstart.getUTCMinutes()]:null,Re(e.bysecond)?It(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<$.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function qb(r){var e=r.dtstart.getTime()%1e3;if(!la(r.freq))return[];var t=[];return r.byhour.forEach(function(n){r.byminute.forEach(function(i){r.bysecond.forEach(function(s){t.push(new Di(n,i,s,e))})})}),t}function fa(r){var e=r.split(` -`).map(NM).filter(function(t){return t!==null});return ot(ot({},e[0]),e[1])}function da(r){var e={},t=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(r);if(!t)return e;var n=t[1],i=t[2];return n&&(e.tzid=n),e.dtstart=oa(i),e}function NM(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return Yb(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return Yb(r);case"DTSTART":return da(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function Yb(r){var e=r.replace(/^RRULE:/i,""),t=da(e),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(i){var s=i.split("="),a=s[0],o=s[1];switch(a.toUpperCase()){case"FREQ":t.freq=ae[o.toUpperCase()];break;case"WKST":t.wkst=Zt[o.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var u=IM(o),l=a.toLowerCase();t[l]=u;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=FM(o);break;case"DTSTART":case"TZID":var c=da(r);t.tzid=c.tzid,t.dtstart=c.dtstart;break;case"UNTIL":t.until=oa(o);break;case"BYEASTER":t.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),t}function IM(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(Gb)}return Gb(r)}function Gb(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function FM(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return Zt[t];var n=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!n||n.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var i=Number(n[1]),s=n[2],a=Zt[s].weekday;return new je(a,i)})}var Un=function(){function r(e,t){if(isNaN(e.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=t}return Object.defineProperty(r.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),r.prototype.toString=function(){var e=ki(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},r.prototype.getTime=function(){return this.date.getTime()},r.prototype.rezonedDate=function(){return this.isUTC?this.date:Pb(this.date,this.tzid)},r}();function pa(r){for(var e=[],t="",n=Object.keys(r),i=Object.keys(ca),s=0;s=4?(c=0,l=o.yearlen+lt(a-e.wkst,7)):l=n-c;for(var p=Math.floor(l/7),h=lt(l,7),_=Math.floor(p+h/4),y=0;y0&&w<=_){var R=void 0;w>1?(R=c+(w-1)*7,c!==u&&(R-=7-u)):R=c;for(var C=0;C<7&&(o.wnomask[R]=1,R++,o.wdaymask[R]!==e.wkst);C++);}}if(de(e.byweekno,1)){var R=c+_*7;if(c!==u&&(R-=7-u),R=4?(oe=0,ie=z+lt(F-e.wkst,7)):ie=n-c,N=Math.floor(52+lt(ie,7)/4)}if(de(e.byweekno,N))for(var R=0;Rs)return Yr(r);if(N>=t){var F=iT(N,e);if(!r.accept(F)||o&&(--o,!o))return Yr(r)}}else for(var C=_;Cs)return Yr(r);if(N>=t){var F=iT(N,e);if(!r.accept(F)||o&&(--o,!o))return Yr(r)}}}if(e.interval===0||(u.add(e,w),u.year>Io))return Yr(r);la(n)||(c=l.gettimeset(n)(u.hour,u.minute,u.second,0)),l.rebuild(u.year,u.month)}}function BM(r,e,t){var n=t.bymonth,i=t.byweekno,s=t.byweekday,a=t.byeaster,o=t.bymonthday,u=t.bynmonthday,l=t.byyearday;return We(n)&&!de(n,r.mmask[e])||We(i)&&!r.wnomask[e]||We(s)&&!de(s,r.wdaymask[e])||We(r.nwdaymask)&&!r.nwdaymask[e]||a!==null&&!de(r.eastermask,e)||(We(o)||We(u))&&!de(o,r.mdaymask[e])&&!de(u,r.nmdaymask[e])||We(l)&&(e=r.yearlen&&!de(l,e+1-r.yearlen)&&!de(l,-r.nextyearlen+e-r.yearlen))}function iT(r,e){return new Un(r,e.tzid).rezonedDate()}function Yr(r){return r.getValue()}function HM(r,e,t,n,i){for(var s=!1,a=e;a=$.HOURLY&&We(i)&&!de(i,e.hour)||n>=$.MINUTELY&&We(s)&&!de(s,e.minute)||n>=$.SECONDLY&&We(a)&&!de(a,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var Zt={MO:new je(0),TU:new je(1),WE:new je(2),TH:new je(3),FR:new je(4),SA:new je(5),SU:new je(6)},ca={freq:ae.YEARLY,dtstart:null,interval:1,wkst:Zt.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},$b=Object.keys(ca),$=function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new jb,this.origOptions=qf(e);var n=Wb(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return ua(e,t)},r.fromText=function(e,t){return Ib(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return Wo(e,this.options)},r.prototype._cacheGet=function(e,t){return this._cache?this._cache._cacheGet(e,t):!1},r.prototype._cacheAdd=function(e,t,n){if(!!this._cache)return this._cache._cacheAdd(e,t,n)},r.prototype.all=function(e){if(e)return this._iter(new Wf("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new $r("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,i){if(n===void 0&&(n=!1),!Fn(e)||!Fn(t))throw new Error("Invalid date passed in to RRule.between");var s={before:t,after:e,inc:n};if(i)return this._iter(new Wf("between",s,i));var a=this._cacheGet("between",s);return a===!1&&(a=this._iter(new $r("between",s)),this._cacheAdd("between",a,s)),a},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!Fn(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},i=this._cacheGet("before",n);return i===!1&&(i=this._iter(new $r("before",n)),this._cacheAdd("before",i,n)),i},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!Fn(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},i=this._cacheGet("after",n);return i===!1&&(i=this._iter(new $r("after",n)),this._cacheAdd("after",i,n)),i},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return pa(this.origOptions)},r.prototype.toText=function(e,t,n){return Fb(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return Lb(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=ae.YEARLY,r.MONTHLY=ae.MONTHLY,r.WEEKLY=ae.WEEKLY,r.DAILY=ae.DAILY,r.HOURLY=ae.HOURLY,r.MINUTELY=ae.MINUTELY,r.SECONDLY=ae.SECONDLY,r.MO=Zt.MO,r.TU=Zt.TU,r.WE=Zt.WE,r.TH=Zt.TH,r.FR=Zt.FR,r.SA=Zt.SA,r.SU=Zt.SU,r.parseString=fa,r.optionsToString=pa,r}();function sT(r,e,t,n,i,s){var a={},o=r.accept;function u(h,_){t.forEach(function(y){y.between(h,_,!0).forEach(function(w){a[Number(w)]=!0})})}i.forEach(function(h){var _=new Un(h,s).rezonedDate();a[Number(_)]=!0}),r.accept=function(h){var _=Number(h);return isNaN(_)?o.call(this,h):!a[_]&&(u(new Date(_-1),new Date(_+1)),!a[_])?(a[_]=!0,o.call(this,h)):!0},r.method==="between"&&(u(r.args.after,r.args.before),r.accept=function(h){var _=Number(h);return a[_]?!0:(a[_]=!0,o.call(this,h))});for(var l=0;l1||i.length||s.length||a.length){var c=new Gf(l);return c.dtstart(o),c.tzid(u||void 0),n.forEach(function(h){c.rrule(new $(Yf(h,o,u),l))}),i.forEach(function(h){c.rdate(h)}),s.forEach(function(h){c.exrule(new $(Yf(h,o,u),l))}),a.forEach(function(h){c.exdate(h)}),e.compatible&&e.dtstart&&c.rdate(o),c}var p=n[0]||{};return new $(Yf(p,p.dtstart||e.dtstart||o,p.tzid||e.tzid||u),l)}function qo(r,e){return e===void 0&&(e={}),KM(r,QM(e))}function Yf(r,e,t){return ot(ot({},r),{dtstart:e,tzid:t})}function QM(r){var e=[],t=Object.keys(r),n=Object.keys(aT);if(t.forEach(function(i){de(n,i)||e.push(i)}),e.length)throw new Error("Invalid options: "+e.join(", "));return ot(ot({},aT),r)}function XM(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=Rb(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function ZM(r){var e=XM(r),t=e.name,n=e.value,i=t.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:n}}function JM(r,e){if(e===void 0&&(e=!1),r=r&&r.trim(),!r)throw new Error("Invalid empty string");if(!e)return r.split(/\s/);for(var t=r.split(` -`),n=0;n0&&i[0]===" "?(t[n-1]+=i.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function eC(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function oT(r,e){return eC(e),r.split(",").map(function(t){return oa(t)})}function uT(r){var e=this;return function(t){if(t!==void 0&&(e["_".concat(r)]=t),e["_".concat(r)]!==void 0)return e["_".concat(r)];for(var n=0;ne in r?ss(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,we=(r,e)=>{for(var t in e||(e={}))rh.call(e,t)&&th(r,t,e[t]);if(eh)for(var t of eh(e))fv.call(e,t)&&th(r,t,e[t]);return r},it=(r,e)=>ov(r,lv(e));var _=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),pv=(r,e)=>{for(var t in e)ss(r,t,{get:e[t],enumerable:!0})},nh=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of cv(e))!rh.call(r,i)&&i!==t&&ss(r,i,{get:()=>e[i],enumerable:!(n=uv(e,i))||n.enumerable});return r};var as=(r,e,t)=>(t=r!=null?av(dv(r)):{},nh(e||!r||!r.__esModule?ss(t,"default",{value:r,enumerable:!0}):t,r)),hv=r=>nh(ss({},"__esModule",{value:!0}),r);var F=(r,e,t)=>new Promise((n,i)=>{var s=u=>{try{o(t.next(u))}catch(l){i(l)}},a=u=>{try{o(t.throw(u))}catch(l){i(l)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,a);o((t=t.apply(r,e)).next())});var Ee=_(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.matchAnyPattern=rn.extractTerms=rn.repeatedTimeunitPattern=void 0;function Tv(r,e){let t=e.replace(/\((?!\?)/g,"(?:");return`${r}${t}\\s{0,5}(?:,?\\s{0,5}${t}){0,10}`}rn.repeatedTimeunitPattern=Tv;function ih(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}rn.extractTerms=ih;function bv(r){return`(?:${ih(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}rn.matchAnyPattern=bv});var ye=_((Vu,Ku)=>{(function(r,e){typeof Vu=="object"&&typeof Ku!="undefined"?Ku.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(Vu,function(){"use strict";var r=1e3,e=6e4,t=36e5,n="millisecond",i="second",s="minute",a="hour",o="day",u="week",l="month",c="quarter",f="year",h="date",T="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,D={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},C=function(B,A,E){var H=String(B);return!H||H.length>=A?B:""+Array(A+1-H.length).join(E)+B},N={s:C,z:function(B){var A=-B.utcOffset(),E=Math.abs(A),H=Math.floor(E/60),P=E%60;return(A<=0?"+":"-")+C(H,2,"0")+":"+C(P,2,"0")},m:function B(A,E){if(A.date(){"use strict";var _v=nn&&nn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(nn,"__esModule",{value:!0});nn.findYearClosestToRef=nn.findMostLikelyADYear=void 0;var vv=_v(ye());function wv(r){return r<100&&(r>50?r=r+1900:r=r+2e3),r}nn.findMostLikelyADYear=wv;function Ev(r,e,t){let n=vv.default(r),i=n;i=i.month(t-1),i=i.date(e),i=i.year(n.year());let s=i.add(1,"y"),a=i.add(-1,"y");return Math.abs(s.diff(n)){"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.parseTimeUnits=re.TIME_UNITS_PATTERN=re.parseYear=re.YEAR_PATTERN=re.parseOrdinalNumberPattern=re.ORDINAL_NUMBER_PATTERN=re.parseNumberPattern=re.NUMBER_PATTERN=re.TIME_UNIT_DICTIONARY=re.ORDINAL_WORD_DICTIONARY=re.INTEGER_WORD_DICTIONARY=re.MONTH_DICTIONARY=re.FULL_MONTH_NAME_DICTIONARY=re.WEEKDAY_DICTIONARY=void 0;var qa=Ee(),kv=st();re.WEEKDAY_DICTIONARY={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6};re.FULL_MONTH_NAME_DICTIONARY={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12};re.MONTH_DICTIONARY=Object.assign(Object.assign({},re.FULL_MONTH_NAME_DICTIONARY),{jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12});re.INTEGER_WORD_DICTIONARY={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12};re.ORDINAL_WORD_DICTIONARY={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31};re.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconds:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",day:"d",days:"d",week:"week",weeks:"week",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year"};re.NUMBER_PATTERN=`(?:${qa.matchAnyPattern(re.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function ah(r){let e=r.toLowerCase();return re.INTEGER_WORD_DICTIONARY[e]!==void 0?re.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}re.parseNumberPattern=ah;re.ORDINAL_NUMBER_PATTERN=`(?:${qa.matchAnyPattern(re.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function Sv(r){let e=r.toLowerCase();return re.ORDINAL_WORD_DICTIONARY[e]!==void 0?re.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}re.parseOrdinalNumberPattern=Sv;re.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9])";function Ov(r){if(/BE/i.test(r))return r=r.replace(/BE/i,""),parseInt(r)-543;if(/BCE?/i.test(r))return r=r.replace(/BCE?/i,""),-parseInt(r);if(/(AD|CE)/i.test(r))return r=r.replace(/(AD|CE)/i,""),parseInt(r);let e=parseInt(r);return kv.findMostLikelyADYear(e)}re.parseYear=Ov;var oh=`(${re.NUMBER_PATTERN})\\s{0,3}(${qa.matchAnyPattern(re.TIME_UNIT_DICTIONARY)})`,sh=new RegExp(oh,"i");re.TIME_UNITS_PATTERN=qa.repeatedTimeunitPattern("(?:(?:about|around)\\s{0,3})?",oh);function Dv(r){let e={},t=r,n=sh.exec(t);for(;n;)xv(e,n),t=t.substring(n[0].length).trim(),n=sh.exec(t);return e}re.parseTimeUnits=Dv;function xv(r,e){let t=ah(e[1]),n=re.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var uh=_((Qu,Xu)=>{(function(r,e){typeof Qu=="object"&&typeof Xu!="undefined"?Xu.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs_plugin_quarterOfYear=e()})(Qu,function(){"use strict";var r="month",e="quarter";return function(t,n){var i=n.prototype;i.quarter=function(o){return this.$utils().u(o)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(o-1))};var s=i.add;i.add=function(o,u){return o=Number(o),this.$utils().p(u)===e?this.add(3*o,r):s.bind(this)(o,u)};var a=i.startOf;i.startOf=function(o,u){var l=this.$utils(),c=!!l.u(u)||u;if(l.p(o)===e){var f=this.quarter()-1;return c?this.month(3*f).startOf(r).startOf("day"):this.month(3*f+2).endOf(r).endOf("day")}return a.bind(this)(o,u)}}})});var Gt=_(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.implySimilarTime=gr.assignSimilarTime=gr.assignSimilarDate=gr.assignTheNextDay=void 0;var lh=Be();function Rv(r,e){e=e.add(1,"day"),ch(r,e),dh(r,e)}gr.assignTheNextDay=Rv;function ch(r,e){r.assign("day",e.date()),r.assign("month",e.month()+1),r.assign("year",e.year())}gr.assignSimilarDate=ch;function Mv(r,e){r.assign("hour",e.hour()),r.assign("minute",e.minute()),r.assign("second",e.second()),r.assign("millisecond",e.millisecond()),r.get("hour")<12?r.assign("meridiem",lh.Meridiem.AM):r.assign("meridiem",lh.Meridiem.PM)}gr.assignSimilarTime=Mv;function dh(r,e){r.imply("hour",e.hour()),r.imply("minute",e.minute()),r.imply("second",e.second()),r.imply("millisecond",e.millisecond())}gr.implySimilarTime=dh});var fh=_(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.toTimezoneOffset=Sn.TIMEZONE_ABBR_MAP=void 0;Sn.TIMEZONE_ABBR_MAP={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function Cv(r){var e;return r==null?null:typeof r=="number"?r:(e=Sn.TIMEZONE_ABBR_MAP[r])!==null&&e!==void 0?e:null}Sn.toTimezoneOffset=Cv});var Ie=_(yr=>{"use strict";var ph=yr&&yr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(yr,"__esModule",{value:!0});yr.ParsingResult=yr.ParsingComponents=yr.ReferenceWithTimezone=void 0;var Av=ph(uh()),$a=ph(ye()),Zu=Gt(),Pv=fh();$a.default.extend(Av.default);var Ju=class{constructor(e){var t;e=e!=null?e:new Date,e instanceof Date?this.instant=e:(this.instant=(t=e.instant)!==null&&t!==void 0?t:new Date,this.timezoneOffset=Pv.toTimezoneOffset(e.timezone))}};yr.ReferenceWithTimezone=Ju;var On=class{constructor(e,t){if(this.reference=e,this.knownValues={},this.impliedValues={},t)for(let i in t)this.knownValues[i]=t[i];let n=$a.default(e.instant);this.imply("day",n.date()),this.imply("month",n.month()+1),this.imply("year",n.year()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}get(e){return e in this.knownValues?this.knownValues[e]:e in this.impliedValues?this.impliedValues[e]:null}isCertain(e){return e in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(e,t){return e in this.knownValues?this:(this.impliedValues[e]=t,this)}assign(e,t){return this.knownValues[e]=t,delete this.impliedValues[e],this}delete(e){delete this.knownValues[e],delete this.impliedValues[e]}clone(){let e=new On(this.reference);e.knownValues={},e.impliedValues={};for(let t in this.knownValues)e.knownValues[t]=this.knownValues[t];for(let t in this.impliedValues)e.impliedValues[t]=this.impliedValues[t];return e}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyDayMonthComponent(){return this.isCertain("day")&&this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let e=this.dateWithoutTimezoneAdjustment();return!(e.getFullYear()!==this.get("year")||e.getMonth()!==this.get("month")-1||e.getDate()!==this.get("day")||this.get("hour")!=null&&e.getHours()!=this.get("hour")||this.get("minute")!=null&&e.getMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents {knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}, reference: ${JSON.stringify(this.reference)}]`}dayjs(){return $a.default(this.date())}date(){let e=this.dateWithoutTimezoneAdjustment();return new Date(e.getTime()+this.getSystemTimezoneAdjustmentMinute(e)*6e4)}dateWithoutTimezoneAdjustment(){let e=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return e.setFullYear(this.get("year")),e}getSystemTimezoneAdjustmentMinute(e){var t,n;(!e||e.getTime()<0)&&(e=new Date);let i=-e.getTimezoneOffset(),s=(n=(t=this.get("timezoneOffset"))!==null&&t!==void 0?t:this.reference.timezoneOffset)!==null&&n!==void 0?n:i;return i-s}static createRelativeFromReference(e,t){let n=$a.default(e.instant);for(let s in t)n=n.add(t[s],s);let i=new On(e);return t.hour||t.minute||t.second?(Zu.assignSimilarTime(i,n),Zu.assignSimilarDate(i,n),e.timezoneOffset!==null&&i.assign("timezoneOffset",-e.instant.getTimezoneOffset())):(Zu.implySimilarTime(i,n),e.timezoneOffset!==null&&i.imply("timezoneOffset",-e.instant.getTimezoneOffset()),t.d?(i.assign("day",n.date()),i.assign("month",n.month()+1),i.assign("year",n.year())):(t.week&&i.imply("weekday",n.day()),i.imply("day",n.date()),t.month?(i.assign("month",n.month()+1),i.assign("year",n.year())):(i.imply("month",n.month()+1),t.year?i.assign("year",n.year()):i.imply("year",n.year())))),i}};yr.ParsingComponents=On;var os=class{constructor(e,t,n,i,s){this.reference=e,this.refDate=e.instant,this.index=t,this.text=n,this.start=i||new On(e),this.end=s}clone(){let e=new os(this.reference,this.index,this.text);return e.start=this.start?this.start.clone():null,e.end=this.end?this.end.clone():null,e}date(){return this.start.date()}toString(){return`[ParsingResult {index: ${this.index}, text: '${this.text}', ...}]`}};yr.ParsingResult=os});var q=_(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.AbstractParserWithWordBoundaryChecking=void 0;var el=class{constructor(){this.cachedInnerPattern=null,this.cachedPattern=null}patternLeftBoundary(){return"(\\W|^)"}pattern(e){let t=this.innerPattern(e);return t==this.cachedInnerPattern?this.cachedPattern:(this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${t.source}`,t.flags),this.cachedInnerPattern=t,this.cachedPattern)}extract(e,t){var n;let i=(n=t[1])!==null&&n!==void 0?n:"";t.index=t.index+i.length,t[0]=t[0].substring(i.length);for(let s=2;s{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});var rl=at(),Nv=Ie(),Iv=q(),Fv=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${rl.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Lv=new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${rl.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),tl=class extends Iv.AbstractParserWithWordBoundaryChecking{innerPattern(e){return e.option.forwardDate?Lv:Fv}innerExtract(e,t){let n=rl.parseTimeUnits(t[1]);return Nv.ParsingComponents.createRelativeFromReference(e.reference,n)}};nl.default=tl});var _h=_(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});var Uv=st(),Th=at(),bh=at(),ja=at(),Wv=Ee(),qv=q(),$v=new RegExp(`(?:on\\s{0,3})?(${ja.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${ja.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${Wv.matchAnyPattern(Th.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s{0,3})(${bh.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),mh=1,gh=2,Yv=3,yh=4,il=class extends qv.AbstractParserWithWordBoundaryChecking{innerPattern(){return $v}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Th.MONTH_DICTIONARY[t[Yv].toLowerCase()],s=ja.parseOrdinalNumberPattern(t[mh]);if(s>31)return t.index=t.index+t[mh].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[yh]){let a=bh.parseYear(t[yh]);n.start.assign("year",a)}else{let a=Uv.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[gh]){let a=ja.parseOrdinalNumberPattern(t[gh]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};sl.default=il});var Sh=_(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});var jv=st(),Eh=at(),Ga=at(),kh=at(),Gv=Ee(),Bv=q(),Hv=new RegExp(`(${Gv.matchAnyPattern(Eh.MONTH_DICTIONARY)})(?:-|/|\\s*,?\\s*)(${Ga.ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${Ga.ORDINAL_NUMBER_PATTERN})\\s*)?(?:(?:-|/|\\s*,?\\s*)(${kh.YEAR_PATTERN}))?(?=\\W|$)(?!\\:\\d)`,"i"),zv=1,Vv=2,vh=3,wh=4,al=class extends Bv.AbstractParserWithWordBoundaryChecking{innerPattern(){return Hv}innerExtract(e,t){let n=Eh.MONTH_DICTIONARY[t[zv].toLowerCase()],i=Ga.parseOrdinalNumberPattern(t[Vv]);if(i>31)return null;let s=e.createParsingComponents({day:i,month:n});if(t[wh]){let u=kh.parseYear(t[wh]);s.assign("year",u)}else{let u=jv.findYearClosestToRef(e.refDate,i,n);s.imply("year",u)}if(!t[vh])return s;let a=Ga.parseOrdinalNumberPattern(t[vh]),o=e.createParsingResult(t.index,t[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}};ol.default=al});var xh=_(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});var ul=at(),Kv=st(),Qv=Ee(),Dh=at(),Xv=q(),Zv=new RegExp(`((?:in)\\s*)?(${Qv.matchAnyPattern(ul.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${Dh.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),Jv=1,ew=2,Oh=3,ll=class extends Xv.AbstractParserWithWordBoundaryChecking{innerPattern(){return Zv}innerExtract(e,t){let n=t[ew].toLowerCase();if(t[0].length<=3&&!ul.FULL_MONTH_NAME_DICTIONARY[n])return null;let i=e.createParsingResult(t.index+(t[Jv]||"").length,t.index+t[0].length);i.start.imply("day",1);let s=ul.MONTH_DICTIONARY[n];if(i.start.assign("month",s),t[Oh]){let a=Dh.parseYear(t[Oh]);i.start.assign("year",a)}else{let a=Kv.findYearClosestToRef(e.refDate,1,s);i.start.imply("year",a)}return i}};cl.default=ll});var Ch=_(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});var Mh=at(),tw=Ee(),rw=q(),nw=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${tw.matchAnyPattern(Mh.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),iw=1,sw=2,Rh=3,aw=4,dl=class extends rw.AbstractParserWithWordBoundaryChecking{innerPattern(){return nw}innerExtract(e,t){let n=t[Rh]?parseInt(t[Rh]):Mh.MONTH_DICTIONARY[t[sw].toLowerCase()];if(n<1||n>12)return null;let i=parseInt(t[iw]);return{day:parseInt(t[aw]),month:n,year:i}}};fl.default=dl});var Ah=_(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});var ow=q(),uw=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),lw=1,cw=2,pl=class extends ow.AbstractParserWithWordBoundaryChecking{innerPattern(){return uw}innerExtract(e,t){let n=parseInt(t[cw]),i=parseInt(t[lw]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}};hl.default=pl});var Dn=_(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.AbstractTimeExpressionParser=void 0;var wt=Be();function dw(r,e,t,n){return new RegExp(`${r}${e}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,n)}function fw(r,e){return new RegExp(`^(${r})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${e}`,"i")}var Ph=2,ui=3,Ba=4,Ha=5,us=6,ml=class{constructor(e=!1){this.cachedPrimaryPrefix=null,this.cachedPrimarySuffix=null,this.cachedPrimaryTimePattern=null,this.cachedFollowingPhase=null,this.cachedFollowingSuffix=null,this.cachedFollowingTimePatten=null,this.strictMode=e}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?=\\W|$)"}followingSuffix(){return"(?=\\W|$)"}pattern(e){return this.getPrimaryTimePatternThroughCache()}extract(e,t){let n=this.extractPrimaryTimeComponents(e,t);if(!n)return t.index+=t[0].length,null;let i=t.index+t[1].length,s=t[0].substring(t[1].length),a=e.createParsingResult(i,s,n);t.index+=t[0].length;let o=e.text.substring(t.index),l=this.getFollowingTimePatternThroughCache().exec(o);return s.match(/^\d{3,4}/)&&l&&l[0].match(/^\s*([+-])\s*\d{2,4}$/)?null:!l||l[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(a):(a.end=this.extractFollowingTimeComponents(e,l,a),a.end&&(a.text+=l[0]),this.checkAndReturnWithFollowingPattern(a))}extractPrimaryTimeComponents(e,t,n=!1){let i=e.createParsingComponents(),s=0,a=null,o=parseInt(t[Ph]);if(o>100){if(this.strictMode||t[ui]!=null)return null;s=o%100,o=Math.floor(o/100)}if(o>24)return null;if(t[ui]!=null){if(t[ui].length==1&&!t[us])return null;s=parseInt(t[ui])}if(s>=60)return null;if(o>12&&(a=wt.Meridiem.PM),t[us]!=null){if(o>12)return null;let u=t[us][0].toLowerCase();u=="a"&&(a=wt.Meridiem.AM,o==12&&(o=0)),u=="p"&&(a=wt.Meridiem.PM,o!=12&&(o+=12))}if(i.assign("hour",o),i.assign("minute",s),a!==null?i.assign("meridiem",a):o<12?i.imply("meridiem",wt.Meridiem.AM):i.imply("meridiem",wt.Meridiem.PM),t[Ha]!=null){let u=parseInt(t[Ha].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(t[Ba]!=null){let u=parseInt(t[Ba]);if(u>=60)return null;i.assign("second",u)}return i}extractFollowingTimeComponents(e,t,n){let i=e.createParsingComponents();if(t[Ha]!=null){let u=parseInt(t[Ha].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(t[Ba]!=null){let u=parseInt(t[Ba]);if(u>=60)return null;i.assign("second",u)}let s=parseInt(t[Ph]),a=0,o=-1;if(t[ui]!=null?a=parseInt(t[ui]):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=wt.Meridiem.PM),t[us]!=null){if(s>12)return null;let u=t[us][0].toLowerCase();u=="a"&&(o=wt.Meridiem.AM,s==12&&(s=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),u=="p"&&(o=wt.Meridiem.PM,s!=12&&(s+=12)),n.start.isCertain("meridiem")||(o==wt.Meridiem.AM?(n.start.imply("meridiem",wt.Meridiem.AM),n.start.get("hour")==12&&n.start.assign("hour",0)):(n.start.imply("meridiem",wt.Meridiem.PM),n.start.get("hour")!=12&&n.start.assign("hour",n.start.get("hour")+12)))}return i.assign("hour",s),i.assign("minute",a),o>=0?i.assign("meridiem",o):n.start.isCertain("meridiem")&&n.start.get("hour")>12?n.start.get("hour")-12>s?i.imply("meridiem",wt.Meridiem.AM):s<=12&&(i.assign("hour",s+12),i.assign("meridiem",wt.Meridiem.PM)):s>12?i.imply("meridiem",wt.Meridiem.PM):s<=12&&i.imply("meridiem",wt.Meridiem.AM),i.date().getTime()24)return null}return e}checkAndReturnWithFollowingPattern(e){if(e.text.match(/^\d+-\d+$/))return null;let t=e.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(t){if(this.strictMode)return null;let n=t[1],i=t[2];if(i.includes(".")&&!i.match(/\d(\.\d{2})+$/))return null;let s=parseInt(i),a=parseInt(n);if(s>24||a>24)return null}return e}getPrimaryTimePatternThroughCache(){let e=this.primaryPrefix(),t=this.primarySuffix();return this.cachedPrimaryPrefix===e&&this.cachedPrimarySuffix===t?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=dw(this.primaryPatternLeftBoundary(),e,t,this.patternFlags()),this.cachedPrimaryPrefix=e,this.cachedPrimarySuffix=t,this.cachedPrimaryTimePattern)}getFollowingTimePatternThroughCache(){let e=this.followingPhase(),t=this.followingSuffix();return this.cachedFollowingPhase===e&&this.cachedFollowingSuffix===t?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=fw(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}};za.AbstractTimeExpressionParser=ml});var Nh=_(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});var Va=Be(),pw=Dn(),gl=class extends pw.AbstractTimeExpressionParser{constructor(e){super(e)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("night")){let i=n.get("hour");i>=6&&i<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",Va.Meridiem.PM)):i<6&&n.assign("meridiem",Va.Meridiem.AM)}if(t[0].endsWith("afternoon")){n.assign("meridiem",Va.Meridiem.PM);let i=n.get("hour");i>=0&&i<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("morning")&&(n.assign("meridiem",Va.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};yl.default=gl});var Bt=_(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.addImpliedTimeUnits=li.reverseTimeUnits=void 0;function hw(r){let e={};for(let t in r)e[t]=-r[t];return e}li.reverseTimeUnits=hw;function mw(r,e){let t=r.clone(),n=r.dayjs();for(let i in e)n=n.add(e[i],i);return("day"in e||"d"in e||"week"in e||"month"in e||"year"in e)&&(t.imply("day",n.date()),t.imply("month",n.month()+1),t.imply("year",n.year())),("second"in e||"minute"in e||"hour"in e)&&(t.imply("second",n.second()),t.imply("minute",n.minute()),t.imply("hour",n.hour())),t}li.addImpliedTimeUnits=mw});var Ih=_(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});var bl=at(),gw=Ie(),yw=q(),Tw=Bt(),bw=new RegExp(`(${bl.TIME_UNITS_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=(?:\\W|$))`,"i"),_w=new RegExp(`(${bl.TIME_UNITS_PATTERN})\\s{0,5}ago(?=(?:\\W|$))`,"i"),Tl=class extends yw.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?_w:bw}innerExtract(e,t){let n=bl.parseTimeUnits(t[1]),i=Tw.reverseTimeUnits(n);return gw.ParsingComponents.createRelativeFromReference(e.reference,i)}};_l.default=Tl});var Fh=_(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});var wl=at(),vw=Ie(),ww=q(),Ew=new RegExp(`(${wl.TIME_UNITS_PATTERN})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),kw=new RegExp("("+wl.TIME_UNITS_PATTERN+")(later|from now)(?=(?:\\W|$))","i"),Sw=1,vl=class extends ww.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?kw:Ew}innerExtract(e,t){let n=wl.parseTimeUnits(t[Sw]);return vw.ParsingComponents.createRelativeFromReference(e.reference,n)}};El.default=vl});var di=_(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.MergingRefiner=ci.Filter=void 0;var kl=class{refine(e,t){return t.filter(n=>this.isValid(e,n))}};ci.Filter=kl;var Sl=class{refine(e,t){if(t.length<2)return t;let n=[],i=t[0],s=null;for(let a=1;a{console.log(`${this.constructor.name} merged ${u} and ${l} into ${c}`)}),i=c}}return i!=null&&n.push(i),n}};ci.MergingRefiner=Sl});var Tr=_(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});var Ow=di(),Ol=class extends Ow.MergingRefiner{shouldMergeResults(e,t,n){return!t.end&&!n.end&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){if(!t.start.isOnlyWeekdayComponent()&&!n.start.isOnlyWeekdayComponent()&&(n.start.getCertainComponents().forEach(s=>{t.start.isCertain(s)||t.start.assign(s,n.start.get(s))}),t.start.getCertainComponents().forEach(s=>{n.start.isCertain(s)||n.start.assign(s,t.start.get(s))})),t.start.date().getTime()>n.start.date().getTime()){let s=t.start.dayjs(),a=n.start.dayjs();t.start.isOnlyWeekdayComponent()&&s.add(-7,"days").isBefore(a)?(s=s.add(-7,"days"),t.start.imply("day",s.date()),t.start.imply("month",s.month()+1),t.start.imply("year",s.year())):n.start.isOnlyWeekdayComponent()&&a.add(7,"days").isAfter(s)?(a=a.add(7,"days"),n.start.imply("day",a.date()),n.start.imply("month",a.month()+1),n.start.imply("year",a.year())):[n,t]=[t,n]}let i=t.clone();return i.start=t.start,i.end=n.start,i.index=Math.min(t.index,n.index),t.index{"use strict";var Dw=ls&&ls.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ls,"__esModule",{value:!0});var xw=Dw(Tr()),xl=class extends xw.default{patternBetween(){return/^\s*(to|-)\s*$/i}};ls.default=xl});var Uh=_(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.mergeDateTimeComponent=fi.mergeDateTimeResult=void 0;var Rw=Be();function Mw(r,e){let t=r.clone(),n=r.start,i=e.start;if(t.start=Rl(n,i),r.end!=null||e.end!=null){let s=r.end==null?r.start:r.end,a=e.end==null?e.start:e.end,o=Rl(s,a);r.end==null&&o.date().getTime(){"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});var Cw=di(),Wh=Uh(),Ml=class extends Cw.MergingRefiner{shouldMergeResults(e,t,n){return(t.start.isOnlyDate()&&n.start.isOnlyTime()||n.start.isOnlyDate()&&t.start.isOnlyTime())&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){let i=t.start.isOnlyDate()?Wh.mergeDateTimeResult(t,n):Wh.mergeDateTimeResult(n,t);return i.index=t.index,i.text=t.text+e+n.text,i}};Cl.default=Ml});var qh=_(cs=>{"use strict";var Aw=cs&&cs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(cs,"__esModule",{value:!0});var Pw=Aw(Cr()),Al=class extends Pw.default{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$")}};cs.default=Al});var $h=_(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});var Nw=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),Iw={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:240,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360},Pl=class{constructor(e){this.timezone=Object.assign(Object.assign({},Iw),e)}refine(e,t){var n;let i=(n=e.option.timezones)!==null&&n!==void 0?n:{};return t.forEach(s=>{var a,o;let u=e.text.substring(s.index+s.text.length),l=Nw.exec(u);if(!l)return;let c=l[1].toUpperCase(),f=(o=(a=i[c])!==null&&a!==void 0?a:this.timezone[c])!==null&&o!==void 0?o:null;if(f===null)return;e.debug(()=>{console.log(`Extracting timezone: '${c}' into: ${f} for: ${s.start}`)});let h=s.start.get("timezoneOffset");h!==null&&f!=h&&(s.start.isCertain("timezoneOffset")||c!=l[1])||s.start.isOnlyDate()&&c!=l[1]||(s.text+=l[0],s.start.isCertain("timezoneOffset")||s.start.assign("timezoneOffset",f),s.end!=null&&!s.end.isCertain("timezoneOffset")&&s.end.assign("timezoneOffset",f))}),t}};Nl.default=Pl});var Ka=_(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});var Fw=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),Lw=1,Uw=2,Ww=3,Il=class{refine(e,t){return t.forEach(function(n){if(n.start.isCertain("timezoneOffset"))return;let i=e.text.substring(n.index+n.text.length),s=Fw.exec(i);if(!s)return;e.debug(()=>{console.log(`Extracting timezone: '${s[0]}' into : ${n}`)});let a=parseInt(s[Uw]),o=parseInt(s[Ww]||"0"),u=a*60+o;u>14*60||(s[Lw]==="-"&&(u=-u),n.end!=null&&n.end.assign("timezoneOffset",u),n.start.assign("timezoneOffset",u),n.text+=s[0])}),t}};Fl.default=Il});var Yh=_(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});var Ll=class{refine(e,t){if(t.length<2)return t;let n=[],i=t[0];for(let s=1;si.text.length&&(i=a):(n.push(i),i=a)}return i!=null&&n.push(i),n}};Ul.default=Ll});var jh=_(ds=>{"use strict";var qw=ds&&ds.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ds,"__esModule",{value:!0});var $w=qw(ye()),Wl=class{refine(e,t){return e.option.forwardDate&&t.forEach(function(n){let i=$w.default(e.refDate);if(n.start.isOnlyDayMonthComponent()&&i.isAfter(n.start.dayjs()))for(let s=0;s<3&&i.isAfter(n.start.dayjs());s++)n.start.imply("year",n.start.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.start})`)}),n.end&&!n.end.isCertain("year")&&(n.end.imply("year",n.end.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.end})`)}));n.start.isOnlyWeekdayComponent()&&i.isAfter(n.start.dayjs())&&(i.day()>=n.start.get("weekday")?i=i.day(n.start.get("weekday")+7):i=i.day(n.start.get("weekday")),n.start.imply("day",i.date()),n.start.imply("month",i.month()+1),n.start.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.start})`)}),n.end&&n.end.isOnlyWeekdayComponent()&&(i.day()>n.end.get("weekday")?i=i.day(n.end.get("weekday")+7):i=i.day(n.end.get("weekday")),n.end.imply("day",i.date()),n.end.imply("month",i.month()+1),n.end.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.end})`)})))}),t}};ds.default=Wl});var Gh=_($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});var Yw=di(),ql=class extends Yw.Filter{constructor(e){super(),this.strictMode=e}isValid(e,t){return t.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(e.debug(()=>{console.log(`Removing unlikely result '${t.text}'`)}),!1):t.start.isValidDate()?t.end&&!t.end.isValidDate()?(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.end})`)}),!1):this.strictMode?this.isStrictModeValid(e,t):!0:(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.start})`)}),!1)}isStrictModeValid(e,t){return t.start.isOnlyWeekdayComponent()?(e.debug(()=>{console.log(`(Strict) Removing weekday only component: ${t} (${t.end})`)}),!1):t.start.isOnlyTime()&&(!t.start.isCertain("hour")||!t.start.isCertain("minute"))?(e.debug(()=>{console.log(`(Strict) Removing uncertain time component: ${t} (${t.end})`)}),!1):!0}};$l.default=ql});var Gl=_(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});var jw=q(),Gw=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(?:Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),Bw=1,Hw=2,zw=3,Bh=4,Vw=5,Hh=6,zh=7,Vh=8,Kh=9,Yl=class extends jw.AbstractParserWithWordBoundaryChecking{innerPattern(){return Gw}innerExtract(e,t){let n={};if(n.year=parseInt(t[Bw]),n.month=parseInt(t[Hw]),n.day=parseInt(t[zw]),t[Bh]!=null)if(n.hour=parseInt(t[Bh]),n.minute=parseInt(t[Vw]),t[Hh]!=null&&(n.second=parseInt(t[Hh])),t[zh]!=null&&(n.millisecond=parseInt(t[zh])),t[Vh]==null)n.timezoneOffset=0;else{let i=parseInt(t[Vh]),s=0;t[Kh]!=null&&(s=parseInt(t[Kh]));let a=i*60;a<0?a-=s:a+=s,n.timezoneOffset=a}return n}};jl.default=Yl});var Qh=_(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});var Kw=di(),Bl=class extends Kw.MergingRefiner{mergeResults(e,t,n){let i=n.clone();return i.index=t.index,i.text=t.text+e+i.text,i.start.assign("weekday",t.start.get("weekday")),i.end&&i.end.assign("weekday",t.start.get("weekday")),i}shouldMergeResults(e,t,n){return t.start.isOnlyWeekdayComponent()&&!t.start.isCertain("hour")&&n.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}};Hl.default=Bl});var Ar=_(pi=>{"use strict";var xn=pi&&pi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pi,"__esModule",{value:!0});pi.includeCommonConfiguration=void 0;var Qw=xn($h()),Xw=xn(Ka()),Xh=xn(Yh()),Zw=xn(jh()),Jw=xn(Gh()),eE=xn(Gl()),tE=xn(Qh());function rE(r,e=!1){return r.parsers.unshift(new eE.default),r.refiners.unshift(new tE.default),r.refiners.unshift(new Qw.default),r.refiners.unshift(new Xw.default),r.refiners.unshift(new Xh.default),r.refiners.push(new Xh.default),r.refiners.push(new Zw.default),r.refiners.push(new Jw.default(e)),r}pi.includeCommonConfiguration=rE});var Nr=_(_e=>{"use strict";var nE=_e&&_e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_e,"__esModule",{value:!0});_e.noon=_e.morning=_e.midnight=_e.yesterdayEvening=_e.evening=_e.lastNight=_e.tonight=_e.theDayAfter=_e.tomorrow=_e.theDayBefore=_e.yesterday=_e.today=_e.now=void 0;var br=Ie(),hi=nE(ye()),Pr=Gt(),fs=Be();function iE(r){let e=hi.default(r.instant),t=new br.ParsingComponents(r,{});return Pr.assignSimilarDate(t,e),Pr.assignSimilarTime(t,e),r.timezoneOffset!==null&&t.assign("timezoneOffset",e.utcOffset()),t}_e.now=iE;function sE(r){let e=hi.default(r.instant),t=new br.ParsingComponents(r,{});return Pr.assignSimilarDate(t,e),Pr.implySimilarTime(t,e),t}_e.today=sE;function aE(r){return Zh(r,1)}_e.yesterday=aE;function Zh(r,e){return zl(r,-e)}_e.theDayBefore=Zh;function oE(r){return zl(r,1)}_e.tomorrow=oE;function zl(r,e){let t=hi.default(r.instant),n=new br.ParsingComponents(r,{});return t=t.add(e,"day"),Pr.assignSimilarDate(n,t),Pr.implySimilarTime(n,t),n}_e.theDayAfter=zl;function uE(r,e=22){let t=hi.default(r.instant),n=new br.ParsingComponents(r,{});return n.imply("hour",e),n.imply("meridiem",fs.Meridiem.PM),Pr.assignSimilarDate(n,t),n}_e.tonight=uE;function lE(r,e=0){let t=hi.default(r.instant),n=new br.ParsingComponents(r,{});return t.hour()<6&&(t=t.add(-1,"day")),Pr.assignSimilarDate(n,t),n.imply("hour",e),n}_e.lastNight=lE;function cE(r,e=20){let t=new br.ParsingComponents(r,{});return t.imply("meridiem",fs.Meridiem.PM),t.imply("hour",e),t}_e.evening=cE;function dE(r,e=20){let t=hi.default(r.instant),n=new br.ParsingComponents(r,{});return t=t.add(-1,"day"),Pr.assignSimilarDate(n,t),n.imply("hour",e),n.imply("meridiem",fs.Meridiem.PM),n}_e.yesterdayEvening=dE;function fE(r){let e=new br.ParsingComponents(r,{});return e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e}_e.midnight=fE;function pE(r,e=6){let t=new br.ParsingComponents(r,{});return t.imply("meridiem",fs.Meridiem.AM),t.imply("hour",e),t}_e.morning=pE;function hE(r){let e=new br.ParsingComponents(r,{});return e.imply("meridiem",fs.Meridiem.AM),e.imply("hour",12),e}_e.noon=hE});var Jh=_(rr=>{"use strict";var mE=rr&&rr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),gE=rr&&rr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),yE=rr&&rr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&mE(e,r,t);return gE(e,r),e},TE=rr&&rr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(rr,"__esModule",{value:!0});var bE=TE(ye()),_E=q(),vE=Gt(),ps=yE(Nr()),wE=/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,Vl=class extends _E.AbstractParserWithWordBoundaryChecking{innerPattern(e){return wE}innerExtract(e,t){let n=bE.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();switch(i){case"now":return ps.now(e.reference);case"today":return ps.today(e.reference);case"yesterday":return ps.yesterday(e.reference);case"tomorrow":case"tmr":case"tmrw":return ps.tomorrow(e.reference);case"tonight":return ps.tonight(e.reference);default:i.match(/last\s*night/)&&(n.hour()>6&&(n=n.add(-1,"day")),vE.assignSimilarDate(s,n),s.imply("hour",0));break}return s}};rr.default=Vl});var em=_(hs=>{"use strict";var EE=hs&&hs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(hs,"__esModule",{value:!0});var Qa=Be(),kE=q(),SE=EE(ye()),OE=Gt(),DE=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i,Kl=class extends kE.AbstractParserWithWordBoundaryChecking{innerPattern(){return DE}innerExtract(e,t){let n=SE.default(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"afternoon":i.imply("meridiem",Qa.Meridiem.PM),i.imply("hour",15);break;case"evening":case"night":i.imply("meridiem",Qa.Meridiem.PM),i.imply("hour",20);break;case"midnight":OE.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"morning":i.imply("meridiem",Qa.Meridiem.AM),i.imply("hour",6);break;case"noon":i.imply("meridiem",Qa.Meridiem.AM),i.imply("hour",12);break}return i}};hs.default=Kl});var Rn=_(sn=>{"use strict";var xE=sn&&sn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(sn,"__esModule",{value:!0});sn.toDayJSClosestWeekday=sn.toDayJSWeekday=void 0;var tm=xE(ye());function RE(r,e,t){if(!t)return rm(r,e);let n=tm.default(r);switch(t){case"this":n=n.day(e);break;case"next":n=n.day(e+7);break;case"last":n=n.day(e-7);break}return n}sn.toDayJSWeekday=RE;function rm(r,e){let t=tm.default(r),n=t.day();return Math.abs(e-7-n){"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});var nm=at(),ME=Ee(),CE=q(),AE=Rn(),PE=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${ME.matchAnyPattern(nm.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),NE=1,IE=2,FE=3,Ql=class extends CE.AbstractParserWithWordBoundaryChecking{innerPattern(){return PE}innerExtract(e,t){let n=t[IE].toLowerCase(),i=nm.WEEKDAY_DICTIONARY[n],s=t[NE],a=t[FE],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="last"||o=="past"?u="last":o=="next"?u="next":o=="this"&&(u="this");let l=AE.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Xl.default=Ql});var om=_(ms=>{"use strict";var LE=ms&&ms.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ms,"__esModule",{value:!0});var am=at(),sm=Ie(),UE=LE(ye()),WE=q(),qE=Ee(),$E=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${qE.matchAnyPattern(am.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),YE=1,jE=2,Zl=class extends WE.AbstractParserWithWordBoundaryChecking{innerPattern(){return $E}innerExtract(e,t){let n=t[YE].toLowerCase(),i=t[jE].toLowerCase(),s=am.TIME_UNIT_DICTIONARY[i];if(n=="next"||n.startsWith("after")){let u={};return u[s]=1,sm.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="last"||n=="past"){let u={};return u[s]=-1,sm.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=UE.default(e.reference.instant);return i.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):i.match(/month/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):i.match(/year/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};ms.default=Zl});var nr=_(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.ParsingContext=yi.Chrono=void 0;var mi=Ie(),GE=Jl(),gi=class{constructor(e){e=e||GE.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new gi({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,t,n){let i=this.parse(e,t,n);return i.length>0?i[0].start.date():null}parse(e,t,n){let i=new Xa(e,t,n),s=[];return this.parsers.forEach(a=>{let o=gi.executeParser(i,a);s=s.concat(o)}),s.sort((a,o)=>a.index-o.index),this.refiners.forEach(function(a){s=a.refine(i,s)}),s}static executeParser(e,t){let n=[],i=t.pattern(e),s=e.text,a=e.text,o=i.exec(a);for(;o;){let u=o.index+s.length-a.length;o.index=u;let l=t.extract(e,o);if(!l){a=s.substring(o.index+1),o=i.exec(a);continue}let c=null;l instanceof mi.ParsingResult?c=l:l instanceof mi.ParsingComponents?(c=e.createParsingResult(o.index,o[0]),c.start=l):c=e.createParsingResult(o.index,o[0],l),e.debug(()=>console.log(`${t.constructor.name} extracted result ${c}`)),n.push(c),a=s.substring(u+c.text.length),o=i.exec(a)}return n}};yi.Chrono=gi;var Xa=class{constructor(e,t,n){this.text=e,this.reference=new mi.ReferenceWithTimezone(t),this.option=n!=null?n:{},this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof mi.ParsingComponents?e:new mi.ParsingComponents(this.reference,e)}createParsingResult(e,t,n,i){let s=typeof t=="string"?t:this.text.substring(e,t),a=n?this.createParsingComponents(n):null,o=i?this.createParsingComponents(i):null;return new mi.ParsingResult(this.reference,e,s,a,o)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}};yi.ParsingContext=Xa});var Mn=_(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});var um=st(),BE=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),Za=1,lm=5,cm=2,dm=3,ec=4,tc=class{constructor(e){this.groupNumberMonth=e?dm:cm,this.groupNumberDay=e?cm:dm}pattern(){return BE}extract(e,t){if(t[Za]=="/"||t[lm]=="/"){t.index+=t[0].length;return}let n=t.index+t[Za].length,i=t[0].substr(t[Za].length,t[0].length-t[Za].length-t[lm].length);if(i.match(/^\d\.\d$/)||i.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!t[ec]&&t[0].indexOf("/")<0)return;let s=e.createParsingResult(n,i),a=parseInt(t[this.groupNumberMonth]),o=parseInt(t[this.groupNumberDay]);if((a<1||a>12)&&a>12)if(o>=1&&o<=12&&a<=31)[o,a]=[a,o];else return null;if(o<1||o>31)return null;if(s.start.assign("day",o),s.start.assign("month",a),t[ec]){let u=parseInt(t[ec]),l=um.findMostLikelyADYear(u);s.start.assign("year",l)}else{let u=um.findYearClosestToRef(e.refDate,o,a);s.start.imply("year",u)}return s}};rc.default=tc});var pm=_(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});var fm=at(),HE=Ie(),zE=q(),VE=Bt(),KE=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${fm.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),nc=class extends zE.AbstractParserWithWordBoundaryChecking{innerPattern(){return KE}innerExtract(e,t){let n=t[1].toLowerCase(),i=fm.parseTimeUnits(t[2]);switch(n){case"last":case"past":case"-":i=VE.reverseTimeUnits(i);break}return HE.ParsingComponents.createRelativeFromReference(e.reference,i)}};ic.default=nc});var mm=_(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});var QE=di(),sc=Ie(),XE=at(),ZE=Bt();function hm(r){return r.text.match(/\s+(before|from)$/i)!=null}function JE(r){return r.text.match(/\s+(after|since)$/i)!=null}var ac=class extends QE.MergingRefiner{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,n){return!e.match(this.patternBetween())||!hm(t)&&!JE(t)?!1:!!n.start.get("day")&&!!n.start.get("month")&&!!n.start.get("year")}mergeResults(e,t,n){let i=XE.parseTimeUnits(t.text);hm(t)&&(i=ZE.reverseTimeUnits(i));let s=sc.ParsingComponents.createRelativeFromReference(new sc.ReferenceWithTimezone(n.start.date()),i);return new sc.ParsingResult(n.reference,t.index,`${t.text}${e}${n.text}`,s)}};oc.default=ac});var Jl=_($e=>{"use strict";var ze=$e&&$e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($e,"__esModule",{value:!0});$e.createConfiguration=$e.createCasualConfiguration=$e.parseDate=$e.parse=$e.GB=$e.strict=$e.casual=void 0;var ek=ze(hh()),tk=ze(_h()),rk=ze(Sh()),nk=ze(xh()),ik=ze(Ch()),sk=ze(Ah()),ak=ze(Nh()),ok=ze(Ih()),uk=ze(Fh()),lk=ze(Lh()),ck=ze(qh()),dk=Ar(),fk=ze(Jh()),pk=ze(em()),hk=ze(im()),mk=ze(om()),uc=nr(),gk=ze(Mn()),yk=ze(pm()),Tk=ze(mm());$e.casual=new uc.Chrono(gm(!1));$e.strict=new uc.Chrono(Ja(!0,!1));$e.GB=new uc.Chrono(Ja(!1,!0));function bk(r,e,t){return $e.casual.parse(r,e,t)}$e.parse=bk;function _k(r,e,t){return $e.casual.parseDate(r,e,t)}$e.parseDate=_k;function gm(r=!1){let e=Ja(!1,r);return e.parsers.unshift(new fk.default),e.parsers.unshift(new pk.default),e.parsers.unshift(new nk.default),e.parsers.unshift(new mk.default),e.parsers.unshift(new yk.default),e}$e.createCasualConfiguration=gm;function Ja(r=!0,e=!1){return dk.includeCommonConfiguration({parsers:[new gk.default(e),new ek.default,new tk.default,new rk.default,new hk.default,new ik.default,new sk.default,new ak.default(r),new ok.default(r),new uk.default(r)],refiners:[new Tk.default,new ck.default,new lk.default]},r)}$e.createConfiguration=Ja});var ym=_(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});var vk=Dn(),lc=class extends vk.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:um|von)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|bis)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};cc.default=lc});var gs=_(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.parseTimeUnits=Oe.TIME_UNITS_PATTERN=Oe.parseYear=Oe.YEAR_PATTERN=Oe.parseNumberPattern=Oe.NUMBER_PATTERN=Oe.TIME_UNIT_DICTIONARY=Oe.INTEGER_WORD_DICTIONARY=Oe.MONTH_DICTIONARY=Oe.WEEKDAY_DICTIONARY=void 0;var dc=Ee(),wk=st();Oe.WEEKDAY_DICTIONARY={sonntag:0,so:0,montag:1,mo:1,dienstag:2,di:2,mittwoch:3,mi:3,donnerstag:4,do:4,freitag:5,fr:5,samstag:6,sa:6};Oe.MONTH_DICTIONARY={januar:1,j\u00E4nner:1,janner:1,jan:1,"jan.":1,februar:2,feber:2,feb:2,"feb.":2,m\u00E4rz:3,maerz:3,m\u00E4r:3,"m\xE4r.":3,mrz:3,"mrz.":3,april:4,apr:4,"apr.":4,mai:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,august:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,dezember:12,dez:12,"dez.":12};Oe.INTEGER_WORD_DICTIONARY={eins:1,eine:1,einem:1,einen:1,einer:1,zwei:2,drei:3,vier:4,f\u00FCnf:5,fuenf:5,sechs:6,sieben:7,acht:8,neun:9,zehn:10,elf:11,zw\u00F6lf:12,zwoelf:12};Oe.TIME_UNIT_DICTIONARY={sek:"second",sekunde:"second",sekunden:"second",min:"minute",minute:"minute",minuten:"minute",h:"hour",std:"hour",stunde:"hour",stunden:"hour",tag:"d",tage:"d",tagen:"d",woche:"week",wochen:"week",monat:"month",monate:"month",monaten:"month",monats:"month",quartal:"quarter",quartals:"quarter",quartale:"quarter",quartalen:"quarter",a:"year",j:"year",jr:"year",jahr:"year",jahre:"year",jahren:"year",jahres:"year"};Oe.NUMBER_PATTERN=`(?:${dc.matchAnyPattern(Oe.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s*an?)?|an?\\b(?:\\s*few)?|few|several|a?\\s*couple\\s*(?:of)?)`;function bm(r){let e=r.toLowerCase();return Oe.INTEGER_WORD_DICTIONARY[e]!==void 0?Oe.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}Oe.parseNumberPattern=bm;Oe.YEAR_PATTERN="(?:[0-9]{1,4}(?:\\s*[vn]\\.?\\s*(?:C(?:hr)?|(?:u\\.?|d\\.?(?:\\s*g\\.?)?)?\\s*Z)\\.?|\\s*(?:u\\.?|d\\.?(?:\\s*g\\.)?)\\s*Z\\.?)?)";function Ek(r){if(/v/i.test(r))return-parseInt(r.replace(/[^0-9]+/gi,""));if(/n/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));if(/z/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));let e=parseInt(r);return wk.findMostLikelyADYear(e)}Oe.parseYear=Ek;var _m=`(${Oe.NUMBER_PATTERN})\\s{0,5}(${dc.matchAnyPattern(Oe.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Tm=new RegExp(_m,"i");Oe.TIME_UNITS_PATTERN=dc.repeatedTimeunitPattern("",_m);function kk(r){let e={},t=r,n=Tm.exec(t);for(;n;)Sk(e,n),t=t.substring(n[0].length),n=Tm.exec(t);return e}Oe.parseTimeUnits=kk;function Sk(r,e){let t=bm(e[1]),n=Oe.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var wm=_(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});var vm=gs(),Ok=Ee(),Dk=q(),xk=Rn(),Rk=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:a[mn]\\s*?)?(?:(diese[mn]|letzte[mn]|n(?:\xE4|ae)chste[mn])\\s*)?(${Ok.matchAnyPattern(vm.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(diese|letzte|n(?:\xE4|ae)chste)\\s*woche)?(?=\\W|$)`,"i"),Mk=1,Ck=3,Ak=2,fc=class extends Dk.AbstractParserWithWordBoundaryChecking{innerPattern(){return Rk}innerExtract(e,t){let n=t[Ak].toLowerCase(),i=vm.WEEKDAY_DICTIONARY[n],s=t[Mk],a=t[Ck],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o.match(/letzte/)?u="last":o.match(/chste/)?u="next":o.match(/diese/)&&(u="this");let l=xk.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};pc.default=fc});var Om=_(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});var an=Be(),Pk=new RegExp("(^|\\s|T)(?:(?:um|von)\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),Nk=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|bis(?:\\s+um)?|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),Ik=2,Em=3,km=4,Sm=5,Ti=class{pattern(e){return Pk}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=Ti.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let i=e.text.substring(t.index+t[0].length),s=Nk.exec(i);return s&&(n.end=Ti.extractTimeComponent(n.start.clone(),s),n.end&&(n.text+=s[0])),n}static extractTimeComponent(e,t){let n=0,i=0,s=null;if(n=parseInt(t[Ik]),t[Em]!=null&&(i=parseInt(t[Em])),i>=60||n>24)return null;if(n>=12&&(s=an.Meridiem.PM),t[Sm]!=null){if(n>12)return null;let a=t[Sm].toLowerCase();a.match(/morgen|vormittag/)&&(s=an.Meridiem.AM,n==12&&(n=0)),a.match(/nachmittag|abend/)&&(s=an.Meridiem.PM,n!=12&&(n+=12)),a.match(/nacht/)&&(n==12?(s=an.Meridiem.AM,n=0):n<6?s=an.Meridiem.AM:(s=an.Meridiem.PM,n+=12))}if(e.assign("hour",n),e.assign("minute",i),s!==null?e.assign("meridiem",s):n<12?e.imply("meridiem",an.Meridiem.AM):e.imply("meridiem",an.Meridiem.PM),t[km]!=null){let a=parseInt(t[km]);if(a>=60)return null;e.assign("second",a)}return e}};hc.default=Ti});var Dm=_(ys=>{"use strict";var Fk=ys&&ys.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ys,"__esModule",{value:!0});var Lk=Fk(Tr()),mc=class extends Lk.default{patternBetween(){return/^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i}};ys.default=mc});var xm=_(Ts=>{"use strict";var Uk=Ts&&Ts.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ts,"__esModule",{value:!0});var Wk=Uk(Cr()),gc=class extends Wk.default{patternBetween(){return new RegExp("^\\s*(T|um|am|,|-)?\\s*$")}};Ts.default=gc});var yc=_(_s=>{"use strict";var qk=_s&&_s.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_s,"__esModule",{value:!0});var $k=qk(ye()),Cn=Be(),Yk=q(),jk=Gt(),Gk=Bt(),bs=class extends Yk.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i}innerExtract(e,t){let n=$k.default(e.refDate),i=t[2].toLowerCase(),s=e.createParsingComponents();return jk.implySimilarTime(s,n),bs.extractTimeComponents(s,i)}static extractTimeComponents(e,t){switch(t){case"morgen":e.imply("hour",6),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Cn.Meridiem.AM);break;case"vormittag":e.imply("hour",9),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Cn.Meridiem.AM);break;case"mittag":case"mittags":e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Cn.Meridiem.AM);break;case"nachmittag":e.imply("hour",15),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Cn.Meridiem.PM);break;case"abend":e.imply("hour",18),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Cn.Meridiem.PM);break;case"nacht":e.imply("hour",22),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Cn.Meridiem.PM);break;case"mitternacht":e.get("hour")>1&&(e=Gk.addImpliedTimeUnits(e,{day:1})),e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Cn.Meridiem.AM);break}return e}};_s.default=bs});var Cm=_(ir=>{"use strict";var Bk=ir&&ir.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Hk=ir&&ir.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),zk=ir&&ir.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Bk(e,r,t);return Hk(e,r),e},Mm=ir&&ir.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ir,"__esModule",{value:!0});var Vk=Mm(ye()),Kk=q(),An=Gt(),Qk=Mm(yc()),Rm=zk(Nr()),Xk=new RegExp("(jetzt|heute|morgen|\xFCbermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?(?=\\W|$)","i"),Zk=1,Jk=2,Tc=class extends Kk.AbstractParserWithWordBoundaryChecking{innerPattern(e){return Xk}innerExtract(e,t){let n=Vk.default(e.refDate),i=(t[Zk]||"").toLowerCase(),s=(t[Jk]||"").toLowerCase(),a=e.createParsingComponents();switch(i){case"jetzt":a=Rm.now(e.reference);break;case"heute":a=Rm.today(e.reference);break;case"morgen":An.assignTheNextDay(a,n);break;case"\xFCbermorgen":case"uebermorgen":n=n.add(1,"day"),An.assignTheNextDay(a,n);break;case"gestern":n=n.add(-1,"day"),An.assignSimilarDate(a,n),An.implySimilarTime(a,n);break;case"vorgestern":n=n.add(-2,"day"),An.assignSimilarDate(a,n),An.implySimilarTime(a,n);break;default:i.match(/letzte\s*nacht/)&&(n.hour()>6&&(n=n.add(-1,"day")),An.assignSimilarDate(a,n),a.imply("hour",0));break}return s&&(a=Qk.default.extractTimeComponents(a,s)),a}};ir.default=Tc});var Lm=_(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});var e1=st(),Im=gs(),Fm=gs(),t1=Ee(),r1=q(),n1=new RegExp(`(?:am\\s*?)?(?:den\\s*?)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\\u2013|\\s)\\s*([0-9]{1,2})\\.?)?\\s*(${t1.matchAnyPattern(Im.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${Fm.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Am=1,Pm=2,i1=3,Nm=4,bc=class extends r1.AbstractParserWithWordBoundaryChecking{innerPattern(){return n1}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Im.MONTH_DICTIONARY[t[i1].toLowerCase()],s=parseInt(t[Am]);if(s>31)return t.index=t.index+t[Am].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[Nm]){let a=Fm.parseYear(t[Nm]);n.start.assign("year",a)}else{let a=e1.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[Pm]){let a=parseInt(t[Pm]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};_c.default=bc});var Um=_(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});var eo=gs(),s1=Ie(),a1=q(),o1=Bt(),u1=Ee(),vc=class extends a1.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:\\s*((?:n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?|vor|in)\\s*)?(${eo.NUMBER_PATTERN})?(?:\\s*(n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?\\s*(${u1.matchAnyPattern(eo.TIME_UNIT_DICTIONARY)})`,"i")}innerExtract(e,t){let n=t[2]?eo.parseNumberPattern(t[2]):1,i=eo.TIME_UNIT_DICTIONARY[t[4].toLowerCase()],s={};s[i]=n;let a=t[1]||t[3]||"";if(a=a.toLowerCase(),!!a)return(/vor/.test(a)||/letzte/.test(a)||/vergangen/.test(a))&&(s=o1.reverseTimeUnits(s)),s1.ParsingComponents.createRelativeFromReference(e.reference,s)}};wc.default=vc});var $m=_(Ve=>{"use strict";var sr=Ve&&Ve.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.createConfiguration=Ve.createCasualConfiguration=Ve.parseDate=Ve.parse=Ve.strict=Ve.casual=void 0;var l1=Ar(),Wm=nr(),c1=sr(Mn()),d1=sr(Gl()),f1=sr(ym()),p1=sr(wm()),h1=sr(Om()),m1=sr(Dm()),g1=sr(xm()),y1=sr(Cm()),T1=sr(yc()),b1=sr(Lm()),_1=sr(Um());Ve.casual=new Wm.Chrono(qm());Ve.strict=new Wm.Chrono(Ec(!0));function v1(r,e,t){return Ve.casual.parse(r,e,t)}Ve.parse=v1;function w1(r,e,t){return Ve.casual.parseDate(r,e,t)}Ve.parseDate=w1;function qm(r=!0){let e=Ec(!1,r);return e.parsers.unshift(new T1.default),e.parsers.unshift(new y1.default),e.parsers.unshift(new _1.default),e}Ve.createCasualConfiguration=qm;function Ec(r=!0,e=!0){return l1.includeCommonConfiguration({parsers:[new d1.default,new c1.default(e),new f1.default,new h1.default,new b1.default,new p1.default],refiners:[new m1.default,new g1.default]},r)}Ve.createConfiguration=Ec});var jm=_(ar=>{"use strict";var E1=ar&&ar.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),k1=ar&&ar.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),S1=ar&&ar.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&E1(e,r,t);return k1(e,r),e},O1=ar&&ar.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ar,"__esModule",{value:!0});var D1=O1(ye()),x1=Be(),R1=q(),Ym=Gt(),to=S1(Nr()),kc=class extends R1.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i}innerExtract(e,t){let n=D1.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();switch(i){case"maintenant":return to.now(e.reference);case"aujourd'hui":return to.today(e.reference);case"hier":return to.yesterday(e.reference);case"demain":return to.tomorrow(e.reference);default:i.match(/cette\s*nuit/)?(Ym.assignSimilarDate(s,n),s.imply("hour",22),s.imply("meridiem",x1.Meridiem.PM)):i.match(/la\s*veille/)&&(n=n.add(-1,"day"),Ym.assignSimilarDate(s,n),s.imply("hour",0))}return s}};ar.default=kc});var Gm=_(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});var vs=Be(),M1=q(),Sc=class extends M1.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(cet?)?\s*(matin|soir|après-midi|aprem|a midi|à minuit)(?=\W|$)/i}innerExtract(e,t){let n=t[2].toLowerCase(),i=e.createParsingComponents();switch(n){case"apr\xE8s-midi":case"aprem":i.imply("hour",14),i.imply("minute",0),i.imply("meridiem",vs.Meridiem.PM);break;case"soir":i.imply("hour",18),i.imply("minute",0),i.imply("meridiem",vs.Meridiem.PM);break;case"matin":i.imply("hour",8),i.imply("minute",0),i.imply("meridiem",vs.Meridiem.AM);break;case"a midi":i.imply("hour",12),i.imply("minute",0),i.imply("meridiem",vs.Meridiem.AM);break;case"\xE0 minuit":i.imply("hour",0),i.imply("meridiem",vs.Meridiem.AM);break}return i}};Oc.default=Sc});var Bm=_(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});var C1=Dn(),Dc=class extends C1.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:[\xE0a])\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};xc.default=Dc});var Hm=_(ws=>{"use strict";var A1=ws&&ws.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ws,"__esModule",{value:!0});var P1=A1(Cr()),Rc=class extends P1.default{patternBetween(){return new RegExp("^\\s*(T|\xE0|a|vers|de|,|-)?\\s*$")}};ws.default=Rc});var zm=_(Es=>{"use strict";var N1=Es&&Es.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Es,"__esModule",{value:!0});var I1=N1(Tr()),Mc=class extends I1.default{patternBetween(){return/^\s*(à|a|-)\s*$/i}};Es.default=Mc});var on=_(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.parseTimeUnits=Te.TIME_UNITS_PATTERN=Te.parseYear=Te.YEAR_PATTERN=Te.parseOrdinalNumberPattern=Te.ORDINAL_NUMBER_PATTERN=Te.parseNumberPattern=Te.NUMBER_PATTERN=Te.TIME_UNIT_DICTIONARY=Te.INTEGER_WORD_DICTIONARY=Te.MONTH_DICTIONARY=Te.WEEKDAY_DICTIONARY=void 0;var Cc=Ee();Te.WEEKDAY_DICTIONARY={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6};Te.MONTH_DICTIONARY={janvier:1,jan:1,"jan.":1,f\u00E9vrier:2,f\u00E9v:2,"f\xE9v.":2,fevrier:2,fev:2,"fev.":2,mars:3,mar:3,"mar.":3,avril:4,avr:4,"avr.":4,mai:5,juin:6,jun:6,juillet:7,juil:7,jul:7,"jul.":7,ao\u00FBt:8,aout:8,septembre:9,sep:9,"sep.":9,sept:9,"sept.":9,octobre:10,oct:10,"oct.":10,novembre:11,nov:11,"nov.":11,d\u00E9cembre:12,decembre:12,dec:12,"dec.":12};Te.INTEGER_WORD_DICTIONARY={un:1,deux:2,trois:3,quatre:4,cinq:5,six:6,sept:7,huit:8,neuf:9,dix:10,onze:11,douze:12,treize:13};Te.TIME_UNIT_DICTIONARY={sec:"second",seconde:"second",secondes:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",heure:"hour",heures:"hour",jour:"d",jours:"d",semaine:"week",semaines:"week",mois:"month",trimestre:"quarter",trimestres:"quarter",ans:"year",ann\u00E9e:"year",ann\u00E9es:"year"};Te.NUMBER_PATTERN=`(?:${Cc.matchAnyPattern(Te.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`;function Km(r){let e=r.toLowerCase();return Te.INTEGER_WORD_DICTIONARY[e]!==void 0?Te.INTEGER_WORD_DICTIONARY[e]:e==="une"||e==="un"?1:e.match(/quelques?/)?3:e.match(/demi-?/)?.5:parseFloat(e)}Te.parseNumberPattern=Km;Te.ORDINAL_NUMBER_PATTERN="(?:[0-9]{1,2}(?:er)?)";function F1(r){let e=r.toLowerCase();return e=e.replace(/(?:er)$/i,""),parseInt(e)}Te.parseOrdinalNumberPattern=F1;Te.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:AC|AD|p\\.\\s*C(?:hr?)?\\.\\s*n\\.)|[1-2][0-9]{3}|[5-9][0-9])";function L1(r){if(/AC/i.test(r))return r=r.replace(/BC/i,""),-parseInt(r);if(/AD/i.test(r)||/C/i.test(r))return r=r.replace(/[^\d]+/i,""),parseInt(r);let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}Te.parseYear=L1;var Qm=`(${Te.NUMBER_PATTERN})\\s{0,5}(${Cc.matchAnyPattern(Te.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Vm=new RegExp(Qm,"i");Te.TIME_UNITS_PATTERN=Cc.repeatedTimeunitPattern("",Qm);function U1(r){let e={},t=r,n=Vm.exec(t);for(;n;)W1(e,n),t=t.substring(n[0].length),n=Vm.exec(t);return e}Te.parseTimeUnits=U1;function W1(r,e){let t=Km(e[1]),n=Te.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Zm=_(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});var Xm=on(),q1=Ee(),$1=q(),Y1=Rn(),j1=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(?:ce)\\s*)?(${q1.matchAnyPattern(Xm.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(dernier|prochain)\\s*)?(?=\\W|\\d|$)`,"i"),G1=1,B1=2,Ac=class extends $1.AbstractParserWithWordBoundaryChecking{innerPattern(){return j1}innerExtract(e,t){let n=t[G1].toLowerCase(),i=Xm.WEEKDAY_DICTIONARY[n];if(i===void 0)return null;let s=t[B1];s=s||"",s=s.toLowerCase();let a=null;s=="dernier"?a="last":s=="prochain"&&(a="next");let o=Y1.toDayJSWeekday(e.refDate,i,a);return e.createParsingComponents().assign("weekday",i).imply("day",o.date()).imply("month",o.month()+1).imply("year",o.year())}};Pc.default=Ac});var rg=_(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});var ks=Be(),H1=new RegExp("(^|\\s|T)(?:(?:[\xE0a])\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),z1=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),V1=2,Jm=3,eg=4,tg=5,bi=class{pattern(e){return H1}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=bi.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let i=e.text.substring(t.index+t[0].length),s=z1.exec(i);return s&&(n.end=bi.extractTimeComponent(n.start.clone(),s),n.end&&(n.text+=s[0])),n}static extractTimeComponent(e,t){let n=0,i=0,s=null;if(n=parseInt(t[V1]),t[Jm]!=null&&(i=parseInt(t[Jm])),i>=60||n>24)return null;if(n>=12&&(s=ks.Meridiem.PM),t[tg]!=null){if(n>12)return null;let a=t[tg][0].toLowerCase();a=="a"&&(s=ks.Meridiem.AM,n==12&&(n=0)),a=="p"&&(s=ks.Meridiem.PM,n!=12&&(n+=12))}if(e.assign("hour",n),e.assign("minute",i),s!==null?e.assign("meridiem",s):n<12?e.imply("meridiem",ks.Meridiem.AM):e.imply("meridiem",ks.Meridiem.PM),t[eg]!=null){let a=parseInt(t[eg]);if(a>=60)return null;e.assign("second",a)}return e}};Nc.default=bi});var ug=_(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});var K1=st(),ag=on(),og=on(),ro=on(),Q1=Ee(),X1=q(),Z1=new RegExp(`(?:on\\s*?)?(${ro.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:au|\\-|\\\u2013|jusqu'au?|\\s)\\s*(${ro.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:de)?\\s*)(${Q1.matchAnyPattern(ag.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${og.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),ng=1,ig=2,J1=3,sg=4,Ic=class extends X1.AbstractParserWithWordBoundaryChecking{innerPattern(){return Z1}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=ag.MONTH_DICTIONARY[t[J1].toLowerCase()],s=ro.parseOrdinalNumberPattern(t[ng]);if(s>31)return t.index=t.index+t[ng].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[sg]){let a=og.parseYear(t[sg]);n.start.assign("year",a)}else{let a=K1.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[ig]){let a=ro.parseOrdinalNumberPattern(t[ig]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Fc.default=Ic});var cg=_(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});var lg=on(),eS=Ie(),tS=q(),rS=Bt(),Lc=class extends tS.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`il y a\\s*(${lg.TIME_UNITS_PATTERN})(?=(?:\\W|$))`,"i")}innerExtract(e,t){let n=lg.parseTimeUnits(t[1]),i=rS.reverseTimeUnits(n);return eS.ParsingComponents.createRelativeFromReference(e.reference,i)}};Uc.default=Lc});var fg=_(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});var dg=on(),nS=Ie(),iS=q(),Wc=class extends iS.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${dg.TIME_UNITS_PATTERN})(?=\\W|$)`,"i")}innerExtract(e,t){let n=dg.parseTimeUnits(t[1]);return nS.ParsingComponents.createRelativeFromReference(e.reference,n)}};qc.default=Wc});var pg=_(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});var no=on(),sS=Ie(),aS=q(),oS=Bt(),uS=Ee(),$c=class extends aS.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:les?|la|l'|du|des?)\\s*(${no.NUMBER_PATTERN})?(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?\\s*(${uS.matchAnyPattern(no.TIME_UNIT_DICTIONARY)})(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?`,"i")}innerExtract(e,t){let n=t[1]?no.parseNumberPattern(t[1]):1,i=no.TIME_UNIT_DICTIONARY[t[3].toLowerCase()],s={};s[i]=n;let a=t[2]||t[4]||"";if(a=a.toLowerCase(),!!a)return(/derni[eè]re?s?/.test(a)||/pass[ée]e?s?/.test(a)||/pr[ée]c[ée]dents?/.test(a))&&(s=oS.reverseTimeUnits(s)),sS.ParsingComponents.createRelativeFromReference(e.reference,s)}};Yc.default=$c});var gg=_(Ke=>{"use strict";var Ht=Ke&&Ke.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.createConfiguration=Ke.createCasualConfiguration=Ke.parseDate=Ke.parse=Ke.strict=Ke.casual=void 0;var lS=Ar(),hg=nr(),cS=Ht(jm()),dS=Ht(Gm()),fS=Ht(Mn()),pS=Ht(Bm()),hS=Ht(Hm()),mS=Ht(zm()),gS=Ht(Zm()),yS=Ht(rg()),TS=Ht(ug()),bS=Ht(cg()),_S=Ht(fg()),vS=Ht(pg());Ke.casual=new hg.Chrono(mg());Ke.strict=new hg.Chrono(jc(!0));function wS(r,e,t){return Ke.casual.parse(r,e,t)}Ke.parse=wS;function ES(r,e,t){return Ke.casual.parseDate(r,e,t)}Ke.parseDate=ES;function mg(r=!0){let e=jc(!1,r);return e.parsers.unshift(new cS.default),e.parsers.unshift(new dS.default),e.parsers.unshift(new vS.default),e}Ke.createCasualConfiguration=mg;function jc(r=!0,e=!0){return lS.includeCommonConfiguration({parsers:[new fS.default(e),new TS.default,new pS.default,new yS.default,new bS.default,new _S.default,new gS.default],refiners:[new hS.default,new mS.default]},r)}Ke.createConfiguration=jc});var yg=_(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.toHankaku=void 0;function kS(r){return String(r).replace(/\u2019/g,"'").replace(/\u201D/g,'"').replace(/\u3000/g," ").replace(/\uFFE5/g,"\xA5").replace(/[\uFF01\uFF03-\uFF06\uFF08\uFF09\uFF0C-\uFF19\uFF1C-\uFF1F\uFF21-\uFF3B\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5E]/g,SS)}io.toHankaku=kS;function SS(r){return String.fromCharCode(r.charCodeAt(0)-65248)}});var bg=_(Ss=>{"use strict";var OS=Ss&&Ss.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ss,"__esModule",{value:!0});var Gc=yg(),DS=st(),xS=OS(ye()),RS=/(?:(?:([同今本])|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i,Tg=1,MS=2,Bc=3,CS=4,AS=5,PS=6,Hc=class{pattern(){return RS}extract(e,t){let n=parseInt(Gc.toHankaku(t[AS])),i=parseInt(Gc.toHankaku(t[PS])),s=e.createParsingComponents({day:i,month:n});if(t[Tg]&&t[Tg].match("\u540C|\u4ECA|\u672C")){let a=xS.default(e.refDate);s.assign("year",a.year())}if(t[MS]){let a=t[CS],o=a=="\u5143"?1:parseInt(Gc.toHankaku(a));t[Bc]=="\u4EE4\u548C"?o+=2018:t[Bc]=="\u5E73\u6210"?o+=1988:t[Bc]=="\u662D\u548C"&&(o+=1925),s.assign("year",o)}else{let a=DS.findYearClosestToRef(e.refDate,i,n);s.imply("year",a)}return s}};Ss.default=Hc});var _g=_(Os=>{"use strict";var NS=Os&&Os.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Os,"__esModule",{value:!0});var IS=NS(Tr()),zc=class extends IS.default{patternBetween(){return/^\s*(から|ー|-)\s*$/i}};Os.default=zc});var wg=_(or=>{"use strict";var FS=or&&or.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),LS=or&&or.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),US=or&&or.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&FS(e,r,t);return LS(e,r),e},WS=or&&or.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(or,"__esModule",{value:!0});var qS=WS(ye()),vg=Be(),Vc=US(Nr()),$S=/今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i,Kc=class{pattern(){return $S}extract(e,t){let n=t[0],i=qS.default(e.refDate),s=e.createParsingComponents();switch(n){case"\u6628\u65E5":return Vc.yesterday(e.reference);case"\u660E\u65E5":return Vc.tomorrow(e.reference);case"\u4ECA\u65E5":case"\u5F53\u65E5":return Vc.today(e.reference)}return n=="\u4ECA\u591C"||n=="\u4ECA\u5915"||n=="\u4ECA\u6669"?(s.imply("hour",22),s.assign("meridiem",vg.Meridiem.PM)):n.match("\u4ECA\u671D")&&(s.imply("hour",6),s.assign("meridiem",vg.Meridiem.AM)),s.assign("day",i.date()),s.assign("month",i.month()+1),s.assign("year",i.year()),s}};or.default=Kc});var Sg=_(Qe=>{"use strict";var Qc=Qe&&Qe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.createConfiguration=Qe.createCasualConfiguration=Qe.parseDate=Qe.parse=Qe.strict=Qe.casual=void 0;var YS=Qc(bg()),jS=Qc(_g()),GS=Qc(wg()),Eg=nr();Qe.casual=new Eg.Chrono(kg());Qe.strict=new Eg.Chrono(Xc());function BS(r,e,t){return Qe.casual.parse(r,e,t)}Qe.parse=BS;function HS(r,e,t){return Qe.casual.parseDate(r,e,t)}Qe.parseDate=HS;function kg(){let r=Xc();return r.parsers.unshift(new GS.default),r}Qe.createCasualConfiguration=kg;function Xc(){return{parsers:[new YS.default],refiners:[new jS.default]}}Qe.createConfiguration=Xc});var so=_(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.parseYear=_r.YEAR_PATTERN=_r.MONTH_DICTIONARY=_r.WEEKDAY_DICTIONARY=void 0;_r.WEEKDAY_DICTIONARY={domingo:0,dom:0,segunda:1,"segunda-feira":1,seg:1,ter\u00E7a:2,"ter\xE7a-feira":2,ter:2,quarta:3,"quarta-feira":3,qua:3,quinta:4,"quinta-feira":4,qui:4,sexta:5,"sexta-feira":5,sex:5,s\u00E1bado:6,sabado:6,sab:6};_r.MONTH_DICTIONARY={janeiro:1,jan:1,"jan.":1,fevereiro:2,fev:2,"fev.":2,mar\u00E7o:3,mar:3,"mar.":3,abril:4,abr:4,"abr.":4,maio:5,mai:5,"mai.":5,junho:6,jun:6,"jun.":6,julho:7,jul:7,"jul.":7,agosto:8,ago:8,"ago.":8,setembro:9,set:9,"set.":9,outubro:10,out:10,"out.":10,novembro:11,nov:11,"nov.":11,dezembro:12,dez:12,"dez.":12};_r.YEAR_PATTERN="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";function zS(r){if(r.match(/^[0-9]{1,4}$/)){let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}return r.match(/a\.?\s*c\.?/i)?(r=r.replace(/a\.?\s*c\.?/i,""),-parseInt(r)):parseInt(r)}_r.parseYear=zS});var Dg=_(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});var Og=so(),VS=Ee(),KS=q(),QS=Rn(),XS=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|passado|pr[o\xF3]ximo)\\s*)?(${VS.matchAnyPattern(Og.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|passado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),ZS=1,JS=2,eO=3,Zc=class extends KS.AbstractParserWithWordBoundaryChecking{innerPattern(){return XS}innerExtract(e,t){let n=t[JS].toLowerCase(),i=Og.WEEKDAY_DICTIONARY[n];if(i===void 0)return null;let s=t[ZS],a=t[eO],o=s||a||"";o=o.toLowerCase();let u=null;o=="passado"?u="this":o=="pr\xF3ximo"||o=="proximo"?u="next":o=="este"&&(u="this");let l=QS.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Jc.default=Zc});var xg=_(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});var tO=Dn(),ed=class extends tO.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:ao?|\xE0s?|das|da|de|do)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:o)?|\\?)\\s*"}};td.default=ed});var Rg=_(Ds=>{"use strict";var rO=Ds&&Ds.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ds,"__esModule",{value:!0});var nO=rO(Cr()),rd=class extends nO.default{patternBetween(){return new RegExp("^\\s*(?:,|\xE0)?\\s*$")}};Ds.default=rd});var Mg=_(xs=>{"use strict";var iO=xs&&xs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xs,"__esModule",{value:!0});var sO=iO(Tr()),nd=class extends sO.default{patternBetween(){return/^\s*(?:-)\s*$/i}};xs.default=nd});var Fg=_(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});var aO=st(),Ng=so(),Ig=so(),oO=Ee(),uO=q(),lO=new RegExp(`([0-9]{1,2})(?:\xBA|\xAA|\xB0)?(?:\\s*(?:desde|de|\\-|\\\u2013|ao?|\\s)\\s*([0-9]{1,2})(?:\xBA|\xAA|\xB0)?)?\\s*(?:de)?\\s*(?:-|/|\\s*(?:de|,)?\\s*)(${oO.matchAnyPattern(Ng.MONTH_DICTIONARY)})(?:\\s*(?:de|,)?\\s*(${Ig.YEAR_PATTERN}))?(?=\\W|$)`,"i"),Cg=1,Ag=2,cO=3,Pg=4,id=class extends uO.AbstractParserWithWordBoundaryChecking{innerPattern(){return lO}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Ng.MONTH_DICTIONARY[t[cO].toLowerCase()],s=parseInt(t[Cg]);if(s>31)return t.index=t.index+t[Cg].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[Pg]){let a=Ig.parseYear(t[Pg]);n.start.assign("year",a)}else{let a=aO.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[Ag]){let a=parseInt(t[Ag]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};sd.default=id});var Lg=_(Ir=>{"use strict";var dO=Ir&&Ir.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),fO=Ir&&Ir.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),pO=Ir&&Ir.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&dO(e,r,t);return fO(e,r),e};Object.defineProperty(Ir,"__esModule",{value:!0});var hO=q(),ao=pO(Nr()),ad=class extends hO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),i=e.createParsingComponents();switch(n){case"agora":return ao.now(e.reference);case"hoje":return ao.today(e.reference);case"amanha":case"amanh\xE3":return ao.tomorrow(e.reference);case"ontem":return ao.yesterday(e.reference)}return i}};Ir.default=ad});var Ug=_(Rs=>{"use strict";var mO=Rs&&Rs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Rs,"__esModule",{value:!0});var oo=Be(),gO=q(),yO=Gt(),TO=mO(ye()),od=class extends gO.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i}innerExtract(e,t){let n=TO.default(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":i.imply("meridiem",oo.Meridiem.PM),i.imply("hour",15);break;case"noite":i.imply("meridiem",oo.Meridiem.PM),i.imply("hour",22);break;case"manha":case"manh\xE3":i.imply("meridiem",oo.Meridiem.AM),i.imply("hour",6);break;case"meia-noite":yO.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"meio-dia":i.imply("meridiem",oo.Meridiem.AM),i.imply("hour",12);break}return i}};Rs.default=od});var $g=_(Xe=>{"use strict";var un=Xe&&Xe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.createConfiguration=Xe.createCasualConfiguration=Xe.parseDate=Xe.parse=Xe.strict=Xe.casual=void 0;var bO=Ar(),Wg=nr(),_O=un(Mn()),vO=un(Dg()),wO=un(xg()),EO=un(Rg()),kO=un(Mg()),SO=un(Fg()),OO=un(Lg()),DO=un(Ug());Xe.casual=new Wg.Chrono(qg());Xe.strict=new Wg.Chrono(ud(!0));function xO(r,e,t){return Xe.casual.parse(r,e,t)}Xe.parse=xO;function RO(r,e,t){return Xe.casual.parseDate(r,e,t)}Xe.parseDate=RO;function qg(r=!0){let e=ud(!1,r);return e.parsers.push(new OO.default),e.parsers.push(new DO.default),e}Xe.createCasualConfiguration=qg;function ud(r=!0,e=!0){return bO.includeCommonConfiguration({parsers:[new _O.default(e),new vO.default,new wO.default,new SO.default],refiners:[new EO.default,new kO.default]},r)}Xe.createConfiguration=ud});var Yg=_(Ms=>{"use strict";var MO=Ms&&Ms.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ms,"__esModule",{value:!0});var CO=MO(Tr()),ld=class extends CO.default{patternBetween(){return/^\s*(tot|-)\s*$/i}};Ms.default=ld});var jg=_(Cs=>{"use strict";var AO=Cs&&Cs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cs,"__esModule",{value:!0});var PO=AO(Cr()),cd=class extends PO.default{patternBetween(){return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$")}};Cs.default=cd});var Gg=_(Fr=>{"use strict";var NO=Fr&&Fr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),IO=Fr&&Fr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),FO=Fr&&Fr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&NO(e,r,t);return IO(e,r),e};Object.defineProperty(Fr,"__esModule",{value:!0});var LO=q(),uo=FO(Nr()),dd=class extends LO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(nu|vandaag|morgen|morgend|gisteren)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),i=e.createParsingComponents();switch(n){case"nu":return uo.now(e.reference);case"vandaag":return uo.today(e.reference);case"morgen":case"morgend":return uo.tomorrow(e.reference);case"gisteren":return uo.yesterday(e.reference)}return i}};Fr.default=dd});var Bg=_(As=>{"use strict";var UO=As&&As.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(As,"__esModule",{value:!0});var lo=Be(),WO=q(),qO=UO(ye()),$O=Gt(),YO=1,jO=2,fd=class extends WO.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i}innerExtract(e,t){let n=qO.default(e.refDate),i=e.createParsingComponents();switch(t[YO]==="deze"&&(i.assign("day",e.refDate.getDate()),i.assign("month",e.refDate.getMonth()+1),i.assign("year",e.refDate.getFullYear())),t[jO].toLowerCase()){case"namiddag":case"'s namiddags":i.imply("meridiem",lo.Meridiem.PM),i.imply("hour",15);break;case"avond":case"'s avonds'":i.imply("meridiem",lo.Meridiem.PM),i.imply("hour",20);break;case"middernacht":$O.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"ochtend":case"'s ochtends":i.imply("meridiem",lo.Meridiem.AM),i.imply("hour",6);break;case"middag":case"'s middags":i.imply("meridiem",lo.Meridiem.AM),i.imply("hour",12);break}return i}};As.default=fd});var Ct=_(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.parseTimeUnits=ue.TIME_UNITS_PATTERN=ue.parseYear=ue.YEAR_PATTERN=ue.parseOrdinalNumberPattern=ue.ORDINAL_NUMBER_PATTERN=ue.parseNumberPattern=ue.NUMBER_PATTERN=ue.TIME_UNIT_DICTIONARY=ue.ORDINAL_WORD_DICTIONARY=ue.INTEGER_WORD_DICTIONARY=ue.MONTH_DICTIONARY=ue.WEEKDAY_DICTIONARY=void 0;var co=Ee(),GO=st();ue.WEEKDAY_DICTIONARY={zondag:0,zon:0,"zon.":0,zo:0,"zo.":0,maandag:1,ma:1,"ma.":1,dinsdag:2,din:2,"din.":2,di:2,"di.":2,woensdag:3,woe:3,"woe.":3,wo:3,"wo.":3,donderdag:4,dond:4,"dond.":4,do:4,"do.":4,vrijdag:5,vrij:5,"vrij.":5,vr:5,"vr.":5,zaterdag:6,zat:6,"zat.":6,za:6,"za.":6};ue.MONTH_DICTIONARY={januari:1,jan:1,"jan.":1,februari:2,feb:2,"feb.":2,maart:3,mar:3,"mar.":3,april:4,apr:4,"apr.":4,mei:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,augustus:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,december:12,dec:12,"dec.":12};ue.INTEGER_WORD_DICTIONARY={een:1,twee:2,drie:3,vier:4,vijf:5,zes:6,zeven:7,acht:8,negen:9,tien:10,elf:11,twaalf:12};ue.ORDINAL_WORD_DICTIONARY={eerste:1,tweede:2,derde:3,vierde:4,vijfde:5,zesde:6,zevende:7,achtste:8,negende:9,tiende:10,elfde:11,twaalfde:12,dertiende:13,veertiende:14,vijftiende:15,zestiende:16,zeventiende:17,achttiende:18,negentiende:19,twintigste:20,eenentwintigste:21,twee\u00EBntwintigste:22,drieentwintigste:23,vierentwintigste:24,vijfentwintigste:25,zesentwintigste:26,zevenentwintigste:27,achtentwintig:28,negenentwintig:29,dertigste:30,eenendertigste:31};ue.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconden:"second",min:"minute",mins:"minute",minute:"minute",minuut:"minute",minuten:"minute",minuutje:"minute",h:"hour",hr:"hour",hrs:"hour",uur:"hour",u:"hour",uren:"hour",dag:"d",dagen:"d",week:"week",weken:"week",maand:"month",maanden:"month",jaar:"year",jr:"year",jaren:"year"};ue.NUMBER_PATTERN=`(?:${co.matchAnyPattern(ue.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`;function zg(r){let e=r.toLowerCase();return ue.INTEGER_WORD_DICTIONARY[e]!==void 0?ue.INTEGER_WORD_DICTIONARY[e]:e==="paar"?2:e==="half"||e.match(/halve?/)?.5:parseFloat(e.replace(",","."))}ue.parseNumberPattern=zg;ue.ORDINAL_NUMBER_PATTERN=`(?:${co.matchAnyPattern(ue.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`;function BO(r){let e=r.toLowerCase();return ue.ORDINAL_WORD_DICTIONARY[e]!==void 0?ue.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:ste|de)$/i,""),parseInt(e))}ue.parseOrdinalNumberPattern=BO;ue.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])";function HO(r){if(/voor Christus/i.test(r))return r=r.replace(/voor Christus/i,""),-parseInt(r);if(/na Christus/i.test(r))return r=r.replace(/na Christus/i,""),parseInt(r);let e=parseInt(r);return GO.findMostLikelyADYear(e)}ue.parseYear=HO;var Vg=`(${ue.NUMBER_PATTERN})\\s{0,5}(${co.matchAnyPattern(ue.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Hg=new RegExp(Vg,"i");ue.TIME_UNITS_PATTERN=co.repeatedTimeunitPattern("(?:(?:binnen|in)\\s*)?",Vg);function zO(r){let e={},t=r,n=Hg.exec(t);for(;n;)VO(e,n),t=t.substring(n[0].length),n=Hg.exec(t);return e}ue.parseTimeUnits=zO;function VO(r,e){let t=zg(e[1]),n=ue.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Qg=_(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});var Kg=Ct(),KO=Ie(),QO=q(),pd=class extends QO.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(?:binnen|in|binnen de|voor)\\s*("+Kg.TIME_UNITS_PATTERN+")(?=\\W|$)","i")}innerExtract(e,t){let n=Kg.parseTimeUnits(t[1]);return KO.ParsingComponents.createRelativeFromReference(e.reference,n)}};hd.default=pd});var Zg=_(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});var Xg=Ct(),XO=Ee(),ZO=q(),JO=Rn(),eD=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:op\\s*?)?(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?(${XO.matchAnyPattern(Xg.WEEKDAY_DICTIONARY)})(?=\\W|$)`,"i"),tD=1,rD=2,nD=3,md=class extends ZO.AbstractParserWithWordBoundaryChecking{innerPattern(){return eD}innerExtract(e,t){let n=t[rD].toLowerCase(),i=Xg.WEEKDAY_DICTIONARY[n],s=t[tD],a=t[nD],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="vorige"?u="last":o=="volgende"?u="next":o=="deze"&&(u="this");let l=JO.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};gd.default=md});var iy=_(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});var iD=st(),ry=Ct(),fo=Ct(),ny=Ct(),sD=Ee(),aD=q(),oD=new RegExp(`(?:on\\s*?)?(${fo.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:tot|\\-|\\\u2013|until|through|till|\\s)\\s*(${fo.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:of)?\\s*)(`+sD.matchAnyPattern(ry.MONTH_DICTIONARY)+`)(?:(?:-|/|,?\\s*)(${ny.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),uD=3,Jg=1,ey=2,ty=4,yd=class extends aD.AbstractParserWithWordBoundaryChecking{innerPattern(){return oD}innerExtract(e,t){let n=ry.MONTH_DICTIONARY[t[uD].toLowerCase()],i=fo.parseOrdinalNumberPattern(t[Jg]);if(i>31)return t.index=t.index+t[Jg].length,null;let s=e.createParsingComponents({day:i,month:n});if(t[ty]){let u=ny.parseYear(t[ty]);s.assign("year",u)}else{let u=iD.findYearClosestToRef(e.refDate,i,n);s.imply("year",u)}if(!t[ey])return s;let a=fo.parseOrdinalNumberPattern(t[ey]),o=e.createParsingResult(t.index,t[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}};Td.default=yd});var uy=_(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});var ay=Ct(),lD=st(),cD=Ee(),oy=Ct(),dD=q(),fD=new RegExp(`(${cD.matchAnyPattern(ay.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${oy.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),pD=1,sy=2,bd=class extends dD.AbstractParserWithWordBoundaryChecking{innerPattern(){return fD}innerExtract(e,t){let n=e.createParsingComponents();n.imply("day",1);let i=t[pD],s=ay.MONTH_DICTIONARY[i.toLowerCase()];if(n.assign("month",s),t[sy]){let a=oy.parseYear(t[sy]);n.assign("year",a)}else{let a=lD.findYearClosestToRef(e.refDate,1,s);n.imply("year",a)}return n}};_d.default=bd});var ly=_(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});var hD=q(),mD=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),gD=1,yD=2,vd=class extends hD.AbstractParserWithWordBoundaryChecking{innerPattern(){return mD}innerExtract(e,t){let n=parseInt(t[yD]),i=parseInt(t[gD]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}};wd.default=vd});var cy=_(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});var TD=Dn(),Ed=class extends TD.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:om)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|om|\\?)\\s*"}primarySuffix(){return"(?:\\s*(?:uur))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};kd.default=Ed});var py=_(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});var fy=Ct(),bD=Ee(),_D=q(),vD=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${bD.matchAnyPattern(fy.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),wD=1,ED=2,dy=3,kD=4,Sd=class extends _D.AbstractParserWithWordBoundaryChecking{innerPattern(){return vD}innerExtract(e,t){let n=t[dy]?parseInt(t[dy]):fy.MONTH_DICTIONARY[t[ED].toLowerCase()];if(n<1||n>12)return null;let i=parseInt(t[wD]);return{day:parseInt(t[kD]),month:n,year:i}}};Od.default=Sd});var hy=_(Ps=>{"use strict";var SD=Ps&&Ps.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ps,"__esModule",{value:!0});var OD=q(),po=Be(),Dd=Gt(),DD=SD(ye()),xD=1,RD=2,xd=class extends OD.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i}innerExtract(e,t){let n=t[xD].toLowerCase(),i=t[RD].toLowerCase(),s=e.createParsingComponents(),a=DD.default(e.refDate);switch(n){case"gisteren":Dd.assignSimilarDate(s,a.add(-1,"day"));break;case"van":Dd.assignSimilarDate(s,a);break;case"morgen":Dd.assignTheNextDay(s,a);break}switch(i){case"ochtend":s.imply("meridiem",po.Meridiem.AM),s.imply("hour",6);break;case"middag":s.imply("meridiem",po.Meridiem.AM),s.imply("hour",12);break;case"namiddag":s.imply("meridiem",po.Meridiem.PM),s.imply("hour",15);break;case"avond":s.imply("meridiem",po.Meridiem.PM),s.imply("hour",20);break}return s}};Ps.default=xd});var gy=_(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var my=Ct(),MD=Ie(),CD=q(),AD=Bt(),PD=new RegExp(`(deze|vorige|afgelopen|komende|over|\\+|-)\\s*(${my.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Rd=class extends CD.AbstractParserWithWordBoundaryChecking{innerPattern(){return PD}innerExtract(e,t){let n=t[1].toLowerCase(),i=my.parseTimeUnits(t[2]);switch(n){case"vorige":case"afgelopen":case"-":i=AD.reverseTimeUnits(i);break}return MD.ParsingComponents.createRelativeFromReference(e.reference,i)}};Md.default=Rd});var by=_(Ns=>{"use strict";var ND=Ns&&Ns.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ns,"__esModule",{value:!0});var Ty=Ct(),yy=Ie(),ID=ND(ye()),FD=q(),LD=Ee(),UD=new RegExp(`(dit|deze|komende|volgend|volgende|afgelopen|vorige)\\s*(${LD.matchAnyPattern(Ty.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),WD=1,qD=2,Cd=class extends FD.AbstractParserWithWordBoundaryChecking{innerPattern(){return UD}innerExtract(e,t){let n=t[WD].toLowerCase(),i=t[qD].toLowerCase(),s=Ty.TIME_UNIT_DICTIONARY[i];if(n=="volgend"||n=="volgende"||n=="komende"){let u={};return u[s]=1,yy.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="afgelopen"||n=="vorige"){let u={};return u[s]=-1,yy.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=ID.default(e.reference.instant);return i.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):i.match(/maand/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):i.match(/jaar/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};Ns.default=Cd});var _y=_(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});var Pd=Ct(),$D=Ie(),YD=q(),jD=Bt(),GD=new RegExp("("+Pd.TIME_UNITS_PATTERN+")(?:geleden|voor|eerder)(?=(?:\\W|$))","i"),BD=new RegExp("("+Pd.TIME_UNITS_PATTERN+")geleden(?=(?:\\W|$))","i"),Ad=class extends YD.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?BD:GD}innerExtract(e,t){let n=Pd.parseTimeUnits(t[1]),i=jD.reverseTimeUnits(n);return $D.ParsingComponents.createRelativeFromReference(e.reference,i)}};Nd.default=Ad});var vy=_(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});var Fd=Ct(),HD=Ie(),zD=q(),VD=new RegExp("("+Fd.TIME_UNITS_PATTERN+")(later|na|vanaf nu|voortaan|vooruit|uit)(?=(?:\\W|$))","i"),KD=new RegExp("("+Fd.TIME_UNITS_PATTERN+")(later|vanaf nu)(?=(?:\\W|$))","i"),QD=1,Id=class extends zD.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?KD:VD}innerExtract(e,t){let n=Fd.parseTimeUnits(t[QD]);return HD.ParsingComponents.createRelativeFromReference(e.reference,n)}};Ld.default=Id});var Sy=_(Ze=>{"use strict";var ot=Ze&&Ze.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.createConfiguration=Ze.createCasualConfiguration=Ze.parseDate=Ze.parse=Ze.strict=Ze.casual=void 0;var XD=Ar(),wy=nr(),ZD=ot(Yg()),JD=ot(jg()),e0=ot(Gg()),t0=ot(Bg()),r0=ot(Mn()),n0=ot(Qg()),i0=ot(Zg()),s0=ot(iy()),Ey=ot(uy()),a0=ot(ly()),o0=ot(cy()),u0=ot(py()),l0=ot(hy()),c0=ot(gy()),d0=ot(by()),f0=ot(_y()),p0=ot(vy());Ze.casual=new wy.Chrono(ky());Ze.strict=new wy.Chrono(Ud(!0));function h0(r,e,t){return Ze.casual.parse(r,e,t)}Ze.parse=h0;function m0(r,e,t){return Ze.casual.parseDate(r,e,t)}Ze.parseDate=m0;function ky(r=!0){let e=Ud(!1,r);return e.parsers.unshift(new e0.default),e.parsers.unshift(new t0.default),e.parsers.unshift(new l0.default),e.parsers.unshift(new Ey.default),e.parsers.unshift(new d0.default),e.parsers.unshift(new c0.default),e}Ze.createCasualConfiguration=ky;function Ud(r=!0,e=!0){return XD.includeCommonConfiguration({parsers:[new r0.default(e),new n0.default,new s0.default,new Ey.default,new i0.default,new u0.default,new a0.default,new o0.default(r),new f0.default(r),new p0.default(r)],refiners:[new JD.default,new ZD.default]},r)}Ze.createConfiguration=Ud});var Ry=_(Is=>{"use strict";var g0=Is&&Is.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Is,"__esModule",{value:!0});var y0=g0(ye()),T0=q(),b0=1,Oy=2,_0=3,Dy=4,xy=5,v0=6,Wd=class extends T0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u800C\u5BB6|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,i=e.createParsingResult(n,t[0]),s=y0.default(e.refDate),a=s;if(t[b0])i.start.imply("hour",s.hour()),i.start.imply("minute",s.minute()),i.start.imply("second",s.second()),i.start.imply("millisecond",s.millisecond());else if(t[Oy]){let o=t[Oy],u=t[_0];o=="\u660E"||o=="\u807D"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u5F8C"?a=a.add(2,"day"):o=="\u5927\u5F8C"&&(a=a.add(3,"day")),u=="\u65E9"||u=="\u671D"?i.start.imply("hour",6):u=="\u665A"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(t[Dy]){let u=t[Dy][0];u=="\u65E9"||u=="\u671D"||u=="\u4E0A"?i.start.imply("hour",6):u=="\u4E0B"||u=="\u664F"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):u=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):u=="\u51CC"&&i.start.imply("hour",0)}else if(t[xy]){let o=t[xy];o=="\u660E"||o=="\u807D"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u5F8C"?a=a.add(2,"day"):o=="\u5927\u5F8C"&&(a=a.add(3,"day"));let u=t[v0];if(u){let l=u[0];l=="\u65E9"||l=="\u671D"||l=="\u4E0A"?i.start.imply("hour",6):l=="\u4E0B"||l=="\u664F"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):l=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):l=="\u51CC"&&i.start.imply("hour",0)}}return i.start.assign("day",a.date()),i.start.assign("month",a.month()+1),i.start.assign("year",a.year()),i}};Is.default=Wd});var _i=_(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.zhStringToYear=xt.zhStringToNumber=xt.WEEKDAY_OFFSET=xt.NUMBER=void 0;xt.NUMBER={\u96F6:0,\u4E00:1,\u4E8C:2,\u5169:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10,\u5EFF:20,\u5345:30};xt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function w0(r){let e=0;for(let t=0;t{"use strict";var k0=Fs&&Fs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fs,"__esModule",{value:!0});var S0=k0(ye()),O0=q(),Pn=_i(),qd=1,My=2,$d=3,Yd=class extends O0.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(Pn.NUMBER).join("")+"]{4}|["+Object.keys(Pn.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(Pn.NUMBER).join("")+"]{1,2})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(Pn.NUMBER).join("")+"]{1,2})?(?:\\s*)(?:\u65E5|\u865F)?")}innerExtract(e,t){let n=S0.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[My]);if(isNaN(s)&&(s=Pn.zhStringToNumber(t[My])),i.start.assign("month",s),t[$d]){let a=parseInt(t[$d]);isNaN(a)&&(a=Pn.zhStringToNumber(t[$d])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[qd]){let a=parseInt(t[qd]);isNaN(a)&&(a=Pn.zhStringToYear(t[qd])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}};Fs.default=Yd});var Py=_(Ls=>{"use strict";var D0=Ls&&Ls.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ls,"__esModule",{value:!0});var x0=D0(ye()),R0=q(),Ay=_i(),M0=new RegExp("(\\d+|["+Object.keys(Ay.NUMBER).join("")+"]+|\u534A|\u5E7E)(?:\\s*)(?:\u500B)?(\u79D2(?:\u9418)?|\u5206\u9418|\u5C0F\u6642|\u9418|\u65E5|\u5929|\u661F\u671F|\u79AE\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u904E)?\u5F8C|(?:\u4E4B)?\u5167)","i"),jd=1,C0=2,Gd=class extends R0.AbstractParserWithWordBoundaryChecking{innerPattern(){return M0}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[jd]);if(isNaN(i)&&(i=Ay.zhStringToNumber(t[jd])),isNaN(i)){let u=t[jd];if(u==="\u5E7E")i=3;else if(u==="\u534A")i=.5;else return null}let s=x0.default(e.refDate),o=t[C0][0];return o.match(/[日天星禮月年]/)?(o=="\u65E5"||o=="\u5929"?s=s.add(i,"d"):o=="\u661F"||o=="\u79AE"?s=s.add(i*7,"d"):o=="\u6708"?s=s.add(i,"month"):o=="\u5E74"&&(s=s.add(i,"year")),n.start.assign("year",s.year()),n.start.assign("month",s.month()+1),n.start.assign("day",s.date()),n):(o=="\u79D2"?s=s.add(i,"second"):o=="\u5206"?s=s.add(i,"minute"):(o=="\u5C0F"||o=="\u9418")&&(s=s.add(i,"hour")),n.start.imply("year",s.year()),n.start.imply("month",s.month()+1),n.start.imply("day",s.date()),n.start.assign("hour",s.hour()),n.start.assign("minute",s.minute()),n.start.assign("second",s.second()),n)}};Ls.default=Gd});var Iy=_(Us=>{"use strict";var A0=Us&&Us.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Us,"__esModule",{value:!0});var P0=A0(ye()),N0=q(),Ny=_i(),I0=new RegExp("(?\u4E0A|\u4ECA|\u4E0B|\u9019|\u5462)(?:\u500B)?(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(Ny.WEEKDAY_OFFSET).join("|")+")"),Bd=class extends N0.AbstractParserWithWordBoundaryChecking{innerPattern(){return I0}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=Ny.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=null,o=t.groups.prefix;o=="\u4E0A"?a="last":o=="\u4E0B"?a="next":(o=="\u4ECA"||o=="\u9019"||o=="\u5462")&&(a="this");let u=P0.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(s-7),l=!0):a=="next"?(u=u.day(s+7),l=!0):a=="this"?u=u.day(s):Math.abs(s-7-c){"use strict";var F0=Ws&&Ws.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ws,"__esModule",{value:!0});var L0=F0(ye()),U0=q(),Vt=_i(),W0=new RegExp("(?:\u7531|\u5F9E|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(Vt.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Vt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Vt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),q0=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(Vt.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Vt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Vt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),ho=1,mo=2,go=3,yo=4,To=5,bo=6,zt=7,vi=8,_o=9,Hd=class extends U0.AbstractParserWithWordBoundaryChecking{innerPattern(){return W0}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=L0.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[ho]){var a=t[ho];a=="\u660E"||a=="\u807D"?n.hour()>1&&s.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?s.add(-1,"day"):a=="\u524D"?s.add(-2,"day"):a=="\u5927\u524D"?s.add(-3,"day"):a=="\u5F8C"?s.add(2,"day"):a=="\u5927\u5F8C"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else if(t[yo]){var o=t[yo];o=="\u660E"||o=="\u807D"?s.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?s.add(-1,"day"):o=="\u524D"?s.add(-2,"day"):o=="\u5927\u524D"?s.add(-3,"day"):o=="\u5F8C"?s.add(2,"day"):o=="\u5927\u5F8C"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else i.start.imply("day",s.date()),i.start.imply("month",s.month()+1),i.start.imply("year",s.year());let u=0,l=0,c=-1;if(t[vi]){var f=parseInt(t[vi]);if(isNaN(f)&&(f=Vt.zhStringToNumber(t[vi])),f>=60)return null;i.start.assign("second",f)}if(u=parseInt(t[bo]),isNaN(u)&&(u=Vt.zhStringToNumber(t[bo])),t[zt]?t[zt]=="\u534A"?l=30:t[zt]=="\u6B63"||t[zt]=="\u6574"?l=0:(l=parseInt(t[zt]),isNaN(l)&&(l=Vt.zhStringToNumber(t[zt]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[_o]){if(u>12)return null;var h=t[_o][0].toLowerCase();h=="a"&&(c=0,u==12&&(u=0)),h=="p"&&(c=1,u!=12&&(u+=12))}else if(t[mo]){var T=t[mo],y=T[0];y=="\u671D"||y=="\u65E9"?(c=0,u==12&&(u=0)):y=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[go]){var w=t[go],D=w[0];D=="\u4E0A"||D=="\u671D"||D=="\u65E9"||D=="\u51CC"?(c=0,u==12&&(u=0)):(D=="\u4E0B"||D=="\u664F"||D=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[To]){var C=t[To],N=C[0];N=="\u4E0A"||N=="\u671D"||N=="\u65E9"||N=="\u51CC"?(c=0,u==12&&(u=0)):(N=="\u4E0B"||N=="\u664F"||N=="\u665A")&&(c=1,u!=12&&(u+=12))}if(i.start.assign("hour",u),i.start.assign("minute",l),c>=0?i.start.assign("meridiem",c):u<12?i.start.imply("meridiem",0):i.start.imply("meridiem",1),t=q0.exec(e.text.substring(i.index+i.text.length)),!t)return i.text.match(/^\d+$/)?null:i;let L=s.clone();if(i.end=e.createParsingComponents(),t[ho]){var a=t[ho];a=="\u660E"||a=="\u807D"?n.hour()>1&&L.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?L.add(-1,"day"):a=="\u524D"?L.add(-2,"day"):a=="\u5927\u524D"?L.add(-3,"day"):a=="\u5F8C"?L.add(2,"day"):a=="\u5927\u5F8C"&&L.add(3,"day"),i.end.assign("day",L.date()),i.end.assign("month",L.month()+1),i.end.assign("year",L.year())}else if(t[yo]){var o=t[yo];o=="\u660E"||o=="\u807D"?L.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?L.add(-1,"day"):o=="\u524D"?L.add(-2,"day"):o=="\u5927\u524D"?L.add(-3,"day"):o=="\u5F8C"?L.add(2,"day"):o=="\u5927\u5F8C"&&L.add(3,"day"),i.end.assign("day",L.date()),i.end.assign("month",L.month()+1),i.end.assign("year",L.year())}else i.end.imply("day",L.date()),i.end.imply("month",L.month()+1),i.end.imply("year",L.year());if(u=0,l=0,c=-1,t[vi]){var f=parseInt(t[vi]);if(isNaN(f)&&(f=Vt.zhStringToNumber(t[vi])),f>=60)return null;i.end.assign("second",f)}if(u=parseInt(t[bo]),isNaN(u)&&(u=Vt.zhStringToNumber(t[bo])),t[zt]?t[zt]=="\u534A"?l=30:t[zt]=="\u6B63"||t[zt]=="\u6574"?l=0:(l=parseInt(t[zt]),isNaN(l)&&(l=Vt.zhStringToNumber(t[zt]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[_o]){if(u>12)return null;var h=t[_o][0].toLowerCase();h=="a"&&(c=0,u==12&&(u=0)),h=="p"&&(c=1,u!=12&&(u+=12)),i.start.isCertain("meridiem")||(c==0?(i.start.imply("meridiem",0),i.start.get("hour")==12&&i.start.assign("hour",0)):(i.start.imply("meridiem",1),i.start.get("hour")!=12&&i.start.assign("hour",i.start.get("hour")+12)))}else if(t[mo]){var T=t[mo],y=T[0];y=="\u671D"||y=="\u65E9"?(c=0,u==12&&(u=0)):y=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[go]){var w=t[go],D=w[0];D=="\u4E0A"||D=="\u671D"||D=="\u65E9"||D=="\u51CC"?(c=0,u==12&&(u=0)):(D=="\u4E0B"||D=="\u664F"||D=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[To]){var C=t[To],N=C[0];N=="\u4E0A"||N=="\u671D"||N=="\u65E9"||N=="\u51CC"?(c=0,u==12&&(u=0)):(N=="\u4E0B"||N=="\u664F"||N=="\u665A")&&(c=1,u!=12&&(u+=12))}return i.text=i.text+t[0],i.end.assign("hour",u),i.end.assign("minute",l),c>=0?i.end.assign("meridiem",c):i.start.isCertain("meridiem")&&i.start.get("meridiem")==1&&i.start.get("hour")>u?i.end.imply("meridiem",0):u>12&&i.end.imply("meridiem",1),i.end.date().getTime(){"use strict";var $0=qs&&qs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qs,"__esModule",{value:!0});var Y0=$0(ye()),j0=q(),Ly=_i(),G0=new RegExp("(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(Ly.WEEKDAY_OFFSET).join("|")+")"),zd=class extends j0.AbstractParserWithWordBoundaryChecking{innerPattern(){return G0}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=Ly.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=Y0.default(e.refDate),o=!1,u=a.day();return Math.abs(s-7-u){"use strict";var B0=$s&&$s.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($s,"__esModule",{value:!0});var H0=B0(Tr()),Vd=class extends H0.default{patternBetween(){return/^\s*(至|到|\-|\~|~|-|ー)\s*$/i}};$s.default=Vd});var qy=_(Ys=>{"use strict";var z0=Ys&&Ys.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ys,"__esModule",{value:!0});var V0=z0(Cr()),Kd=class extends V0.default{patternBetween(){return/^\s*$/i}};Ys.default=Kd});var $y=_(Ye=>{"use strict";var Lr=Ye&&Ye.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.createConfiguration=Ye.createCasualConfiguration=Ye.parseDate=Ye.parse=Ye.strict=Ye.casual=Ye.hant=void 0;var Qd=nr(),K0=Lr(Ka()),Q0=Ar(),X0=Lr(Ry()),Z0=Lr(Cy()),J0=Lr(Py()),ex=Lr(Iy()),tx=Lr(Fy()),rx=Lr(Uy()),nx=Lr(Wy()),ix=Lr(qy());Ye.hant=new Qd.Chrono(Xd());Ye.casual=new Qd.Chrono(Xd());Ye.strict=new Qd.Chrono(Zd());function sx(r,e,t){return Ye.casual.parse(r,e,t)}Ye.parse=sx;function ax(r,e,t){return Ye.casual.parseDate(r,e,t)}Ye.parseDate=ax;function Xd(){let r=Zd();return r.parsers.unshift(new X0.default),r}Ye.createCasualConfiguration=Xd;function Zd(){let r=Q0.includeCommonConfiguration({parsers:[new Z0.default,new ex.default,new rx.default,new tx.default,new J0.default],refiners:[new nx.default,new ix.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof K0.default)),r}Ye.createConfiguration=Zd});var By=_(js=>{"use strict";var ox=js&&js.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(js,"__esModule",{value:!0});var ux=ox(ye()),lx=q(),cx=1,Yy=2,dx=3,jy=4,Gy=5,fx=6,Jd=class extends lx.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u73B0\u5728|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,i=e.createParsingResult(n,t[0]),s=ux.default(e.refDate),a=s;if(t[cx])i.start.imply("hour",s.hour()),i.start.imply("minute",s.minute()),i.start.imply("second",s.second()),i.start.imply("millisecond",s.millisecond());else if(t[Yy]){let o=t[Yy],u=t[dx];o=="\u660E"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u540E"?a=a.add(2,"day"):o=="\u5927\u540E"&&(a=a.add(3,"day")),u=="\u65E9"?i.start.imply("hour",6):u=="\u665A"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(t[jy]){let u=t[jy][0];u=="\u65E9"||u=="\u4E0A"?i.start.imply("hour",6):u=="\u4E0B"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):u=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):u=="\u51CC"&&i.start.imply("hour",0)}else if(t[Gy]){let o=t[Gy];o=="\u660E"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u540E"?a=a.add(2,"day"):o=="\u5927\u540E"&&(a=a.add(3,"day"));let u=t[fx];if(u){let l=u[0];l=="\u65E9"||l=="\u4E0A"?i.start.imply("hour",6):l=="\u4E0B"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):l=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):l=="\u51CC"&&i.start.imply("hour",0)}}return i.start.assign("day",a.date()),i.start.assign("month",a.month()+1),i.start.assign("year",a.year()),i}};js.default=Jd});var wi=_(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.zhStringToYear=Rt.zhStringToNumber=Rt.WEEKDAY_OFFSET=Rt.NUMBER=void 0;Rt.NUMBER={\u96F6:0,"\u3007":0,\u4E00:1,\u4E8C:2,\u4E24:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10};Rt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function px(r){let e=0;for(let t=0;t{"use strict";var mx=Gs&&Gs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gs,"__esModule",{value:!0});var gx=mx(ye()),yx=q(),Nn=wi(),ef=1,Hy=2,tf=3,rf=class extends yx.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(Nn.NUMBER).join("")+"]{4}|["+Object.keys(Nn.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(Nn.NUMBER).join("")+"]{1,3})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(Nn.NUMBER).join("")+"]{1,3})?(?:\\s*)(?:\u65E5|\u53F7)?")}innerExtract(e,t){let n=gx.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[Hy]);if(isNaN(s)&&(s=Nn.zhStringToNumber(t[Hy])),i.start.assign("month",s),t[tf]){let a=parseInt(t[tf]);isNaN(a)&&(a=Nn.zhStringToNumber(t[tf])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[ef]){let a=parseInt(t[ef]);isNaN(a)&&(a=Nn.zhStringToYear(t[ef])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}};Gs.default=rf});var Ky=_(Bs=>{"use strict";var Tx=Bs&&Bs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Bs,"__esModule",{value:!0});var bx=Tx(ye()),_x=q(),Vy=wi(),vx=new RegExp("(\\d+|["+Object.keys(Vy.NUMBER).join("")+"]+|\u534A|\u51E0)(?:\\s*)(?:\u4E2A)?(\u79D2(?:\u949F)?|\u5206\u949F|\u5C0F\u65F6|\u949F|\u65E5|\u5929|\u661F\u671F|\u793C\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u8FC7)?\u540E|(?:\u4E4B)?\u5185)","i"),nf=1,wx=2,sf=class extends _x.AbstractParserWithWordBoundaryChecking{innerPattern(){return vx}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[nf]);if(isNaN(i)&&(i=Vy.zhStringToNumber(t[nf])),isNaN(i)){let u=t[nf];if(u==="\u51E0")i=3;else if(u==="\u534A")i=.5;else return null}let s=bx.default(e.refDate),o=t[wx][0];return o.match(/[日天星礼月年]/)?(o=="\u65E5"||o=="\u5929"?s=s.add(i,"d"):o=="\u661F"||o=="\u793C"?s=s.add(i*7,"d"):o=="\u6708"?s=s.add(i,"month"):o=="\u5E74"&&(s=s.add(i,"year")),n.start.assign("year",s.year()),n.start.assign("month",s.month()+1),n.start.assign("day",s.date()),n):(o=="\u79D2"?s=s.add(i,"second"):o=="\u5206"?s=s.add(i,"minute"):(o=="\u5C0F"||o=="\u949F")&&(s=s.add(i,"hour")),n.start.imply("year",s.year()),n.start.imply("month",s.month()+1),n.start.imply("day",s.date()),n.start.assign("hour",s.hour()),n.start.assign("minute",s.minute()),n.start.assign("second",s.second()),n)}};Bs.default=sf});var Xy=_(Hs=>{"use strict";var Ex=Hs&&Hs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Hs,"__esModule",{value:!0});var kx=Ex(ye()),Sx=q(),Qy=wi(),Ox=new RegExp("(?\u4E0A|\u4E0B|\u8FD9)(?:\u4E2A)?(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(Qy.WEEKDAY_OFFSET).join("|")+")"),af=class extends Sx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Ox}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=Qy.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=null,o=t.groups.prefix;o=="\u4E0A"?a="last":o=="\u4E0B"?a="next":o=="\u8FD9"&&(a="this");let u=kx.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(s-7),l=!0):a=="next"?(u=u.day(s+7),l=!0):a=="this"?u=u.day(s):Math.abs(s-7-c){"use strict";var Dx=zs&&zs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(zs,"__esModule",{value:!0});var xx=Dx(ye()),Rx=q(),Qt=wi(),Mx=new RegExp("(?:\u4ECE|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(Qt.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Qt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Qt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Cx=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(Qt.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Qt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Qt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),vo=1,wo=2,Eo=3,ko=4,So=5,Oo=6,Kt=7,Ei=8,Do=9,of=class extends Rx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Mx}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=xx.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[vo]){let c=t[vo];c=="\u660E"?n.hour()>1&&s.add(1,"day"):c=="\u6628"?s.add(-1,"day"):c=="\u524D"?s.add(-2,"day"):c=="\u5927\u524D"?s.add(-3,"day"):c=="\u540E"?s.add(2,"day"):c=="\u5927\u540E"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else if(t[ko]){let c=t[ko];c=="\u660E"?s.add(1,"day"):c=="\u6628"?s.add(-1,"day"):c=="\u524D"?s.add(-2,"day"):c=="\u5927\u524D"?s.add(-3,"day"):c=="\u540E"?s.add(2,"day"):c=="\u5927\u540E"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else i.start.imply("day",s.date()),i.start.imply("month",s.month()+1),i.start.imply("year",s.year());let a=0,o=0,u=-1;if(t[Ei]){let c=parseInt(t[Ei]);if(isNaN(c)&&(c=Qt.zhStringToNumber(t[Ei])),c>=60)return null;i.start.assign("second",c)}if(a=parseInt(t[Oo]),isNaN(a)&&(a=Qt.zhStringToNumber(t[Oo])),t[Kt]?t[Kt]=="\u534A"?o=30:t[Kt]=="\u6B63"||t[Kt]=="\u6574"?o=0:(o=parseInt(t[Kt]),isNaN(o)&&(o=Qt.zhStringToNumber(t[Kt]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[Do]){if(a>12)return null;let c=t[Do][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12))}else if(t[wo]){let f=t[wo][0];f=="\u65E9"?(u=0,a==12&&(a=0)):f=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Eo]){let f=t[Eo][0];f=="\u4E0A"||f=="\u65E9"||f=="\u51CC"?(u=0,a==12&&(a=0)):(f=="\u4E0B"||f=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[So]){let f=t[So][0];f=="\u4E0A"||f=="\u65E9"||f=="\u51CC"?(u=0,a==12&&(a=0)):(f=="\u4E0B"||f=="\u665A")&&(u=1,a!=12&&(a+=12))}if(i.start.assign("hour",a),i.start.assign("minute",o),u>=0?i.start.assign("meridiem",u):a<12?i.start.imply("meridiem",0):i.start.imply("meridiem",1),t=Cx.exec(e.text.substring(i.index+i.text.length)),!t)return i.text.match(/^\d+$/)?null:i;let l=s.clone();if(i.end=e.createParsingComponents(),t[vo]){let c=t[vo];c=="\u660E"?n.hour()>1&&l.add(1,"day"):c=="\u6628"?l.add(-1,"day"):c=="\u524D"?l.add(-2,"day"):c=="\u5927\u524D"?l.add(-3,"day"):c=="\u540E"?l.add(2,"day"):c=="\u5927\u540E"&&l.add(3,"day"),i.end.assign("day",l.date()),i.end.assign("month",l.month()+1),i.end.assign("year",l.year())}else if(t[ko]){let c=t[ko];c=="\u660E"?l.add(1,"day"):c=="\u6628"?l.add(-1,"day"):c=="\u524D"?l.add(-2,"day"):c=="\u5927\u524D"?l.add(-3,"day"):c=="\u540E"?l.add(2,"day"):c=="\u5927\u540E"&&l.add(3,"day"),i.end.assign("day",l.date()),i.end.assign("month",l.month()+1),i.end.assign("year",l.year())}else i.end.imply("day",l.date()),i.end.imply("month",l.month()+1),i.end.imply("year",l.year());if(a=0,o=0,u=-1,t[Ei]){let c=parseInt(t[Ei]);if(isNaN(c)&&(c=Qt.zhStringToNumber(t[Ei])),c>=60)return null;i.end.assign("second",c)}if(a=parseInt(t[Oo]),isNaN(a)&&(a=Qt.zhStringToNumber(t[Oo])),t[Kt]?t[Kt]=="\u534A"?o=30:t[Kt]=="\u6B63"||t[Kt]=="\u6574"?o=0:(o=parseInt(t[Kt]),isNaN(o)&&(o=Qt.zhStringToNumber(t[Kt]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[Do]){if(a>12)return null;let c=t[Do][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12)),i.start.isCertain("meridiem")||(u==0?(i.start.imply("meridiem",0),i.start.get("hour")==12&&i.start.assign("hour",0)):(i.start.imply("meridiem",1),i.start.get("hour")!=12&&i.start.assign("hour",i.start.get("hour")+12)))}else if(t[wo]){let f=t[wo][0];f=="\u65E9"?(u=0,a==12&&(a=0)):f=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Eo]){let f=t[Eo][0];f=="\u4E0A"||f=="\u65E9"||f=="\u51CC"?(u=0,a==12&&(a=0)):(f=="\u4E0B"||f=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[So]){let f=t[So][0];f=="\u4E0A"||f=="\u65E9"||f=="\u51CC"?(u=0,a==12&&(a=0)):(f=="\u4E0B"||f=="\u665A")&&(u=1,a!=12&&(a+=12))}return i.text=i.text+t[0],i.end.assign("hour",a),i.end.assign("minute",o),u>=0?i.end.assign("meridiem",u):i.start.isCertain("meridiem")&&i.start.get("meridiem")==1&&i.start.get("hour")>a?i.end.imply("meridiem",0):a>12&&i.end.imply("meridiem",1),i.end.date().getTime(){"use strict";var Ax=Vs&&Vs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vs,"__esModule",{value:!0});var Px=Ax(ye()),Nx=q(),Jy=wi(),Ix=new RegExp("(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(Jy.WEEKDAY_OFFSET).join("|")+")"),uf=class extends Nx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Ix}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=Jy.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=Px.default(e.refDate),o=!1,u=a.day();return Math.abs(s-7-u){"use strict";var Fx=Ks&&Ks.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ks,"__esModule",{value:!0});var Lx=Fx(Tr()),lf=class extends Lx.default{patternBetween(){return/^\s*(至|到|-|~|~|-|ー)\s*$/i}};Ks.default=lf});var rT=_(Qs=>{"use strict";var Ux=Qs&&Qs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qs,"__esModule",{value:!0});var Wx=Ux(Cr()),cf=class extends Wx.default{patternBetween(){return/^\s*$/i}};Qs.default=cf});var nT=_(je=>{"use strict";var Ur=je&&je.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(je,"__esModule",{value:!0});je.createConfiguration=je.createCasualConfiguration=je.parseDate=je.parse=je.strict=je.casual=je.hans=void 0;var df=nr(),qx=Ur(Ka()),$x=Ar(),Yx=Ur(By()),jx=Ur(zy()),Gx=Ur(Ky()),Bx=Ur(Xy()),Hx=Ur(Zy()),zx=Ur(eT()),Vx=Ur(tT()),Kx=Ur(rT());je.hans=new df.Chrono(ff());je.casual=new df.Chrono(ff());je.strict=new df.Chrono(pf());function Qx(r,e,t){return je.casual.parse(r,e,t)}je.parse=Qx;function Xx(r,e,t){return je.casual.parseDate(r,e,t)}je.parseDate=Xx;function ff(){let r=pf();return r.parsers.unshift(new Yx.default),r}je.createCasualConfiguration=ff;function pf(){let r=$x.includeCommonConfiguration({parsers:[new jx.default,new Bx.default,new zx.default,new Hx.default,new Gx.default],refiners:[new Vx.default,new Kx.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof qx.default)),r}je.createConfiguration=pf});var sT=_(At=>{"use strict";var iT=At&&At.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Zx=At&&At.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Jx=At&&At.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&iT(e,r,t)},eR=At&&At.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&iT(e,r,t);return Zx(e,r),e};Object.defineProperty(At,"__esModule",{value:!0});At.hans=void 0;Jx($y(),At);At.hans=eR(nT())});var Mt=_(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.parseTimeUnits=ee.TIME_UNITS_PATTERN=ee.parseYear=ee.YEAR_PATTERN=ee.parseOrdinalNumberPattern=ee.ORDINAL_NUMBER_PATTERN=ee.parseNumberPattern=ee.NUMBER_PATTERN=ee.TIME_UNIT_DICTIONARY=ee.ORDINAL_WORD_DICTIONARY=ee.INTEGER_WORD_DICTIONARY=ee.MONTH_DICTIONARY=ee.FULL_MONTH_NAME_DICTIONARY=ee.WEEKDAY_DICTIONARY=ee.REGEX_PARTS=void 0;var xo=Ee(),tR=st();ee.REGEX_PARTS={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"};ee.WEEKDAY_DICTIONARY={\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435:0,\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u044F:0,\u0432\u0441\u043A:0,"\u0432\u0441\u043A.":0,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A:1,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A\u0430:1,\u043F\u043D:1,"\u043F\u043D.":1,\u0432\u0442\u043E\u0440\u043D\u0438\u043A:2,\u0432\u0442\u043E\u0440\u043D\u0438\u043A\u0430:2,\u0432\u0442:2,"\u0432\u0442.":2,\u0441\u0440\u0435\u0434\u0430:3,\u0441\u0440\u0435\u0434\u044B:3,\u0441\u0440\u0435\u0434\u0443:3,\u0441\u0440:3,"\u0441\u0440.":3,\u0447\u0435\u0442\u0432\u0435\u0440\u0433:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430:4,\u0447\u0442:4,"\u0447\u0442.":4,\u043F\u044F\u0442\u043D\u0438\u0446\u0430:5,\u043F\u044F\u0442\u043D\u0438\u0446\u0443:5,\u043F\u044F\u0442\u043D\u0438\u0446\u044B:5,\u043F\u0442:5,"\u043F\u0442.":5,\u0441\u0443\u0431\u0431\u043E\u0442\u0430:6,\u0441\u0443\u0431\u0431\u043E\u0442\u0443:6,\u0441\u0443\u0431\u0431\u043E\u0442\u044B:6,\u0441\u0431:6,"\u0441\u0431.":6};ee.FULL_MONTH_NAME_DICTIONARY={\u044F\u043D\u0432\u0430\u0440\u044C:1,\u044F\u043D\u0432\u0430\u0440\u044F:1,\u044F\u043D\u0432\u0430\u0440\u0435:1,\u0444\u0435\u0432\u0440\u044F\u043B\u044C:2,\u0444\u0435\u0432\u0440\u044F\u043B\u044F:2,\u0444\u0435\u0432\u0440\u044F\u043B\u0435:2,\u043C\u0430\u0440\u0442:3,\u043C\u0430\u0440\u0442\u0430:3,\u043C\u0430\u0440\u0442\u0435:3,\u0430\u043F\u0440\u0435\u043B\u044C:4,\u0430\u043F\u0440\u0435\u043B\u044F:4,\u0430\u043F\u0440\u0435\u043B\u0435:4,\u043C\u0430\u0439:5,\u043C\u0430\u044F:5,\u043C\u0430\u0435:5,\u0438\u044E\u043D\u044C:6,\u0438\u044E\u043D\u044F:6,\u0438\u044E\u043D\u0435:6,\u0438\u044E\u043B\u044C:7,\u0438\u044E\u043B\u044F:7,\u0438\u044E\u043B\u0435:7,\u0430\u0432\u0433\u0443\u0441\u0442:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0430:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0435:8,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044C:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044F:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u0435:9,\u043E\u043A\u0442\u044F\u0431\u0440\u044C:10,\u043E\u043A\u0442\u044F\u0431\u0440\u044F:10,\u043E\u043A\u0442\u044F\u0431\u0440\u0435:10,\u043D\u043E\u044F\u0431\u0440\u044C:11,\u043D\u043E\u044F\u0431\u0440\u044F:11,\u043D\u043E\u044F\u0431\u0440\u0435:11,\u0434\u0435\u043A\u0430\u0431\u0440\u044C:12,\u0434\u0435\u043A\u0430\u0431\u0440\u044F:12,\u0434\u0435\u043A\u0430\u0431\u0440\u0435:12};ee.MONTH_DICTIONARY=Object.assign(Object.assign({},ee.FULL_MONTH_NAME_DICTIONARY),{\u044F\u043D\u0432:1,"\u044F\u043D\u0432.":1,\u0444\u0435\u0432:2,"\u0444\u0435\u0432.":2,\u043C\u0430\u0440:3,"\u043C\u0430\u0440.":3,\u0430\u043F\u0440:4,"\u0430\u043F\u0440.":4,\u0430\u0432\u0433:8,"\u0430\u0432\u0433.":8,\u0441\u0435\u043D:9,"\u0441\u0435\u043D.":9,\u043E\u043A\u0442:10,"\u043E\u043A\u0442.":10,\u043D\u043E\u044F:11,"\u043D\u043E\u044F.":11,\u0434\u0435\u043A:12,"\u0434\u0435\u043A.":12});ee.INTEGER_WORD_DICTIONARY={\u043E\u0434\u0438\u043D:1,\u043E\u0434\u043D\u0430:1,\u043E\u0434\u043D\u043E\u0439:1,\u043E\u0434\u043D\u0443:1,\u0434\u0432\u0435:2,\u0434\u0432\u0430:2,\u0434\u0432\u0443\u0445:2,\u0442\u0440\u0438:3,\u0442\u0440\u0435\u0445:3,\u0442\u0440\u0451\u0445:3,\u0447\u0435\u0442\u044B\u0440\u0435:4,\u0447\u0435\u0442\u044B\u0440\u0435\u0445:4,\u0447\u0435\u0442\u044B\u0440\u0451\u0445:4,\u043F\u044F\u0442\u044C:5,\u043F\u044F\u0442\u0438:5,\u0448\u0435\u0441\u0442\u044C:6,\u0448\u0435\u0441\u0442\u0438:6,\u0441\u0435\u043C\u044C:7,\u0441\u0435\u043C\u0438:7,\u0432\u043E\u0441\u0435\u043C\u044C:8,\u0432\u043E\u0441\u0435\u043C\u044C\u043C\u0438:8,\u0434\u0435\u0432\u044F\u0442\u044C:9,\u0434\u0435\u0432\u044F\u0442\u0438:9,\u0434\u0435\u0441\u044F\u0442\u044C:10,\u0434\u0435\u0441\u044F\u0442\u0438:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u044C:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u0438:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u044C:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u0438:12};ee.ORDINAL_WORD_DICTIONARY={\u043F\u0435\u0440\u0432\u043E\u0435:1,\u043F\u0435\u0440\u0432\u043E\u0433\u043E:1,\u0432\u0442\u043E\u0440\u043E\u0435:2,\u0432\u0442\u043E\u0440\u043E\u0433\u043E:2,\u0442\u0440\u0435\u0442\u044C\u0435:3,\u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E:3,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E:4,\u043F\u044F\u0442\u043E\u0435:5,\u043F\u044F\u0442\u043E\u0433\u043E:5,\u0448\u0435\u0441\u0442\u043E\u0435:6,\u0448\u0435\u0441\u0442\u043E\u0433\u043E:6,\u0441\u0435\u0434\u044C\u043C\u043E\u0435:7,\u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E:7,\u0432\u043E\u0441\u044C\u043C\u043E\u0435:8,\u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E:8,\u0434\u0435\u0432\u044F\u0442\u043E\u0435:9,\u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E:9,\u0434\u0435\u0441\u044F\u0442\u043E\u0435:10,\u0434\u0435\u0441\u044F\u0442\u043E\u0433\u043E:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:12,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:13,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:13,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:14,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:14,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:15,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:15,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:16,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:16,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:17,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:17,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:18,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:18,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:19,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:19,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0435:20,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:20,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0435":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0433\u043E":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0435":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0433\u043E":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0435":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0433\u043E":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0435":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0435":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0435":29,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E":29,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0435:30,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0433\u043E:30,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":31,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":31};ee.TIME_UNIT_DICTIONARY={\u0441\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u044B:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0443:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0443:"second",\u043C\u0438\u043D:"minute",\u043C\u0438\u043D\u0443\u0442\u0430:"minute",\u043C\u0438\u043D\u0443\u0442:"minute",\u043C\u0438\u043D\u0443\u0442\u044B:"minute",\u043C\u0438\u043D\u0443\u0442\u0443:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u043A:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0438:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0443:"minute",\u0447\u0430\u0441:"hour",\u0447\u0430\u0441\u043E\u0432:"hour",\u0447\u0430\u0441\u0430:"hour",\u0447\u0430\u0441\u0443:"hour",\u0447\u0430\u0441\u0438\u043A\u043E\u0432:"hour",\u0447\u0430\u0441\u0438\u043A\u0430:"hour",\u0447\u0430\u0441\u0438\u043A\u0435:"hour",\u0447\u0430\u0441\u0438\u043A:"hour",\u0434\u0435\u043D\u044C:"d",\u0434\u043D\u044F:"d",\u0434\u043D\u0435\u0439:"d",\u0441\u0443\u0442\u043E\u043A:"d",\u0441\u0443\u0442\u043A\u0438:"d",\u043D\u0435\u0434\u0435\u043B\u044F:"week",\u043D\u0435\u0434\u0435\u043B\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u044E:"week",\u043D\u0435\u0434\u0435\u043B\u044C:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u0435\u043A:"week",\u043C\u0435\u0441\u044F\u0446:"month",\u043C\u0435\u0441\u044F\u0446\u0435:"month",\u043C\u0435\u0441\u044F\u0446\u0435\u0432:"month",\u043C\u0435\u0441\u044F\u0446\u0430:"month",\u043A\u0432\u0430\u0440\u0442\u0430\u043B:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0435:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u043E\u0432:"quarter",\u0433\u043E\u0434:"year",\u0433\u043E\u0434\u0430:"year",\u0433\u043E\u0434\u0443:"year",\u0433\u043E\u0434\u043E\u0432:"year",\u043B\u0435\u0442:"year",\u0433\u043E\u0434\u0438\u043A:"year",\u0433\u043E\u0434\u0438\u043A\u0430:"year",\u0433\u043E\u0434\u0438\u043A\u043E\u0432:"year"};ee.NUMBER_PATTERN=`(?:${xo.matchAnyPattern(ee.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|\u043F\u043E\u043B|\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E|\u043F\u0430\u0440(?:\u044B|\u0443)|\\s{0,3})`;function oT(r){let e=r.toLowerCase();return ee.INTEGER_WORD_DICTIONARY[e]!==void 0?ee.INTEGER_WORD_DICTIONARY[e]:e.match(/несколько/)?3:e.match(/пол/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}ee.parseNumberPattern=oT;ee.ORDINAL_NUMBER_PATTERN=`(?:${xo.matchAnyPattern(ee.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435|\u043E\u0435)?)`;function rR(r){let e=r.toLowerCase();return ee.ORDINAL_WORD_DICTIONARY[e]!==void 0?ee.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}ee.parseOrdinalNumberPattern=rR;var hf="(?:\\s+(?:\u0433\u043E\u0434\u0443|\u0433\u043E\u0434\u0430|\u0433\u043E\u0434|\u0433|\u0433.))?";ee.YEAR_PATTERN=`(?:[1-9][0-9]{0,3}${hf}\\s*(?:\u043D.\u044D.|\u0434\u043E \u043D.\u044D.|\u043D. \u044D.|\u0434\u043E \u043D. \u044D.)|[1-2][0-9]{3}${hf}|[5-9][0-9]${hf})`;function nR(r){if(/(год|года|г|г.)/i.test(r)&&(r=r.replace(/(год|года|г|г.)/i,"")),/(до н.э.|до н. э.)/i.test(r))return r=r.replace(/(до н.э.|до н. э.)/i,""),-parseInt(r);if(/(н. э.|н.э.)/i.test(r))return r=r.replace(/(н. э.|н.э.)/i,""),parseInt(r);let e=parseInt(r);return tR.findMostLikelyADYear(e)}ee.parseYear=nR;var uT=`(${ee.NUMBER_PATTERN})\\s{0,3}(${xo.matchAnyPattern(ee.TIME_UNIT_DICTIONARY)})`,aT=new RegExp(uT,"i");ee.TIME_UNITS_PATTERN=xo.repeatedTimeunitPattern("(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s{0,3})?",uT);function iR(r){let e={},t=r,n=aT.exec(t);for(;n;)sR(e,n),t=t.substring(n[0].length).trim(),n=aT.exec(t);return e}ee.parseTimeUnits=iR;function sR(r,e){let t=oT(e[1]),n=ee.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var cT=_(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});var Xs=Mt(),aR=Ie(),oR=q(),lT=`(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s*(?:~\\s*)?)?(${Xs.TIME_UNITS_PATTERN})${Xs.REGEX_PARTS.rightBoundary}`,uR=new RegExp(`(?:\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435|\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0438)\\s*${lT}`,Xs.REGEX_PARTS.flags),lR=new RegExp(lT,"i"),mf=class extends oR.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Xs.REGEX_PARTS.leftBoundary}innerPattern(e){return e.option.forwardDate?lR:uR}innerExtract(e,t){let n=Xs.parseTimeUnits(t[1]);return aR.ParsingComponents.createRelativeFromReference(e.reference,n)}};gf.default=mf});var mT=_(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});var cR=st(),Zs=Mt(),hT=Mt(),Ro=Mt(),dR=Ee(),fR=q(),pR=new RegExp(`(?:\u0441)?\\s*(${Ro.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${Ro.ORDINAL_NUMBER_PATTERN}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${dR.matchAnyPattern(Zs.MONTH_DICTIONARY)})(?:(?:-|\\/|,?\\s{0,3})(${hT.YEAR_PATTERN}(?![^\\s]\\d)))?${Zs.REGEX_PARTS.rightBoundary}`,Zs.REGEX_PARTS.flags),dT=1,fT=2,hR=3,pT=4,yf=class extends fR.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Zs.REGEX_PARTS.leftBoundary}innerPattern(){return pR}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Zs.MONTH_DICTIONARY[t[hR].toLowerCase()],s=Ro.parseOrdinalNumberPattern(t[dT]);if(s>31)return t.index=t.index+t[dT].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[pT]){let a=hT.parseYear(t[pT]);n.start.assign("year",a)}else{let a=cR.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[fT]){let a=Ro.parseOrdinalNumberPattern(t[fT]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Tf.default=yf});var TT=_(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});var Js=Mt(),mR=st(),gR=Ee(),yT=Mt(),yR=q(),TR=new RegExp(`((?:\u0432)\\s*)?(${gR.matchAnyPattern(Js.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${yT.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,Js.REGEX_PARTS.flags),bR=2,gT=3,bf=class extends yR.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Js.REGEX_PARTS.leftBoundary}innerPattern(){return TR}innerExtract(e,t){let n=t[bR].toLowerCase();if(t[0].length<=3&&!Js.FULL_MONTH_NAME_DICTIONARY[n])return null;let i=e.createParsingResult(t.index,t.index+t[0].length);i.start.imply("day",1);let s=Js.MONTH_DICTIONARY[n];if(i.start.assign("month",s),t[gT]){let a=yT.parseYear(t[gT]);i.start.assign("year",a)}else{let a=mR.findYearClosestToRef(e.refDate,1,s);i.start.imply("year",a)}return i}};_f.default=bf});var _T=_(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});var Mo=Be(),_R=Dn(),bT=Mt(),vf=class extends _R.AbstractTimeExpressionParser{constructor(e){super(e)}patternFlags(){return bT.REGEX_PARTS.flags}primaryPatternLeftBoundary(){return"(^|\\s|T|(?:[^\\p{L}\\p{N}_]))"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|\u0434\u043E|\u0438|\u043F\u043E|\\?)\\s*"}primaryPrefix(){return"(?:(?:\u0432|\u0441)\\s*)??"}primarySuffix(){return`(?:\\s*(?:\u0443\u0442\u0440\u0430|\u0432\u0435\u0447\u0435\u0440\u0430|\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F))?(?!\\/)${bT.REGEX_PARTS.rightBoundary}`}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("\u0432\u0435\u0447\u0435\u0440\u0430")){let i=n.get("hour");i>=6&&i<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",Mo.Meridiem.PM)):i<6&&n.assign("meridiem",Mo.Meridiem.AM)}if(t[0].endsWith("\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F")){n.assign("meridiem",Mo.Meridiem.PM);let i=n.get("hour");i>=0&&i<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("\u0443\u0442\u0440\u0430")&&(n.assign("meridiem",Mo.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};wf.default=vf});var vT=_(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});var Co=Mt(),vR=Ie(),wR=q(),ER=Bt(),kR=new RegExp(`(${Co.TIME_UNITS_PATTERN})\\s{0,5}\u043D\u0430\u0437\u0430\u0434(?=(?:\\W|$))`,Co.REGEX_PARTS.flags),Ef=class extends wR.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Co.REGEX_PARTS.leftBoundary}innerPattern(){return kR}innerExtract(e,t){let n=Co.parseTimeUnits(t[1]),i=ER.reverseTimeUnits(n);return vR.ParsingComponents.createRelativeFromReference(e.reference,i)}};kf.default=Ef});var wT=_(ea=>{"use strict";var SR=ea&&ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ea,"__esModule",{value:!0});var OR=SR(Tr()),Sf=class extends OR.default{patternBetween(){return/^\s*(и до|и по|до|по|-)\s*$/i}};ea.default=Sf});var ET=_(ta=>{"use strict";var DR=ta&&ta.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ta,"__esModule",{value:!0});var xR=DR(Cr()),Of=class extends xR.default{patternBetween(){return new RegExp("^\\s*(T|\u0432|,|-)?\\s*$")}};ta.default=Of});var kT=_(Wr=>{"use strict";var RR=Wr&&Wr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),MR=Wr&&Wr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),CR=Wr&&Wr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&RR(e,r,t);return MR(e,r),e};Object.defineProperty(Wr,"__esModule",{value:!0});var AR=q(),ra=CR(Nr()),Df=Mt(),PR=new RegExp(`(?:\u0441|\u0441\u043E)?\\s*(\u0441\u0435\u0433\u043E\u0434\u043D\u044F|\u0432\u0447\u0435\u0440\u0430|\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430)${Df.REGEX_PARTS.rightBoundary}`,Df.REGEX_PARTS.flags),xf=class extends AR.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Df.REGEX_PARTS.leftBoundary}innerPattern(e){return PR}innerExtract(e,t){let n=t[1].toLowerCase(),i=e.createParsingComponents();switch(n){case"\u0441\u0435\u0433\u043E\u0434\u043D\u044F":return ra.today(e.reference);case"\u0432\u0447\u0435\u0440\u0430":return ra.yesterday(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return ra.tomorrow(e.reference);case"\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return ra.theDayAfter(e.reference,2);case"\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return ra.theDayBefore(e.reference,2)}return i}};Wr.default=xf});var ST=_(ur=>{"use strict";var NR=ur&&ur.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),IR=ur&&ur.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),FR=ur&&ur.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&NR(e,r,t);return IR(e,r),e},LR=ur&&ur.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ur,"__esModule",{value:!0});var UR=q(),In=FR(Nr()),WR=Gt(),qR=LR(ye()),Rf=Mt(),$R=new RegExp(`(\u0441\u0435\u0439\u0447\u0430\u0441|\u043F\u0440\u043E\u0448\u043B\u044B\u043C\\s*\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u043F\u0440\u043E\u0448\u043B\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u0435\u0433\u043E\u0434\u043D\u044F\\s*\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u0438\u043C \u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u0434\u0435\u043D\u044C|\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u0432\u0435\u0447\u0435\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u043D\u043E\u0447\u044C)${Rf.REGEX_PARTS.rightBoundary}`,Rf.REGEX_PARTS.flags),Mf=class extends UR.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Rf.REGEX_PARTS.leftBoundary}innerPattern(){return $R}innerExtract(e,t){let n=qR.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();if(i==="\u0441\u0435\u0439\u0447\u0430\u0441")return In.now(e.reference);if(i==="\u0432\u0435\u0447\u0435\u0440\u043E\u043C"||i==="\u0432\u0435\u0447\u0435\u0440\u0430")return In.evening(e.reference);if(i.endsWith("\u0443\u0442\u0440\u043E\u043C")||i.endsWith("\u0443\u0442\u0440\u0430"))return In.morning(e.reference);if(i.match(/в\s*полдень/))return In.noon(e.reference);if(i.match(/прошлой\s*ночью/))return In.lastNight(e.reference);if(i.match(/прошлым\s*вечером/))return In.yesterdayEvening(e.reference);if(i.match(/следующей\s*ночью/)){let a=n.hour()<22?1:2;n=n.add(a,"day"),WR.assignSimilarDate(s,n),s.imply("hour",0)}return i.match(/в\s*полночь/)||i.endsWith("\u043D\u043E\u0447\u044C\u044E")?In.midnight(e.reference):s}};ur.default=Mf});var OT=_(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});var na=Mt(),YR=Ee(),jR=q(),GR=Rn(),BR=new RegExp(`(?:(?:,|\\(|\uFF08)\\s*)?(?:\u0432\\s*?)?(?:(\u044D\u0442\u0443|\u044D\u0442\u043E\u0442|\u043F\u0440\u043E\u0448\u043B\u044B\u0439|\u043F\u0440\u043E\u0448\u043B\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E)\\s*)?(${YR.matchAnyPattern(na.WEEKDAY_DICTIONARY)})(?:\\s*(?:,|\\)|\uFF09))?(?:\\s*\u043D\u0430\\s*(\u044D\u0442\u043E\u0439|\u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439)\\s*\u043D\u0435\u0434\u0435\u043B\u0435)?${na.REGEX_PARTS.rightBoundary}`,na.REGEX_PARTS.flags),HR=1,zR=2,VR=3,Cf=class extends jR.AbstractParserWithWordBoundaryChecking{innerPattern(){return BR}patternLeftBoundary(){return na.REGEX_PARTS.leftBoundary}innerExtract(e,t){let n=t[zR].toLowerCase(),i=na.WEEKDAY_DICTIONARY[n],s=t[HR],a=t[VR],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="\u043F\u0440\u043E\u0448\u043B\u044B\u0439"||o=="\u043F\u0440\u043E\u0448\u043B\u0443\u044E"||o=="\u043F\u0440\u043E\u0448\u043B\u043E\u0439"?u="last":o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E"?u="next":(o=="\u044D\u0442\u043E\u0442"||o=="\u044D\u0442\u0443"||o=="\u044D\u0442\u043E\u0439")&&(u="this");let l=GR.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Af.default=Cf});var xT=_(sa=>{"use strict";var KR=sa&&sa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(sa,"__esModule",{value:!0});var ia=Mt(),DT=Ie(),QR=KR(ye()),XR=q(),ZR=Ee(),JR=new RegExp(`(\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C|\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439|\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C|\u043D\u0430 \u044D\u0442\u043E\u0439|\u0432 \u044D\u0442\u043E\u043C)\\s*(${ZR.matchAnyPattern(ia.TIME_UNIT_DICTIONARY)})(?=\\s*)${ia.REGEX_PARTS.rightBoundary}`,ia.REGEX_PARTS.flags),eM=1,tM=2,Pf=class extends XR.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return ia.REGEX_PARTS.leftBoundary}innerPattern(){return JR}innerExtract(e,t){let n=t[eM].toLowerCase(),i=t[tM].toLowerCase(),s=ia.TIME_UNIT_DICTIONARY[i];if(n=="\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||n=="\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C"){let u={};return u[s]=1,DT.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C"||n=="\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439"){let u={};return u[s]=-1,DT.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=QR.default(e.reference.instant);return s.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):s.match(/month/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):s.match(/year/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};sa.default=Pf});var RT=_(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});var aa=Mt(),rM=Ie(),nM=q(),iM=Bt(),sM=new RegExp(`(\u044D\u0442\u0438|\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435|\u043F\u0440\u043E\u0448\u043B\u044B\u0435|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0435|\u043F\u043E\u0441\u043B\u0435|\u0447\u0435\u0440\u0435\u0437|\\+|-)\\s*(${aa.TIME_UNITS_PATTERN})${aa.REGEX_PARTS.rightBoundary}`,aa.REGEX_PARTS.flags),Nf=class extends nM.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return aa.REGEX_PARTS.leftBoundary}innerPattern(){return sM}innerExtract(e,t){let n=t[1].toLowerCase(),i=aa.parseTimeUnits(t[2]);switch(n){case"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435":case"\u043F\u0440\u043E\u0448\u043B\u044B\u0435":case"-":i=iM.reverseTimeUnits(i);break}return rM.ParsingComponents.createRelativeFromReference(e.reference,i)}};If.default=Nf});var AT=_(Je=>{"use strict";var Pt=Je&&Je.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Je,"__esModule",{value:!0});Je.createConfiguration=Je.createCasualConfiguration=Je.parseDate=Je.parse=Je.strict=Je.casual=void 0;var aM=Pt(cT()),oM=Pt(mT()),uM=Pt(TT()),lM=Pt(_T()),cM=Pt(vT()),dM=Pt(wT()),fM=Pt(ET()),pM=Ar(),hM=Pt(kT()),mM=Pt(ST()),gM=Pt(OT()),yM=Pt(xT()),MT=nr(),TM=Pt(Mn()),bM=Pt(RT());Je.casual=new MT.Chrono(CT());Je.strict=new MT.Chrono(Ff(!0));function _M(r,e,t){return Je.casual.parse(r,e,t)}Je.parse=_M;function vM(r,e,t){return Je.casual.parseDate(r,e,t)}Je.parseDate=vM;function CT(){let r=Ff(!1);return r.parsers.unshift(new hM.default),r.parsers.unshift(new mM.default),r.parsers.unshift(new uM.default),r.parsers.unshift(new yM.default),r.parsers.unshift(new bM.default),r}Je.createCasualConfiguration=CT;function Ff(r=!0){return pM.includeCommonConfiguration({parsers:[new TM.default(!0),new aM.default,new oM.default,new gM.default,new lM.default(r),new cM.default],refiners:[new fM.default,new dM.default]},r)}Je.createConfiguration=Ff});var Be=_(ne=>{"use strict";var wM=ne&&ne.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),EM=ne&&ne.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),ln=ne&&ne.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&wM(e,r,t);return EM(e,r),e};Object.defineProperty(ne,"__esModule",{value:!0});ne.parseDate=ne.parse=ne.casual=ne.strict=ne.ru=ne.zh=ne.nl=ne.pt=ne.ja=ne.fr=ne.de=ne.Meridiem=ne.Chrono=ne.en=void 0;var Lf=ln(Jl());ne.en=Lf;var kM=nr();Object.defineProperty(ne,"Chrono",{enumerable:!0,get:function(){return kM.Chrono}});var SM;(function(r){r[r.AM=0]="AM",r[r.PM=1]="PM"})(SM=ne.Meridiem||(ne.Meridiem={}));var OM=ln($m());ne.de=OM;var DM=ln(gg());ne.fr=DM;var xM=ln(Sg());ne.ja=xM;var RM=ln($g());ne.pt=RM;var MM=ln(Sy());ne.nl=MM;var CM=ln(sT());ne.zh=CM;var AM=ln(AT());ne.ru=AM;ne.strict=Lf.strict;ne.casual=Lf.casual;function PM(r,e,t){return ne.casual.parse(r,e,t)}ne.parse=PM;function NM(r,e,t){return ne.casual.parseDate(r,e,t)}ne.parseDate=NM});var Rb=_((Db,xb)=>{(function(r){var e=Object.hasOwnProperty,t=Array.isArray?Array.isArray:function(p){return Object.prototype.toString.call(p)==="[object Array]"},n=10,i=typeof process=="object"&&typeof process.nextTick=="function",s=typeof Symbol=="function",a=typeof Reflect=="object",o=typeof setImmediate=="function",u=o?setImmediate:setTimeout,l=s?a&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(d){var p=Object.getOwnPropertyNames(d);return p.push.apply(p,Object.getOwnPropertySymbols(d)),p}:Object.keys;function c(){this._events={},this._conf&&f.call(this,this._conf)}function f(d){d&&(this._conf=d,d.delimiter&&(this.delimiter=d.delimiter),d.maxListeners!==r&&(this._maxListeners=d.maxListeners),d.wildcard&&(this.wildcard=d.wildcard),d.newListener&&(this._newListener=d.newListener),d.removeListener&&(this._removeListener=d.removeListener),d.verboseMemoryLeak&&(this.verboseMemoryLeak=d.verboseMemoryLeak),d.ignoreErrors&&(this.ignoreErrors=d.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function h(d,p){var m="(node) warning: possible EventEmitter memory leak detected. "+d+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(m+=" Event name: "+p+"."),typeof process!="undefined"&&process.emitWarning){var g=new Error(m);g.name="MaxListenersExceededWarning",g.emitter=this,g.count=d,process.emitWarning(g)}else console.error(m),console.trace&&console.trace()}var T=function(d,p,m){var g=arguments.length;switch(g){case 0:return[];case 1:return[d];case 2:return[d,p];case 3:return[d,p,m];default:for(var b=new Array(g);g--;)b[g]=arguments[g];return b}};function y(d,p){for(var m={},g,b=d.length,v=p?p.length:0,k=0;k0;)d=v[S],k.call(x,d,m[d]);this._listeners={},this._listenersCount=0,O()}}});function D(d,p,m,g){var b=Object.assign({},p);if(!d)return b;if(typeof d!="object")throw TypeError("options must be an object");var v=Object.keys(d),k=v.length,x,S,O;function I(se){throw Error('Invalid "'+x+'" option value'+(se?". Reason: "+se:""))}for(var me=0;me0;)if(x===d[S])return v;k(p)}}var L=N(["function"]),oe=N(["object","function"]);function z(d,p,m){var g,b,v=0,k,x=new d(function(S,O,I){m=D(m,{timeout:0,overload:!1},{timeout:function(De,W){return De*=1,(typeof De!="number"||De<0||!Number.isFinite(De))&&W("timeout must be a positive number"),De}}),g=!m.overload&&typeof d.prototype.cancel=="function"&&typeof I=="function";function me(){b&&(b=null),v&&(clearTimeout(v),v=0)}var se=function(De){me(),S(De)},te=function(De){me(),O(De)};g?p(se,te,I):(b=[function(De){te(De||Error("canceled"))}],p(se,te,function(De){if(k)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof De!="function")throw TypeError("onCancel callback must be a function");b.push(De)}),k=!0),m.timeout>0&&(v=setTimeout(function(){var De=Error("timeout");De.code="ETIMEDOUT",v=0,x.cancel(De),O(De)},m.timeout))});return g||(x.cancel=function(S){if(!!b){for(var O=b.length,I=1;I0;)te=qe[x],te!=="_listeners"&&(Ue=j(d,p,m[te],g+1,b),Ue&&(se?se.push.apply(se,Ue):se=Ue));return se}else if(nt==="**"){for(Ae=g+1===b||g+2===b&&Mr==="*",Ae&&m._listeners&&(se=j(d,p,m,b,b)),qe=l(m),x=qe.length;x-- >0;)te=qe[x],te!=="_listeners"&&(te==="*"||te==="**"?(m[te]._listeners&&!Ae&&(Ue=j(d,p,m[te],b,b),Ue&&(se?se.push.apply(se,Ue):se=Ue)),Ue=j(d,p,m[te],g,b)):te===Mr?Ue=j(d,p,m[te],g+2,b):Ue=j(d,p,m[te],g,b),Ue&&(se?se.push.apply(se,Ue):se=Ue));return se}else m[nt]&&(se=j(d,p,m[nt],g+1,b));if(De=m["*"],De&&j(d,p,De,g+1,b),W=m["**"],W)if(g0;)te=qe[x],te!=="_listeners"&&(te===Mr?j(d,p,W[te],g+2,b):te===nt?j(d,p,W[te],g+1,b):(Re={},Re[te]=W[te],j(d,p,{"**":Re},g+1,b)));else W._listeners?j(d,p,W,b,b):W["*"]&&W["*"]._listeners&&j(d,p,W["*"],b,b);return se}function G(d,p,m){var g=0,b=0,v,k=this.delimiter,x=k.length,S;if(typeof d=="string")if((v=d.indexOf(k))!==-1){S=new Array(5);do S[g++]=d.slice(b,v),b=v+x;while((v=d.indexOf(k,b))!==-1);S[g++]=d.slice(b)}else S=[d],g=1;else S=d,g=d.length;if(g>1){for(v=0;v+10&&O._listeners.length>this._maxListeners&&(O._listeners.warned=!0,h.call(this,O._listeners.length,I))):O._listeners=p,!0;return!0}function Ne(d,p,m,g){for(var b=l(d),v=b.length,k,x,S,O=d._listeners,I;v-- >0;)x=b[v],k=d[x],x==="_listeners"?S=m:S=m?m.concat(x):[x],I=g||typeof x=="symbol",O&&p.push(I?S:S.join(this.delimiter)),typeof k=="object"&&Ne.call(this,k,p,S,I);return p}function Le(d){for(var p=l(d),m=p.length,g,b,v;m-- >0;)b=p[m],g=d[b],g&&(v=!0,b!=="_listeners"&&!Le(g)&&delete d[b]);return v}function B(d,p,m){this.emitter=d,this.event=p,this.listener=m}B.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function A(d,p,m){if(m===!0)b=!0;else if(m===!1)g=!0;else{if(!m||typeof m!="object")throw TypeError("options should be an object or true");var g=m.async,b=m.promisify,v=m.nextTick,k=m.objectify}if(g||v||b){var x=p,S=p._origin||p;if(v&&!i)throw Error("process.nextTick is not supported");b===r&&(b=p.constructor.name==="AsyncFunction"),p=function(){var O=arguments,I=this,me=this.event;return b?v?Promise.resolve():new Promise(function(se){u(se)}).then(function(){return I.event=me,x.apply(I,O)}):(v?process.nextTick:u)(function(){I.event=me,x.apply(I,O)})},p._async=!0,p._origin=S}return[p,k?new B(this,d,p):this]}function E(d){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,f.call(this,d)}E.EventEmitter2=E,E.prototype.listenTo=function(d,p,m){if(typeof d!="object")throw TypeError("target musts be an object");var g=this;m=D(m,{on:r,off:r,reducers:r},{on:L,off:L,reducers:oe});function b(v){if(typeof v!="object")throw TypeError("events must be an object");var k=m.reducers,x=ie.call(g,d),S;x===-1?S=new w(g,d,m):S=g._observers[x];for(var O=l(v),I=O.length,me,se=typeof k=="function",te=0;te0;)b=m[g],(!d||b._target===d)&&(b.unsubscribe(p),v=!0);return v},E.prototype.delimiter=".",E.prototype.setMaxListeners=function(d){d!==r&&(this._maxListeners=d,this._conf||(this._conf={}),this._conf.maxListeners=d)},E.prototype.getMaxListeners=function(){return this._maxListeners},E.prototype.event="",E.prototype.once=function(d,p,m){return this._once(d,p,!1,m)},E.prototype.prependOnceListener=function(d,p,m){return this._once(d,p,!0,m)},E.prototype._once=function(d,p,m,g){return this._many(d,1,p,m,g)},E.prototype.many=function(d,p,m,g){return this._many(d,p,m,!1,g)},E.prototype.prependMany=function(d,p,m,g){return this._many(d,p,m,!0,g)},E.prototype._many=function(d,p,m,g,b){var v=this;if(typeof m!="function")throw new Error("many only accepts instances of Function");function k(){return--p===0&&v.off(d,k),m.apply(this,arguments)}return k._origin=m,this._on(d,k,g,b)},E.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||c.call(this);var d=arguments[0],p,m=this.wildcard,g,b,v,k,x;if(d==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(m&&(p=d,d!=="newListener"&&d!=="removeListener"&&typeof d=="object")){if(b=d.length,s){for(v=0;v3)for(g=new Array(S-1),k=1;k3)for(b=new Array(O-1),x=1;x0&&this._events[d].length>this._maxListeners&&(this._events[d].warned=!0,h.call(this,this._events[d].length,d))):this._events[d]=p,b)},E.prototype.off=function(d,p){if(typeof p!="function")throw new Error("removeListener only takes instances of Function");var m,g=[];if(this.wildcard){var b=typeof d=="string"?d.split(this.delimiter):d.slice();if(g=j.call(this,null,b,this.listenerTree,0),!g)return this}else{if(!this._events[d])return this;m=this._events[d],g.push({_listeners:m})}for(var v=0;v0){for(g=this._all,p=0,m=g.length;p0;)g=p[m[v]],typeof g=="function"?b.push(g):b.push.apply(b,g);return b}else{if(this.wildcard){if(k=this.listenerTree,!k)return[];var x=[],S=typeof d=="string"?d.split(this.delimiter):d.slice();return j.call(this,x,S,k,0),x}return p?(g=p[d],g?typeof g=="function"?[g]:g:[]):[]}},E.prototype.eventNames=function(d){var p=this._events;return this.wildcard?Ne.call(this,this.listenerTree,[],null,d):p?l(p):[]},E.prototype.listenerCount=function(d){return this.listeners(d).length},E.prototype.hasListeners=function(d){if(this.wildcard){var p=[],m=typeof d=="string"?d.split(this.delimiter):d.slice();return j.call(this,p,m,this.listenerTree,0),p.length>0}var g=this._events,b=this._all;return!!(b&&b.length||g&&(d===r?l(g).length:g[d]))},E.prototype.listenersAny=function(){return this._all?this._all:[]},E.prototype.waitFor=function(d,p){var m=this,g=typeof p;return g==="number"?p={timeout:p}:g==="function"&&(p={filter:p}),p=D(p,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:L,Promise:C}),z(p.Promise,function(b,v,k){function x(){var S=p.filter;if(!(S&&!S.apply(m,arguments)))if(m.off(d,x),p.handleError){var O=arguments[0];O?v(O):b(T.apply(null,arguments).slice(1))}else b(T.apply(null,arguments))}k(function(){m.off(d,x)}),m._on(d,x,!1)},{timeout:p.timeout,overload:p.overload})};function H(d,p,m){m=D(m,{Promise,timeout:0,overload:!1},{Promise:C});var g=m.Promise;return z(g,function(b,v,k){var x;if(typeof d.addEventListener=="function"){x=function(){b(T.apply(null,arguments))},k(function(){d.removeEventListener(p,x)}),d.addEventListener(p,x,{once:!0});return}var S=function(){O&&d.removeListener("error",O),b(T.apply(null,arguments))},O;p!=="error"&&(O=function(I){d.removeListener(p,S),v(I)},d.once("error",O)),k(function(){O&&d.removeListener("error",O),d.removeListener(p,S)}),d.once(p,S)},{timeout:m.timeout,overload:m.overload})}var P=E.prototype;if(Object.defineProperties(E,{defaultMaxListeners:{get:function(){return P._maxListeners},set:function(d){if(typeof d!="number"||d<0||Number.isNaN(d))throw TypeError("n must be a non-negative number");P._maxListeners=d},enumerable:!0},once:{value:H,writable:!0,configurable:!0}}),Object.defineProperties(P,{_maxListeners:{value:n,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define=="function"&&define.amd)define(function(){return E});else if(typeof Db=="object")xb.exports=E;else{var Z=new Function("","return this")();Z.EventEmitter2=E}})()});var r_=_(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});var e_=Symbol("MustacheDataPath");function Jb({target:r,propertyName:e}){return[...r[e_]||[],e]}function t_(r,e){return typeof r!="object"?r:new Proxy(r,{get(t,n){let i=t[n];if(i===void 0&&!(n in t)){let s=Jb({target:t,propertyName:n});if(e!=null&&e.handleError)return e.handleError(s),i;throw Error(`Missing Mustache data property: ${s.join(" > ")}`)}return i&&typeof i=="object"?(i[e_]=Jb({target:t,propertyName:n}),t_(i,e)):i}})}yp.default=t_});var Or=_(fr=>{"use strict";fr.__esModule=!0;fr.Tokens=fr.StructuralCharacters=fr.Operators=void 0;var dA;(function(r){r.AND="AND",r.OR="OR",r.XOR="XOR",r.NOT="NOT"})(dA=fr.Operators||(fr.Operators={}));var fA;(function(r){r.OPEN_PARENTHESIS="(",r.CLOSE_PARENTHESIS=")"})(fA=fr.StructuralCharacters||(fr.StructuralCharacters={}));var pA;(function(r){r.IDENTIFIER="IDENTIFIER",r.OPERATOR="OPERATOR",r.STRUCTURAL_CHARACTER="STRUCTURAL_CHARACTER",r.EOF="EOF",r.COMMENT="COMMENT"})(pA=fr.Tokens||(fr.Tokens={}))});var wp=_(Bi=>{"use strict";Bi.__esModule=!0;Bi.VALID_TOKENS=Bi.OPERATOR_PRECEDENCE=void 0;var Fe=Or();Bi.OPERATOR_PRECEDENCE={NOT:0,XOR:1,AND:2,OR:3};Bi.VALID_TOKENS={identifierOnly:[{name:Fe.Tokens.IDENTIFIER},{name:Fe.Tokens.STRUCTURAL_CHARACTER,value:Fe.StructuralCharacters.OPEN_PARENTHESIS}],identifierOrNot:[{name:Fe.Tokens.IDENTIFIER},{name:Fe.Tokens.STRUCTURAL_CHARACTER,value:Fe.StructuralCharacters.OPEN_PARENTHESIS},{name:Fe.Tokens.OPERATOR,value:Fe.Operators.NOT}],binaryOperator:[{name:Fe.Tokens.OPERATOR,value:Fe.Operators.AND},{name:Fe.Tokens.OPERATOR,value:Fe.Operators.OR},{name:Fe.Tokens.OPERATOR,value:Fe.Operators.XOR}],binaryOperatorOrClose:[{name:Fe.Tokens.OPERATOR,value:Fe.Operators.AND},{name:Fe.Tokens.OPERATOR,value:Fe.Operators.OR},{name:Fe.Tokens.OPERATOR,value:Fe.Operators.XOR},{name:Fe.Tokens.STRUCTURAL_CHARACTER,value:Fe.StructuralCharacters.CLOSE_PARENTHESIS}]}});var Ep=_(Tt=>{"use strict";Tt.__esModule=!0;Tt.ESCAPE_CHARACTER=Tt.EOL=Tt.COMMENT_DELIMITER=Tt.QUOTED_IDENTIFIER_DELIMITER=Tt.SEPARATORS=Tt.OPERATORS=Tt.STRUCTURAL_CHARACTERS=void 0;var Hi=Or();Tt.STRUCTURAL_CHARACTERS={"(":Hi.StructuralCharacters.OPEN_PARENTHESIS,")":Hi.StructuralCharacters.CLOSE_PARENTHESIS};Tt.OPERATORS={AND:Hi.Operators.AND,OR:Hi.Operators.OR,XOR:Hi.Operators.XOR,NOT:Hi.Operators.NOT};Tt.SEPARATORS=new Set([32,9,10,13].map(function(r){return String.fromCodePoint(r)}));Tt.QUOTED_IDENTIFIER_DELIMITER=String.fromCodePoint(34);Tt.COMMENT_DELIMITER=String.fromCodePoint(35);Tt.EOL=String.fromCodePoint(10);Tt.ESCAPE_CHARACTER=String.fromCodePoint(92)});var o_=_(er=>{"use strict";var kp=er&&er.__assign||function(){return kp=Object.assign||function(r){for(var e,t=1,n=arguments.length;t{"use strict";bu.__esModule=!0;bu.lex=void 0;var zi=Or(),Wt=Ep(),Vi=o_(),yA=function(r){for(var e=null,t=null,n=null,i=0;i{"use strict";var l_=qt&&qt.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n{"use strict";var Dr=Qi&&Qi.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n{"use strict";bt.__esModule=!0;bt.throwInvalidExpression=bt.isOperator=bt.isIdentifier=bt.notUtil=bt.xorUtil=bt.orUtil=bt.andUtil=void 0;var p_=Or(),kA=function(r,e){return r&&e};bt.andUtil=kA;var SA=function(r,e){return r||e};bt.orUtil=SA;var OA=function(r,e){return r!==e};bt.xorUtil=OA;var DA=function(r){return!r};bt.notUtil=DA;var xA=function(r){var e=r.name,t=r.value;return e===p_.Tokens.IDENTIFIER&&typeof t=="string"};bt.isIdentifier=xA;var RA=function(r){var e=r.name,t=r.value;return e===p_.Tokens.OPERATOR&&typeof t=="string"};bt.isOperator=RA;var MA=function(r){throw new TypeError("Invalid postfix expression: ".concat(r))};bt.throwInvalidExpression=MA});var h_=_(wu=>{"use strict";var Sa;wu.__esModule=!0;wu.OPERATOR_MAP=void 0;var xp=Or(),Rp=Dp();wu.OPERATOR_MAP=(Sa={},Sa[xp.Operators.AND]=Rp.andUtil,Sa[xp.Operators.OR]=Rp.orUtil,Sa[xp.Operators.XOR]=Rp.xorUtil,Sa)});var g_=_(Zr=>{"use strict";var Xi=Zr&&Zr.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n{"use strict";var Mp=xr&&xr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]});xr.__esModule=!0;xr.parse=xr.evaluate=xr.getEvaluator=void 0;var y_=g_();Mp(xr,y_,"getEvaluator");Mp(xr,y_,"evaluate");var IA=Op();Mp(xr,IA,"parse")});var rP={};pv(rP,{default:()=>ju});module.exports=hv(rP);var sv=require("obsidian");var Ci=require("obsidian");var iP=new Error("timeout while waiting for mutex to become available"),sP=new Error("mutex already locked"),mv=new Error("request for lock canceled"),gv=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(f){a(f)}}function u(c){try{l(n.throw(c))}catch(f){a(f)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},zu=class{constructor(e,t=mv){this._value=e,this._cancelError=t,this._weightedQueues=[],this._weightedWaiters=[]}acquire(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((t,n)=>{this._weightedQueues[e-1]||(this._weightedQueues[e-1]=[]),this._weightedQueues[e-1].push({resolve:t,reject:n}),this._dispatch()})}runExclusive(e,t=1){return gv(this,void 0,void 0,function*(){let[n,i]=yield this.acquire(t);try{return yield e(n)}finally{i()}})}waitForUnlock(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(t=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),this._weightedWaiters[e-1].push(t),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatch()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatch()}cancel(){this._weightedQueues.forEach(e=>e.forEach(t=>t.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var e;for(let t=this._value;t>0;t--){let n=(e=this._weightedQueues[t-1])===null||e===void 0?void 0:e.shift();if(!n)continue;let i=this._value,s=t;this._value-=t,t=this._value+1,n.resolve([i,this._newReleaser(s)])}this._drainUnlockWaiters()}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){for(let e=this._value;e>0;e--)!this._weightedWaiters[e-1]||(this._weightedWaiters[e-1].forEach(t=>t()),this._weightedWaiters[e-1]=[])}},yv=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(f){a(f)}}function u(c){try{l(n.throw(c))}catch(f){a(f)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},Wa=class{constructor(e){this._semaphore=new zu(1,e)}acquire(){return yv(this,void 0,void 0,function*(){let[,e]=yield this._semaphore.acquire();return e})}runExclusive(e){return this._semaphore.runExclusive(()=>e())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var Ao=as(Be());var Et=class{constructor(e,t){this.start=e,this.end=t,t.isBefore(e)&&(this.start=t,this.end=e),this.start=this.start.startOf("day"),this.end=this.end.startOf("day")}static buildRelative(e){let t=e==="week"?"isoWeek":e;return new Et(window.moment().startOf(t).startOf("day"),window.moment().endOf(t).startOf("day"))}static buildInvalid(){return new Et(window.moment.invalid(),window.moment.invalid())}isValid(){return this.start.isValid()&&this.end.isValid()}moveToPrevious(e){let t=window.moment.duration(1,e);this.start.subtract(t),this.end.subtract(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}moveToNext(e){let t=window.moment.duration(1,e);this.start.add(t),this.end.add(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}};var Nt=class{static parseDate(e,t=!1){return window.moment(Ao.parseDate(e,void 0,{forwardDate:t})).startOf("day")}static parseDateRange(e,t=!1){let n=[Nt.parseRelativeDateRange,Nt.parseNumberedDateRange,Nt.parseAbsoluteDateRange];for(let i of n){let s=i(e,t);if(s.isValid())return s}return Et.buildInvalid()}static parseAbsoluteDateRange(e,t){let n=Ao.parse(e,void 0,{forwardDate:t});if(n.length===0)return Et.buildInvalid();let i=n[0].start,s=n[1]&&n[1].start?n[1].start:i,a=window.moment(i.date()),o=window.moment(s.date());return new Et(a,o)}static parseRelativeDateRange(e,t){let n=/(last|this|next) (week|month|quarter|year)/,i=e.match(n);if(i&&i.length===3){let s=i[1],a=i[2],o=Et.buildRelative(a);switch(s){case"last":o.moveToPrevious(a);break;case"next":o.moveToNext(a);break}return o}return Et.buildInvalid()}static parseNumberedDateRange(e,t){let n=[[/^\s*[0-9]{4}\s*$/,"YYYY","year"],[/^\s*[0-9]{4}-Q[1-4]\s*$/,"YYYY-Q","quarter"],[/^\s*[0-9]{4}-[0-9]{2}\s*$/,"YYYY-MM","month"],[/^\s*[0-9]{4}-W[0-9]{2}\s*$/,"YYYY-WW","isoWeek"]];for(let[i,s,a]of n){let o=e.match(i);if(o){let u=o[0].trim();return new Et(window.moment(u,s).startOf(a),window.moment(u,s).endOf(a))}}return Et.buildInvalid()}};var IM={td:"today",tm:"tomorrow",yd:"yesterday",tw:"this week",nw:"next week",weekend:"sat",we:"sat"};function ki(r){for(let[e,t]of Object.entries(IM))r=r.replace(RegExp(`\\b${e}\\s`,"i"),t);return r}var Po=["MO","TU","WE","TH","FR","SA","SU"],Ge=function(){function r(e,t){if(t===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=t}return r.fromStr=function(e){return new r(Po.indexOf(e))},r.prototype.nth=function(e){return this.n===e?this:new r(this.weekday,e)},r.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},r.prototype.toString=function(){var e=Po[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},r.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},r}();var xe=function(r){return r!=null},It=function(r){return typeof r=="number"},Uf=function(r){return typeof r=="string"&&Po.includes(r)},ut=Array.isArray,Xt=function(r,e){e===void 0&&(e=r),arguments.length===1&&(e=r,r=0);for(var t=[],n=r;n>0,n.length>e?String(n):(e=e-n.length,e>t.length&&(t+=ce(t,e/t.length)),t.slice(0,e)+String(n))}var NT=function(r,e,t){var n=r.split(e);return t?n.slice(0,t).concat([n.slice(t).join(e)]):n},dt=function(r,e){var t=r%e;return t*e<0?t+e:t},No=function(r,e){return{div:Math.floor(r/e),mod:dt(r,e)}},Ft=function(r){return!xe(r)||r.length===0},We=function(r){return!Ft(r)},fe=function(r,e){return We(r)&&r.indexOf(e)!==-1};var vr=function(r,e,t,n,i,s){return n===void 0&&(n=0),i===void 0&&(i=0),s===void 0&&(s=0),new Date(Date.UTC(r,e-1,t,n,i,s))},FM=[31,28,31,30,31,30,31,31,30,31,30,31],LT=1e3*60*60*24,Io=9999,UT=vr(1970,1,1),LM=[6,0,1,2,3,4,5];var Si=function(r){return r%4===0&&r%100!==0||r%400===0},Wf=function(r){return r instanceof Date},Ln=function(r){return Wf(r)&&!isNaN(r.getTime())},IT=function(r){return r.getTimezoneOffset()*60*1e3},UM=function(r,e){var t=r.getTime()-IT(r),n=e.getTime()-IT(e),i=t-n;return Math.round(i/LT)},oa=function(r){return UM(r,UT)},Fo=function(r){return new Date(UT.getTime()+r*LT)},WM=function(r){var e=r.getUTCMonth();return e===1&&Si(r.getUTCFullYear())?29:FM[e]},qr=function(r){return LM[r.getUTCDay()]},qf=function(r,e){var t=vr(r,e+1,1);return[qr(t),WM(t)]},Lo=function(r,e){return e=e||r,new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},Uo=function(r){var e=new Date(r.getTime());return e},$f=function(r){for(var e=[],t=0;tthis.maxDate;if(this.method==="between"){if(t)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return t?!0:(this.add(e),!1);return this.add(e)},r.prototype.add=function(e){return this._result.push(e),!0},r.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":default:return e.length?e[e.length-1]:null}},r.prototype.clone=function(){return new r(this.method,this.args)},r}(),Yr=qM;var Yf=function(r,e){return Yf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Yf(r,e)};function Di(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Yf(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var lt=function(){return lt=Object.assign||function(e){for(var t,n=1,i=arguments.length;ne[0].length)&&(e=s,t=i)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(t==="SKIP");return this.symbol=t,this.value=e,!0},r.prototype.accept=function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},r.prototype.acceptNumber=function(){return this.accept("number")},r.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},r}();function la(r,e){e===void 0&&(e=Un);var t={},n=new HM(e.tokens);if(!n.start(r))return null;return i(),t;function i(){n.expect("every");var h=n.acceptNumber();if(h&&(t.interval=parseInt(h[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":t.freq=$.DAILY,n.nextSymbol()&&(a(),f());break;case"weekday(s)":t.freq=$.WEEKLY,t.byweekday=[$.MO,$.TU,$.WE,$.TH,$.FR],n.nextSymbol(),f();break;case"week(s)":t.freq=$.WEEKLY,n.nextSymbol()&&(s(),f());break;case"hour(s)":t.freq=$.HOURLY,n.nextSymbol()&&(s(),f());break;case"minute(s)":t.freq=$.MINUTELY,n.nextSymbol()&&(s(),f());break;case"month(s)":t.freq=$.MONTHLY,n.nextSymbol()&&(s(),f());break;case"year(s)":t.freq=$.YEARLY,n.nextSymbol()&&(s(),f());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=$.WEEKLY;var T=n.symbol.substr(0,2).toUpperCase();if(t.byweekday=[$[T]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var y=u();if(!y)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push($[y]),n.nextSymbol()}c(),f();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(t.freq=$.YEARLY,t.bymonth=[o()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var w=o();if(!w)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(w),n.nextSymbol()}s(),f();break;default:throw new Error("Unknown symbol")}}function s(){var h=n.accept("on"),T=n.accept("the");if(!!(h||T))do{var y=l(),w=u(),D=o();if(y)w?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push($[w].nth(y))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(y),n.accept("day(s)"));else if(w)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push($[w]);else if(n.symbol==="weekday(s)")n.nextSymbol(),t.byweekday||(t.byweekday=[$.MO,$.TU,$.WE,$.TH,$.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var C=n.acceptNumber();if(!C)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt(C[0],10)];n.accept("comma");){if(C=n.acceptNumber(),!C)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt(C[0],10))}}else if(D)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(D);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function a(){var h=n.accept("at");if(!!h)do{var T=n.acceptNumber();if(!T)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(t.byhour=[parseInt(T[0],10)];n.accept("comma");){if(T=n.acceptNumber(),!T)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");t.byhour.push(parseInt(T[0],10))}}while(n.accept("comma")||n.accept("at"))}function o(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function u(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function l(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var h=parseInt(n.value[1],10);if(h<-366||h>366)throw new Error("Nth out of range: "+h);return n.nextSymbol(),n.accept("last")?-h:h;default:return!1}}function c(){n.accept("on"),n.accept("the");var h=l();if(!!h)for(t.bymonthday=[h],n.nextSymbol();n.accept("comma");){if(h=l(),!h)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(h),n.nextSymbol()}}function f(){if(n.symbol==="until"){var h=Date.parse(n.text);if(!h)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(h)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}var ae;(function(r){r[r.YEARLY=0]="YEARLY",r[r.MONTHLY=1]="MONTHLY",r[r.WEEKLY=2]="WEEKLY",r[r.DAILY=3]="DAILY",r[r.HOURLY=4]="HOURLY",r[r.MINUTELY=5]="MINUTELY",r[r.SECONDLY=6]="SECONDLY"})(ae||(ae={}));function ca(r){return r12){var n=Math.floor(this.month/12),i=dt(this.month,12);this.month=i,this.year+=n,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+t*7:this.day+=-(this.getWeekday()-n)+t*7,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,n,i){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var s=No(this.hour,24),a=s.div,o=s.mod;if(a&&(this.hour=o,this.addDaily(a)),Ft(i)||fe(i,this.hour))break}},e.prototype.addMinutes=function(t,n,i,s){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/t)*t);;){this.minute+=t;var a=No(this.minute,60),o=a.div,u=a.mod;if(o&&(this.minute=u,this.addHours(o,!1,i)),(Ft(i)||fe(i,this.hour))&&(Ft(s)||fe(s,this.minute)))break}},e.prototype.addSeconds=function(t,n,i,s,a){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var o=No(this.second,60),u=o.div,l=o.mod;if(u&&(this.second=l,this.addMinutes(u,!1,i,s)),(Ft(i)||fe(i,this.hour))&&(Ft(s)||fe(s,this.minute))&&(Ft(a)||fe(a,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=qf(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,this.month===13&&(this.month=1,++this.year,this.year>Io))return;t=qf(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var i=t.freq,s=t.interval,a=t.wkst,o=t.byhour,u=t.byminute,l=t.bysecond;switch(i){case ae.YEARLY:return this.addYears(s);case ae.MONTHLY:return this.addMonths(s);case ae.WEEKLY:return this.addWeekly(s,a);case ae.DAILY:return this.addDaily(s);case ae.HOURLY:return this.addHours(s,n,o);case ae.MINUTELY:return this.addMinutes(s,n,o,u);case ae.SECONDLY:return this.addSeconds(s,n,o,u,l)}},e}(Ri);function Gf(r){for(var e=[],t=Object.keys(r),n=0,i=t;n=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||We(e.byweekno)||We(e.byyearday)||Boolean(e.bymonthday)||We(e.bymonthday)||xe(e.byweekday)||xe(e.byeaster)))switch(e.freq){case $.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case $.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case $.WEEKLY:e.byweekday=[qr(e.dtstart)];break}if(xe(e.bymonth)&&!ut(e.bymonth)&&(e.bymonth=[e.bymonth]),xe(e.byyearday)&&!ut(e.byyearday)&&It(e.byyearday)&&(e.byyearday=[e.byyearday]),!xe(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(ut(e.bymonthday)){for(var i=[],s=[],t=0;t0?i.push(n):n<0&&s.push(n)}e.bymonthday=i,e.bynmonthday=s}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(xe(e.byweekno)&&!ut(e.byweekno)&&(e.byweekno=[e.byweekno]),!xe(e.byweekday))e.bynweekday=null;else if(It(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(Uf(e.byweekday))e.byweekday=[Ge.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof Ge)!e.byweekday.n||e.freq>$.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var a=[],o=[],t=0;t$.MONTHLY?a.push(u.weekday):o.push([u.weekday,u.n])}e.byweekday=We(a)?a:null,e.bynweekday=We(o)?o:null}return xe(e.byhour)?It(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<$.HOURLY?[e.dtstart.getUTCHours()]:null,xe(e.byminute)?It(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<$.MINUTELY?[e.dtstart.getUTCMinutes()]:null,xe(e.bysecond)?It(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<$.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function HT(r){var e=r.dtstart.getTime()%1e3;if(!ca(r.freq))return[];var t=[];return r.byhour.forEach(function(n){r.byminute.forEach(function(i){r.bysecond.forEach(function(s){t.push(new Ri(n,i,s,e))})})}),t}function pa(r){var e=r.split(` +`).map(zM).filter(function(t){return t!==null});return lt(lt({},e[0]),e[1])}function fa(r){var e={},t=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(r);if(!t)return e;var n=t[1],i=t[2];return n&&(e.tzid=n),e.dtstart=ua(i),e}function zM(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return VT(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return VT(r);case"DTSTART":return fa(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function VT(r){var e=r.replace(/^RRULE:/i,""),t=fa(e),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(i){var s=i.split("="),a=s[0],o=s[1];switch(a.toUpperCase()){case"FREQ":t.freq=ae[o.toUpperCase()];break;case"WKST":t.wkst=Zt[o.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var u=VM(o),l=a.toLowerCase();t[l]=u;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=KM(o);break;case"DTSTART":case"TZID":var c=fa(r);t.tzid=c.tzid,t.dtstart=c.dtstart;break;case"UNTIL":t.until=ua(o);break;case"BYEASTER":t.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),t}function VM(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(KT)}return KT(r)}function KT(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function KM(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return Zt[t];var n=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!n||n.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var i=Number(n[1]),s=n[2],a=Zt[s].weekday;return new Ge(a,i)})}var Wn=function(){function r(e,t){if(isNaN(e.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=t}return Object.defineProperty(r.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),r.prototype.toString=function(){var e=Oi(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},r.prototype.getTime=function(){return this.date.getTime()},r.prototype.rezonedDate=function(){return this.isUTC?this.date:WT(this.date,this.tzid)},r}();function ha(r){for(var e=[],t="",n=Object.keys(r),i=Object.keys(da),s=0;s=4?(c=0,l=o.yearlen+dt(a-e.wkst,7)):l=n-c;for(var f=Math.floor(l/7),h=dt(l,7),T=Math.floor(f+h/4),y=0;y0&&w<=T){var D=void 0;w>1?(D=c+(w-1)*7,c!==u&&(D-=7-u)):D=c;for(var C=0;C<7&&(o.wnomask[D]=1,D++,o.wdaymask[D]!==e.wkst);C++);}}if(fe(e.byweekno,1)){var D=c+T*7;if(c!==u&&(D-=7-u),D=4?(oe=0,ie=z+dt(L-e.wkst,7)):ie=n-c,N=Math.floor(52+dt(ie,7)/4)}if(fe(e.byweekno,N))for(var D=0;Ds)return jr(r);if(N>=t){var L=cb(N,e);if(!r.accept(L)||o&&(--o,!o))return jr(r)}}else for(var C=T;Cs)return jr(r);if(N>=t){var L=cb(N,e);if(!r.accept(L)||o&&(--o,!o))return jr(r)}}}if(e.interval===0||(u.add(e,w),u.year>Io))return jr(r);ca(n)||(c=l.gettimeset(n)(u.hour,u.minute,u.second,0)),l.rebuild(u.year,u.month)}}function iC(r,e,t){var n=t.bymonth,i=t.byweekno,s=t.byweekday,a=t.byeaster,o=t.bymonthday,u=t.bynmonthday,l=t.byyearday;return We(n)&&!fe(n,r.mmask[e])||We(i)&&!r.wnomask[e]||We(s)&&!fe(s,r.wdaymask[e])||We(r.nwdaymask)&&!r.nwdaymask[e]||a!==null&&!fe(r.eastermask,e)||(We(o)||We(u))&&!fe(o,r.mdaymask[e])&&!fe(u,r.nmdaymask[e])||We(l)&&(e=r.yearlen&&!fe(l,e+1-r.yearlen)&&!fe(l,-r.nextyearlen+e-r.yearlen))}function cb(r,e){return new Wn(r,e.tzid).rezonedDate()}function jr(r){return r.getValue()}function sC(r,e,t,n,i){for(var s=!1,a=e;a=$.HOURLY&&We(i)&&!fe(i,e.hour)||n>=$.MINUTELY&&We(s)&&!fe(s,e.minute)||n>=$.SECONDLY&&We(a)&&!fe(a,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var Zt={MO:new Ge(0),TU:new Ge(1),WE:new Ge(2),TH:new Ge(3),FR:new Ge(4),SA:new Ge(5),SU:new Ge(6)},da={freq:ae.YEARLY,dtstart:null,interval:1,wkst:Zt.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},zT=Object.keys(da),$=function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new QT,this.origOptions=Gf(e);var n=BT(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return la(e,t)},r.fromText=function(e,t){return $T(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return Wo(e,this.options)},r.prototype._cacheGet=function(e,t){return this._cache?this._cache._cacheGet(e,t):!1},r.prototype._cacheAdd=function(e,t,n){if(!!this._cache)return this._cache._cacheAdd(e,t,n)},r.prototype.all=function(e){if(e)return this._iter(new jf("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new Yr("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,i){if(n===void 0&&(n=!1),!Ln(e)||!Ln(t))throw new Error("Invalid date passed in to RRule.between");var s={before:t,after:e,inc:n};if(i)return this._iter(new jf("between",s,i));var a=this._cacheGet("between",s);return a===!1&&(a=this._iter(new Yr("between",s)),this._cacheAdd("between",a,s)),a},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!Ln(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},i=this._cacheGet("before",n);return i===!1&&(i=this._iter(new Yr("before",n)),this._cacheAdd("before",i,n)),i},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!Ln(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},i=this._cacheGet("after",n);return i===!1&&(i=this._iter(new Yr("after",n)),this._cacheAdd("after",i,n)),i},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return ha(this.origOptions)},r.prototype.toText=function(e,t,n){return YT(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return jT(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=ae.YEARLY,r.MONTHLY=ae.MONTHLY,r.WEEKLY=ae.WEEKLY,r.DAILY=ae.DAILY,r.HOURLY=ae.HOURLY,r.MINUTELY=ae.MINUTELY,r.SECONDLY=ae.SECONDLY,r.MO=Zt.MO,r.TU=Zt.TU,r.WE=Zt.WE,r.TH=Zt.TH,r.FR=Zt.FR,r.SA=Zt.SA,r.SU=Zt.SU,r.parseString=pa,r.optionsToString=ha,r}();function db(r,e,t,n,i,s){var a={},o=r.accept;function u(h,T){t.forEach(function(y){y.between(h,T,!0).forEach(function(w){a[Number(w)]=!0})})}i.forEach(function(h){var T=new Wn(h,s).rezonedDate();a[Number(T)]=!0}),r.accept=function(h){var T=Number(h);return isNaN(T)?o.call(this,h):!a[T]&&(u(new Date(T-1),new Date(T+1)),!a[T])?(a[T]=!0,o.call(this,h)):!0},r.method==="between"&&(u(r.args.after,r.args.before),r.accept=function(h){var T=Number(h);return a[T]?!0:(a[T]=!0,o.call(this,h))});for(var l=0;l1||i.length||s.length||a.length){var c=new zf(l);return c.dtstart(o),c.tzid(u||void 0),n.forEach(function(h){c.rrule(new $(Hf(h,o,u),l))}),i.forEach(function(h){c.rdate(h)}),s.forEach(function(h){c.exrule(new $(Hf(h,o,u),l))}),a.forEach(function(h){c.exdate(h)}),e.compatible&&e.dtstart&&c.rdate(o),c}var f=n[0]||{};return new $(Hf(f,f.dtstart||e.dtstart||o,f.tzid||e.tzid||u),l)}function qo(r,e){return e===void 0&&(e={}),uC(r,lC(e))}function Hf(r,e,t){return lt(lt({},r),{dtstart:e,tzid:t})}function lC(r){var e=[],t=Object.keys(r),n=Object.keys(fb);if(t.forEach(function(i){fe(n,i)||e.push(i)}),e.length)throw new Error("Invalid options: "+e.join(", "));return lt(lt({},fb),r)}function cC(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=NT(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function dC(r){var e=cC(r),t=e.name,n=e.value,i=t.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:n}}function fC(r,e){if(e===void 0&&(e=!1),r=r&&r.trim(),!r)throw new Error("Invalid empty string");if(!e)return r.split(/\s/);for(var t=r.split(` +`),n=0;n0&&i[0]===" "?(t[n-1]+=i.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function pC(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function pb(r,e){return pC(e),r.split(",").map(function(t){return ua(t)})}function hb(r){var e=this;return function(t){if(t!==void 0&&(e["_".concat(r)]=t),e["_".concat(r)]!==void 0)return e["_".concat(r)];for(var n=0;nn}static nextAfterYears(e,t,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));Je.isSkippingTooManyYears(e,t,s);)t=Je.fromOneDayEarlier(e,n);return t}static isSkippingTooManyYears(e,t,n){return t.year()-e.year()>n}static fromOneDayEarlier(e,t){e.subtract(1,"days").endOf("day");let n=t.origOptions;return n.dtstart=e.startOf("day").toDate(),t=new $(n),window.moment(t.after(e.toDate()))}static addTimezone(e){return window.moment.utc(e).local(!0).startOf("day")}};function $o(r){return r.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")}var dn=class{constructor(){this._globalFilter="";this._removeGlobalFilter=!1}static getInstance(){return dn.instance||(dn.instance=new dn),dn.instance}get(){return this._globalFilter}set(e){this._globalFilter=e}reset(){this.set(dn.empty)}isEmpty(){return this.get()===dn.empty}equals(e){return this.get()===e}includedIn(e){let t=this.get();return e.includes(t)}prependTo(e){return this.get()+" "+e}removeAsWordFromDependingOnSettings(e){return this.getRemoveGlobalFilter()?this.removeAsWordFrom(e):e}getRemoveGlobalFilter(){return this._removeGlobalFilter}setRemoveGlobalFilter(e){this._removeGlobalFilter=e}removeAsWordFrom(e){if(this.isEmpty())return e;let t=RegExp("(^|\\s)"+$o(this.get())+"($|\\s)","ug");return e.search(t)>-1&&(e=e.replace(t,"$1$2").replace(" "," ").trim()),e}removeAsSubstringFrom(e){let t=this.get();return e.replace(t,"").trim()}},me=dn;me.empty="";var jf=5;function Bf(r,e){let t=[r.startDateSymbol,r.scheduledDateSymbol,r.dueDateSymbol].join("|");return(n,i,s)=>{let a=[];return a=a.concat(rC(n,i,s,t,e)),a=a.concat(nC(n,i,s,r.recurrenceSymbol)),a=a.concat(tC(n,i,s,r)),a.length>0&&!a.some(o=>o.suggestionType==="match")&&a.unshift({suggestionType:"empty",displayText:"\u23CE",appendText:` -`}),a=a.slice(0,s.autoSuggestMaxItems),a}}function tC(r,e,t,n){let i=u=>Object.values(n.prioritySymbols).some(l=>l.length>0&&u.includes(l)),s=[];if(r.includes(n.dueDateSymbol)||s.push({displayText:`${n.dueDateSymbol} due date`,appendText:`${n.dueDateSymbol} `}),r.includes(n.startDateSymbol)||s.push({displayText:`${n.startDateSymbol} start date`,appendText:`${n.startDateSymbol} `}),r.includes(n.scheduledDateSymbol)||s.push({displayText:`${n.scheduledDateSymbol} scheduled date`,appendText:`${n.scheduledDateSymbol} `}),i(r)||(s.push({displayText:`${n.prioritySymbols.High} high priority`,appendText:`${n.prioritySymbols.High} `}),s.push({displayText:`${n.prioritySymbols.Medium} medium priority`,appendText:`${n.prioritySymbols.Medium} `}),s.push({displayText:`${n.prioritySymbols.Low} low priority`,appendText:`${n.prioritySymbols.Low} `}),s.push({displayText:`${n.prioritySymbols.Highest} highest priority`,appendText:`${n.prioritySymbols.Highest} `}),s.push({displayText:`${n.prioritySymbols.Lowest} lowest priority`,appendText:`${n.prioritySymbols.Lowest} `})),r.includes(n.recurrenceSymbol)||s.push({displayText:`${n.recurrenceSymbol} recurring (repeat)`,appendText:`${n.recurrenceSymbol} `}),!r.includes(n.createdDateSymbol)){let l=Nt.parseDate("today",!0).format(V.dateFormat);s.push({textToMatch:`${n.createdDateSymbol} created`,displayText:`${n.createdDateSymbol} created today (${l})`,appendText:`${n.createdDateSymbol} ${l} `})}let a=Hf(r,/([a-zA-Z'_-]*)/g,e),o=[];if(a&&a.length>0){let u=a[0];if(u.length>=Math.max(1,t.autoSuggestMinMatch)){let l=s.filter(c=>(c.textToMatch||c.displayText).toLowerCase().includes(u.toLowerCase()));for(let c of l)o.push({suggestionType:"match",displayText:c.displayText,appendText:c.appendText,insertAt:a.index,insertSkip:u.length})}}return o.length===0&&t.autoSuggestMinMatch===0?s:o}function rC(r,e,t,n,i){let s=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],a=[],o=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),u=Hf(r,o,e);if(u&&u.length>=2){let l=u[1],c=u[2];if(c.length1?Nt.parseDate(wi(c),!0):null;p&&p.isValid()&&a.push({displayText:`${p.format(V.dateFormat)}`,appendText:`${l} ${p.format(V.dateFormat)} `,insertAt:u.index,insertSkip:u[0].length});let h=1,_=s.filter(y=>c&&c.length>=h&&y.toLowerCase().includes(c.toLowerCase())).slice(0,i);_.length===0&&(_=s.slice(0,i));for(let y of _){let R=`${Nt.parseDate(y,!0).format(V.dateFormat)}`;a.push({suggestionType:"match",displayText:`${y} (${R})`,appendText:`${l} ${R} `,insertAt:u.index,insertSkip:u[0].length})}}return a}function nC(r,e,t,n){var u;let i=["every","every day","every week","every month","every month on the","every year","every week on Sunday","every week on Monday","every week on Tuesday","every week on Wednesday","every week on Thursday","every week on Friday","every week on Saturday"],s=[],a=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),o=Hf(r,a,e);if(o&&o.length>=2){let l=o[1],c=o[2];if(c.length0){let y=(u=Je.fromText({recurrenceRuleText:c,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:u.toText();if(y){let w=`${l} ${y} `;if(s.push({suggestionType:"match",displayText:`\u2705 ${y}`,appendText:w,insertAt:o.index,insertSkip:o[0].length}),o[0]==w)return[]}}let p=1,h=t.autoSuggestMaxItems/2,_=i.filter(y=>c&&c.length>=p&&y.toLowerCase().includes(c.toLowerCase())).slice(0,h);_.length===0&&c.trim().length===0&&(_=i.slice(0,h));for(let y of _)s.push({suggestionType:"match",displayText:`${y}`,appendText:`${l} ${y} `,insertAt:o.index,insertSkip:o[0].length})}return s}function Hf(r,e,t){let n=r.matchAll(e);for(let i of n)if((i==null?void 0:i.index)&&i.index<=t&&t<=i.index+i[0].length)return i}function iC(r,e){if(e.length===0)return!1;let t=Object.fromEntries(e.map(([i,s])=>[i,0])),n=Object.fromEntries(e.map(([i,s])=>[s,i]));for(let i of r)i in t?t[i]++:i in n&&(t[n[i]]=Math.max(0,t[n[i]]-1));return Object.values(t).some(i=>i>0)}function pT(r,e){return(t,n,i)=>iC(t.slice(0,n),e)?r(t,n,i):[]}function hT(r,e){return me.getInstance().includedIn(r)&&sC(r,e)}function sC(r,e){if(r.length===0)return!1;let t=ge.extractTaskComponents(r);if(!t)return!1;let n=t.indentation+t.listMarker+" ["+t.status.symbol+"] ";return e>=n.length}var Wn=class{constructor(){this.hideTaskCount=!1;this.hideBacklinks=!1;this.hidePriority=!1;this.hideCreatedDate=!1;this.hideStartDate=!1;this.hideScheduledDate=!1;this.hideDoneDate=!1;this.hideDueDate=!1;this.hideRecurrenceRule=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.hideTags=!1;this.shortMode=!1;this.explainQuery=!1}},fn=class{constructor(e){this.defaultLayout=["description","priority","recurrenceRule","createdDate","startDate","scheduledDate","dueDate","doneDate","blockLink"];this.hiddenTaskLayoutComponents=[];this.taskListHiddenClasses=[];e?this.options=e:this.options=new Wn,this.shownTaskLayoutComponents=this.defaultLayout,this.applyOptions()}applyOptions(){let e=[[this.options.hidePriority,"priority"],[this.options.hideRecurrenceRule,"recurrenceRule"],[this.options.hideCreatedDate,"createdDate"],[this.options.hideStartDate,"startDate"],[this.options.hideScheduledDate,"scheduledDate"],[this.options.hideDueDate,"dueDate"],[this.options.hideDoneDate,"doneDate"]];for(let[n,i]of e)this.hideComponent(n,i),this.generateHiddenClassForTaskList(n,i);let t=[[this.options.hideTags,"tags"],[this.options.hideUrgency,"urgency"],[this.options.hideBacklinks,"backlinks"],[this.options.hideEditButton,"edit-button"]];for(let[n,i]of t)this.generateHiddenClassForTaskList(n,i);this.options.shortMode&&this.taskListHiddenClasses.push("tasks-layout-short-mode")}generateHiddenClassForTaskList(e,t){e&&this.taskListHiddenClasses.push(`tasks-layout-hide-${t}`)}hideComponent(e,t){e&&(this.hiddenTaskLayoutComponents.push(t),this.shownTaskLayoutComponents=this.shownTaskLayoutComponents.filter(n=>n!=t))}};var zf={prioritySymbols:{Highest:"\u{1F53A}",High:"\u23EB",Medium:"\u{1F53C}",Low:"\u{1F53D}",Lowest:"\u23EC",None:""},startDateSymbol:"\u{1F6EB}",createdDateSymbol:"\u2795",scheduledDateSymbol:"\u23F3",dueDateSymbol:"\u{1F4C5}",doneDateSymbol:"\u2705",recurrenceSymbol:"\u{1F501}",TaskFormatRegularExpressions:{priorityRegex:/([🔺⏫🔼🔽⏬])$/u,startDateRegex:/🛫 *(\d{4}-\d{2}-\d{2})$/u,createdDateRegex:/➕ *(\d{4}-\d{2}-\d{2})$/u,scheduledDateRegex:/[⏳⌛] *(\d{4}-\d{2}-\d{2})$/u,dueDateRegex:/[📅📆🗓] *(\d{4}-\d{2}-\d{2})$/u,doneDateRegex:/✅ *(\d{4}-\d{2}-\d{2})$/u,recurrenceRegex:/🔁 ?([a-zA-Z0-9, !]+)$/iu}},qn=class{constructor(e){this.symbols=e}serialize(e){let t=new fn,n="";for(let i of t.shownTaskLayoutComponents)n+=this.componentToString(e,t,i);return n}componentToString(e,t,n){var p;let{prioritySymbols:i,startDateSymbol:s,createdDateSymbol:a,scheduledDateSymbol:o,doneDateSymbol:u,recurrenceSymbol:l,dueDateSymbol:c}=this.symbols;switch(n){case"description":return e.description;case"priority":{let h="";return e.priority==="0"?h=" "+i.Highest:e.priority==="1"?h=" "+i.High:e.priority==="2"?h=" "+i.Medium:e.priority==="4"?h=" "+i.Low:e.priority==="5"&&(h=" "+i.Lowest),h}case"startDate":return e.startDate?t.options.shortMode?" "+s:` ${s} ${e.startDate.format(V.dateFormat)}`:"";case"createdDate":return e.createdDate?t.options.shortMode?" "+a:` ${a} ${e.createdDate.format(V.dateFormat)}`:"";case"scheduledDate":return!e.scheduledDate||e.scheduledDateIsInferred?"":t.options.shortMode?" "+o:` ${o} ${e.scheduledDate.format(V.dateFormat)}`;case"doneDate":return e.doneDate?t.options.shortMode?" "+u:` ${u} ${e.doneDate.format(V.dateFormat)}`:"";case"dueDate":return e.dueDate?t.options.shortMode?" "+c:` ${c} ${e.dueDate.format(V.dateFormat)}`:"";case"recurrenceRule":return e.recurrence?t.options.shortMode?" "+l:` ${l} ${e.recurrence.toText()}`:"";case"blockLink":return(p=e.blockLink)!=null?p:"";default:throw new Error(`Don't know how to render task component of type '${n}'`)}}parsePriority(e){let{prioritySymbols:t}=this.symbols;switch(e){case t.Lowest:return"5";case t.Low:return"4";case t.Medium:return"2";case t.High:return"1";case t.Highest:return"0";default:return"3"}}deserialize(e){let{TaskFormatRegularExpressions:t}=this.symbols,n,i="3",s=null,a=null,o=null,u=null,l=null,c="",p=null,h="",_=20,y=0;do{n=!1;let w=e.match(t.priorityRegex);w!==null&&(i=this.parsePriority(w[1]),e=e.replace(t.priorityRegex,"").trim(),n=!0);let R=e.match(t.doneDateRegex);R!==null&&(u=window.moment(R[1],V.dateFormat),e=e.replace(t.doneDateRegex,"").trim(),n=!0);let C=e.match(t.dueDateRegex);C!==null&&(o=window.moment(C[1],V.dateFormat),e=e.replace(t.dueDateRegex,"").trim(),n=!0);let N=e.match(t.scheduledDateRegex);N!==null&&(a=window.moment(N[1],V.dateFormat),e=e.replace(t.scheduledDateRegex,"").trim(),n=!0);let F=e.match(t.startDateRegex);F!==null&&(s=window.moment(F[1],V.dateFormat),e=e.replace(t.startDateRegex,"").trim(),n=!0);let oe=e.match(t.createdDateRegex);oe!==null&&(l=window.moment(oe[1],V.dateFormat),e=e.replace(t.createdDateRegex,"").trim(),n=!0);let z=e.match(t.recurrenceRegex);z!==null&&(c=z[1].trim(),e=e.replace(t.recurrenceRegex,"").trim(),n=!0);let ie=e.match(V.hashTagsFromEnd);if(ie!=null){e=e.replace(V.hashTagsFromEnd,"").trim(),n=!0;let G=ie[0].trim();h=h.length>0?[G,h].join(" "):G}y++}while(n&&y<=_);return c.length>0&&(p=Je.fromText({recurrenceRuleText:c,startDate:s,scheduledDate:a,dueDate:o})),h.length>0&&(e+=" "+h),{description:e,priority:i,startDate:s,createdDate:l,scheduledDate:a,dueDate:o,doneDate:u,recurrence:p,tags:ge.extractHashtags(e)}}};function $n(r){let e=["(?:",/(?=[^\]]+\])\[/,"|",/(?=[^)]+\))\(/,")",/ */,r,/ */,/[)\]]/,/(?: *,)?/,/$/].map(t=>t instanceof RegExp?t.source:t).join("");return new RegExp(e,r.flags)}var Vf={prioritySymbols:{Highest:"priority:: highest",High:"priority:: high",Medium:"priority:: medium",Low:"priority:: low",Lowest:"priority:: lowest",None:""},startDateSymbol:"start::",createdDateSymbol:"created::",scheduledDateSymbol:"scheduled::",dueDateSymbol:"due::",doneDateSymbol:"completion::",recurrenceSymbol:"repeat::",TaskFormatRegularExpressions:{priorityRegex:$n(/priority:: *(highest|high|medium|low|lowest)/),startDateRegex:$n(/start:: *(\d{4}-\d{2}-\d{2})/),createdDateRegex:$n(/created:: *(\d{4}-\d{2}-\d{2})/),scheduledDateRegex:$n(/scheduled:: *(\d{4}-\d{2}-\d{2})/),dueDateRegex:$n(/due:: *(\d{4}-\d{2}-\d{2})/),doneDateRegex:$n(/completion:: *(\d{4}-\d{2}-\d{2})/),recurrenceRegex:$n(/repeat:: *([a-zA-Z0-9, !]+)/)}},Yo=class extends qn{constructor(){super(Vf)}parsePriority(e){switch(e){case"highest":return"0";case"high":return"1";case"medium":return"2";case"low":return"4";case"lowest":return"5";default:return"3"}}componentToString(e,t,n){let i=super.componentToString(e,t,n);return i!==""&&!["blockLink","description"].includes(n)?` [${i.trim()}]`:i}};var Lt=(a=>(a.TODO="TODO",a.DONE="DONE",a.IN_PROGRESS="IN_PROGRESS",a.CANCELLED="CANCELLED",a.NON_TASK="NON_TASK",a.EMPTY="EMPTY",a))(Lt||{}),et=class{constructor(e,t,n,i,s="TODO"){this.symbol=e,this.name=t,this.nextStatusSymbol=n,this.availableAsCommand=i,this.type=s}};var Rt=class{get symbol(){return this.configuration.symbol}get name(){return this.configuration.name}get nextStatusSymbol(){return this.configuration.nextStatusSymbol}get nextSymbol(){return this.configuration.nextStatusSymbol}get availableAsCommand(){return this.configuration.availableAsCommand}get type(){return this.configuration.type}get typeGroupText(){let e=this.type,t;switch(e){case"IN_PROGRESS":t="1";break;case"TODO":t="2";break;case"DONE":t="3";break;case"CANCELLED":t="4";break;case"NON_TASK":t="5";break;case"EMPTY":t="6";break}return`%%${t}%%${e}`}constructor(e){this.configuration=e}static makeDone(){return new Rt(new et("x","Done"," ",!0,"DONE"))}static makeEmpty(){return new Rt(new et("","EMPTY","",!0,"EMPTY"))}static makeTodo(){return new Rt(new et(" ","Todo","x",!0,"TODO"))}static makeCancelled(){return new Rt(new et("-","Cancelled"," ",!0,"CANCELLED"))}static makeInProgress(){return new Rt(new et("/","In Progress","x",!0,"IN_PROGRESS"))}static getTypeForUnknownSymbol(e){switch(e){case"x":case"X":return"DONE";case"/":return"IN_PROGRESS";case"-":return"CANCELLED";case"":return"EMPTY";case" ":default:return"TODO"}}static getTypeFromStatusTypeString(e){return Lt[e]||"TODO"}static createUnknownStatus(e){return new Rt(new et(e,"Unknown","x",!1,"TODO"))}static createFromImportedValue(e){let t=e[0],n=Rt.getTypeFromStatusTypeString(e[3]);return new Rt(new et(t,e[1],e[2],!1,n))}isCompleted(){return this.type==="DONE"}identicalTo(e){let t=["symbol","name","nextStatusSymbol","availableAsCommand","type"];for(let n of t)if(this[n]!==e[n])return!1;return!0}previewText(){let e="";return Rt.tasksPluginCanCreateCommandsForStatuses()&&this.availableAsCommand&&(e=" Available as a command."),`- [${this.symbol}] => [${this.nextStatusSymbol}], name: '${this.name}', type: '${this.configuration.type}'.${e}`}static tasksPluginCanCreateCommandsForStatuses(){return!1}},X=Rt;X.DONE=Rt.makeDone(),X.EMPTY=Rt.makeEmpty(),X.TODO=Rt.makeTodo();var Go=class{constructor(e=!1,t=!1){this.ignoreSortInstructions=e,this.showTaskHiddenData=t}};var Ie=class{constructor(){this.coreStatuses=[X.makeTodo().configuration,X.makeDone().configuration],this.customStatuses=[X.makeInProgress().configuration,X.makeCancelled().configuration]}static addStatus(e,t){e.push(t)}static replaceStatus(e,t,n){let i=this.findStatusIndex(t,e);return i<=-1?!1:(e.splice(i,1,n),!0)}static findStatusIndex(e,t){let n=new X(e);return t.findIndex(i=>new X(i).previewText()==n.previewText())}static deleteStatus(e,t){let n=this.findStatusIndex(t,e);return n<=-1?!1:(e.splice(n,1),!0)}static deleteAllCustomStatuses(e){e.customStatuses.splice(0)}static resetAllCustomStatuses(e){Ie.deleteAllCustomStatuses(e),new Ie().customStatuses.forEach(n=>{Ie.addStatus(e.customStatuses,n)})}static bulkAddStatusCollection(e,t){let n=[];return t.forEach(i=>{e.customStatuses.find(a=>a.symbol==i[0]&&a.name==i[1]&&a.nextStatusSymbol==i[2])?n.push(`The status ${i[1]} (${i[0]}) is already added.`):Ie.addStatus(e.customStatuses,X.createFromImportedValue(i))}),n}static allStatuses(e){return e.coreStatuses.concat(e.customStatuses)}static applyToStatusRegistry(e,t){t.clearStatuses(),Ie.allStatuses(e).forEach(n=>{t.add(n)})}};var mT=[{index:9999,internalName:"INTERNAL_TESTING_ENABLED_BY_DEFAULT",displayName:"Test Item. Used to validate the Feature Framework.",description:"Description",enabledByDefault:!0,stable:!1}];var jr=class{constructor(e,t,n,i,s,a){this.internalName=e;this.index=t;this.description=n;this.displayName=i;this.enabledByDefault=s;this.stable=a}static get values(){let e=[];return mT.forEach(t=>{e=[...e,new jr(t.internalName,t.index,t.description,t.displayName,t.enabledByDefault,t.stable)]}),e}static get settingsFlags(){let e={};return jr.values.forEach(t=>{e[t.internalName]=t.enabledByDefault}),e}static fromString(e){for(let t of jr.values)if(e===t.internalName)return t;throw new RangeError(`Illegal argument passed to fromString(): ${e} does not correspond to any available Feature ${this.prototype.constructor.name}`)}};var Br={tasksPluginEmoji:{displayName:"Tasks Emoji Format",taskSerializer:new qn(zf),buildSuggestions:Bf(zf,jf)},dataview:{displayName:"Dataview",taskSerializer:new Yo,buildSuggestions:pT(Bf(Vf,jf),[["(",")"],["[","]"]])}},yT={globalQuery:"",globalFilter:"",removeGlobalFilter:!1,taskFormat:"tasksPluginEmoji",setCreatedDate:!1,setDoneDate:!0,autoSuggestInEditor:!0,autoSuggestMinMatch:0,autoSuggestMaxItems:6,provideAccessKeys:!0,useFilenameAsScheduledDate:!1,filenameAsDateFolders:[],recurrenceOnNextLine:!1,statusSettings:new Ie,features:jr.settingsFlags,generalSettings:{},headingOpened:{},debugSettings:new Go,loggingOptions:{minLevels:{"":"info",tasks:"info","tasks.Cache":"info","tasks.Events":"info","tasks.File":"info","tasks.Query":"info","tasks.Task":"info"}}},pn=De({},yT);function gT(r,e){for(let t in r)e[t]===void 0&&(e[t]=r[t])}var Q=()=>(gT(jr.settingsFlags,pn.features),gT(yT.loggingOptions.minLevels,pn.loggingOptions.minLevels),pn.statusSettings.customStatuses.forEach((r,e,t)=>{var i,s;let n=X.getTypeFromStatusTypeString(r.type);t[e]=new et((i=r.symbol)!=null?i:" ",r.name,(s=r.nextStatusSymbol)!=null?s:"x",r.availableAsCommand,n)}),De({},pn)),tt=r=>(pn=De(De({},pn),r),Q());var Yn=(r,e)=>(pn.generalSettings[r]=e,Q()),bT=r=>{var e;return(e=pn.features[r])!=null?e:!1};function ma(){return Br[Q().taskFormat]}function jo(r){let t={"<":"<",">":">","&":"&",'"':"""}[r];return t!==void 0?t:r}function TT(r){let e=[...r],t="";return e.forEach(n=>{t+=jo(n)}),t}var Se=class{constructor(){this._registeredStatuses=[];this.addDefaultStatusTypes()}set(e){this.clearStatuses(),e.forEach(t=>{this.add(t)})}get registeredStatuses(){return this._registeredStatuses.filter(({symbol:e})=>e!==X.EMPTY.symbol)}static getInstance(){return Se.instance||(Se.instance=new Se),Se.instance}add(e){this.hasSymbol(e.symbol)||(e instanceof X?this._registeredStatuses.push(e):this._registeredStatuses.push(new X(e)))}bySymbol(e){return this.hasSymbol(e)?this.getSymbol(e):X.EMPTY}bySymbolOrCreate(e){return this.hasSymbol(e)?this.getSymbol(e):X.createUnknownStatus(e)}byName(e){return this._registeredStatuses.filter(({name:t})=>t===e).length>0?this._registeredStatuses.filter(({name:t})=>t===e)[0]:X.EMPTY}resetToDefaultStatuses(){this.clearStatuses(),this.addDefaultStatusTypes()}clearStatuses(){this._registeredStatuses=[]}getNextStatus(e){if(e.nextStatusSymbol!==""){let t=this.bySymbol(e.nextStatusSymbol);if(t!==null)return t}return X.EMPTY}getNextStatusOrCreate(e){let t=this.getNextStatus(e);return t.type!=="EMPTY"?t:X.createUnknownStatus(e.nextStatusSymbol)}findUnknownStatuses(e){let t=e.filter(s=>!this.hasSymbol(s.symbol)),n=new Se,i=[];return t.forEach(s=>{if(n.hasSymbol(s.symbol))return;let a=Se.copyStatusWithNewName(s,`Unknown (${s.symbol})`);i.push(a),n.add(a)}),i.sort((s,a)=>s.symbol.localeCompare(a.symbol,void 0,{numeric:!0}))}static copyStatusWithNewName(e,t){let n=new et(e.symbol,t,e.nextStatusSymbol,e.availableAsCommand,e.type);return new X(n)}getSymbol(e){return this._registeredStatuses.filter(({symbol:t})=>t===e)[0]}hasSymbol(e){return this._registeredStatuses.find(t=>t.symbol===e)!==void 0}addDefaultStatusTypes(){[X.makeTodo(),X.makeInProgress(),X.makeDone(),X.makeCancelled()].forEach(t=>{this.add(t)})}mermaidDiagram(e=!1){let t=this.registeredStatuses,n="mermaid",i=[],s=[];return t.forEach((a,o)=>{let u=this.getMermaidNodeLabel(a,e);i.push(`${o+1}${u}`);let l=this.getNextStatus(a),c=t.findIndex(_=>_.symbol===l.symbol),p=c!==-1,h=l.type!=="EMPTY";p&&h&&s.push(`${o+1} --> ${c+1}`)}),` +`).map(function(i){return i.replace(/^RRULE:/,"EXRULE:")}).filter(function(i){return!/^DTSTART/.test(i)}))}),this._rdate.length&&t.push(yb("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(yb("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join(` +`)},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach(function(n){return t.rrule(n.clone())}),this._exrule.forEach(function(n){return t.exrule(n.clone())}),this._rdate.forEach(function(n){return t.rdate(new Date(n.getTime()))}),this._exdate.forEach(function(n){return t.exdate(new Date(n.getTime()))}),t},e}($);function mb(r,e){if(!(r instanceof $))throw new TypeError(String(r)+" is not RRule instance");fe(e.map(String),String(r))||e.push(r)}function gb(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");fe(e.map(Number),Number(r))||(e.push(r),$r(e))}function yb(r,e,t){var n=!t||t.toUpperCase()==="UTC",i=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),s=e.map(function(a){return Oi(a.valueOf(),n)}).join(",");return"".concat(i).concat(s)}function Gr(r,e){return r!==null&&e===null?-1:r===null&&e!==null?1:r!==null&&e!==null?r.isValid()&&!e.isValid()?-1:!r.isValid()&&e.isValid()||r.isAfter(e)?1:r.isBefore(e)?-1:0:0}var et=class{constructor({rrule:e,baseOnToday:t,referenceDate:n,startDate:i,scheduledDate:s,dueDate:a}){this.rrule=e,this.baseOnToday=t,this.referenceDate=n,this.startDate=i,this.scheduledDate=s,this.dueDate=a}static fromText({recurrenceRuleText:e,startDate:t,scheduledDate:n,dueDate:i}){try{let s=e.match(/^([a-zA-Z0-9, !]+?)( when done)?$/i);if(s==null)return null;let a=s[1].trim(),o=s[2]!==void 0,u=$.parseText(a);if(u!==null){let l=null;i?l=window.moment(i):n?l=window.moment(n):t&&(l=window.moment(t)),!o&&l!==null?u.dtstart=window.moment(l).startOf("day").utc(!0).toDate():u.dtstart=window.moment().startOf("day").utc(!0).toDate();let c=new $(u);return new et({rrule:c,baseOnToday:o,referenceDate:l,startDate:t,scheduledDate:n,dueDate:i})}}catch(s){s instanceof Error&&console.log(s.message)}return null}toText(){let e=this.rrule.toText();return this.baseOnToday&&(e+=" when done"),e}next(){let e=this.nextReferenceDate();if(e!==null){let t=null,n=null,i=null;if(this.referenceDate){if(this.startDate){let s=window.moment.duration(this.startDate.diff(this.referenceDate));t=window.moment(e),t.add(Math.round(s.asDays()),"days")}if(this.scheduledDate){let s=window.moment.duration(this.scheduledDate.diff(this.referenceDate));n=window.moment(e),n.add(Math.round(s.asDays()),"days")}if(this.dueDate){let s=window.moment.duration(this.dueDate.diff(this.referenceDate));i=window.moment(e),i.add(Math.round(s.asDays()),"days")}}return{startDate:t,scheduledDate:n,dueDate:i}}return null}identicalTo(e){return this.baseOnToday!==e.baseOnToday||Gr(this.startDate,e.startDate)!==0||Gr(this.scheduledDate,e.scheduledDate)!==0||Gr(this.dueDate,e.dueDate)!==0?!1:this.toText()===e.toText()}nextReferenceDate(){if(this.baseOnToday){let e=window.moment();return this.nextReferenceDateFromToday(e).toDate()}else return this.nextReferenceDateFromOriginalReferenceDate().toDate()}nextReferenceDateFromToday(e){let t=new $(it(we({},this.rrule.origOptions),{dtstart:e.startOf("day").utc(!0).toDate()}));return this.nextAfter(e.endOf("day"),t)}nextReferenceDateFromOriginalReferenceDate(){var t;let e=window.moment((t=this.referenceDate)!=null?t:void 0).endOf("day");return this.nextAfter(e,this.rrule)}nextAfter(e,t){e.utc(!0);let n=window.moment(t.after(e.toDate())),i=this.toText(),s=i.match(/every( \d+)? month(s)?(.*)?/);s!==null&&(i.includes(" on ")||(n=et.nextAfterMonths(e,n,t,s[1])));let a=i.match(/every( \d+)? year(s)?(.*)?/);return a!==null&&(n=et.nextAfterYears(e,n,t,a[1])),et.addTimezone(n)}static nextAfterMonths(e,t,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));et.isSkippingTooManyMonths(e,t,s);)t=et.fromOneDayEarlier(e,n);return t}static isSkippingTooManyMonths(e,t,n){let i=t.month()-e.month();return i+=(t.year()-e.year())*12,i>n}static nextAfterYears(e,t,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));et.isSkippingTooManyYears(e,t,s);)t=et.fromOneDayEarlier(e,n);return t}static isSkippingTooManyYears(e,t,n){return t.year()-e.year()>n}static fromOneDayEarlier(e,t){e.subtract(1,"days").endOf("day");let n=t.origOptions;return n.dtstart=e.startOf("day").toDate(),t=new $(n),window.moment(t.after(e.toDate()))}static addTimezone(e){return window.moment.utc(e).local(!0).startOf("day")}};function $o(r){return r.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")}var fn=class{constructor(){this._globalFilter="";this._removeGlobalFilter=!1}static getInstance(){return fn.instance||(fn.instance=new fn),fn.instance}get(){return this._globalFilter}set(e){this._globalFilter=e}reset(){this.set(fn.empty)}isEmpty(){return this.get()===fn.empty}equals(e){return this.get()===e}includedIn(e){let t=this.get();return e.includes(t)}prependTo(e){return this.get()+" "+e}removeAsWordFromDependingOnSettings(e){return this.getRemoveGlobalFilter()?this.removeAsWordFrom(e):e}getRemoveGlobalFilter(){return this._removeGlobalFilter}setRemoveGlobalFilter(e){this._removeGlobalFilter=e}removeAsWordFrom(e){if(this.isEmpty())return e;let t=RegExp("(^|\\s)"+$o(this.get())+"($|\\s)","ug");return e.search(t)>-1&&(e=e.replace(t,"$1$2").replace(" "," ").trim()),e}removeAsSubstringFrom(e){let t=this.get();return e.replace(t,"").trim()}},ge=fn;ge.empty="";var Vf=5;function Kf(r,e){let t=[r.startDateSymbol,r.scheduledDateSymbol,r.dueDateSymbol].join("|");return(n,i,s)=>{let a=[];return a=a.concat(mC(n,i,s,t,e)),a=a.concat(gC(n,i,s,r.recurrenceSymbol)),a=a.concat(hC(n,i,s,r)),a.length>0&&!a.some(o=>o.suggestionType==="match")&&a.unshift({suggestionType:"empty",displayText:"\u23CE",appendText:` +`}),a=a.slice(0,s.autoSuggestMaxItems),a}}function hC(r,e,t,n){let i=u=>Object.values(n.prioritySymbols).some(l=>l.length>0&&u.includes(l)),s=[];if(r.includes(n.dueDateSymbol)||s.push({displayText:`${n.dueDateSymbol} due date`,appendText:`${n.dueDateSymbol} `}),r.includes(n.startDateSymbol)||s.push({displayText:`${n.startDateSymbol} start date`,appendText:`${n.startDateSymbol} `}),r.includes(n.scheduledDateSymbol)||s.push({displayText:`${n.scheduledDateSymbol} scheduled date`,appendText:`${n.scheduledDateSymbol} `}),i(r)||(s.push({displayText:`${n.prioritySymbols.High} high priority`,appendText:`${n.prioritySymbols.High} `}),s.push({displayText:`${n.prioritySymbols.Medium} medium priority`,appendText:`${n.prioritySymbols.Medium} `}),s.push({displayText:`${n.prioritySymbols.Low} low priority`,appendText:`${n.prioritySymbols.Low} `}),s.push({displayText:`${n.prioritySymbols.Highest} highest priority`,appendText:`${n.prioritySymbols.Highest} `}),s.push({displayText:`${n.prioritySymbols.Lowest} lowest priority`,appendText:`${n.prioritySymbols.Lowest} `})),r.includes(n.recurrenceSymbol)||s.push({displayText:`${n.recurrenceSymbol} recurring (repeat)`,appendText:`${n.recurrenceSymbol} `}),!r.includes(n.createdDateSymbol)){let l=Nt.parseDate("today",!0).format(V.dateFormat);s.push({textToMatch:`${n.createdDateSymbol} created`,displayText:`${n.createdDateSymbol} created today (${l})`,appendText:`${n.createdDateSymbol} ${l} `})}let a=Qf(r,/([a-zA-Z'_-]*)/g,e),o=[];if(a&&a.length>0){let u=a[0];if(u.length>=Math.max(1,t.autoSuggestMinMatch)){let l=s.filter(c=>(c.textToMatch||c.displayText).toLowerCase().includes(u.toLowerCase()));for(let c of l)o.push({suggestionType:"match",displayText:c.displayText,appendText:c.appendText,insertAt:a.index,insertSkip:u.length})}}return o.length===0&&t.autoSuggestMinMatch===0?s:o}function mC(r,e,t,n,i){let s=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],a=[],o=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),u=Qf(r,o,e);if(u&&u.length>=2){let l=u[1],c=u[2];if(c.length1?Nt.parseDate(ki(c),!0):null;f&&f.isValid()&&a.push({displayText:`${f.format(V.dateFormat)}`,appendText:`${l} ${f.format(V.dateFormat)} `,insertAt:u.index,insertSkip:u[0].length});let h=1,T=s.filter(y=>c&&c.length>=h&&y.toLowerCase().includes(c.toLowerCase())).slice(0,i);T.length===0&&(T=s.slice(0,i));for(let y of T){let D=`${Nt.parseDate(y,!0).format(V.dateFormat)}`;a.push({suggestionType:"match",displayText:`${y} (${D})`,appendText:`${l} ${D} `,insertAt:u.index,insertSkip:u[0].length})}}return a}function gC(r,e,t,n){var u;let i=["every","every day","every week","every month","every month on the","every year","every week on Sunday","every week on Monday","every week on Tuesday","every week on Wednesday","every week on Thursday","every week on Friday","every week on Saturday"],s=[],a=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),o=Qf(r,a,e);if(o&&o.length>=2){let l=o[1],c=o[2];if(c.length0){let y=(u=et.fromText({recurrenceRuleText:c,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:u.toText();if(y){let w=`${l} ${y} `;if(s.push({suggestionType:"match",displayText:`\u2705 ${y}`,appendText:w,insertAt:o.index,insertSkip:o[0].length}),o[0]==w)return[]}}let f=1,h=t.autoSuggestMaxItems/2,T=i.filter(y=>c&&c.length>=f&&y.toLowerCase().includes(c.toLowerCase())).slice(0,h);T.length===0&&c.trim().length===0&&(T=i.slice(0,h));for(let y of T)s.push({suggestionType:"match",displayText:`${y}`,appendText:`${l} ${y} `,insertAt:o.index,insertSkip:o[0].length})}return s}function Qf(r,e,t){let n=r.matchAll(e);for(let i of n)if((i==null?void 0:i.index)&&i.index<=t&&t<=i.index+i[0].length)return i}function yC(r,e){if(e.length===0)return!1;let t=Object.fromEntries(e.map(([i,s])=>[i,0])),n=Object.fromEntries(e.map(([i,s])=>[s,i]));for(let i of r)i in t?t[i]++:i in n&&(t[n[i]]=Math.max(0,t[n[i]]-1));return Object.values(t).some(i=>i>0)}function bb(r,e){return(t,n,i)=>yC(t.slice(0,n),e)?r(t,n,i):[]}function _b(r,e){return ge.getInstance().includedIn(r)&&TC(r,e)}function TC(r,e){if(r.length===0)return!1;let t=le.extractTaskComponents(r);if(!t)return!1;let n=t.indentation+t.listMarker+" ["+t.status.symbol+"] ";return e>=n.length}var qn=class{constructor(){this.hidePostponeButton=!1;this.hideTaskCount=!1;this.hideBacklinks=!1;this.hidePriority=!1;this.hideCreatedDate=!1;this.hideStartDate=!1;this.hideScheduledDate=!1;this.hideDoneDate=!1;this.hideDueDate=!1;this.hideRecurrenceRule=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.hideTags=!1;this.shortMode=!1;this.explainQuery=!1}},pn=class{constructor(e){this.defaultLayout=["description","priority","recurrenceRule","createdDate","startDate","scheduledDate","dueDate","doneDate","blockLink"];this.hiddenTaskLayoutComponents=[];this.taskListHiddenClasses=[];e?this.options=e:this.options=new qn,this.shownTaskLayoutComponents=this.defaultLayout,this.applyOptions()}applyOptions(){let e=[[this.options.hidePriority,"priority"],[this.options.hideRecurrenceRule,"recurrenceRule"],[this.options.hideCreatedDate,"createdDate"],[this.options.hideStartDate,"startDate"],[this.options.hideScheduledDate,"scheduledDate"],[this.options.hideDueDate,"dueDate"],[this.options.hideDoneDate,"doneDate"]];for(let[n,i]of e)this.hideComponent(n,i),this.generateHiddenClassForTaskList(n,i);let t=[[this.options.hideTags,"tags"],[this.options.hideUrgency,"urgency"],[this.options.hideBacklinks,"backlinks"],[this.options.hideEditButton,"edit-button"],[this.options.hidePostponeButton,"postpone-button"]];for(let[n,i]of t)this.generateHiddenClassForTaskList(n,i);this.options.shortMode&&this.taskListHiddenClasses.push("tasks-layout-short-mode")}generateHiddenClassForTaskList(e,t){e&&this.taskListHiddenClasses.push(`tasks-layout-hide-${t}`)}hideComponent(e,t){e&&(this.hiddenTaskLayoutComponents.push(t),this.shownTaskLayoutComponents=this.shownTaskLayoutComponents.filter(n=>n!=t))}};var Xf={prioritySymbols:{Highest:"\u{1F53A}",High:"\u23EB",Medium:"\u{1F53C}",Low:"\u{1F53D}",Lowest:"\u23EC",None:""},startDateSymbol:"\u{1F6EB}",createdDateSymbol:"\u2795",scheduledDateSymbol:"\u23F3",dueDateSymbol:"\u{1F4C5}",doneDateSymbol:"\u2705",recurrenceSymbol:"\u{1F501}",TaskFormatRegularExpressions:{priorityRegex:/([🔺⏫🔼🔽⏬])$/u,startDateRegex:/🛫 *(\d{4}-\d{2}-\d{2})$/u,createdDateRegex:/➕ *(\d{4}-\d{2}-\d{2})$/u,scheduledDateRegex:/[⏳⌛] *(\d{4}-\d{2}-\d{2})$/u,dueDateRegex:/[📅📆🗓] *(\d{4}-\d{2}-\d{2})$/u,doneDateRegex:/✅ *(\d{4}-\d{2}-\d{2})$/u,recurrenceRegex:/🔁 ?([a-zA-Z0-9, !]+)$/iu}},$n=class{constructor(e){this.symbols=e}serialize(e){let t=new pn,n="";for(let i of t.shownTaskLayoutComponents)n+=this.componentToString(e,t,i);return n}componentToString(e,t,n){var f;let{prioritySymbols:i,startDateSymbol:s,createdDateSymbol:a,scheduledDateSymbol:o,doneDateSymbol:u,recurrenceSymbol:l,dueDateSymbol:c}=this.symbols;switch(n){case"description":return e.description;case"priority":{let h="";return e.priority==="0"?h=" "+i.Highest:e.priority==="1"?h=" "+i.High:e.priority==="2"?h=" "+i.Medium:e.priority==="4"?h=" "+i.Low:e.priority==="5"&&(h=" "+i.Lowest),h}case"startDate":return e.startDate?t.options.shortMode?" "+s:` ${s} ${e.startDate.format(V.dateFormat)}`:"";case"createdDate":return e.createdDate?t.options.shortMode?" "+a:` ${a} ${e.createdDate.format(V.dateFormat)}`:"";case"scheduledDate":return!e.scheduledDate||e.scheduledDateIsInferred?"":t.options.shortMode?" "+o:` ${o} ${e.scheduledDate.format(V.dateFormat)}`;case"doneDate":return e.doneDate?t.options.shortMode?" "+u:` ${u} ${e.doneDate.format(V.dateFormat)}`:"";case"dueDate":return e.dueDate?t.options.shortMode?" "+c:` ${c} ${e.dueDate.format(V.dateFormat)}`:"";case"recurrenceRule":return e.recurrence?t.options.shortMode?" "+l:` ${l} ${e.recurrence.toText()}`:"";case"blockLink":return(f=e.blockLink)!=null?f:"";default:throw new Error(`Don't know how to render task component of type '${n}'`)}}parsePriority(e){let{prioritySymbols:t}=this.symbols;switch(e){case t.Lowest:return"5";case t.Low:return"4";case t.Medium:return"2";case t.High:return"1";case t.Highest:return"0";default:return"3"}}deserialize(e){let{TaskFormatRegularExpressions:t}=this.symbols,n,i="3",s=null,a=null,o=null,u=null,l=null,c="",f=null,h="",T=20,y=0;do{n=!1;let w=e.match(t.priorityRegex);w!==null&&(i=this.parsePriority(w[1]),e=e.replace(t.priorityRegex,"").trim(),n=!0);let D=e.match(t.doneDateRegex);D!==null&&(u=window.moment(D[1],V.dateFormat),e=e.replace(t.doneDateRegex,"").trim(),n=!0);let C=e.match(t.dueDateRegex);C!==null&&(o=window.moment(C[1],V.dateFormat),e=e.replace(t.dueDateRegex,"").trim(),n=!0);let N=e.match(t.scheduledDateRegex);N!==null&&(a=window.moment(N[1],V.dateFormat),e=e.replace(t.scheduledDateRegex,"").trim(),n=!0);let L=e.match(t.startDateRegex);L!==null&&(s=window.moment(L[1],V.dateFormat),e=e.replace(t.startDateRegex,"").trim(),n=!0);let oe=e.match(t.createdDateRegex);oe!==null&&(l=window.moment(oe[1],V.dateFormat),e=e.replace(t.createdDateRegex,"").trim(),n=!0);let z=e.match(t.recurrenceRegex);z!==null&&(c=z[1].trim(),e=e.replace(t.recurrenceRegex,"").trim(),n=!0);let ie=e.match(V.hashTagsFromEnd);if(ie!=null){e=e.replace(V.hashTagsFromEnd,"").trim(),n=!0;let j=ie[0].trim();h=h.length>0?[j,h].join(" "):j}y++}while(n&&y<=T);return c.length>0&&(f=et.fromText({recurrenceRuleText:c,startDate:s,scheduledDate:a,dueDate:o})),h.length>0&&(e+=" "+h),{description:e,priority:i,startDate:s,createdDate:l,scheduledDate:a,dueDate:o,doneDate:u,recurrence:f,tags:le.extractHashtags(e)}}};function Yn(r){let e=["(?:",/(?=[^\]]+\])\[/,"|",/(?=[^)]+\))\(/,")",/ */,r,/ */,/[)\]]/,/(?: *,)?/,/$/].map(t=>t instanceof RegExp?t.source:t).join("");return new RegExp(e,r.flags)}var Zf={prioritySymbols:{Highest:"priority:: highest",High:"priority:: high",Medium:"priority:: medium",Low:"priority:: low",Lowest:"priority:: lowest",None:""},startDateSymbol:"start::",createdDateSymbol:"created::",scheduledDateSymbol:"scheduled::",dueDateSymbol:"due::",doneDateSymbol:"completion::",recurrenceSymbol:"repeat::",TaskFormatRegularExpressions:{priorityRegex:Yn(/priority:: *(highest|high|medium|low|lowest)/),startDateRegex:Yn(/start:: *(\d{4}-\d{2}-\d{2})/),createdDateRegex:Yn(/created:: *(\d{4}-\d{2}-\d{2})/),scheduledDateRegex:Yn(/scheduled:: *(\d{4}-\d{2}-\d{2})/),dueDateRegex:Yn(/due:: *(\d{4}-\d{2}-\d{2})/),doneDateRegex:Yn(/completion:: *(\d{4}-\d{2}-\d{2})/),recurrenceRegex:Yn(/repeat:: *([a-zA-Z0-9, !]+)/)}},Yo=class extends $n{constructor(){super(Zf)}parsePriority(e){switch(e){case"highest":return"0";case"high":return"1";case"medium":return"2";case"low":return"4";case"lowest":return"5";default:return"3"}}componentToString(e,t,n){let i=super.componentToString(e,t,n);return i!==""&&!["blockLink","description"].includes(n)?` [${i.trim()}]`:i}};var Lt=(a=>(a.TODO="TODO",a.DONE="DONE",a.IN_PROGRESS="IN_PROGRESS",a.CANCELLED="CANCELLED",a.NON_TASK="NON_TASK",a.EMPTY="EMPTY",a))(Lt||{}),He=class{constructor(e,t,n,i,s="TODO"){this.symbol=e,this.name=t,this.nextStatusSymbol=n,this.availableAsCommand=i,this.type=s}};var kt=class{get symbol(){return this.configuration.symbol}get name(){return this.configuration.name}get nextStatusSymbol(){return this.configuration.nextStatusSymbol}get nextSymbol(){return this.configuration.nextStatusSymbol}get availableAsCommand(){return this.configuration.availableAsCommand}get type(){return this.configuration.type}get typeGroupText(){let e=this.type,t;switch(e){case"IN_PROGRESS":t="1";break;case"TODO":t="2";break;case"DONE":t="3";break;case"CANCELLED":t="4";break;case"NON_TASK":t="5";break;case"EMPTY":t="6";break}return`%%${t}%%${e}`}constructor(e){this.configuration=e}static makeDone(){return new kt(new He("x","Done"," ",!0,"DONE"))}static makeEmpty(){return new kt(new He("","EMPTY","",!0,"EMPTY"))}static makeTodo(){return new kt(new He(" ","Todo","x",!0,"TODO"))}static makeCancelled(){return new kt(new He("-","Cancelled"," ",!0,"CANCELLED"))}static makeInProgress(){return new kt(new He("/","In Progress","x",!0,"IN_PROGRESS"))}static makeNonTask(){return new kt(new He("Q","Non-Task","A",!0,"NON_TASK"))}static getTypeForUnknownSymbol(e){switch(e){case"x":case"X":return"DONE";case"/":return"IN_PROGRESS";case"-":return"CANCELLED";case"":return"EMPTY";case" ":default:return"TODO"}}static getTypeFromStatusTypeString(e){return Lt[e]||"TODO"}static createUnknownStatus(e){return new kt(new He(e,"Unknown","x",!1,"TODO"))}static createFromImportedValue(e){let t=e[0],n=kt.getTypeFromStatusTypeString(e[3]);return new kt(new He(t,e[1],e[2],!1,n))}isCompleted(){return this.type==="DONE"}identicalTo(e){let t=["symbol","name","nextStatusSymbol","availableAsCommand","type"];for(let n of t)if(this[n]!==e[n])return!1;return!0}previewText(){let e="";return kt.tasksPluginCanCreateCommandsForStatuses()&&this.availableAsCommand&&(e=" Available as a command."),`- [${this.symbol}] => [${this.nextStatusSymbol}], name: '${this.name}', type: '${this.configuration.type}'.${e}`}static tasksPluginCanCreateCommandsForStatuses(){return!1}},X=kt;X.DONE=kt.makeDone(),X.EMPTY=kt.makeEmpty(),X.TODO=kt.makeTodo();var jo=class{constructor(e=!1,t=!1){this.ignoreSortInstructions=e,this.showTaskHiddenData=t}};var Pe=class{constructor(){this.coreStatuses=[X.makeTodo().configuration,X.makeDone().configuration],this.customStatuses=[X.makeInProgress().configuration,X.makeCancelled().configuration]}static addStatus(e,t){e.push(t)}static replaceStatus(e,t,n){let i=this.findStatusIndex(t,e);return i<=-1?!1:(e.splice(i,1,n),!0)}static findStatusIndex(e,t){let n=new X(e);return t.findIndex(i=>new X(i).previewText()==n.previewText())}static deleteStatus(e,t){let n=this.findStatusIndex(t,e);return n<=-1?!1:(e.splice(n,1),!0)}static deleteAllCustomStatuses(e){e.customStatuses.splice(0)}static resetAllCustomStatuses(e){Pe.deleteAllCustomStatuses(e),new Pe().customStatuses.forEach(n=>{Pe.addStatus(e.customStatuses,n)})}static bulkAddStatusCollection(e,t){let n=[];return t.forEach(i=>{e.customStatuses.find(a=>a.symbol==i[0]&&a.name==i[1]&&a.nextStatusSymbol==i[2])?n.push(`The status ${i[1]} (${i[0]}) is already added.`):Pe.addStatus(e.customStatuses,X.createFromImportedValue(i))}),n}static allStatuses(e){return e.coreStatuses.concat(e.customStatuses)}static applyToStatusRegistry(e,t){t.clearStatuses(),Pe.allStatuses(e).forEach(n=>{t.add(n)})}};var vb=[{index:9999,internalName:"INTERNAL_TESTING_ENABLED_BY_DEFAULT",displayName:"Test Item. Used to validate the Feature Framework.",description:"Description",enabledByDefault:!0,stable:!1}];var Br=class{constructor(e,t,n,i,s,a){this.internalName=e;this.index=t;this.description=n;this.displayName=i;this.enabledByDefault=s;this.stable=a}static get values(){let e=[];return vb.forEach(t=>{e=[...e,new Br(t.internalName,t.index,t.description,t.displayName,t.enabledByDefault,t.stable)]}),e}static get settingsFlags(){let e={};return Br.values.forEach(t=>{e[t.internalName]=t.enabledByDefault}),e}static fromString(e){for(let t of Br.values)if(e===t.internalName)return t;throw new RangeError(`Illegal argument passed to fromString(): ${e} does not correspond to any available Feature ${this.prototype.constructor.name}`)}};var Hr={tasksPluginEmoji:{displayName:"Tasks Emoji Format",taskSerializer:new $n(Xf),buildSuggestions:Kf(Xf,Vf)},dataview:{displayName:"Dataview",taskSerializer:new Yo,buildSuggestions:bb(Kf(Zf,Vf),[["(",")"],["[","]"]])}},Eb={globalQuery:"",globalFilter:"",removeGlobalFilter:!1,taskFormat:"tasksPluginEmoji",setCreatedDate:!1,setDoneDate:!0,autoSuggestInEditor:!0,autoSuggestMinMatch:0,autoSuggestMaxItems:6,provideAccessKeys:!0,useFilenameAsScheduledDate:!1,filenameAsDateFolders:[],recurrenceOnNextLine:!1,statusSettings:new Pe,features:Br.settingsFlags,generalSettings:{},headingOpened:{},debugSettings:new jo,loggingOptions:{minLevels:{"":"info",tasks:"info","tasks.Cache":"info","tasks.Events":"info","tasks.File":"info","tasks.Query":"info","tasks.Task":"info"}}},hn=we({},Eb);function wb(r,e){for(let t in r)e[t]===void 0&&(e[t]=r[t])}var Q=()=>(wb(Br.settingsFlags,hn.features),wb(Eb.loggingOptions.minLevels,hn.loggingOptions.minLevels),hn.statusSettings.customStatuses.forEach((r,e,t)=>{var i,s;let n=X.getTypeFromStatusTypeString(r.type);t[e]=new He((i=r.symbol)!=null?i:" ",r.name,(s=r.nextStatusSymbol)!=null?s:"x",r.availableAsCommand,n)}),we({},hn)),tt=r=>(hn=we(we({},hn),r),Q());var jn=(r,e)=>(hn.generalSettings[r]=e,Q()),kb=r=>{var e;return(e=hn.features[r])!=null?e:!1};function ga(){return Hr[Q().taskFormat]}function Go(r){let t={"<":"<",">":">","&":"&",'"':"""}[r];return t!==void 0?t:r}function Sb(r){let e=[...r],t="";return e.forEach(n=>{t+=Go(n)}),t}var ve=class{constructor(){this._registeredStatuses=[];this.addDefaultStatusTypes()}set(e){this.clearStatuses(),e.forEach(t=>{this.add(t)})}get registeredStatuses(){return this._registeredStatuses.filter(({symbol:e})=>e!==X.EMPTY.symbol)}static getInstance(){return ve.instance||(ve.instance=new ve),ve.instance}add(e){this.hasSymbol(e.symbol)||(e instanceof X?this._registeredStatuses.push(e):this._registeredStatuses.push(new X(e)))}bySymbol(e){return this.hasSymbol(e)?this.getSymbol(e):X.EMPTY}bySymbolOrCreate(e){return this.hasSymbol(e)?this.getSymbol(e):X.createUnknownStatus(e)}byName(e){return this._registeredStatuses.filter(({name:t})=>t===e).length>0?this._registeredStatuses.filter(({name:t})=>t===e)[0]:X.EMPTY}resetToDefaultStatuses(){this.clearStatuses(),this.addDefaultStatusTypes()}clearStatuses(){this._registeredStatuses=[]}getNextStatus(e){if(e.nextStatusSymbol!==""){let t=this.bySymbol(e.nextStatusSymbol);if(t!==null)return t}return X.EMPTY}getNextStatusOrCreate(e){let t=this.getNextStatus(e);return t.type!=="EMPTY"?t:X.createUnknownStatus(e.nextStatusSymbol)}findUnknownStatuses(e){let t=e.filter(s=>!this.hasSymbol(s.symbol)),n=new ve,i=[];return t.forEach(s=>{if(n.hasSymbol(s.symbol))return;let a=ve.copyStatusWithNewName(s,`Unknown (${s.symbol})`);i.push(a),n.add(a)}),i.sort((s,a)=>s.symbol.localeCompare(a.symbol,void 0,{numeric:!0}))}static copyStatusWithNewName(e,t){let n=new He(e.symbol,t,e.nextStatusSymbol,e.availableAsCommand,e.type);return new X(n)}getSymbol(e){return this._registeredStatuses.filter(({symbol:t})=>t===e)[0]}hasSymbol(e){return this._registeredStatuses.find(t=>t.symbol===e)!==void 0}addDefaultStatusTypes(){[X.makeTodo(),X.makeInProgress(),X.makeDone(),X.makeCancelled()].forEach(t=>{this.add(t)})}mermaidDiagram(e=!1){let t=this.registeredStatuses,n="mermaid",i=[],s=[];return t.forEach((a,o)=>{let u=this.getMermaidNodeLabel(a,e);i.push(`${o+1}${u}`);let l=this.getNextStatus(a),c=t.findIndex(T=>T.symbol===l.symbol),f=c!==-1,h=l.type!=="EMPTY";f&&h&&s.push(`${o+1} --> ${c+1}`)}),` \`\`\`${n} flowchart LR @@ -146,8 +146,8 @@ ${s.join(` linkStyle default stroke:gray \`\`\` -`}getMermaidNodeLabel(e,t){let n=TT(e.name),i=e.type;if(t){let s=jo(e.symbol),a=jo(e.nextStatusSymbol),o=`[${s}] -> [${a}]`,u=`'${n}'`,l=`(${i})`;return`["${u}
${o}
${l}"]:::${i}`}else return`["${n}"]:::${i}`}};var lr=class{static calculate(e){let t=0;if(e.dueDate!==null){let n=window.moment().startOf("day"),i=Math.round(n.diff(e.dueDate)/lr.milliSecondsPerDay),s;i>=7?s=1:i>=-14?s=(i+14)*.8/21+.2:s=.2,t+=s*lr.dueCoefficient}switch(e.scheduledDate!==null&&window.moment().isSameOrAfter(e.scheduledDate)&&(t+=1*lr.scheduledCoefficient),e.startDate!==null&&window.moment().isBefore(e.startDate)&&(t+=1*lr.startedCoefficient),e.priority){case"0":t+=1.5*lr.priorityCoefficient;break;case"1":t+=1*lr.priorityCoefficient;break;case"2":t+=.65*lr.priorityCoefficient;break;case"3":t+=.325*lr.priorityCoefficient;break;case"5":t-=.3*lr.priorityCoefficient;break}return t}},Hr=lr;Hr.dueCoefficient=12,Hr.scheduledCoefficient=5,Hr.startedCoefficient=-3,Hr.priorityCoefficient=6,Hr.milliSecondsPerDay=1e3*60*60*24;var xt=class{static fromPath(e){let{useFilenameAsScheduledDate:t,filenameAsDateFolders:n}=Q();return!t||!this.matchesAnyFolder(n,e)?null:this.extractDateFromPath(e)}static matchesAnyFolder(e,t){return e.length===0?!0:e.some(n=>t.startsWith(n+"/"))}static extractDateFromPath(e){let t=Math.max(0,e.lastIndexOf("/")+1),n=e.lastIndexOf("."),i=e.substring(t,n),s=/(\d{4})-(\d{2})-(\d{2})/.exec(i);if(s||(s=/(\d{4})(\d{2})(\d{2})/.exec(i)),s){let a=window.moment([parseInt(s[1]),parseInt(s[2])-1,parseInt(s[3])]);if(a.isValid())return a}return null}static canApplyFallback({startDate:e,scheduledDate:t,dueDate:n}){return e===null&&n===null&&t===null}static updateTaskPath(e,t,n){let i=e.scheduledDate,s=e.scheduledDateIsInferred;return n===null?s&&(s=!1,i=null):s?i=n:this.canApplyFallback(e)&&(i=n,s=!0),new ge(Tt(De({},e),{taskLocation:e.taskLocation.fromRenamedFile(t),scheduledDate:i,scheduledDateIsInferred:s}))}static removeInferredStatusIfNeeded(e,t){let n=e.scheduledDateIsInferred?e.scheduledDate:null;return t.map(i=>(n!==null&&!n.isSame(i.scheduledDate,"day")&&(i=new ge(Tt(De({},i),{scheduledDateIsInferred:!1}))),i))}};var zr=class{constructor(e,t){this.name=e,this.sortOrder=t}get groupText(){return this.name!==""?`%%${this.sortOrder}%% ${this.name}`:""}};var wt=class{constructor(e){this._date=null;this._date=e}get moment(){return this._date}formatAsDate(e=""){return this.format(V.dateFormat,e)}formatAsDateAndTime(e=""){return this.format(V.dateTimeFormat,e)}format(e,t=""){return this._date?this._date.format(e):t}toISOString(e){return this._date?this._date.toISOString(e):""}get category(){let e=window.moment(),t=this.moment;return t?t.isBefore(e,"day")?new zr("Overdue",1):t.isSame(e,"day")?new zr("Today",2):new zr("Future",3):new zr("Undated",4)}get fromNow(){let e=this.moment;if(!e)return new zr("",0);let t=this.fromNowOrder(e);return new zr(e.fromNow(),t)}fromNowOrder(e){let t=window.moment(),n=e.isSameOrBefore(t,"day"),i=this.fromNowStartDateOfGroup(e,n,t);return Number((n?1:3)+i.format("YYYYMMDD"))}fromNowStartDateOfGroup(e,t,n){let i=e.fromNow(!0).split(" "),s,a=Number(i[0]);isNaN(a)?s=1:s=a;let o=i[1];return t?n.subtract(s,o):n.add(s,o)}};var Ri=class{constructor(e){this._path=e}get path(){return this._path}get pathWithoutExtension(){return this.withoutExtension(this.path)}withoutExtension(e){return e.replace(/\.md$/,"")}get root(){let e=this.path.replace(/\\/g,"/");e.charAt(0)==="/"&&(e=e.substring(1));let t=e.indexOf("/");return t==-1?"/":e.substring(0,t+1)}get folder(){let e=this.path,t=this.filename,n=e.substring(0,e.lastIndexOf(t));return n===""?"/":n}get filename(){let e=this.path.match(/([^/]+)$/);return e!==null?e[1]:""}get filenameWithoutExtension(){return this.withoutExtension(this.filename)}};var Vr=class{static priorityNameUsingNone(e){let t="ERROR";switch(e){case"1":t="High";break;case"0":t="Highest";break;case"2":t="Medium";break;case"3":t="None";break;case"4":t="Low";break;case"5":t="Lowest";break}return t}static priorityNameUsingNormal(e){return Vr.priorityNameUsingNone(e).replace("None","Normal")}};var oC=require("obsidian"),ET=ss(wT());var Kf=class extends ET.EventEmitter2{constructor(){super(...arguments);this.options={minLevels:{"":"info",tasks:"info"}};this.consoleLoggerRegistered=!1;this.arrAvg=t=>t.reduce((n,i)=>n+i,0)/t.length}configure(t){return this.options=Object.assign({},this.options,t),this}getLogger(t){let n="none",i="";for(let s in this.options.minLevels)t.startsWith(s)&&s.length>=i.length&&(n=this.options.minLevels[s],i=s);return new Qf(this,t,n)}onLogEntry(t){return this.on("log",t),this}registerConsoleLogger(){return this.consoleLoggerRegistered?this:(this.onLogEntry(t=>{let n=`[${window.moment().format("YYYY-MM-DD-HH:mm:ss.SSS")}][${t.level}][${t.module}]`;switch(t.traceId&&(n+=`[${t.traceId}]`),n+=` ${t.message}`,t.objects===void 0&&(t.objects=""),t.level){case"trace":console.trace(n,t.objects);break;case"debug":console.debug(n,t.objects);break;case"info":console.info(n,t.objects);break;case"warn":console.warn(n,t.objects);break;case"error":console.error(n,t.objects);break;default:console.log(`{${t.level}} ${n}`,t.objects)}}),this.consoleLoggerRegistered=!0,this)}},Mt=new Kf,Qf=class{constructor(e,t,n){this.levels={trace:1,debug:2,info:3,warn:4,error:5};this.logManager=e,this.module=t,this.minLevel=this.levelToInt(n)}levelToInt(e){return e.toLowerCase()in this.levels?this.levels[e.toLowerCase()]:99}log(e,t,n){if(this.levelToInt(e)]*)/,V.listMarkerRegex=/([-*+]|[0-9]+\.)/,V.checkboxRegex=/\[(.)\]/u,V.afterCheckboxRegex=/ *(.*)/u,V.taskRegex=new RegExp(Ut.indentationRegex.source+Ut.listMarkerRegex.source+" +"+Ut.checkboxRegex.source+Ut.afterCheckboxRegex.source,"u"),V.nonTaskRegex=new RegExp(Ut.indentationRegex.source+Ut.listMarkerRegex.source+"? *("+Ut.checkboxRegex.source+")?"+Ut.afterCheckboxRegex.source,"u"),V.listItemRegex=new RegExp(Ut.indentationRegex.source+Ut.listMarkerRegex.source),V.blockLinkRegex=/ \^[a-zA-Z0-9-]+$/u,V.hashTags=/(^|\s)#[^ !@#$%^&*(),.?":{}|<>]+/g,V.hashTagsFromEnd=new RegExp(Ut.hashTags.source+"$");var ge=class{constructor({status:e,description:t,taskLocation:n,indentation:i,listMarker:s,priority:a,createdDate:o,startDate:u,scheduledDate:l,dueDate:c,doneDate:p,recurrence:h,blockLink:_,tags:y,originalMarkdown:w,scheduledDateIsInferred:R}){this._urgency=null;this.status=e,this.description=t,this.indentation=i,this.listMarker=s,this.taskLocation=n,this.tags=y,this.priority=a,this.createdDate=o,this.startDate=u,this.scheduledDate=l,this.dueDate=c,this.doneDate=p,this.recurrence=h,this.blockLink=_,this.originalMarkdown=w,this.scheduledDateIsInferred=R}static fromLine({line:e,taskLocation:t,fallbackDate:n}){let i=ge.extractTaskComponents(e);return i===null||!me.getInstance().includedIn(i.body)?null:ge.parseTaskSignifiers(e,t,n)}static parseTaskSignifiers(e,t,n){let i=ge.extractTaskComponents(e);if(i===null)return null;let{taskSerializer:s}=ma(),a=s.deserialize(i.body),o=!1;return xt.canApplyFallback(a)&&n!==null&&(a.scheduledDate=n,o=!0),a.tags=a.tags.map(u=>u.trim()),a.tags=a.tags.filter(u=>!me.getInstance().equals(u)),new ge(Tt(De(De({},i),a),{taskLocation:t,originalMarkdown:e,scheduledDateIsInferred:o}))}static extractTaskComponents(e){let t=e.match(V.taskRegex);if(t===null)return null;let n=t[1],i=t[2],s=t[3],a=Se.getInstance().bySymbolOrCreate(s),o=t[4].trim(),u=o.match(V.blockLinkRegex),l=u!==null?u[0]:"";return l!==""&&(o=o.replace(V.blockLinkRegex,"").trim()),{indentation:n,listMarker:i,status:a,body:o,blockLink:l}}toString(){return ma().taskSerializer.serialize(this)}toFileLineString(){return`${this.indentation}${this.listMarker} [${this.status.symbol}] ${this.toString()}`}toggle(){Mt.getLogger("tasks.Task").trace(`toggling task ${this.taskLocation.path} ${this.taskLocation.lineNumber} ${this.originalMarkdown}`);let t=Se.getInstance().getNextStatusOrCreate(this.status),n=null,i=null;if(t.isCompleted()){let{setDoneDate:o}=Q();o&&(n=window.moment()),this.recurrence!==null&&(i=this.recurrence.next())}let s=new ge(Tt(De({},this),{status:t,doneDate:n})),a=[];if(i!==null){let{setCreatedDate:o}=Q(),u=null;o&&(u=window.moment());let l=Se.getInstance().getNextStatusOrCreate(t),c=new ge(Tt(De(De({},this),i),{status:l,blockLink:"",createdDate:u}));a.push(c)}return a.push(s),a}toggleWithRecurrenceInUsersOrder(){let e=this.toggle(),{recurrenceOnNextLine:t}=Q();return t?e.reverse():e}get isDone(){return this.status.type==="DONE"||this.status.type==="CANCELLED"||this.status.type==="NON_TASK"}get priorityNumber(){return Number.parseInt(this.priority)}get priorityNameGroupText(){let e=Vr.priorityNameUsingNormal(this.priority);return`%%${this.priority}%%${e} priority`}get descriptionWithoutTags(){return this.description.replace(V.hashTags,"").trim()}get priorityName(){return Vr.priorityNameUsingNormal(this.priority)}get urgency(){return this._urgency===null&&(this._urgency=Hr.calculate(this)),this._urgency}get path(){return this.taskLocation.path}get created(){return new wt(this.createdDate)}get done(){return new wt(this.doneDate)}get due(){return new wt(this.dueDate)}get scheduled(){return new wt(this.scheduledDate)}get start(){return new wt(this.startDate)}get happensDates(){return Array.of(this.startDate,this.scheduledDate,this.dueDate)}get happens(){let t=this.happensDates.sort(Gr);return new wt(t[0])}get isRecurring(){return this.recurrence!==null}get recurrenceRule(){return this.recurrence?this.recurrence.toText():""}get heading(){return this.precedingHeader}get hasHeading(){return this.precedingHeader!==null}get file(){return new Ri(this.path)}get filename(){let e=this.path.match(/([^/]+)\.md$/);return e!==null?e[1]:null}get lineNumber(){return this.taskLocation.lineNumber}get sectionStart(){return this.taskLocation.sectionStart}get sectionIndex(){return this.taskLocation.sectionIndex}get precedingHeader(){return this.taskLocation.precedingHeader}getLinkText({isFilenameUnique:e}){let t;return e?t=this.filename:t="/"+this.path,t===null?null:(this.precedingHeader!==null&&this.precedingHeader!==t&&(t=t+" > "+this.precedingHeader),t)}static tasksListsIdentical(e,t){return e.length!==t.length?!1:e.every((n,i)=>n.identicalTo(t[i]))}identicalTo(e){let t=["description","path","indentation","listMarker","lineNumber","sectionStart","sectionIndex","precedingHeader","priority","blockLink","scheduledDateIsInferred"];for(let s of t)if(this[s]!==e[s])return!1;if(!this.status.identicalTo(e.status)||this.tags.length!==e.tags.length||!this.tags.every(function(s,a){return s===e.tags[a]}))return!1;t=["createdDate","startDate","scheduledDate","dueDate","doneDate"];for(let s of t){let a=this[s],o=e[s];if(Gr(a,o)!==0)return!1}let n=this.recurrence,i=e.recurrence;return n===null&&i!==null||n!==null&&i===null?!1:!(n&&i&&!n.identicalTo(i))}static extractHashtags(e){var t,n;return(n=(t=e.match(V.hashTags))==null?void 0:t.map(i=>i.trim()))!=null?n:[]}};var ga=class{constructor(e){this.fetch=e;this._value=void 0}get value(){return this._value===void 0&&(this._value=this.fetch()),this._value}};var ut=class{constructor(e,t,n,i,s){this._path=e,this._lineNumber=t,this._sectionStart=n,this._sectionIndex=i,this._precedingHeader=s}static fromUnknownPosition(e){return new ut(e,0,0,0,null)}fromRenamedFile(e){return new ut(e,this.lineNumber,this.sectionStart,this.sectionIndex,this.precedingHeader)}get path(){return this._path}get lineNumber(){return this._lineNumber}get sectionStart(){return this._sectionStart}get sectionIndex(){return this._sectionIndex}get precedingHeader(){return this._precedingHeader}};var Gn=class{constructor({metadataCache:e,vault:t,events:n}){this.logger=Mt.getLogger("tasks.Cache");this.logger.debug("Creating Cache object"),this.metadataCache=e,this.metadataCacheEventReferences=[],this.vault=t,this.vaultEventReferences=[],this.events=n,this.eventsEventReferences=[],this.tasksMutex=new Wa,this.state="Cold",this.logger.debug("Cache.constructor(): state = Cold"),this.tasks=[],this.loadedAfterFirstResolve=!1,this.subscribeToCache(),this.subscribeToVault(),this.subscribeToEvents(),this.loadVault()}unload(){this.logger.info("Unloading Cache");for(let e of this.metadataCacheEventReferences)this.metadataCache.offref(e);for(let e of this.vaultEventReferences)this.vault.offref(e);for(let e of this.eventsEventReferences)this.events.off(e)}getTasks(){return this.tasks}getState(){return this.state}notifySubscribers(){this.logger.debug("Cache.notifySubscribers()"),this.events.triggerCacheUpdate({tasks:this.tasks,state:this.state})}subscribeToCache(){this.logger.debug("Cache.subscribeToCache()");let e=this.metadataCache.on("resolved",()=>q(this,null,function*(){this.loadedAfterFirstResolve||(this.loadedAfterFirstResolve=!0,this.loadVault())}));this.metadataCacheEventReferences.push(e);let t=this.metadataCache.on("changed",n=>{this.tasksMutex.runExclusive(()=>{this.indexFile(n)})});this.metadataCacheEventReferences.push(t)}subscribeToVault(){this.logger.debug("Cache.subscribeToVault()");let{useFilenameAsScheduledDate:e}=Q(),t=this.vault.on("create",s=>{s instanceof xi.TFile&&(this.logger.debug(`Cache.subscribeToVault.createdEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.indexFile(s)}))});this.vaultEventReferences.push(t);let n=this.vault.on("delete",s=>{s instanceof xi.TFile&&(this.logger.debug(`Cache.subscribeToVault.deletedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.tasks=this.tasks.filter(a=>a.path!==s.path),this.notifySubscribers()}))});this.vaultEventReferences.push(n);let i=this.vault.on("rename",(s,a)=>{s instanceof xi.TFile&&(this.logger.debug(`Cache.subscribeToVault.renamedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{let o=new ga(()=>xt.fromPath(s.path));this.tasks=this.tasks.map(u=>u.path===a?e?xt.updateTaskPath(u,s.path,o.value):new ge(Tt(De({},u),{taskLocation:u.taskLocation.fromRenamedFile(s.path)})):u),this.notifySubscribers()}))});this.vaultEventReferences.push(i)}subscribeToEvents(){this.logger.debug("Cache.subscribeToEvents()");let e=this.events.onRequestCacheUpdate(t=>{t({tasks:this.tasks,state:this.state})});this.eventsEventReferences.push(e)}loadVault(){return this.logger.debug("Cache.loadVault()"),this.tasksMutex.runExclusive(()=>q(this,null,function*(){this.state="Initializing",this.logger.debug("Cache.loadVault(): state = Initializing"),yield Promise.all(this.vault.getMarkdownFiles().map(e=>this.indexFile(e))),this.state="Warm",this.logger.debug("Cache.loadVault(): state = Warm"),this.notifySubscribers()}))}indexFile(e){return q(this,null,function*(){let t=this.metadataCache.getFileCache(e);if(t==null)return;e.path.endsWith(".md")||this.logger.warn("indexFile: WARNING: indexing non-markdown file: "+e.path),this.logger.debug("Cache.indexFile: "+e.path);let n=this.tasks.filter(a=>a.path===e.path),i=t.listItems,s=[];if(i!==void 0){let a=yield this.vault.cachedRead(e);s=this.getTasksFromFileContent(a,i,t,e)}ge.tasksListsIdentical(n,s)||(this.tasks=this.tasks.filter(a=>a.path!==e.path),this.tasks.push(...s),this.logger.debug("Cache.indexFile: "+e.path+`: read ${s.length} task(s)`),this.notifySubscribers())})}getTasksFromFileContent(e,t,n,i){let s=[],a=e.split(` -`),o=a.length,u=new ga(()=>xt.fromPath(i.path)),l=null,c=0;for(let p of t)if(p.task!==void 0){let h=p.position.start.line;if(h>=o)return this.logger.debug(`${i.path} Obsidian gave us a line number ${h} past the end of the file. ${o}.`),s;if((l===null||l.position.end.line [${a}]`,u=`'${n}'`,l=`(${i})`;return`["${u}
${o}
${l}"]:::${i}`}else return`["${n}"]:::${i}`}};var lr=class{static calculate(e){let t=0;if(e.dueDate!==null){let n=window.moment().startOf("day"),i=Math.round(n.diff(e.dueDate)/lr.milliSecondsPerDay),s;i>=7?s=1:i>=-14?s=(i+14)*.8/21+.2:s=.2,t+=s*lr.dueCoefficient}switch(e.scheduledDate!==null&&window.moment().isSameOrAfter(e.scheduledDate)&&(t+=1*lr.scheduledCoefficient),e.startDate!==null&&window.moment().isBefore(e.startDate)&&(t+=1*lr.startedCoefficient),e.priority){case"0":t+=1.5*lr.priorityCoefficient;break;case"1":t+=1*lr.priorityCoefficient;break;case"2":t+=.65*lr.priorityCoefficient;break;case"3":t+=.325*lr.priorityCoefficient;break;case"5":t-=.3*lr.priorityCoefficient;break}return t}},zr=lr;zr.dueCoefficient=12,zr.scheduledCoefficient=5,zr.startedCoefficient=-3,zr.priorityCoefficient=6,zr.milliSecondsPerDay=1e3*60*60*24;var ht=class{static fromPath(e){let{useFilenameAsScheduledDate:t,filenameAsDateFolders:n}=Q();return!t||!this.matchesAnyFolder(n,e)?null:this.extractDateFromPath(e)}static matchesAnyFolder(e,t){return e.length===0?!0:e.some(n=>t.startsWith(n+"/"))}static extractDateFromPath(e){let t=Math.max(0,e.lastIndexOf("/")+1),n=e.lastIndexOf("."),i=e.substring(t,n),s=/(\d{4})-(\d{2})-(\d{2})/.exec(i);if(s||(s=/(\d{4})(\d{2})(\d{2})/.exec(i)),s){let a=window.moment([parseInt(s[1]),parseInt(s[2])-1,parseInt(s[3])]);if(a.isValid())return a}return null}static canApplyFallback({startDate:e,scheduledDate:t,dueDate:n}){return e===null&&n===null&&t===null}static updateTaskPath(e,t,n){let i=e.scheduledDate,s=e.scheduledDateIsInferred;return n===null?s&&(s=!1,i=null):s?i=n:this.canApplyFallback(e)&&(i=n,s=!0),new le(it(we({},e),{taskLocation:e.taskLocation.fromRenamedFile(t),scheduledDate:i,scheduledDateIsInferred:s}))}static removeInferredStatusIfNeeded(e,t){let n=e.scheduledDateIsInferred?e.scheduledDate:null;return t.map(i=>(n!==null&&!n.isSame(i.scheduledDate,"day")&&(i=new le(it(we({},i),{scheduledDateIsInferred:!1}))),i))}};var Ob=require("obsidian");var Vr=class{constructor(e,t){this.name=e,this.sortOrder=t}get groupText(){return this.name!==""?`%%${this.sortOrder}%% ${this.name}`:""}};var rt=class{constructor(e){this._date=null;this._date=e}get moment(){return this._date}formatAsDate(e=""){return this.format(V.dateFormat,e)}formatAsDateAndTime(e=""){return this.format(V.dateTimeFormat,e)}format(e,t=""){return this._date?this._date.format(e):t}toISOString(e){return this._date?this._date.toISOString(e):""}get category(){let e=window.moment(),t=this.moment;return t?t.isBefore(e,"day")?new Vr("Overdue",1):t.isSame(e,"day")?new Vr("Today",2):new Vr("Future",3):new Vr("Undated",4)}get fromNow(){let e=this.moment;if(!e)return new Vr("",0);let t=this.fromNowOrder(e);return new Vr(e.fromNow(),t)}fromNowOrder(e){let t=window.moment(),n=e.isSameOrBefore(t,"day"),i=this.fromNowStartDateOfGroup(e,n,t);return Number((n?1:3)+i.format("YYYYMMDD"))}fromNowStartDateOfGroup(e,t,n){let i=e.fromNow(!0).split(" "),s,a=Number(i[0]);isNaN(a)?s=1:s=a;let o=i[1];return t?n.subtract(s,o):n.add(s,o)}postpone(e="days",t=1){if(!this._date)throw new Ob.Notice("Cannot postpone a null date");let n=window.moment().startOf("day");return this._date.isSameOrAfter(n,"day")?this._date.clone().add(t,e):n.add(t,e)}};var Mi=class{constructor(e){this._path=e}get path(){return this._path}get pathWithoutExtension(){return this.withoutExtension(this.path)}withoutExtension(e){return e.replace(/\.md$/,"")}get root(){let e=this.path.replace(/\\/g,"/");e.charAt(0)==="/"&&(e=e.substring(1));let t=e.indexOf("/");return t==-1?"/":e.substring(0,t+1)}get folder(){let e=this.path,t=this.filename,n=e.substring(0,e.lastIndexOf(t));return n===""?"/":n}get filename(){let e=this.path.match(/([^/]+)$/);return e!==null?e[1]:""}get filenameWithoutExtension(){return this.withoutExtension(this.filename)}};var Kr=class{static priorityNameUsingNone(e){let t="ERROR";switch(e){case"1":t="High";break;case"0":t="Highest";break;case"2":t="Medium";break;case"3":t="None";break;case"4":t="Low";break;case"5":t="Lowest";break}return t}static priorityNameUsingNormal(e){return Kr.priorityNameUsingNone(e).replace("None","Normal")}};var _C=require("obsidian"),Mb=as(Rb());var Jf=class extends Mb.EventEmitter2{constructor(){super(...arguments);this.options={minLevels:{"":"info",tasks:"info"}};this.consoleLoggerRegistered=!1;this.arrAvg=t=>t.reduce((n,i)=>n+i,0)/t.length}configure(t){return this.options=Object.assign({},this.options,t),this}getLogger(t){let n="none",i="";for(let s in this.options.minLevels)t.startsWith(s)&&s.length>=i.length&&(n=this.options.minLevels[s],i=s);return new ep(this,t,n)}onLogEntry(t){return this.on("log",t),this}registerConsoleLogger(){return this.consoleLoggerRegistered?this:(this.onLogEntry(t=>{let n=`[${window.moment().format("YYYY-MM-DD-HH:mm:ss.SSS")}][${t.level}][${t.module}]`;switch(t.traceId&&(n+=`[${t.traceId}]`),n+=` ${t.message}`,t.objects===void 0&&(t.objects=""),t.level){case"trace":console.trace(n,t.objects);break;case"debug":console.debug(n,t.objects);break;case"info":console.info(n,t.objects);break;case"warn":console.warn(n,t.objects);break;case"error":console.error(n,t.objects);break;default:console.log(`{${t.level}} ${n}`,t.objects)}}),this.consoleLoggerRegistered=!0,this)}},St=new Jf,ep=class{constructor(e,t,n){this.levels={trace:1,debug:2,info:3,warn:4,error:5};this.logManager=e,this.module=t,this.minLevel=this.levelToInt(n)}levelToInt(e){return e.toLowerCase()in this.levels?this.levels[e.toLowerCase()]:99}log(e,t,n){if(this.levelToInt(e){r.debug(`${e} ==> ${i+1} : ${n.toFileLineString()}`)})}var Ut=class{},V=Ut;V.dateFormat="YYYY-MM-DD",V.dateTimeFormat="YYYY-MM-DD HH:mm",V.indentationRegex=/^([\s\t>]*)/,V.listMarkerRegex=/([-*+]|[0-9]+\.)/,V.checkboxRegex=/\[(.)\]/u,V.afterCheckboxRegex=/ *(.*)/u,V.taskRegex=new RegExp(Ut.indentationRegex.source+Ut.listMarkerRegex.source+" +"+Ut.checkboxRegex.source+Ut.afterCheckboxRegex.source,"u"),V.nonTaskRegex=new RegExp(Ut.indentationRegex.source+Ut.listMarkerRegex.source+"? *("+Ut.checkboxRegex.source+")?"+Ut.afterCheckboxRegex.source,"u"),V.listItemRegex=new RegExp(Ut.indentationRegex.source+Ut.listMarkerRegex.source),V.blockLinkRegex=/ \^[a-zA-Z0-9-]+$/u,V.hashTags=/(^|\s)#[^ !@#$%^&*(),.?":{}|<>]+/g,V.hashTagsFromEnd=new RegExp(Ut.hashTags.source+"$");var le=class{constructor({status:e,description:t,taskLocation:n,indentation:i,listMarker:s,priority:a,createdDate:o,startDate:u,scheduledDate:l,dueDate:c,doneDate:f,recurrence:h,blockLink:T,tags:y,originalMarkdown:w,scheduledDateIsInferred:D}){this._urgency=null;this.status=e,this.description=t,this.indentation=i,this.listMarker=s,this.taskLocation=n,this.tags=y,this.priority=a,this.createdDate=o,this.startDate=u,this.scheduledDate=l,this.dueDate=c,this.doneDate=f,this.recurrence=h,this.blockLink=T,this.originalMarkdown=w,this.scheduledDateIsInferred=D}static fromLine({line:e,taskLocation:t,fallbackDate:n}){let i=le.extractTaskComponents(e);return i===null||!ge.getInstance().includedIn(i.body)?null:le.parseTaskSignifiers(e,t,n)}static parseTaskSignifiers(e,t,n){let i=le.extractTaskComponents(e);if(i===null)return null;let{taskSerializer:s}=ga(),a=s.deserialize(i.body),o=!1;return ht.canApplyFallback(a)&&n!==null&&(a.scheduledDate=n,o=!0),a.tags=a.tags.map(u=>u.trim()),a.tags=a.tags.filter(u=>!ge.getInstance().equals(u)),new le(it(we(we({},i),a),{taskLocation:t,originalMarkdown:e,scheduledDateIsInferred:o}))}static extractTaskComponents(e){let t=e.match(V.taskRegex);if(t===null)return null;let n=t[1],i=t[2],s=t[3],a=ve.getInstance().bySymbolOrCreate(s),o=t[4].trim(),u=o.match(V.blockLinkRegex),l=u!==null?u[0]:"";return l!==""&&(o=o.replace(V.blockLinkRegex,"").trim()),{indentation:n,listMarker:i,status:a,body:o,blockLink:l}}toString(){return ga().taskSerializer.serialize(this)}toFileLineString(){return`${this.indentation}${this.listMarker} [${this.status.symbol}] ${this.toString()}`}toggle(){let e=St.getLogger("tasks.Task"),t="toggle()";Bo(e,t,this);let n=ve.getInstance().getNextStatusOrCreate(this.status),i=this.handleNewStatus(n);return Ho(e,t,i),i}handleNewStatus(e){if(e.identicalTo(this.status))return[this];let t=null;if(e.isCompleted())if(this.status.isCompleted())t=this.doneDate;else{let{setDoneDate:a}=Q();a&&(t=window.moment())}let n=null;e.isCompleted()&&!this.status.isCompleted()&&this.recurrence!==null&&(n=this.recurrence.next());let i=new le(it(we({},this),{status:e,doneDate:t})),s=[];if(n!==null){let{setCreatedDate:a}=Q(),o=null;a&&(o=window.moment());let u=ve.getInstance().getNextStatusOrCreate(e),l=new le(it(we(we({},this),n),{status:u,blockLink:"",createdDate:o}));s.push(l)}return s.push(i),s}toggleWithRecurrenceInUsersOrder(){let e=this.toggle(),{recurrenceOnNextLine:t}=Q();return t?e.reverse():e}handleNewStatusWithRecurrenceInUsersOrder(e){St.getLogger("tasks.Task").debug(`changed task ${this.taskLocation.path} ${this.taskLocation.lineNumber} ${this.originalMarkdown} status to ${e}`);let n=this.handleNewStatus(e),{recurrenceOnNextLine:i}=Q();return i?n.reverse():n}get isDone(){return this.status.type==="DONE"||this.status.type==="CANCELLED"||this.status.type==="NON_TASK"}get priorityNumber(){return Number.parseInt(this.priority)}get priorityNameGroupText(){let e=Kr.priorityNameUsingNormal(this.priority);return`%%${this.priority}%%${e} priority`}get descriptionWithoutTags(){return this.description.replace(V.hashTags,"").trim()}get priorityName(){return Kr.priorityNameUsingNormal(this.priority)}get urgency(){return this._urgency===null&&(this._urgency=zr.calculate(this)),this._urgency}get path(){return this.taskLocation.path}get created(){return new rt(this.createdDate)}get done(){return new rt(this.doneDate)}get due(){return new rt(this.dueDate)}get scheduled(){return new rt(this.scheduledDate)}get start(){return new rt(this.startDate)}get happensDates(){return Array.of(this.startDate,this.scheduledDate,this.dueDate)}get happens(){let t=this.happensDates.sort(Gr);return new rt(t[0])}get isRecurring(){return this.recurrence!==null}get recurrenceRule(){return this.recurrence?this.recurrence.toText():""}get heading(){return this.precedingHeader}get hasHeading(){return this.precedingHeader!==null}get file(){return new Mi(this.path)}get filename(){let e=this.path.match(/([^/]+)\.md$/);return e!==null?e[1]:null}get lineNumber(){return this.taskLocation.lineNumber}get sectionStart(){return this.taskLocation.sectionStart}get sectionIndex(){return this.taskLocation.sectionIndex}get precedingHeader(){return this.taskLocation.precedingHeader}getLinkText({isFilenameUnique:e}){let t;return e?t=this.filename:t="/"+this.path,t===null?null:(this.precedingHeader!==null&&this.precedingHeader!==t&&(t=t+" > "+this.precedingHeader),t)}static tasksListsIdentical(e,t){return e.length!==t.length?!1:e.every((n,i)=>n.identicalTo(t[i]))}identicalTo(e){let t=["description","path","indentation","listMarker","lineNumber","sectionStart","sectionIndex","precedingHeader","priority","blockLink","scheduledDateIsInferred"];for(let s of t)if(this[s]!==e[s])return!1;if(!this.status.identicalTo(e.status)||this.tags.length!==e.tags.length||!this.tags.every(function(s,a){return s===e.tags[a]}))return!1;t=le.allDateFields();for(let s of t){let a=this[s],o=e[s];if(Gr(a,o)!==0)return!1}let n=this.recurrence,i=e.recurrence;return n===null&&i!==null||n!==null&&i===null?!1:!(n&&i&&!n.identicalTo(i))}static allDateFields(){return["createdDate","startDate","scheduledDate","dueDate","doneDate"]}static extractHashtags(e){var t,n;return(n=(t=e.match(V.hashTags))==null?void 0:t.map(i=>i.trim()))!=null?n:[]}};var ya=class{constructor(e){this.fetch=e;this._value=void 0}get value(){return this._value===void 0&&(this._value=this.fetch()),this._value}};var ct=class{constructor(e,t,n,i,s){this._path=e,this._lineNumber=t,this._sectionStart=n,this._sectionIndex=i,this._precedingHeader=s}static fromUnknownPosition(e){return new ct(e,0,0,0,null)}fromRenamedFile(e){return new ct(e,this.lineNumber,this.sectionStart,this.sectionIndex,this.precedingHeader)}get path(){return this._path}get lineNumber(){return this._lineNumber}get sectionStart(){return this._sectionStart}get sectionIndex(){return this._sectionIndex}get precedingHeader(){return this._precedingHeader}};var Gn=class{constructor({metadataCache:e,vault:t,events:n}){this.logger=St.getLogger("tasks.Cache");this.logger.debug("Creating Cache object"),this.metadataCache=e,this.metadataCacheEventReferences=[],this.vault=t,this.vaultEventReferences=[],this.events=n,this.eventsEventReferences=[],this.tasksMutex=new Wa,this.state="Cold",this.logger.debug("Cache.constructor(): state = Cold"),this.tasks=[],this.loadedAfterFirstResolve=!1,this.subscribeToCache(),this.subscribeToVault(),this.subscribeToEvents(),this.loadVault()}unload(){this.logger.info("Unloading Cache");for(let e of this.metadataCacheEventReferences)this.metadataCache.offref(e);for(let e of this.vaultEventReferences)this.vault.offref(e);for(let e of this.eventsEventReferences)this.events.off(e)}getTasks(){return this.tasks}getState(){return this.state}notifySubscribers(){this.logger.debug("Cache.notifySubscribers()"),this.events.triggerCacheUpdate({tasks:this.tasks,state:this.state})}subscribeToCache(){this.logger.debug("Cache.subscribeToCache()");let e=this.metadataCache.on("resolved",()=>F(this,null,function*(){this.loadedAfterFirstResolve||(this.loadedAfterFirstResolve=!0,this.loadVault())}));this.metadataCacheEventReferences.push(e);let t=this.metadataCache.on("changed",n=>{this.tasksMutex.runExclusive(()=>{this.indexFile(n)})});this.metadataCacheEventReferences.push(t)}subscribeToVault(){this.logger.debug("Cache.subscribeToVault()");let{useFilenameAsScheduledDate:e}=Q(),t=this.vault.on("create",s=>{s instanceof Ci.TFile&&(this.logger.debug(`Cache.subscribeToVault.createdEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.indexFile(s)}))});this.vaultEventReferences.push(t);let n=this.vault.on("delete",s=>{s instanceof Ci.TFile&&(this.logger.debug(`Cache.subscribeToVault.deletedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.tasks=this.tasks.filter(a=>a.path!==s.path),this.notifySubscribers()}))});this.vaultEventReferences.push(n);let i=this.vault.on("rename",(s,a)=>{s instanceof Ci.TFile&&(this.logger.debug(`Cache.subscribeToVault.renamedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{let o=new ya(()=>ht.fromPath(s.path));this.tasks=this.tasks.map(u=>u.path===a?e?ht.updateTaskPath(u,s.path,o.value):new le(it(we({},u),{taskLocation:u.taskLocation.fromRenamedFile(s.path)})):u),this.notifySubscribers()}))});this.vaultEventReferences.push(i)}subscribeToEvents(){this.logger.debug("Cache.subscribeToEvents()");let e=this.events.onRequestCacheUpdate(t=>{t({tasks:this.tasks,state:this.state})});this.eventsEventReferences.push(e)}loadVault(){return this.logger.debug("Cache.loadVault()"),this.tasksMutex.runExclusive(()=>F(this,null,function*(){this.state="Initializing",this.logger.debug("Cache.loadVault(): state = Initializing"),yield Promise.all(this.vault.getMarkdownFiles().map(e=>this.indexFile(e))),this.state="Warm",this.logger.debug("Cache.loadVault(): state = Warm"),this.notifySubscribers()}))}indexFile(e){return F(this,null,function*(){let t=this.metadataCache.getFileCache(e);if(t==null)return;if(!e.path.endsWith(".md")){this.logger.debug("indexFile: skipping non-markdown file: "+e.path);return}this.logger.debug("Cache.indexFile: "+e.path);let n=this.tasks.filter(a=>a.path===e.path),i=t.listItems,s=[];if(i!==void 0){let a=yield this.vault.cachedRead(e);s=this.getTasksFromFileContent(a,i,t,e)}le.tasksListsIdentical(n,s)||(this.tasks=this.tasks.filter(a=>a.path!==e.path),this.tasks.push(...s),this.logger.debug("Cache.indexFile: "+e.path+`: read ${s.length} task(s)`),this.notifySubscribers())})}getTasksFromFileContent(e,t,n,i){let s=[],a=e.split(` +`),o=a.length,u=new ya(()=>ht.fromPath(i.path)),l=null,c=0;for(let f of t)if(f.task!==void 0){let h=f.position.start.line;if(h>=o)return this.logger.debug(`${i.path} Obsidian gave us a line number ${h} past the end of the file. ${o}.`),s;if((l===null||l.position.end.line=e)return n;return null}static getPrecedingHeader(e,t){if(t===void 0)return null;let n=null;for(let i of t){if(i.position.start.line>e)return n;n=i.heading}return n}};var up=require("obsidian");var $T=require("obsidian");function Kr(){}function ep(r){return r()}function kT(){return Object.create(null)}function Bn(r){r.forEach(ep)}function Bo(r){return typeof r=="function"}function OT(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function DT(r){return Object.keys(r).length===0}var RT=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global,ba=class{constructor(e){this.options=e,this._listeners="WeakMap"in RT?new WeakMap:void 0}observe(e,t){return this._listeners.set(e,t),this._getObserver().observe(e,this.options),()=>{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){var e;return(e=this._observer)!==null&&e!==void 0?e:this._observer=new ResizeObserver(t=>{var n;for(let i of t)ba.entries.set(i.target,i),(n=this._listeners.get(i.target))===null||n===void 0||n(i)})}};ba.entries="WeakMap"in RT?new WeakMap:void 0;var xT=!1;function lC(){xT=!0}function cC(){xT=!1}function x(r,e){r.appendChild(e)}function Pi(r,e,t){r.insertBefore(e,t||null)}function Hn(r){r.parentNode&&r.parentNode.removeChild(r)}function tp(r,e){for(let t=0;tr.removeEventListener(e,t,n)}function MT(r){return function(e){return e.preventDefault(),r.call(this,e)}}function L(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function CT(r){let e;return{p(...t){e=t,e.forEach(n=>r.push(n))},r(){e.forEach(t=>r.splice(r.indexOf(t),1))}}}function fC(r){return Array.from(r.childNodes)}function rp(r,e){e=""+e,r.data!==e&&(r.data=e)}function cr(r,e){r.value=e==null?"":e}function np(r,e,t){for(let n=0;nr.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),Ai=e}var bC=new Set;function TC(r,e){r&&r.i&&(bC.delete(r),r.i(e))}var _C=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],TU=new Set([..._C]);function vC(r,e,t,n){let{fragment:i,after_update:s}=r.$$;i&&i.m(e,t),n||_a(()=>{let a=r.$$.on_mount.map(ep).filter(Bo);r.$$.on_destroy?r.$$.on_destroy.push(...a):Bn(a),r.$$.on_mount=[]}),s.forEach(_a)}function NT(r,e){let t=r.$$;t.fragment!==null&&(yC(t.after_update),Bn(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function wC(r,e){r.$$.dirty[0]===-1&&(Ci.push(r),mC(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<{let y=_.length?_[0]:h;return l.ctx&&i(l.ctx[p],l.ctx[p]=y)&&(!l.skip_bound&&l.bound[p]&&l.bound[p](y),c&&wC(r,p)),h}):[],l.update(),c=!0,Bn(l.before_update),l.fragment=n?n(l.ctx):!1,e.target){if(e.hydrate){lC();let p=fC(e.target);l.fragment&&l.fragment.l(p),p.forEach(Hn)}else l.fragment&&l.fragment.c();e.intro&&TC(r.$$.fragment),vC(r,e.target,e.anchor,e.customElement),cC(),PT()}ya(u)}var EC;typeof HTMLElement=="function"&&(EC=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:r}=this.$$;this.$$.on_disconnect=r.map(ep).filter(Bo);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(r,e,t){this[r]=t}disconnectedCallback(){Bn(this.$$.on_disconnect)}$destroy(){NT(this,1),this.$destroy=Kr}$on(r,e){if(!Bo(e))return Kr;let t=this.$$.callbacks[r]||(this.$$.callbacks[r]=[]);return t.push(e),()=>{let n=t.indexOf(e);n!==-1&&t.splice(n,1)}}$set(r){this.$$set&&!DT(r)&&(this.$$.skip_bound=!0,this.$$set(r),this.$$.skip_bound=!1)}});var zo=class{$destroy(){NT(this,1),this.$destroy=Kr}$on(e,t){if(!Bo(t))return Kr;let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!DT(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var ap=ss(Be());function FT(r,e,t){let n=r.slice();return n[45]=e[t],n}function LT(r,e,t){let n=r.slice();return n[48]=e[t].value,n[49]=e[t].label,n[50]=e[t].symbol,n[51]=e[t].accessKey,n[52]=e[t].accessKeyIndex,n}function kC(r){let e,t=r[50]+"",n;return{c(){e=K("span"),n=ft(t)},m(i,s){Pi(i,e,s),x(e,n)},p:Kr,d(i){i&&Hn(e)}}}function UT(r){let e,t,n,i,s,a,o,u,l=r[49].substring(0,r[52])+"",c,p,h=r[49].substring(r[52],r[52]+1)+"",_,y,w=r[49].substring(r[52]+1)+"",R,C,N=r[50]&&r[50].charCodeAt(0)>=256,F,oe,z,ie,G,j=N&&kC(r);return z=CT(r[33][0]),{c(){e=K("span"),t=K("input"),a=fe(),o=K("label"),u=K("span"),c=ft(l),p=K("span"),_=ft(h),y=K("span"),R=ft(w),C=fe(),j&&j.c(),oe=fe(),L(t,"type","radio"),L(t,"id",n="priority-"+r[48]),t.__value=i=r[48],t.value=t.__value,L(t,"accesskey",s=r[15](r[51])),L(p,"class","accesskey"),L(o,"for",F="priority-"+r[48]),z.p(t)},m(Pe,Le){Pi(Pe,e,Le),x(e,t),t.checked=t.__value===r[1].priority,x(e,a),x(e,o),x(o,u),x(u,c),x(o,p),x(p,_),x(o,y),x(y,R),x(o,C),j&&j.m(o,null),x(e,oe),ie||(G=Et(t,"change",r[32]),ie=!0)},p(Pe,Le){Le[0]&32768&&s!==(s=Pe[15](Pe[51]))&&L(t,"accesskey",s),Le[0]&3&&(t.checked=t.__value===Pe[1].priority),N&&j.p(Pe,Le)},d(Pe){Pe&&Hn(e),j&&j.d(),z.r(),ie=!1,G()}}}function WT(r){let e,t=r[45].name+"",n,i,s=r[45].symbol+"",a,o,u;return{c(){e=K("option"),n=ft(t),i=ft(" ["),a=ft(s),o=ft("]"),e.__value=u=r[45],e.value=e.__value},m(l,c){Pi(l,e,c),x(e,n),x(e,i),x(e,a),x(e,o)},p(l,c){c[0]&1&&t!==(t=l[45].name+"")&&rp(n,t),c[0]&1&&s!==(s=l[45].symbol+"")&&rp(a,s),c[0]&1&&u!==(u=l[45])&&(e.__value=u,e.value=e.__value)},d(l){l&&Hn(e)}}}function SC(r){let e,t,n,i,s,a,o,u,l,c,p,h,_,y,w,R,C,N,F,oe,z,ie,G,j,Pe,Le,B,A,E,H,P,Z,d,f,m,g,b,v,k,D,S,O,I,he,se,te,Oe,U,xe,Ae,rt,xr,qe,Ue,Np,Zi,Ma,Ip,hr,Ca,Fp,ri,Aa,Lp,Gt,Pa,Up,Jr,Ji,Na,Wp,en,Ia,qp,es,qu,$p,Fa,Yp,ts,$u,Gp,La,jp,ni,En,Bp,Ua,Hp,rs,Yu,zp,ii=r[20],yt=[];for(let Y=0;Ytion',s=fe(),a=K("textarea"),u=fe(),l=K("div"),c=K("label"),p=ft("Priority"),_=fe();for(let Y=0;Yart',Oe=fe(),U=K("input"),Ae=fe(),rt=K("code"),xr=ft(r[17]),qe=fe(),Ue=new jn(!1),Np=fe(),Zi=K("div"),Ma=K("label"),Ma.innerHTML=`Only - future dates:`,Ip=fe(),hr=K("input"),Fp=fe(),ri=K("div"),Aa=K("label"),Aa.innerHTML='Status',Lp=fe(),Gt=K("select");for(let Y=0;Yr[39].call(Gt)),L(ri,"class","tasks-modal-section"),L(Na,"for","status"),L(en,"id","status"),L(en,"type","checkbox"),L(en,"class","task-list-item-checkbox tasks-modal-checkbox"),en.checked=Ia=r[1].status.isCompleted(),en.disabled=!0,L(Jr,"class","tasks-modal-section tasks-modal-status"),En.disabled=Ua=!r[14],L(En,"type","submit"),L(En,"class","mod-cta"),L(rs,"type","button"),L(ni,"class","tasks-modal-section tasks-modal-buttons"),dr(t,"with-accesskeys",r[9]),L(e,"class","tasks-modal")},m(Y,pe){Pi(Y,e,pe),x(e,t),x(t,n),x(n,i),x(n,s),x(n,a),cr(a,r[1].description),r[31](a),x(t,u),x(t,l),x(l,c),x(c,p),x(l,_);for(let ce=0;ceno ${U} date`;let rt=ap.parseDate(xe,Ae,{forwardDate:Ae!=null});return rt!==null?window.moment(rt).format("YYYY-MM-DD"):`invalid ${U} date`}function P(U,xe){return H(U,xe,y.forwardOnly?new Date:void 0)}function Z(U){let xe=null,Ae=ap.parseDate(U,new Date,{forwardDate:y.forwardOnly});return Ae!==null&&(xe=window.moment(Ae)),xe}ip(()=>{let{provideAccessKeys:U}=Q();t(9,B=U);let xe=me.getInstance().removeAsWordFrom(s.description);(xe!=s.description||!me.getInstance().includedIn(s.description))&&(Le=!0);let Ae="none";s.priority==="5"?Ae="lowest":s.priority==="4"?Ae="low":s.priority==="2"?Ae="medium":s.priority==="1"?Ae="high":s.priority==="0"&&(Ae="highest"),t(1,y={description:xe,status:s.status,priority:Ae,recurrenceRule:s.recurrence?s.recurrence.toText():"",createdDate:new wt(s.createdDate).formatAsDate(),startDate:new wt(s.startDate).formatAsDate(),scheduledDate:new wt(s.scheduledDate).formatAsDate(),dueDate:new wt(s.dueDate).formatAsDate(),doneDate:new wt(s.doneDate).formatAsDate(),forwardOnly:!0}),setTimeout(()=>{_.focus()},10)});let d=U=>{if(U.key&&!U.altKey&&!U.ctrlKey){let xe=E.find(Ae=>Ae.label.charAt(0).toLowerCase()==U.key);xe&&t(1,y.priority=xe.value,y)}},f=()=>{a([])},m=U=>{U.key==="Enter"&&(U.preventDefault(),A&&b())},g=()=>{setTimeout(()=>{t(1,y.description=y.description.replace(/[\r\n]+/g," "),y)},0)},b=()=>{let U=y.description.trim();Le&&(U=me.getInstance().prependTo(U));let xe=Z(y.startDate),Ae=Z(y.scheduledDate),rt=Z(y.dueDate),xr=null;y.recurrenceRule&&(xr=Je.fromText({recurrenceRuleText:y.recurrenceRule,startDate:xe,scheduledDate:Ae,dueDate:rt}));let qe;switch(y.priority){case"lowest":qe="5";break;case"low":qe="4";break;case"medium":qe="2";break;case"high":qe="1";break;case"highest":qe="0";break;default:qe="3"}let Ue=new ge(Object.assign(Object.assign({},s),{description:U,status:y.status,priority:qe,recurrence:xr,startDate:xe,scheduledDate:Ae,dueDate:rt,doneDate:window.moment(y.doneDate,"YYYY-MM-DD").isValid()?window.moment(y.doneDate,"YYYY-MM-DD"):null}));a([Ue])},v=[[]];function k(){y.description=this.value,t(1,y),t(6,z),t(2,C),t(4,F),t(0,o)}function D(U){Ho[U?"unshift":"push"](()=>{_=U,t(10,_)})}function S(){y.priority=this.__value,t(1,y),t(6,z),t(2,C),t(4,F),t(0,o)}function O(){y.recurrenceRule=this.value,t(1,y),t(6,z),t(2,C),t(4,F),t(0,o)}function I(){y.dueDate=this.value,t(1,y),t(6,z),t(2,C),t(4,F),t(0,o)}function he(){y.scheduledDate=this.value,t(1,y),t(6,z),t(2,C),t(4,F),t(0,o)}function se(){y.startDate=this.value,t(1,y),t(6,z),t(2,C),t(4,F),t(0,o)}function te(){y.forwardOnly=this.checked,t(1,y),t(6,z),t(2,C),t(4,F),t(0,o)}function Oe(){y.status=AT(this),t(1,y),t(6,z),t(2,C),t(4,F),t(0,o)}return r.$$set=U=>{"task"in U&&t(26,s=U.task),"onSubmit"in U&&t(27,a=U.onSubmit),"statusOptions"in U&&t(0,o=U.statusOptions)},r.$$.update=()=>{if(r.$$.dirty[0]&512){e:t(15,n=U=>B?U:null)}if(r.$$.dirty[0]&66){e:t(1,y.dueDate=wi(y.dueDate),y),t(6,z=P("due",y.dueDate)),t(7,ie=!z.includes("invalid"))}if(r.$$.dirty[0]&6){e:t(1,y.startDate=wi(y.startDate),y),t(2,C=P("start",y.startDate)),t(3,N=!C.includes("invalid"))}if(r.$$.dirty[0]&18){e:t(1,y.scheduledDate=wi(y.scheduledDate),y),t(4,F=P("scheduled",y.scheduledDate)),t(5,oe=!F.includes("invalid"))}if(r.$$.dirty[0]&268435458){e:if(t(8,j=!0),!y.recurrenceRule)t(12,G="not recurring");else{let U=t(28,i=Je.fromText({recurrenceRuleText:y.recurrenceRule,startDate:null,scheduledDate:null,dueDate:null}))===null||i===void 0?void 0:i.toText();U?!y.startDate&&!y.scheduledDate&&!y.dueDate?(t(12,G="due, scheduled or start date required"),t(8,j=!1)):t(12,G=U):(t(12,G="invalid recurrence rule"),t(8,j=!1))}}if(r.$$.dirty[0]&2){e:t(29,w=y.description.trim()!=="")}if(r.$$.dirty[0]&536871336){e:t(14,A=ie&&j&&oe&&N&&w)}if(r.$$.dirty[0]&2){e:t(11,R=H("created",y.createdDate)),t(13,Pe=H("done",y.doneDate))}},[o,y,C,N,F,oe,z,ie,j,B,_,R,G,Pe,A,n,l,c,p,h,E,d,f,m,g,b,s,a,i,w,k,D,S,v,O,I,he,se,te,Oe]}var op=class extends zo{constructor(e){super(),IT(this,e,OC,SC,OT,{task:26,onSubmit:27,statusOptions:0},null,[-1,-1])}},qT=op;var hn=class extends $T.Modal{constructor({app:t,task:n,onSubmit:i}){super(t);this.task=n,this.onSubmit=s=>{s.length&&i(s),this.close()}}onOpen(){this.titleEl.setText("Create or edit Task");let{contentEl:t}=this,n=this.getKnownStatusesAndCurrentTaskStatusIfNotKnown();new qT({target:t,props:{task:this.task,statusOptions:n,onSubmit:this.onSubmit}})}getKnownStatusesAndCurrentTaskStatusIfNotKnown(){let t=Se.getInstance().registeredStatuses;return Se.getInstance().bySymbol(this.task.status.symbol)===X.EMPTY&&t.push(this.task.status),t}onClose(){let{contentEl:t}=this;t.empty()}};function DC(){let{setCreatedDate:r}=Q();return r?window.moment():null}function RC(r){let{setCreatedDate:e}=Q();if(!e||r.createdDate!==null)return!1;let t=r.description==="",n=!me.getInstance().isEmpty(),i=!me.getInstance().includedIn(r.description);return t||n&&i}var Vo=({line:r,path:e})=>{var h,_;let t=ge.parseTaskSignifiers(r,ut.fromUnknownPosition(e),xt.fromPath(e)),n=DC();if(t!==null)return RC(t)?new ge(Tt(De({},t),{createdDate:n})):t;let i=r.match(V.nonTaskRegex);if(i===null)return console.error("Tasks: Cannot create task on line:",r),new ge({status:X.TODO,description:"",taskLocation:ut.fromUnknownPosition(e),indentation:"",listMarker:"-",priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,recurrence:null,blockLink:"",tags:[],originalMarkdown:"",scheduledDateIsInferred:!1});let s=i[1],a=(h=i[2])!=null?h:"-",o=(_=i[4])!=null?_:" ",u=Se.getInstance().bySymbolOrCreate(o),l=i[5],c=r.match(V.blockLinkRegex),p=c!==null?c[0]:"";return p!==""&&(l=l.replace(V.blockLinkRegex,"")),new ge({status:u,description:l,taskLocation:ut.fromUnknownPosition(e),indentation:s,listMarker:a,blockLink:p,priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,recurrence:null,tags:[],originalMarkdown:"",scheduledDateIsInferred:!1})};var YT=(r,e,t,n)=>{var p;if(r)return t instanceof up.MarkdownView;if(!(t instanceof up.MarkdownView))return;let i=(p=t.file)==null?void 0:p.path;if(i===void 0)return;let a=e.getCursor().line,o=e.getLine(a),u=Vo({line:o,path:i}),l=h=>{let _=xt.removeInferredStatusIfNeeded(u,h).map(y=>y.toFileLineString()).join(` -`);e.setLine(a,_)};new hn({app:n,task:u,onSubmit:l}).open()};var lp=require("obsidian");var GT=(r,e,t)=>{var u;if(r)return t instanceof lp.MarkdownView;if(!(t instanceof lp.MarkdownView))return;let n=(u=t.file)==null?void 0:u.path;if(n===void 0)return;let i=e.getCursor(),s=i.line,a=e.getLine(s),o=xC(a,n);e.setLine(s,o.text),e.setCursor(MC(i,o))},xC=(r,e)=>{let t=ge.fromLine({line:r,taskLocation:ut.fromUnknownPosition(e),fallbackDate:null});if(t!==null){let n=t.toggleWithRecurrenceInUsersOrder().map(i=>i.toFileLineString());return{text:n.join(` -`),moveTo:{line:n.length-1}}}else{let n=r.match(V.taskRegex);if(n!==null){let i=n[3],a=Se.getInstance().bySymbol(i).nextStatusSymbol;return{text:r.replace(V.taskRegex,`$1- [${a}] $4`)}}else if(V.listItemRegex.test(r)){let i=r.replace(V.listItemRegex,"$1$2 [ ]");return{text:i,moveTo:{ch:i.length}}}else{let i=r.replace(V.indentationRegex,"$1- ");return{text:i,moveTo:{ch:i.length}}}}},MC=(r,e)=>{var s;let t={line:0,ch:r.ch},n=De(De({},t),(s=e.moveTo)!=null?s:{}),i=e.text.split(` -`)[n.line].length;return{line:r.line+n.line,ch:Math.min(n.ch,i)}};var Ko=class{get app(){return this.plugin.app}constructor({plugin:e}){this.plugin=e,e.addCommand({id:"edit-task",name:"Create or edit task",icon:"pencil",editorCheckCallback:(t,n,i)=>YT(t,n,i,this.app)}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:GT})}};var CC=Object.prototype.toString,Ii=Array.isArray||function(e){return CC.call(e)==="[object Array]"};function dp(r){return typeof r=="function"}function AC(r){return Ii(r)?"array":typeof r}function cp(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function jT(r,e){return r!=null&&typeof r=="object"&&e in r}function PC(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var NC=RegExp.prototype.test;function IC(r,e){return NC.call(r,e)}var FC=/\S/;function LC(r){return!IC(FC,r)}var UC={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function WC(r){return String(r).replace(/[&<>"'`=\/]/g,function(t){return UC[t]})}var qC=/\s*/,$C=/\s+/,BT=/\s*=/,YC=/\s*\}/,GC=/#|\^|\/|>|\{|&|=|!/;function jC(r,e){if(!r)return[];var t=!1,n=[],i=[],s=[],a=!1,o=!1,u="",l=0;function c(){if(a&&!o)for(;s.length;)delete i[s.pop()];else s=[];a=!1,o=!1}var p,h,_;function y(j){if(typeof j=="string"&&(j=j.split($C,2)),!Ii(j)||j.length!==2)throw new Error("Invalid tags: "+j);p=new RegExp(cp(j[0])+"\\s*"),h=new RegExp("\\s*"+cp(j[1])),_=new RegExp("\\s*"+cp("}"+j[1]))}y(e||Jt.tags);for(var w=new wa(r),R,C,N,F,oe,z;!w.eos();){if(R=w.pos,N=w.scanUntil(p),N)for(var ie=0,G=N.length;ie"?oe=[C,N,R,w.pos,u,l,t]:oe=[C,N,R,w.pos],l++,i.push(oe),C==="#"||C==="^")n.push(oe);else if(C==="/"){if(z=n.pop(),!z)throw new Error('Unopened section "'+N+'" at '+R);if(z[1]!==N)throw new Error('Unclosed section "'+z[1]+'" at '+R)}else C==="name"||C==="{"||C==="&"?o=!0:C==="="&&y(N)}if(c(),z=n.pop(),z)throw new Error('Unclosed section "'+z[1]+'" at '+w.pos);return HC(BC(i))}function BC(r){for(var e=[],t,n,i=0,s=r.length;i0?n[n.length-1][4]:e;break;default:t.push(i)}return e}function wa(r){this.string=r,this.tail=r,this.pos=0}wa.prototype.eos=function(){return this.tail===""};wa.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n};wa.prototype.scanUntil=function(e){var t=this.tail.search(e),n;switch(t){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=n.length,n};function Ni(r,e){this.view=r,this.cache={".":this.view},this.parent=e}Ni.prototype.push=function(e){return new Ni(e,this)};Ni.prototype.lookup=function(e){var t=this.cache,n;if(t.hasOwnProperty(e))n=t[e];else{for(var i=this,s,a,o,u=!1;i;){if(e.indexOf(".")>0)for(s=i.view,a=e.split("."),o=0;s!=null&&o"?l=this.renderPartial(o,t,n,s):u==="&"?l=this.unescapedValue(o,t):u==="name"?l=this.escapedValue(o,t,s):u==="text"&&(l=this.rawValue(o)),l!==void 0&&(a+=l);return a};kt.prototype.renderSection=function(e,t,n,i,s){var a=this,o="",u=t.lookup(e[1]);function l(h){return a.render(h,t,n,s)}if(!!u){if(Ii(u))for(var c=0,p=u.length;c=e)return n;return null}static getPrecedingHeader(e,t){if(t===void 0)return null;let n=null;for(let i of t){if(i.position.start.line>e)return n;n=i.heading}return n}};var fp=require("obsidian");var Vb=require("obsidian");function Qr(){}function ip(r){return r()}function Cb(){return Object.create(null)}function Hn(r){r.forEach(ip)}function zo(r){return typeof r=="function"}function Pb(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function Nb(r){return Object.keys(r).length===0}var Ib=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global,ba=class{constructor(e){this.options=e,this._listeners="WeakMap"in Ib?new WeakMap:void 0}observe(e,t){return this._listeners.set(e,t),this._getObserver().observe(e,this.options),()=>{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){var e;return(e=this._observer)!==null&&e!==void 0?e:this._observer=new ResizeObserver(t=>{var n;for(let i of t)ba.entries.set(i.target,i),(n=this._listeners.get(i.target))===null||n===void 0||n(i)})}};ba.entries="WeakMap"in Ib?new WeakMap:void 0;var Fb=!1;function wC(){Fb=!0}function EC(){Fb=!1}function R(r,e){r.appendChild(e)}function Ii(r,e,t){r.insertBefore(e,t||null)}function zn(r){r.parentNode&&r.parentNode.removeChild(r)}function sp(r,e){for(let t=0;tr.removeEventListener(e,t,n)}function Lb(r){return function(e){return e.preventDefault(),r.call(this,e)}}function U(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function Ub(r){let e;return{p(...t){e=t,e.forEach(n=>r.push(n))},r(){e.forEach(t=>r.splice(r.indexOf(t),1))}}}function SC(r){return Array.from(r.childNodes)}function ap(r,e){e=""+e,r.data!==e&&(r.data=e)}function cr(r,e){r.value=e==null?"":e}function op(r,e,t){for(let n=0;nr.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),Ni=e}var CC=new Set;function AC(r,e){r&&r.i&&(CC.delete(r),r.i(e))}var PC=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],NU=new Set([...PC]);function NC(r,e,t,n){let{fragment:i,after_update:s}=r.$$;i&&i.m(e,t),n||va(()=>{let a=r.$$.on_mount.map(ip).filter(zo);r.$$.on_destroy?r.$$.on_destroy.push(...a):Hn(a),r.$$.on_mount=[]}),s.forEach(va)}function $b(r,e){let t=r.$$;t.fragment!==null&&(MC(t.after_update),Hn(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function IC(r,e){r.$$.dirty[0]===-1&&(Pi.push(r),xC(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<{let y=T.length?T[0]:h;return l.ctx&&i(l.ctx[f],l.ctx[f]=y)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](y),c&&IC(r,f)),h}):[],l.update(),c=!0,Hn(l.before_update),l.fragment=n?n(l.ctx):!1,e.target){if(e.hydrate){wC();let f=SC(e.target);l.fragment&&l.fragment.l(f),f.forEach(zn)}else l.fragment&&l.fragment.c();e.intro&&AC(r.$$.fragment),NC(r,e.target,e.anchor,e.customElement),EC(),qb()}Ta(u)}var FC;typeof HTMLElement=="function"&&(FC=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:r}=this.$$;this.$$.on_disconnect=r.map(ip).filter(zo);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(r,e,t){this[r]=t}disconnectedCallback(){Hn(this.$$.on_disconnect)}$destroy(){$b(this,1),this.$destroy=Qr}$on(r,e){if(!zo(e))return Qr;let t=this.$$.callbacks[r]||(this.$$.callbacks[r]=[]);return t.push(e),()=>{let n=t.indexOf(e);n!==-1&&t.splice(n,1)}}$set(r){this.$$set&&!Nb(r)&&(this.$$.skip_bound=!0,this.$$set(r),this.$$.skip_bound=!1)}});var Ko=class{$destroy(){$b(this,1),this.$destroy=Qr}$on(e,t){if(!zo(t))return Qr;let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!Nb(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var cp=as(Be());function jb(r,e,t){let n=r.slice();return n[45]=e[t],n}function Gb(r,e,t){let n=r.slice();return n[48]=e[t].value,n[49]=e[t].label,n[50]=e[t].symbol,n[51]=e[t].accessKey,n[52]=e[t].accessKeyIndex,n}function LC(r){let e,t=r[50]+"",n;return{c(){e=K("span"),n=mt(t)},m(i,s){Ii(i,e,s),R(e,n)},p:Qr,d(i){i&&zn(e)}}}function Bb(r){let e,t,n,i,s,a,o,u,l=r[49].substring(0,r[52])+"",c,f,h=r[49].substring(r[52],r[52]+1)+"",T,y,w=r[49].substring(r[52]+1)+"",D,C,N=r[50]&&r[50].charCodeAt(0)>=256,L,oe,z,ie,j,G=N&&LC(r);return z=Ub(r[33][0]),{c(){e=K("span"),t=K("input"),a=pe(),o=K("label"),u=K("span"),c=mt(l),f=K("span"),T=mt(h),y=K("span"),D=mt(w),C=pe(),G&&G.c(),oe=pe(),U(t,"type","radio"),U(t,"id",n="priority-"+r[48]),t.__value=i=r[48],t.value=t.__value,U(t,"accesskey",s=r[15](r[51])),U(f,"class","accesskey"),U(o,"for",L="priority-"+r[48]),z.p(t)},m(Ne,Le){Ii(Ne,e,Le),R(e,t),t.checked=t.__value===r[1].priority,R(e,a),R(e,o),R(o,u),R(u,c),R(o,f),R(f,T),R(o,y),R(y,D),R(o,C),G&&G.m(o,null),R(e,oe),ie||(j=Ot(t,"change",r[32]),ie=!0)},p(Ne,Le){Le[0]&32768&&s!==(s=Ne[15](Ne[51]))&&U(t,"accesskey",s),Le[0]&3&&(t.checked=t.__value===Ne[1].priority),N&&G.p(Ne,Le)},d(Ne){Ne&&zn(e),G&&G.d(),z.r(),ie=!1,j()}}}function Hb(r){let e,t=r[45].name+"",n,i,s=r[45].symbol+"",a,o,u;return{c(){e=K("option"),n=mt(t),i=mt(" ["),a=mt(s),o=mt("]"),e.__value=u=r[45],e.value=e.__value},m(l,c){Ii(l,e,c),R(e,n),R(e,i),R(e,a),R(e,o)},p(l,c){c[0]&1&&t!==(t=l[45].name+"")&&ap(n,t),c[0]&1&&s!==(s=l[45].symbol+"")&&ap(a,s),c[0]&1&&u!==(u=l[45])&&(e.__value=u,e.value=e.__value)},d(l){l&&zn(e)}}}function UC(r){let e,t,n,i,s,a,o,u,l,c,f,h,T,y,w,D,C,N,L,oe,z,ie,j,G,Ne,Le,B,A,E,H,P,Z,d,p,m,g,b,v,k,x,S,O,I,me,se,te,De,W,Re,Ae,nt,Mr,qe,Ue,qp,Ji,Ma,$p,mr,Ca,Yp,ii,Aa,jp,jt,Pa,Gp,en,es,Na,Bp,tn,Ia,Hp,ts,Gu,zp,Fa,Vp,rs,Bu,Kp,La,Qp,si,kn,Xp,Ua,Zp,ns,Hu,Jp,ai=r[20],_t=[];for(let Y=0;Ytion',s=pe(),a=K("textarea"),u=pe(),l=K("div"),c=K("label"),f=mt("Priority"),T=pe();for(let Y=0;Y<_t.length;Y+=1)_t[Y].c();y=pe(),w=K("div"),D=K("label"),D.textContent="Recurs",C=pe(),N=K("input"),oe=pe(),z=K("code"),ie=mt(r[16]),j=pe(),G=new Bn(!1),Ne=pe(),Le=K("label"),Le.textContent="Due",B=pe(),A=K("input"),H=pe(),P=K("code"),Z=mt(r[19]),d=pe(),p=new Bn(!1),m=pe(),g=K("label"),g.textContent="Scheduled",b=pe(),v=K("input"),x=pe(),S=K("code"),O=mt(r[18]),I=pe(),me=new Bn(!1),se=pe(),te=K("label"),te.innerHTML='Start',De=pe(),W=K("input"),Ae=pe(),nt=K("code"),Mr=mt(r[17]),qe=pe(),Ue=new Bn(!1),qp=pe(),Ji=K("div"),Ma=K("label"),Ma.innerHTML=`Only + future dates:`,$p=pe(),mr=K("input"),Yp=pe(),ii=K("div"),Aa=K("label"),Aa.innerHTML='Status',jp=pe(),jt=K("select");for(let Y=0;Yr[39].call(jt)),U(ii,"class","tasks-modal-section"),U(Na,"for","status"),U(tn,"id","status"),U(tn,"type","checkbox"),U(tn,"class","task-list-item-checkbox tasks-modal-checkbox"),tn.checked=Ia=r[1].status.isCompleted(),tn.disabled=!0,U(en,"class","tasks-modal-section tasks-modal-status"),kn.disabled=Ua=!r[14],U(kn,"type","submit"),U(kn,"class","mod-cta"),U(ns,"type","button"),U(si,"class","tasks-modal-section tasks-modal-buttons"),dr(t,"with-accesskeys",r[9]),U(e,"class","tasks-modal")},m(Y,he){Ii(Y,e,he),R(e,t),R(t,n),R(n,i),R(n,s),R(n,a),cr(a,r[1].description),r[31](a),R(t,u),R(t,l),R(l,c),R(c,f),R(l,T);for(let de=0;de<_t.length;de+=1)_t[de]&&_t[de].m(l,null);R(t,y),R(t,w),R(w,D),R(w,C),R(w,N),cr(N,r[1].recurrenceRule),R(w,oe),R(w,z),R(z,ie),R(z,j),G.m(r[12],z),R(w,Ne),R(w,Le),R(w,B),R(w,A),cr(A,r[1].dueDate),R(w,H),R(w,P),R(P,Z),R(P,d),p.m(r[6],P),R(w,m),R(w,g),R(w,b),R(w,v),cr(v,r[1].scheduledDate),R(w,x),R(w,S),R(S,O),R(S,I),me.m(r[4],S),R(w,se),R(w,te),R(w,De),R(w,W),cr(W,r[1].startDate),R(w,Ae),R(w,nt),R(nt,Mr),R(nt,qe),Ue.m(r[2],nt),R(w,qp),R(w,Ji),R(Ji,Ma),R(Ji,$p),R(Ji,mr),mr.checked=r[1].forwardOnly,R(t,Yp),R(t,ii),R(ii,Aa),R(ii,jp),R(ii,jt);for(let de=0;deno ${W} date`;let nt=cp.parseDate(Re,Ae,{forwardDate:Ae!=null});return nt!==null?window.moment(nt).format("YYYY-MM-DD"):`invalid ${W} date`}function P(W,Re){return H(W,Re,y.forwardOnly?new Date:void 0)}function Z(W){let Re=null,Ae=cp.parseDate(W,new Date,{forwardDate:y.forwardOnly});return Ae!==null&&(Re=window.moment(Ae)),Re}up(()=>{let{provideAccessKeys:W}=Q();t(9,B=W);let Re=ge.getInstance().removeAsWordFrom(s.description);(Re!=s.description||!ge.getInstance().includedIn(s.description))&&(Le=!0);let Ae="none";s.priority==="5"?Ae="lowest":s.priority==="4"?Ae="low":s.priority==="2"?Ae="medium":s.priority==="1"?Ae="high":s.priority==="0"&&(Ae="highest"),t(1,y={description:Re,status:s.status,priority:Ae,recurrenceRule:s.recurrence?s.recurrence.toText():"",createdDate:new rt(s.createdDate).formatAsDate(),startDate:new rt(s.startDate).formatAsDate(),scheduledDate:new rt(s.scheduledDate).formatAsDate(),dueDate:new rt(s.dueDate).formatAsDate(),doneDate:new rt(s.doneDate).formatAsDate(),forwardOnly:!0}),setTimeout(()=>{T.focus()},10)});let d=W=>{if(W.key&&!W.altKey&&!W.ctrlKey){let Re=E.find(Ae=>Ae.label.charAt(0).toLowerCase()==W.key);Re&&t(1,y.priority=Re.value,y)}},p=()=>{a([])},m=W=>{W.key==="Enter"&&(W.preventDefault(),A&&b())},g=()=>{setTimeout(()=>{t(1,y.description=y.description.replace(/[\r\n]+/g," "),y)},0)},b=()=>{let W=y.description.trim();Le&&(W=ge.getInstance().prependTo(W));let Re=Z(y.startDate),Ae=Z(y.scheduledDate),nt=Z(y.dueDate),Mr=null;y.recurrenceRule&&(Mr=et.fromText({recurrenceRuleText:y.recurrenceRule,startDate:Re,scheduledDate:Ae,dueDate:nt}));let qe;switch(y.priority){case"lowest":qe="5";break;case"low":qe="4";break;case"medium":qe="2";break;case"high":qe="1";break;case"highest":qe="0";break;default:qe="3"}let Ue=new le(Object.assign(Object.assign({},s),{description:W,status:y.status,priority:qe,recurrence:Mr,startDate:Re,scheduledDate:Ae,dueDate:nt,doneDate:window.moment(y.doneDate,"YYYY-MM-DD").isValid()?window.moment(y.doneDate,"YYYY-MM-DD"):null}));a([Ue])},v=[[]];function k(){y.description=this.value,t(1,y),t(6,z),t(2,C),t(4,L),t(0,o)}function x(W){Vo[W?"unshift":"push"](()=>{T=W,t(10,T)})}function S(){y.priority=this.__value,t(1,y),t(6,z),t(2,C),t(4,L),t(0,o)}function O(){y.recurrenceRule=this.value,t(1,y),t(6,z),t(2,C),t(4,L),t(0,o)}function I(){y.dueDate=this.value,t(1,y),t(6,z),t(2,C),t(4,L),t(0,o)}function me(){y.scheduledDate=this.value,t(1,y),t(6,z),t(2,C),t(4,L),t(0,o)}function se(){y.startDate=this.value,t(1,y),t(6,z),t(2,C),t(4,L),t(0,o)}function te(){y.forwardOnly=this.checked,t(1,y),t(6,z),t(2,C),t(4,L),t(0,o)}function De(){y.status=Wb(this),t(1,y),t(6,z),t(2,C),t(4,L),t(0,o)}return r.$$set=W=>{"task"in W&&t(26,s=W.task),"onSubmit"in W&&t(27,a=W.onSubmit),"statusOptions"in W&&t(0,o=W.statusOptions)},r.$$.update=()=>{if(r.$$.dirty[0]&512){e:t(15,n=W=>B?W:null)}if(r.$$.dirty[0]&66){e:t(1,y.dueDate=ki(y.dueDate),y),t(6,z=P("due",y.dueDate)),t(7,ie=!z.includes("invalid"))}if(r.$$.dirty[0]&6){e:t(1,y.startDate=ki(y.startDate),y),t(2,C=P("start",y.startDate)),t(3,N=!C.includes("invalid"))}if(r.$$.dirty[0]&18){e:t(1,y.scheduledDate=ki(y.scheduledDate),y),t(4,L=P("scheduled",y.scheduledDate)),t(5,oe=!L.includes("invalid"))}if(r.$$.dirty[0]&268435458){e:if(t(8,G=!0),!y.recurrenceRule)t(12,j="not recurring");else{let W=t(28,i=et.fromText({recurrenceRuleText:y.recurrenceRule,startDate:null,scheduledDate:null,dueDate:null}))===null||i===void 0?void 0:i.toText();W?!y.startDate&&!y.scheduledDate&&!y.dueDate?(t(12,j="due, scheduled or start date required"),t(8,G=!1)):t(12,j=W):(t(12,j="invalid recurrence rule"),t(8,G=!1))}}if(r.$$.dirty[0]&2){e:t(29,w=y.description.trim()!=="")}if(r.$$.dirty[0]&536871336){e:t(14,A=ie&&G&&oe&&N&&w)}if(r.$$.dirty[0]&2){e:t(11,D=H("created",y.createdDate)),t(13,Ne=H("done",y.doneDate))}},[o,y,C,N,L,oe,z,ie,G,B,T,D,j,Ne,A,n,l,c,f,h,E,d,p,m,g,b,s,a,i,w,k,x,S,v,O,I,me,se,te,De]}var dp=class extends Ko{constructor(e){super(),Yb(this,e,WC,UC,Pb,{task:26,onSubmit:27,statusOptions:0},null,[-1,-1])}},zb=dp;var mn=class extends Vb.Modal{constructor({app:t,task:n,onSubmit:i}){super(t);this.task=n,this.onSubmit=s=>{s.length&&i(s),this.close()}}onOpen(){this.titleEl.setText("Create or edit Task");let{contentEl:t}=this,n=this.getKnownStatusesAndCurrentTaskStatusIfNotKnown();new zb({target:t,props:{task:this.task,statusOptions:n,onSubmit:this.onSubmit}})}getKnownStatusesAndCurrentTaskStatusIfNotKnown(){let t=ve.getInstance().registeredStatuses;return ve.getInstance().bySymbol(this.task.status.symbol)===X.EMPTY&&t.push(this.task.status),t}onClose(){let{contentEl:t}=this;t.empty()}};function qC(){let{setCreatedDate:r}=Q();return r?window.moment():null}function $C(r){let{setCreatedDate:e}=Q();if(!e||r.createdDate!==null)return!1;let t=r.description==="",n=!ge.getInstance().isEmpty(),i=!ge.getInstance().includedIn(r.description);return t||n&&i}var Qo=({line:r,path:e})=>{var h,T;let t=le.parseTaskSignifiers(r,ct.fromUnknownPosition(e),ht.fromPath(e)),n=qC();if(t!==null)return $C(t)?new le(it(we({},t),{createdDate:n})):t;let i=r.match(V.nonTaskRegex);if(i===null)return console.error("Tasks: Cannot create task on line:",r),new le({status:X.TODO,description:"",taskLocation:ct.fromUnknownPosition(e),indentation:"",listMarker:"-",priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,recurrence:null,blockLink:"",tags:[],originalMarkdown:"",scheduledDateIsInferred:!1});let s=i[1],a=(h=i[2])!=null?h:"-",o=(T=i[4])!=null?T:" ",u=ve.getInstance().bySymbolOrCreate(o),l=i[5],c=r.match(V.blockLinkRegex),f=c!==null?c[0]:"";return f!==""&&(l=l.replace(V.blockLinkRegex,"")),new le({status:u,description:l,taskLocation:ct.fromUnknownPosition(e),indentation:s,listMarker:a,blockLink:f,priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,recurrence:null,tags:[],originalMarkdown:"",scheduledDateIsInferred:!1})};var Kb=(r,e,t,n)=>{var f;if(r)return t instanceof fp.MarkdownView;if(!(t instanceof fp.MarkdownView))return;let i=(f=t.file)==null?void 0:f.path;if(i===void 0)return;let a=e.getCursor().line,o=e.getLine(a),u=Qo({line:o,path:i}),l=h=>{let T=ht.removeInferredStatusIfNeeded(u,h).map(y=>y.toFileLineString()).join(` +`);e.setLine(a,T)};new mn({app:n,task:u,onSubmit:l}).open()};var pp=require("obsidian");var Qb=(r,e,t)=>{var u;if(r)return t instanceof pp.MarkdownView;if(!(t instanceof pp.MarkdownView))return;let n=(u=t.file)==null?void 0:u.path;if(n===void 0)return;let i=e.getCursor(),s=i.line,a=e.getLine(s),o=YC(a,n);e.setLine(s,o.text),e.setCursor(jC(i,o))},YC=(r,e)=>{let t=le.fromLine({line:r,taskLocation:ct.fromUnknownPosition(e),fallbackDate:null});if(t!==null){let n=t.toggleWithRecurrenceInUsersOrder().map(i=>i.toFileLineString());return{text:n.join(` +`),moveTo:{line:n.length-1}}}else{let n=r.match(V.taskRegex);if(n!==null){let i=n[3],a=ve.getInstance().bySymbol(i).nextStatusSymbol;return{text:r.replace(V.taskRegex,`$1- [${a}] $4`)}}else if(V.listItemRegex.test(r)){let i=r.replace(V.listItemRegex,"$1$2 [ ]");return{text:i,moveTo:{ch:i.length}}}else{let i=r.replace(V.indentationRegex,"$1- ");return{text:i,moveTo:{ch:i.length}}}}},jC=(r,e)=>{var s;let t={line:0,ch:r.ch},n=we(we({},t),(s=e.moveTo)!=null?s:{}),i=e.text.split(` +`)[n.line].length;return{line:r.line+n.line,ch:Math.min(n.ch,i)}};var Xo=class{get app(){return this.plugin.app}constructor({plugin:e}){this.plugin=e,e.addCommand({id:"edit-task",name:"Create or edit task",icon:"pencil",editorCheckCallback:(t,n,i)=>Kb(t,n,i,this.app)}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:Qb})}};var GC=Object.prototype.toString,Li=Array.isArray||function(e){return GC.call(e)==="[object Array]"};function mp(r){return typeof r=="function"}function BC(r){return Li(r)?"array":typeof r}function hp(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Xb(r,e){return r!=null&&typeof r=="object"&&e in r}function HC(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var zC=RegExp.prototype.test;function VC(r,e){return zC.call(r,e)}var KC=/\S/;function QC(r){return!VC(KC,r)}var XC={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function ZC(r){return String(r).replace(/[&<>"'`=\/]/g,function(t){return XC[t]})}var JC=/\s*/,eA=/\s+/,Zb=/\s*=/,tA=/\s*\}/,rA=/#|\^|\/|>|\{|&|=|!/;function nA(r,e){if(!r)return[];var t=!1,n=[],i=[],s=[],a=!1,o=!1,u="",l=0;function c(){if(a&&!o)for(;s.length;)delete i[s.pop()];else s=[];a=!1,o=!1}var f,h,T;function y(G){if(typeof G=="string"&&(G=G.split(eA,2)),!Li(G)||G.length!==2)throw new Error("Invalid tags: "+G);f=new RegExp(hp(G[0])+"\\s*"),h=new RegExp("\\s*"+hp(G[1])),T=new RegExp("\\s*"+hp("}"+G[1]))}y(e||Jt.tags);for(var w=new Ea(r),D,C,N,L,oe,z;!w.eos();){if(D=w.pos,N=w.scanUntil(f),N)for(var ie=0,j=N.length;ie"?oe=[C,N,D,w.pos,u,l,t]:oe=[C,N,D,w.pos],l++,i.push(oe),C==="#"||C==="^")n.push(oe);else if(C==="/"){if(z=n.pop(),!z)throw new Error('Unopened section "'+N+'" at '+D);if(z[1]!==N)throw new Error('Unclosed section "'+z[1]+'" at '+D)}else C==="name"||C==="{"||C==="&"?o=!0:C==="="&&y(N)}if(c(),z=n.pop(),z)throw new Error('Unclosed section "'+z[1]+'" at '+w.pos);return sA(iA(i))}function iA(r){for(var e=[],t,n,i=0,s=r.length;i0?n[n.length-1][4]:e;break;default:t.push(i)}return e}function Ea(r){this.string=r,this.tail=r,this.pos=0}Ea.prototype.eos=function(){return this.tail===""};Ea.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n};Ea.prototype.scanUntil=function(e){var t=this.tail.search(e),n;switch(t){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=n.length,n};function Fi(r,e){this.view=r,this.cache={".":this.view},this.parent=e}Fi.prototype.push=function(e){return new Fi(e,this)};Fi.prototype.lookup=function(e){var t=this.cache,n;if(t.hasOwnProperty(e))n=t[e];else{for(var i=this,s,a,o,u=!1;i;){if(e.indexOf(".")>0)for(s=i.view,a=e.split("."),o=0;s!=null&&o"?l=this.renderPartial(o,t,n,s):u==="&"?l=this.unescapedValue(o,t):u==="name"?l=this.escapedValue(o,t,s):u==="text"&&(l=this.rawValue(o)),l!==void 0&&(a+=l);return a};Dt.prototype.renderSection=function(e,t,n,i,s){var a=this,o="",u=t.lookup(e[1]);function l(h){return a.render(h,t,n,s)}if(!!u){if(Li(u))for(var c=0,f=u.length;c0||!n)&&(s[a]=i+s[a]);return s.join(` -`)};kt.prototype.renderPartial=function(e,t,n,i){if(!!n){var s=this.getConfigTags(i),a=dp(n)?n(e[1]):n[e[1]];if(a!=null){var o=e[6],u=e[5],l=e[4],c=a;u==0&&l&&(c=this.indentPartial(a,l,o));var p=this.parse(c,s);return this.renderTokens(p,t,n,c,i)}}};kt.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(n!=null)return n};kt.prototype.escapedValue=function(e,t,n){var i=this.getConfigEscape(n)||Jt.escape,s=t.lookup(e[1]);if(s!=null)return typeof s=="number"&&i===Jt.escape?String(s):i(s)};kt.prototype.rawValue=function(e){return e[1]};kt.prototype.getConfigTags=function(e){return Ii(e)?e:e&&typeof e=="object"?e.tags:void 0};kt.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!Ii(e))return e.escape};var Jt={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(r){va.templateCache=r},get templateCache(){return va.templateCache}},va=new kt;Jt.clearCache=function(){return va.clearCache()};Jt.parse=function(e,t){return va.parse(e,t)};Jt.render=function(e,t,n,i){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+AC(e)+'" was given as the first argument for mustache#render(template, view, partials)');return va.render(e,t,n,i)};Jt.escape=WC;Jt.Scanner=wa;Jt.Context=Ni;Jt.Writer=kt;var fp=Jt;var QT=ss(KT());function XT(r,e){fp.escape=function(t){return t};try{return fp.render(r,(0,QT.default)(e))}catch(t){let n="";throw t instanceof Error?n=`There was an error expanding one or more placeholders. +`)};Dt.prototype.renderPartial=function(e,t,n,i){if(!!n){var s=this.getConfigTags(i),a=mp(n)?n(e[1]):n[e[1]];if(a!=null){var o=e[6],u=e[5],l=e[4],c=a;u==0&&l&&(c=this.indentPartial(a,l,o));var f=this.parse(c,s);return this.renderTokens(f,t,n,c,i)}}};Dt.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(n!=null)return n};Dt.prototype.escapedValue=function(e,t,n){var i=this.getConfigEscape(n)||Jt.escape,s=t.lookup(e[1]);if(s!=null)return typeof s=="number"&&i===Jt.escape?String(s):i(s)};Dt.prototype.rawValue=function(e){return e[1]};Dt.prototype.getConfigTags=function(e){return Li(e)?e:e&&typeof e=="object"?e.tags:void 0};Dt.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!Li(e))return e.escape};var Jt={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(r){wa.templateCache=r},get templateCache(){return wa.templateCache}},wa=new Dt;Jt.clearCache=function(){return wa.clearCache()};Jt.parse=function(e,t){return wa.parse(e,t)};Jt.render=function(e,t,n,i){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+BC(e)+'" was given as the first argument for mustache#render(template, view, partials)');return wa.render(e,t,n,i)};Jt.escape=ZC;Jt.Scanner=Ea;Jt.Context=Fi;Jt.Writer=Dt;var gp=Jt;var n_=as(r_());function i_(r,e){gp.escape=function(t){return t};try{return gp.render(r,(0,n_.default)(e))}catch(t){let n="";throw t instanceof Error?n=`There was an error expanding one or more placeholders. The error message was: ${t.message.replace(/ > /g,".").replace("Missing Mustache data property","Unknown property")}`:n="Unknown error expanding placeholders.",n+=` The problem is in: - ${r}`,Error(n)}}function Qo(r){return{query:{file:new Ri(r)}}}function zn(r,e){let t=`Error: ${r}. + ${r}`,Error(n)}}function Zo(r){return{query:{file:new Mi(r)}}}function Vn(r,e){let t=`Error: ${r}. The error message was: - `,n="";return e instanceof Error?n+=e:n+="Unknown error",`${t}"${n}"`}var Qr=class{constructor(e,t,n){this.property=e,this.comparator=Qr.maybeReverse(n,t)}static maybeReverse(e,t){return e?Qr.makeReversedComparator(t):t}static makeReversedComparator(e){return(t,n)=>e(t,n)*-1}};var mn=class{constructor(e,t,n){this.property=e,this.grouper=t,this.reverse=n}};var we=class{canCreateFilterForLine(e){return we.lineMatchesFilter(this.filterRegExp(),e)}static lineMatchesFilter(e,t){return e?e.test(t):!1}static getMatch(e,t){return e?t.match(e):null}fieldNameSingular(){return this.fieldName()}fieldNameSingularEscaped(){return $o(this.fieldNameSingular())}supportsSorting(){return!1}createSorterFromLine(e){if(!this.supportsSorting())return null;let t=we.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createSorter(n)}sorterRegExp(){if(!this.supportsSorting())throw Error(`sorterRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)?`,"i")}comparator(){throw Error(`comparator() unimplemented for ${this.fieldNameSingular()}`)}createSorter(e){return new Qr(this.fieldNameSingular(),this.comparator(),e)}createNormalSorter(){return this.createSorter(!1)}createReverseSorter(){return this.createSorter(!0)}supportsGrouping(){return!1}createGrouperFromLine(e){if(!this.supportsGrouping())return null;let t=we.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createGrouper(n)}grouperRegExp(){if(!this.supportsGrouping())throw Error(`grouperRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)?$`,"i")}grouper(){throw Error(`grouper() unimplemented for ${this.fieldNameSingular()}`)}createGrouper(e){return new mn(this.fieldNameSingular(),this.grouper(),e)}createNormalGrouper(){return this.createGrouper(!1)}createReverseGrouper(){return this.createGrouper(!0)}};var Ee=class{constructor(e,t=[],n=""){this.description=e,this.symbol=n,this.children=t}static booleanAnd(e){return this.combineOrCreateExplanation("All of",e,"AND")}static booleanOr(e){return this.combineOrCreateExplanation("At least one of",e,"OR")}static booleanNot(e){return new Ee("None of",e,"NOT")}static booleanXor(e){return new Ee("Exactly one of",e,"XOR")}asString(e=""){if(this.children.length==0)return e+this.description;let t=e;this.symbol===""?t+=this.description:(t+=this.symbol,this.children.length>1&&(t+=` (${this.description})`),t+=":");let n=e+" ";for(let i=0;ie(t,n)*-1}};var gn=class{constructor(e,t,n){this.property=e,this.grouper=t,this.reverse=n}};var ke=class{canCreateFilterForLine(e){return ke.lineMatchesFilter(this.filterRegExp(),e)}static lineMatchesFilter(e,t){return e?e.test(t):!1}static getMatch(e,t){return e?t.match(e):null}fieldNameSingular(){return this.fieldName()}fieldNameSingularEscaped(){return $o(this.fieldNameSingular())}supportsSorting(){return!1}createSorterFromLine(e){if(!this.supportsSorting())return null;let t=ke.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createSorter(n)}sorterRegExp(){if(!this.supportsSorting())throw Error(`sorterRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)?`,"i")}comparator(){throw Error(`comparator() unimplemented for ${this.fieldNameSingular()}`)}createSorter(e){return new Xr(this.fieldNameSingular(),this.comparator(),e)}createNormalSorter(){return this.createSorter(!1)}createReverseSorter(){return this.createSorter(!0)}supportsGrouping(){return!1}createGrouperFromLine(e){if(!this.supportsGrouping())return null;let t=ke.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createGrouper(n)}grouperRegExp(){if(!this.supportsGrouping())throw Error(`grouperRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)?$`,"i")}grouper(){throw Error(`grouper() unimplemented for ${this.fieldNameSingular()}`)}createGrouper(e){return new gn(this.fieldNameSingular(),this.grouper(),e)}createNormalGrouper(){return this.createGrouper(!1)}createReverseGrouper(){return this.createGrouper(!0)}};var Se=class{constructor(e,t=[],n=""){this.description=e,this.symbol=n,this.children=t}static booleanAnd(e){return this.combineOrCreateExplanation("All of",e,"AND")}static booleanOr(e){return this.combineOrCreateExplanation("At least one of",e,"OR")}static booleanNot(e){return new Se("None of",e,"NOT")}static booleanXor(e){return new Se("Exactly one of",e,"XOR")}asString(e=""){if(this.children.length==0)return e+this.description;let t=e;this.symbol===""?t+=this.description:(t+=this.symbol,this.children.length>1&&(t+=` (${this.description})`),t+=":");let n=e+" ";for(let i=0;i ${t.asString(" ")} -`}};var wr=class{constructor(e){this.instruction=e}get queryComponent(){return this._queryComponent}set queryComponent(e){this._queryComponent=e}get error(){return this._error}set error(e){this._error=e}static fromObject(e,t){let n=new wr(e);return n._queryComponent=t,n}static fromError(e,t){let n=new wr(e);return n._error=t,n}};var J=class{constructor(e){this.object=e}get instruction(){return this.object.instruction}get filter(){return this.object.queryComponent}get error(){return this.object.error}get filterFunction(){if(this.filter)return this.filter.filterFunction}static fromFilter(e){return new J(wr.fromObject(e.instruction,e))}static fromError(e,t){return new J(wr.fromError(e,t))}};var Xo=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e.toLocaleLowerCase()===this._instruction.toLocaleLowerCase()}createFilterOrErrorMessage(e){return this.canCreateFilterForLine(e)?J.fromFilter(new pt(e,this._filter,new Ee(e))):J.fromError(e,`do not understand filter: ${e}`)}};var Er=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new Xo(e,t))}canCreateFilterForLine(e){for(let t of this._filters)if(t.canCreateFilterForLine(e))return!0;return!1}createFilterOrErrorMessage(e){for(let t of this._filters){let n=t.createFilterOrErrorMessage(e);if(n.error===void 0)return n}return J.fromError(e,`do not understand filter: ${e}`)}};var gn=class extends we{constructor(){super(...arguments);this._filters=new Er}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var kr=class extends gn{constructor(){super(),this._filters.add("done",e=>e.isDone),this._filters.add("not done",e=>!e.isDone)}fieldName(){return"status"}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=kr.oldStatusName(e),i=kr.oldStatusName(t);return ni?-1:0}}static oldStatusName(e){return e.status.symbol===" "?"Todo":"Done"}supportsGrouping(){return!0}grouper(){return e=>[kr.oldStatusName(e)]}};var Zo=class{findUnexpandedDateText(e){let t=["<%","YYYY-MM-DD"];for(let n of t)if(e.includes(n))return this.unexpandedDateTextMessage(n);return null}unexpandedDateTextMessage(e){return`Instruction contains unexpanded template text: "${e}" - and cannot be interpreted. +`}};var Er=class{constructor(e){this.instruction=e}get queryComponent(){return this._queryComponent}set queryComponent(e){this._queryComponent=e}get error(){return this._error}set error(e){this._error=e}static fromObject(e,t){let n=new Er(e);return n._queryComponent=t,n}static fromError(e,t){let n=new Er(e);return n._error=t,n}};var J=class{constructor(e){this.object=e}get instruction(){return this.object.instruction}get filter(){return this.object.queryComponent}get error(){return this.object.error}get filterFunction(){if(this.filter)return this.filter.filterFunction}static fromFilter(e){return new J(Er.fromObject(e.instruction,e))}static fromError(e,t){return new J(Er.fromError(e,t))}};var Jo=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e.toLocaleLowerCase()===this._instruction.toLocaleLowerCase()}createFilterOrErrorMessage(e){return this.canCreateFilterForLine(e)?J.fromFilter(new gt(e,this._filter,new Se(e))):J.fromError(e,`do not understand filter: ${e}`)}};var kr=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new Jo(e,t))}canCreateFilterForLine(e){for(let t of this._filters)if(t.canCreateFilterForLine(e))return!0;return!1}createFilterOrErrorMessage(e){for(let t of this._filters){let n=t.createFilterOrErrorMessage(e);if(n.error===void 0)return n}return J.fromError(e,`do not understand filter: ${e}`)}};var yn=class extends ke{constructor(){super(...arguments);this._filters=new kr}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var Sr=class extends yn{constructor(){super(),this._filters.add("done",e=>e.isDone),this._filters.add("not done",e=>!e.isDone)}fieldName(){return"status"}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Sr.oldStatusName(e),i=Sr.oldStatusName(t);return ni?-1:0}}static oldStatusName(e){return e.status.symbol===" "?"Todo":"Done"}supportsGrouping(){return!0}grouper(){return e=>[Sr.oldStatusName(e)]}};var eu=class{findUnexpandedDateText(e){let t=["<%","YYYY-MM-DD"];for(let n of t)if(e.includes(n))return this.unexpandedDateTextMessage(n);return null}unexpandedDateTextMessage(e){return`Instruction contains unexpanded template text: "${e}" - and cannot be interpreted. Possible causes: - The query is an a template file, and is not intended to be searched. @@ -195,7 +195,7 @@ Possible causes: instead of in to a template file. See: https://publish.obsidian.md/tasks/Advanced/Instruction+contains+unexpanded+template+text -`}};var ht=class extends we{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new Er,this.filterInstructions.add(`has ${this.fieldName()} date`,n=>this.date(n)!==null),this.filterInstructions.add(`no ${this.fieldName()} date`,n=>this.date(n)===null),this.filterInstructions.add(`${this.fieldName()} date is invalid`,n=>{let i=this.date(n);return i!==null&&!i.isValid()}))}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){var h;let n=this.checkForUnexpandedTemplateText(t);if(n)return J.fromError(t,n);let i=this.filterInstructions.createFilterOrErrorMessage(t);if(i.filter!==void 0)return i;let s=we.getMatch(this.filterRegExp(),t);if(s===null)return J.fromError(t,"do not understand query filter ("+this.fieldName()+" date)");let a=s[1],o=(h=s[2])==null?void 0:h.toLowerCase(),u=s[3],l=Nt.parseDateRange(u);if(!l.isValid()){let _=Nt.parseDate(a);_.isValid()&&(l=new vt(_,_))}if(!l.isValid())return J.fromError(t,"do not understand "+this.fieldName()+" date");let c=this.buildFilterFunction(o,l),p=ht.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),l);return J.fromFilter(new pt(t,c,p))}buildFilterFunction(t,n){let i;switch(t){case"before":i=s=>s?s.isBefore(n.start):this.filterResultIfFieldMissing();break;case"after":i=s=>s?s.isAfter(n.end):this.filterResultIfFieldMissing();break;case"on or before":case"in or before":i=s=>s?s.isSameOrBefore(n.end):this.filterResultIfFieldMissing();break;case"on or after":case"in or after":i=s=>s?s.isSameOrAfter(n.start):this.filterResultIfFieldMissing();break;default:i=s=>s?s.isSameOrAfter(n.start)&&s.isSameOrBefore(n.end):this.filterResultIfFieldMissing()}return this.getFilter(i)}getFilter(t){return n=>t(this.date(n))}filterRegExp(){return new RegExp(`^${this.fieldNameForFilterInstruction()} (((?:on|in) or before|before|(?:on|in) or after|after|on|in)? ?(.*))`,"i")}fieldNameForFilterInstruction(){return this.fieldName()}static buildExplanation(t,n,i,s){let a=n,o="YYYY-MM-DD (dddd Do MMMM YYYY)",u;switch(n){case"before":case"on or after":u=s.start.format(o);break;case"after":case"on or before":u=s.end.format(o);break;case"in or before":a="on or before",u=s.end.format(o);break;case"in or after":a="on or after",u=s.start.format(o);break;default:if(!s.start.isSame(s.end)){let c=`${t} date is between:`,p=[new Ee(`${s.start.format(o)} and`),new Ee(`${s.end.format(o)} inclusive`)];return i&&p.push(new Ee(`OR no ${t} date`)),new Ee(c,p)}a="on",u=s.start.format(o);break}let l=`${t} date is ${a} ${u}`;return i&&(l+=` OR no ${t} date`),new Ee(l)}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(t,n)=>Gr(this.date(t),this.date(n))}supportsGrouping(){return!0}grouper(){return t=>{let n=this.date(t);return n===null?["No "+this.fieldName()+" date"]:[n.format("YYYY-MM-DD dddd")]}}checkForUnexpandedTemplateText(t){return new Zo().findUnexpandedDateText(t)}};var Fi=class extends ht{fieldName(){return"due"}date(e){return e.dueDate}filterResultIfFieldMissing(){return!1}};var hp=class extends we{createFilterOrErrorMessage(e){var n;let t=we.getMatch(this.filterRegExp(),e);if(t!==null){let i=t[5],s=null;switch(i.toLowerCase()){case"lowest":s="5";break;case"low":s="4";break;case"none":s="3";break;case"medium":s="2";break;case"high":s="1";break;case"highest":s="0";break}if(s===null)return J.fromError(e,"do not understand priority");let a=e,o;switch((n=t[3])==null?void 0:n.toLowerCase()){case"above":o=u=>u.priority.localeCompare(s)<0;break;case"below":o=u=>u.priority.localeCompare(s)>0;break;case"not":o=u=>u.priority!==s;break;default:o=u=>u.priority===s,a=`${this.fieldName()} is ${i}`}return J.fromFilter(new pt(e,o,new Ee(a)))}else return J.fromError(e,"do not understand query filter (priority)")}fieldName(){return"priority"}filterRegExp(){return hp.priorityRegexp}supportsSorting(){return!0}comparator(){return(e,t)=>e.priority.localeCompare(t.priority)}supportsGrouping(){return!0}grouper(){return e=>[e.priorityNameGroupText]}},Vn=hp;Vn.priorityRegexp=/^priority(\s+is)?(\s+(above|below|not))?(\s+(lowest|low|none|medium|high|highest))$/i;var Li=class{matchesAnyOf(e){return e.some(t=>this.matches(t))}};var Ui=class extends Li{constructor(t){super();this.stringToFind=t}matches(t){return Ui.stringIncludesCaseInsensitive(t,this.stringToFind)}static stringIncludesCaseInsensitive(t,n){return t.toLocaleLowerCase().includes(n.toLocaleLowerCase())}explanation(t){return new Ee(t)}};var yn=class extends Li{constructor(t){super();this.regex=t}static validateAndConstruct(t){let n=/^\/(.+)\/([^/]*)$/,i=t.match(n);if(i!==null){let s=new RegExp(i[1],i[2]);return new yn(s)}else return null}matches(t){return t.match(this.regex)!==null}static helpMessage(){return String.raw`See https://publish.obsidian.md/tasks/Queries/Regular+Expressions +`}};var yt=class extends ke{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new kr,this.filterInstructions.add(`has ${this.fieldName()} date`,n=>this.date(n)!==null),this.filterInstructions.add(`no ${this.fieldName()} date`,n=>this.date(n)===null),this.filterInstructions.add(`${this.fieldName()} date is invalid`,n=>{let i=this.date(n);return i!==null&&!i.isValid()}))}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){var h;let n=this.checkForUnexpandedTemplateText(t);if(n)return J.fromError(t,n);let i=this.filterInstructions.createFilterOrErrorMessage(t);if(i.filter!==void 0)return i;let s=ke.getMatch(this.filterRegExp(),t);if(s===null)return J.fromError(t,"do not understand query filter ("+this.fieldName()+" date)");let a=s[1],o=(h=s[2])==null?void 0:h.toLowerCase(),u=s[3],l=Nt.parseDateRange(u);if(!l.isValid()){let T=Nt.parseDate(a);T.isValid()&&(l=new Et(T,T))}if(!l.isValid())return J.fromError(t,"do not understand "+this.fieldName()+" date");let c=this.buildFilterFunction(o,l),f=yt.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),l);return J.fromFilter(new gt(t,c,f))}buildFilterFunction(t,n){let i;switch(t){case"before":i=s=>s?s.isBefore(n.start):this.filterResultIfFieldMissing();break;case"after":i=s=>s?s.isAfter(n.end):this.filterResultIfFieldMissing();break;case"on or before":case"in or before":i=s=>s?s.isSameOrBefore(n.end):this.filterResultIfFieldMissing();break;case"on or after":case"in or after":i=s=>s?s.isSameOrAfter(n.start):this.filterResultIfFieldMissing();break;default:i=s=>s?s.isSameOrAfter(n.start)&&s.isSameOrBefore(n.end):this.filterResultIfFieldMissing()}return this.getFilter(i)}getFilter(t){return n=>t(this.date(n))}filterRegExp(){return new RegExp(`^${this.fieldNameForFilterInstruction()} (((?:on|in) or before|before|(?:on|in) or after|after|on|in)? ?(.*))`,"i")}fieldNameForFilterInstruction(){return this.fieldName()}static buildExplanation(t,n,i,s){let a=n,o="YYYY-MM-DD (dddd Do MMMM YYYY)",u;switch(n){case"before":case"on or after":u=s.start.format(o);break;case"after":case"on or before":u=s.end.format(o);break;case"in or before":a="on or before",u=s.end.format(o);break;case"in or after":a="on or after",u=s.start.format(o);break;default:if(!s.start.isSame(s.end)){let c=`${t} date is between:`,f=[new Se(`${s.start.format(o)} and`),new Se(`${s.end.format(o)} inclusive`)];return i&&f.push(new Se(`OR no ${t} date`)),new Se(c,f)}a="on",u=s.start.format(o);break}let l=`${t} date is ${a} ${u}`;return i&&(l+=` OR no ${t} date`),new Se(l)}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(t,n)=>Gr(this.date(t),this.date(n))}supportsGrouping(){return!0}grouper(){return t=>{let n=this.date(t);return n===null?["No "+this.fieldName()+" date"]:[n.format("YYYY-MM-DD dddd")]}}checkForUnexpandedTemplateText(t){return new eu().findUnexpandedDateText(t)}};var Ui=class extends yt{fieldName(){return"due"}date(e){return e.dueDate}filterResultIfFieldMissing(){return!1}};var Tp=class extends ke{createFilterOrErrorMessage(e){var n;let t=ke.getMatch(this.filterRegExp(),e);if(t!==null){let i=t[5],s=null;switch(i.toLowerCase()){case"lowest":s="5";break;case"low":s="4";break;case"none":s="3";break;case"medium":s="2";break;case"high":s="1";break;case"highest":s="0";break}if(s===null)return J.fromError(e,"do not understand priority");let a=e,o;switch((n=t[3])==null?void 0:n.toLowerCase()){case"above":o=u=>u.priority.localeCompare(s)<0;break;case"below":o=u=>u.priority.localeCompare(s)>0;break;case"not":o=u=>u.priority!==s;break;default:o=u=>u.priority===s,a=`${this.fieldName()} is ${i}`}return J.fromFilter(new gt(e,o,new Se(a)))}else return J.fromError(e,"do not understand query filter (priority)")}fieldName(){return"priority"}filterRegExp(){return Tp.priorityRegexp}supportsSorting(){return!0}comparator(){return(e,t)=>e.priority.localeCompare(t.priority)}supportsGrouping(){return!0}grouper(){return e=>[e.priorityNameGroupText]}},Kn=Tp;Kn.priorityRegexp=/^priority(\s+is)?(\s+(above|below|not))?(\s+(lowest|low|none|medium|high|highest))$/i;var Wi=class{matchesAnyOf(e){return e.some(t=>this.matches(t))}};var qi=class extends Wi{constructor(t){super();this.stringToFind=t}matches(t){return qi.stringIncludesCaseInsensitive(t,this.stringToFind)}static stringIncludesCaseInsensitive(t,n){return t.toLocaleLowerCase().includes(n.toLocaleLowerCase())}explanation(t){return new Se(t)}};var Tn=class extends Wi{constructor(t){super();this.regex=t}static validateAndConstruct(t){let n=/^\/(.+)\/([^/]*)$/,i=t.match(n);if(i!==null){let s=new RegExp(i[1],i[2]);return new Tn(s)}else return null}matches(t){return t.match(this.regex)!==null}static helpMessage(){return String.raw`See https://publish.obsidian.md/tasks/Queries/Regular+Expressions Regular expressions must look like this: /pattern/ @@ -221,33 +221,33 @@ to find them literally, you must add a \ before them: CAUTION! Regular expression (or 'regex') searching is a powerful but advanced feature that requires thorough knowledge in order to use successfully, and not miss intended search results. -`}explanation(t){let i=zC(t,"using regex: ",this.regexAsString());return new Ee(i)}regexAsString(){let t=`'${this.regex.source}' with `;switch(this.regex.flags.length){case 0:t+="no flags";break;case 1:t+=`flag '${this.regex.flags}'`;break;default:t+=`flags '${this.regex.flags}'`;break}return t}};function zC(r,e,t){var o;let n=r.match(/\//);if(!n)return"Error explaining instruction. Could not find a slash character";let i=2,s=((o=n.index)!=null?o:i)-i;return`${e.padEnd(s)}${t}`}var Me=class extends we{createFilterOrErrorMessage(e){let t=we.getMatch(this.filterRegExp(),e);if(t===null)return J.fromError(e,`do not understand query filter (${this.fieldName()})`);let n=t[1].toLowerCase(),i=t[2],s=null;if(n.includes("include"))s=new Ui(i);else if(n.includes("regex")){try{s=yn.validateAndConstruct(i)}catch(u){let l=zn("Parsing regular expression",u)+` +`}explanation(t){let i=aA(t,"using regex: ",this.regexAsString());return new Se(i)}regexAsString(){let t=`'${this.regex.source}' with `;switch(this.regex.flags.length){case 0:t+="no flags";break;case 1:t+=`flag '${this.regex.flags}'`;break;default:t+=`flags '${this.regex.flags}'`;break}return t}};function aA(r,e,t){var o;let n=r.match(/\//);if(!n)return"Error explaining instruction. Could not find a slash character";let i=2,s=((o=n.index)!=null?o:i)-i;return`${e.padEnd(s)}${t}`}var Me=class extends ke{createFilterOrErrorMessage(e){let t=ke.getMatch(this.filterRegExp(),e);if(t===null)return J.fromError(e,`do not understand query filter (${this.fieldName()})`);let n=t[1].toLowerCase(),i=t[2],s=null;if(n.includes("include"))s=new qi(i);else if(n.includes("regex")){try{s=Tn.validateAndConstruct(i)}catch(u){let l=Vn("Parsing regular expression",u)+` -${yn.helpMessage()}`;return J.fromError(e,l)}if(s===null)return J.fromError(e,`Invalid instruction: '${e}' +${Tn.helpMessage()}`;return J.fromError(e,l)}if(s===null)return J.fromError(e,`Invalid instruction: '${e}' -${yn.helpMessage()}`)}if(s===null)return J.fromError(e,`do not understand query filter (${this.fieldName()})`);let a=n.match(/not/)!==null,o=new pt(e,this.getFilter(s,a),s.explanation(e));return J.fromFilter(o)}fieldPattern(){return this.fieldNameSingularEscaped()}filterOperatorPattern(){return"includes|does not include|regex matches|regex does not match"}filterRegExp(){return new RegExp(`^(?:${this.fieldPattern()}) (${this.filterOperatorPattern()}) (.*)`,"i")}getFilter(e,t){return n=>{let i=e.matches(this.value(n));return t?!i:i}}comparator(){return(e,t)=>this.value(e).localeCompare(this.value(t),void 0,{numeric:!0})}grouper(){return e=>[this.value(e)]}static escapeMarkdownCharacters(e){return e.replace(/\\/g,"\\\\").replace(/_/g,"\\_")}};var Wi=class extends Me{fieldName(){return"path"}value(e){return e.path}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>[Me.escapeMarkdownCharacters(e.path.replace(".md",""))]}};var qi=class extends we{canCreateFilterForLine(e){return!1}createFilterOrErrorMessage(e){return J.fromError(e,"Filtering by urgency is not yet supported")}fieldName(){return"urgency"}filterRegExp(){throw Error(`filterRegExp() unimplemented for ${this.fieldName()}`)}supportsSorting(){return!0}comparator(){return(e,t)=>t.urgency-e.urgency}supportsGrouping(){return!0}grouper(){return e=>[`${e.urgency.toFixed(2)}`]}createGrouper(e){return super.createGrouper(!e)}};var $i=class{static by(e,t){let n=[new qi().comparator(),new kr().comparator(),new Fi().comparator(),new Vn().comparator(),new Wi().comparator()],i=[];for(let s of e)i.push(s.comparator);return t.sort($i.makeCompositeComparator([...i,...n]))}static makeCompositeComparator(e){return(t,n)=>{for(let i of e){let s=i(t,n);if(s!==0)return s}return 0}}};var Jo=class{constructor(e,t,n){this.nestingLevel=e,this.displayName=t,this.property=n}};var eu=class{constructor(e,t){this.lastHeadingAtLevel=new Array;this.groupers=t;let i=e.keys().next().value.length;for(let s=0;st.set(o,a)),e.pop();return t}};var ru=class extends tu{},nu=class{constructor(e,t,n){this.root=new ru(t),this.buildGroupingTree(e,n)}buildGroupingTree(e,t){let n=[this.root];for(let i of e){let s=[];for(let a of n)for(let o of a.values){let u=i.grouper(o,t);u.length===0&&u.push("");for(let l of u){let c=a.children.get(l);c===void 0&&(c=new ru([]),a.children.set(l,c),s.push(c)),c.values.push(o)}}n=s}}generateTaskTreeStorage(){return this.root.generateAllPaths()}};var iu=class{constructor(e,t){this.groups=e,this.groupHeadings=[],this.tasks=t}setGroupHeadings(e){for(let t of e)this.groupHeadings.push(t)}applyTaskLimit(e){this.tasks=this.tasks.slice(0,e)}tasksAsStringOfLines(){let e="";for(let t of this.tasks)e+=t.toFileLineString()+` +${Tn.helpMessage()}`)}if(s===null)return J.fromError(e,`do not understand query filter (${this.fieldName()})`);let a=n.match(/not/)!==null,o=new gt(e,this.getFilter(s,a),s.explanation(e));return J.fromFilter(o)}fieldPattern(){return this.fieldNameSingularEscaped()}filterOperatorPattern(){return"includes|does not include|regex matches|regex does not match"}filterRegExp(){return new RegExp(`^(?:${this.fieldPattern()}) (${this.filterOperatorPattern()}) (.*)`,"i")}getFilter(e,t){return n=>{let i=e.matches(this.value(n));return t?!i:i}}comparator(){return(e,t)=>this.value(e).localeCompare(this.value(t),void 0,{numeric:!0})}grouper(){return e=>[this.value(e)]}static escapeMarkdownCharacters(e){return e.replace(/\\/g,"\\\\").replace(/_/g,"\\_")}};var $i=class extends Me{fieldName(){return"path"}value(e){return e.path}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>[Me.escapeMarkdownCharacters(e.path.replace(".md",""))]}};var Yi=class extends ke{canCreateFilterForLine(e){return!1}createFilterOrErrorMessage(e){return J.fromError(e,"Filtering by urgency is not yet supported")}fieldName(){return"urgency"}filterRegExp(){throw Error(`filterRegExp() unimplemented for ${this.fieldName()}`)}supportsSorting(){return!0}comparator(){return(e,t)=>t.urgency-e.urgency}supportsGrouping(){return!0}grouper(){return e=>[`${e.urgency.toFixed(2)}`]}createGrouper(e){return super.createGrouper(!e)}};var ji=class{static by(e,t){let n=[new Yi().comparator(),new Sr().comparator(),new Ui().comparator(),new Kn().comparator(),new $i().comparator()],i=[];for(let s of e)i.push(s.comparator);return t.sort(ji.makeCompositeComparator([...i,...n]))}static makeCompositeComparator(e){return(t,n)=>{for(let i of e){let s=i(t,n);if(s!==0)return s}return 0}}};var tu=class{constructor(e,t,n){this.nestingLevel=e,this.displayName=t,this.property=n}};var ru=class{constructor(e,t){this.lastHeadingAtLevel=new Array;this.groupers=t;let i=e.keys().next().value.length;for(let s=0;st.set(o,a)),e.pop();return t}};var iu=class extends nu{},su=class{constructor(e,t,n){this.root=new iu(t),this.buildGroupingTree(e,n)}buildGroupingTree(e,t){let n=[this.root];for(let i of e){let s=[];for(let a of n)for(let o of a.values){let u=i.grouper(o,t);u.length===0&&u.push("");for(let l of u){let c=a.children.get(l);c===void 0&&(c=new iu([]),a.children.set(l,c),s.push(c)),c.values.push(o)}}n=s}}generateTaskTreeStorage(){return this.root.generateAllPaths()}};var au=class{constructor(e,t){this.groups=e,this.groupHeadings=[],this.tasks=t}setGroupHeadings(e){for(let t of e)this.groupHeadings.push(t)}applyTaskLimit(e){this.tasks=this.tasks.slice(0,e)}tasksAsStringOfLines(){let e="";for(let t of this.tasks)e+=t.toFileLineString()+` `;return e}toString(){let e=` `;e+=`Group names: [${this.groups}] `;for(let t of this.groupHeadings)e+=`${"#".repeat(4+t.nestingLevel)} [${t.property}] ${t.displayName} -`;return e+=this.tasksAsStringOfLines(),e}};var Yi=class{constructor(e,t,n){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length,this._groupers=e;let s=new nu(e,t,n).generateTaskTreeStorage();this.addTaskGroups(s),this.sortTaskGroups(),this.setGroupsHeadings(s)}get groupers(){return this._groupers}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let e="";e+=`Groupers (if any): +`;return e+=this.tasksAsStringOfLines(),e}};var Gi=class{constructor(e,t,n){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length,this._groupers=e;let s=new su(e,t,n).generateTaskTreeStorage();this.addTaskGroups(s),this.sortTaskGroups(),this.setGroupsHeadings(s)}get groupers(){return this._groupers}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let e="";e+=`Groupers (if any): `;for(let n of this._groupers){let i=n.reverse?" reverse":"";e+=`- ${n.property}${i} `}for(let n of this.groups)e+=n.toString(),e+=` --- `;return e+=` ${this.totalTasksCount()} tasks -`,e}addTaskGroups(e){for(let[t,n]of e){let i=new iu(t,n);this.addTaskGroup(i)}}addTaskGroup(e){this._groups.push(e)}sortTaskGroups(){let e=(t,n)=>{let i=t.groups,s=n.groups;for(let a=0;a{t.applyTaskLimit(e)}),this.recalculateTotalTaskCount())}recalculateTotalTaskCount(){let e=[];this._groups.forEach(n=>{e=[...e,...n.tasks]});let t=[...new Set(e)];this._totalTaskCount=t.length}};var Kn=class extends Me{fieldName(){return"description"}value(e){return me.getInstance().removeAsSubstringFrom(e.description)}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Kn.cleanDescription(e.description),i=Kn.cleanDescription(t.description);return n.localeCompare(i,void 0,{numeric:!0})}}static cleanDescription(e){e=me.getInstance().removeAsSubstringFrom(e);let t=/^\[\[?([^\]]*)]]?/,n=e.match(t);if(n!==null){let i=n[1];e=i.substring(i.indexOf("|")+1)+e.replace(t,"")}return e=this.replaceFormatting(e,/^\*\*([^*]+)\*\*/),e=this.replaceFormatting(e,/^\*([^*]+)\*/),e=this.replaceFormatting(e,/^==([^=]+)==/),e=this.replaceFormatting(e,/^__([^_]+)__/),e=this.replaceFormatting(e,/^_([^_]+)_/),e}static replaceFormatting(e,t){let n=e.match(t);return n!==null&&(e=n[1]+e.replace(t,"")),e}};var su=class extends ht{fieldName(){return"created"}date(e){return e.createdDate}filterResultIfFieldMissing(){return!1}};var au=class extends ht{fieldName(){return"done"}date(e){return e.doneDate}filterResultIfFieldMissing(){return!1}};var ou=class extends gn{constructor(){super(),this._filters.add("exclude sub-items",e=>{if(e.indentation==="")return!0;let t=e.indentation.lastIndexOf(">");return t===-1?!1:/^ ?$/.test(e.indentation.slice(t+1))})}fieldName(){return"exclude"}};var Ea=class extends wr{};function mp(r,e){let t=r.map(([n])=>n);try{let n=e.includes("return")?e:`return ${e}`,i=e&&new Function(...t,n);return i instanceof Function?Ea.fromObject(e,i):Ea.fromError(e,"Error parsing group function")}catch(n){return Ea.fromError(e,zn(`Failed parsing expression "${e}"`,n))}}function gp(r,e){let t=e.map(([n,i])=>i);return r(...t)}function yp(r,e,t){try{return gp(r,e)}catch(n){return zn(`Failed calculating expression "${t}"`,n)}}function uu(r,e){return[["task",r],["query",e?e.query:null]]}function ZT(r,e,t){let n=uu(r,t||null),i=mp(n,e);return i.error?i.error:yp(i.queryComponent,n,e)}var lu=class{constructor(e){this.line=e,this.functionOrError=mp(uu(null,null),e)}isValid(){return this.functionOrError.error===void 0}get parseError(){return this.functionOrError.error}evaluate(e,t){if(!this.isValid())throw Error(`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`);return gp(this.functionOrError.queryComponent,uu(e,t||null))}evaluateOrCatch(e,t){return this.isValid()?yp(this.functionOrError.queryComponent,uu(e,t),this.line):`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`}};var cu=class extends we{createFilterOrErrorMessage(e){let t=we.getMatch(this.filterRegExp(),e);if(t===null)return J.fromError(e,"Unable to parse line");let n=t[1],i=new lu(n);return i.isValid()?J.fromFilter(new pt(e,VC(i),new Ee(e))):J.fromError(e,i.parseError)}fieldName(){return"function"}filterRegExp(){return new RegExp(`^filter by ${this.fieldNameSingularEscaped()} (.*)`,"i")}supportsGrouping(){return!0}createGrouperFromLine(e){let t=we.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1],i=t[2];return new mn("function",QC(i),n)}grouperRegExp(){return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)? (.*)`,"i")}grouper(){throw Error("grouper() function not valid for FunctionField. Use createGrouperFromLine() instead.")}};function VC(r){return(e,t)=>{let n=t.queryContext();return KC(r,e,n)}}function KC(r,e,t){let n=r.evaluate(e,t);if(typeof n=="boolean")return n;throw Error(`filtering function must return true or false. This returned "${n}".`)}function QC(r){return(e,t)=>{let n=t.queryContext();return XC(e,r,n)}}function XC(r,e,t){try{let n=ZT(r,e,t);return Array.isArray(n)?n.map(s=>s.toString()):n===null?[]:[n.toString()]}catch(n){let i=`Error: Failed calculating expression "${e}". The error message was: `;return n instanceof Error?[i+n.message]:[i+"Unknown error"]}}var du=class extends Me{fieldName(){return"heading"}value(e){return e.precedingHeader?e.precedingHeader:""}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>e.precedingHeader===null||e.precedingHeader.length===0?["(No heading)"]:[e.precedingHeader]}};var fu=class extends ht{fieldName(){return"scheduled"}date(e){return e.scheduledDate}filterResultIfFieldMissing(){return!1}};var pu=class extends ht{fieldName(){return"start"}fieldNameForFilterInstruction(){return"starts"}date(e){return e.startDate}filterResultIfFieldMissing(){return!0}};var hu=class extends ht{constructor(){let e=new Er;e.add("has happens date",t=>this.dates(t).some(n=>n!==null)),e.add("no happens date",t=>!this.dates(t).some(n=>n!==null)),super(e)}fieldName(){return"happens"}fieldNameForExplanation(){return"due, start or scheduled"}date(e){return this.earliestDate(e)}dates(e){return e.happensDates}earliestDate(e){return e.happens.moment}filterResultIfFieldMissing(){return!1}getFilter(e){return t=>this.dates(t).some(n=>e(n))}};var mu=class extends gn{constructor(){super(),this._filters.add("is recurring",e=>e.recurrence!==null),this._filters.add("is not recurring",e=>e.recurrence===null)}fieldName(){return"recurring"}supportsSorting(){return!0}comparator(){return(e,t)=>e.recurrence!==null&&t.recurrence===null?-1:e.recurrence===null&&t.recurrence!==null?1:0}supportsGrouping(){return!0}grouper(){return e=>e.recurrence!==null?["Recurring"]:["Not Recurring"]}};var gu=class extends Me{fieldNamePlural(){return this.fieldNameSingular()+"s"}fieldName(){return`${this.fieldNameSingular()}/${this.fieldNamePlural()}`}fieldPattern(){return`${this.fieldNameSingular()}|${this.fieldNamePlural()}`}filterOperatorPattern(){return`${super.filterOperatorPattern()}|include|do not include`}value(e){return this.values(e).join(", ")}getFilter(e,t){return n=>{let i=e.matchesAnyOf(this.values(n));return t?!i:i}}createGrouper(e){return new mn(this.fieldNamePlural(),this.grouper(),e)}grouperRegExp(){if(!this.supportsGrouping())throw Error(`grouperRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^group by ${this.fieldNamePlural()}( reverse)?$`,"i")}};var Qn=class extends gu{constructor(){super();this.filterInstructions=new Er,this.filterInstructions.add(`has ${this.fieldNameSingular()}`,t=>this.values(t).length>0),this.filterInstructions.add(`has ${this.fieldNamePlural()}`,t=>this.values(t).length>0),this.filterInstructions.add(`no ${this.fieldNameSingular()}`,t=>this.values(t).length===0),this.filterInstructions.add(`no ${this.fieldNamePlural()}`,t=>this.values(t).length===0)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.filter!==void 0?n:super.createFilterOrErrorMessage(t)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}fieldNameSingular(){return"tag"}values(t){return t.tags}supportsSorting(){return!0}createSorterFromLine(t){let n=t.match(this.sorterRegExp());if(n===null)return null;let i=!!n[1],s=isNaN(+n[2])?1:+n[2],a=Qn.makeCompareByTagComparator(s);return new Qr(this.fieldNameSingular(),a,i)}sorterRegExp(){return/^sort by tag( reverse)?[\s]*(\d+)?/i}comparator(){return Qn.makeCompareByTagComparator(1)}static makeCompareByTagComparator(t){return(n,i)=>{if(n.tags.length===0&&i.tags.length===0)return 0;if(n.tags.length===0)return 1;if(i.tags.length===0)return-1;let s=t-1;if(n.tags.length=t)return 1;if(i.tags.length=t)return-1;if(n.tags.lengtht.tags.length==0?["(No tags)"]:t.tags}};var f_=ss(d_());var vu=class extends we{constructor(){super(...arguments);this.basicBooleanRegexp=/(.*(AND|OR|XOR|NOT)\s*[("].*|\(.+\))/g;this.supportedOperators=["AND","OR","XOR","NOT"];this.subFields={}}filterRegExp(){return this.basicBooleanRegexp}createFilterOrErrorMessage(t){return this.parseLine(t)}fieldName(){return"boolean query"}parseLine(t){if(t.length===0)return J.fromError(t,"empty line");let n=this.preprocessExpression(t);try{let i=(0,f_.parse)(n);for(let o of i)if(o.name==="IDENTIFIER"&&o.value){let u=o.value.trim();if(!(u in this.subFields)){let l=wu(u);if(l===null)return J.fromError(t,`couldn't parse sub-expression '${u}'`);if(l.error)return J.fromError(t,`couldn't parse sub-expression '${u}': ${l.error}`);l.filter&&(this.subFields[u]=l.filter)}}else if(o.name==="OPERATOR"){if(o.value==null)return J.fromError(t,"empty operator in boolean query");if(!this.supportedOperators.includes(o.value))return J.fromError(t,`unknown boolean operator '${o.value}'`)}let s=(o,u)=>this.filterTaskWithParsedQuery(o,i,u),a=this.constructExplanation(i);return J.fromFilter(new pt(t,s,a))}catch(i){let s=i instanceof Error?i.message:"unknown error type";return J.fromError(t,`malformed boolean query -- ${s} (check the documentation for guidelines)`)}}preprocessExpression(t){return t.replace(/\(([^()]+)\)/g,'("$1")')}filterTaskWithParsedQuery(t,n,i){let s=u=>u==="true",a=u=>u?"true":"false",o=[];for(let u of n)if(u.name==="IDENTIFIER"){if(u.value==null)throw Error("null token value");let c=this.subFields[u.value.trim()].filterFunction(t,i);o.push(a(c))}else if(u.name==="OPERATOR")if(u.value==="NOT"){let l=s(o.pop());o.push(a(!l))}else if(u.value==="OR"){let l=s(o.pop()),c=s(o.pop());o.push(a(l||c))}else if(u.value==="AND"){let l=s(o.pop()),c=s(o.pop());o.push(a(l&&c))}else if(u.value==="XOR"){let l=s(o.pop()),c=s(o.pop());o.push(a(l&&!c||!l&&c))}else throw Error("Unsupported operator: "+u.value);else throw Error("Unsupported token type: "+u);return s(o[0])}constructExplanation(t){let n=[];for(let i of t)if(i.name==="IDENTIFIER"){if(i.value==null)throw Error("null token value");let s=this.subFields[i.value.trim()];n.push(s.explanation)}else if(i.name==="OPERATOR")if(i.value==="NOT"){let s=n.pop();n.push(Ee.booleanNot([s]))}else if(i.value==="OR"){let s=n.pop(),a=n.pop();n.push(Ee.booleanOr([a,s]))}else if(i.value==="AND"){let s=n.pop(),a=n.pop();n.push(Ee.booleanAnd([a,s]))}else if(i.value==="XOR"){let s=n.pop(),a=n.pop();n.push(Ee.booleanXor([a,s]))}else throw Error("Unsupported operator: "+i.value);else throw Error("Unsupported token type: "+i.name);return n[0]}};var Eu=class extends Me{fieldName(){return"filename"}value(e){let t=e.filename;return t===null?"":t+".md"}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>{let t=e.filename;return t===null?["Unknown Location"]:["[["+t+"]]"]}}};var ku=class extends Me{constructor(){super()}fieldName(){return"status.name"}value(e){return e.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};var bn=class extends we{canCreateFilterForLine(e){let t=new RegExp(`^(?:${this.fieldNameSingularEscaped()})`,"i");return we.lineMatchesFilter(t,e)}createFilterOrErrorMessage(e){let t=we.getMatch(this.filterRegExp(),e);if(t===null)return this.helpMessage(e);let n=t[1].toLowerCase(),i=t[2],s=Lt[i.toUpperCase()];if(!s)return this.helpMessage(e);let a;switch(n){case"is":a=o=>o.status.type===s;break;case"is not":a=o=>o.status.type!==s;break;default:return this.helpMessage(e)}return J.fromFilter(new pt(e,a,new Ee(e)))}filterRegExp(){return new RegExp(`^(?:${this.fieldNameSingularEscaped()}) (is|is not) ([^ ]+)$`,"i")}helpMessage(e){let t=Object.values(Lt).filter(i=>i!=="EMPTY").join(" "),n=`Invalid ${this.fieldNameSingular()} instruction: '${e}'. +`,e}addTaskGroups(e){for(let[t,n]of e){let i=new au(t,n);this.addTaskGroup(i)}}addTaskGroup(e){this._groups.push(e)}sortTaskGroups(){let e=(t,n)=>{let i=t.groups,s=n.groups;for(let a=0;a{t.applyTaskLimit(e)}),this.recalculateTotalTaskCount())}recalculateTotalTaskCount(){let e=[];this._groups.forEach(n=>{e=[...e,...n.tasks]});let t=[...new Set(e)];this._totalTaskCount=t.length}};var Qn=class extends Me{fieldName(){return"description"}value(e){return ge.getInstance().removeAsSubstringFrom(e.description)}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Qn.cleanDescription(e.description),i=Qn.cleanDescription(t.description);return n.localeCompare(i,void 0,{numeric:!0})}}static cleanDescription(e){e=ge.getInstance().removeAsSubstringFrom(e);let t=/^\[\[?([^\]]*)]]?/,n=e.match(t);if(n!==null){let i=n[1];e=i.substring(i.indexOf("|")+1)+e.replace(t,"")}return e=this.replaceFormatting(e,/^\*\*([^*]+)\*\*/),e=this.replaceFormatting(e,/^\*([^*]+)\*/),e=this.replaceFormatting(e,/^==([^=]+)==/),e=this.replaceFormatting(e,/^__([^_]+)__/),e=this.replaceFormatting(e,/^_([^_]+)_/),e}static replaceFormatting(e,t){let n=e.match(t);return n!==null&&(e=n[1]+e.replace(t,"")),e}};var ou=class extends yt{fieldName(){return"created"}date(e){return e.createdDate}filterResultIfFieldMissing(){return!1}};var uu=class extends yt{fieldName(){return"done"}date(e){return e.doneDate}filterResultIfFieldMissing(){return!1}};var lu=class extends yn{constructor(){super(),this._filters.add("exclude sub-items",e=>{if(e.indentation==="")return!0;let t=e.indentation.lastIndexOf(">");return t===-1?!1:/^ ?$/.test(e.indentation.slice(t+1))})}fieldName(){return"exclude"}};var ka=class extends Er{};function bp(r,e){let t=r.map(([n])=>n);try{let n=e.includes("return")?e:`return ${e}`,i=e&&new Function(...t,n);return i instanceof Function?ka.fromObject(e,i):ka.fromError(e,"Error parsing group function")}catch(n){return ka.fromError(e,Vn(`Failed parsing expression "${e}"`,n))}}function _p(r,e){let t=e.map(([n,i])=>i);return r(...t)}function vp(r,e,t){try{return _p(r,e)}catch(n){return Vn(`Failed calculating expression "${t}"`,n)}}function cu(r,e){return[["task",r],["query",e?e.query:null]]}function s_(r,e,t){let n=cu(r,t||null),i=bp(n,e);return i.error?i.error:vp(i.queryComponent,n,e)}var du=class{constructor(e){this.line=e,this.functionOrError=bp(cu(null,null),e)}isValid(){return this.functionOrError.error===void 0}get parseError(){return this.functionOrError.error}evaluate(e,t){if(!this.isValid())throw Error(`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`);return _p(this.functionOrError.queryComponent,cu(e,t||null))}evaluateOrCatch(e,t){return this.isValid()?vp(this.functionOrError.queryComponent,cu(e,t),this.line):`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`}};var fu=class extends ke{createFilterOrErrorMessage(e){let t=ke.getMatch(this.filterRegExp(),e);if(t===null)return J.fromError(e,"Unable to parse line");let n=t[1],i=new du(n);return i.isValid()?J.fromFilter(new gt(e,oA(i),new Se(e))):J.fromError(e,i.parseError)}fieldName(){return"function"}filterRegExp(){return new RegExp(`^filter by ${this.fieldNameSingularEscaped()} (.*)`,"i")}supportsGrouping(){return!0}createGrouperFromLine(e){let t=ke.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1],i=t[2];return new gn("function",lA(i),n)}grouperRegExp(){return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)? (.*)`,"i")}grouper(){throw Error("grouper() function not valid for FunctionField. Use createGrouperFromLine() instead.")}};function oA(r){return(e,t)=>{let n=t.queryContext();return uA(r,e,n)}}function uA(r,e,t){let n=r.evaluate(e,t);if(typeof n=="boolean")return n;throw Error(`filtering function must return true or false. This returned "${n}".`)}function lA(r){return(e,t)=>{let n=t.queryContext();return cA(e,r,n)}}function cA(r,e,t){try{let n=s_(r,e,t);return Array.isArray(n)?n.map(s=>s.toString()):n===null?[]:[n.toString()]}catch(n){let i=`Error: Failed calculating expression "${e}". The error message was: `;return n instanceof Error?[i+n.message]:[i+"Unknown error"]}}var pu=class extends Me{fieldName(){return"heading"}value(e){return e.precedingHeader?e.precedingHeader:""}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>e.precedingHeader===null||e.precedingHeader.length===0?["(No heading)"]:[e.precedingHeader]}};var hu=class extends yt{fieldName(){return"scheduled"}date(e){return e.scheduledDate}filterResultIfFieldMissing(){return!1}};var mu=class extends yt{fieldName(){return"start"}fieldNameForFilterInstruction(){return"starts"}date(e){return e.startDate}filterResultIfFieldMissing(){return!0}};var gu=class extends yt{constructor(){let e=new kr;e.add("has happens date",t=>this.dates(t).some(n=>n!==null)),e.add("no happens date",t=>!this.dates(t).some(n=>n!==null)),super(e)}fieldName(){return"happens"}fieldNameForExplanation(){return"due, start or scheduled"}date(e){return this.earliestDate(e)}dates(e){return e.happensDates}earliestDate(e){return e.happens.moment}filterResultIfFieldMissing(){return!1}getFilter(e){return t=>this.dates(t).some(n=>e(n))}};var yu=class extends yn{constructor(){super(),this._filters.add("is recurring",e=>e.recurrence!==null),this._filters.add("is not recurring",e=>e.recurrence===null)}fieldName(){return"recurring"}supportsSorting(){return!0}comparator(){return(e,t)=>e.recurrence!==null&&t.recurrence===null?-1:e.recurrence===null&&t.recurrence!==null?1:0}supportsGrouping(){return!0}grouper(){return e=>e.recurrence!==null?["Recurring"]:["Not Recurring"]}};var Tu=class extends Me{fieldNamePlural(){return this.fieldNameSingular()+"s"}fieldName(){return`${this.fieldNameSingular()}/${this.fieldNamePlural()}`}fieldPattern(){return`${this.fieldNameSingular()}|${this.fieldNamePlural()}`}filterOperatorPattern(){return`${super.filterOperatorPattern()}|include|do not include`}value(e){return this.values(e).join(", ")}getFilter(e,t){return n=>{let i=e.matchesAnyOf(this.values(n));return t?!i:i}}createGrouper(e){return new gn(this.fieldNamePlural(),this.grouper(),e)}grouperRegExp(){if(!this.supportsGrouping())throw Error(`grouperRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^group by ${this.fieldNamePlural()}( reverse)?$`,"i")}};var Xn=class extends Tu{constructor(){super();this.filterInstructions=new kr,this.filterInstructions.add(`has ${this.fieldNameSingular()}`,t=>this.values(t).length>0),this.filterInstructions.add(`has ${this.fieldNamePlural()}`,t=>this.values(t).length>0),this.filterInstructions.add(`no ${this.fieldNameSingular()}`,t=>this.values(t).length===0),this.filterInstructions.add(`no ${this.fieldNamePlural()}`,t=>this.values(t).length===0)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.filter!==void 0?n:super.createFilterOrErrorMessage(t)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}fieldNameSingular(){return"tag"}values(t){return t.tags}supportsSorting(){return!0}createSorterFromLine(t){let n=t.match(this.sorterRegExp());if(n===null)return null;let i=!!n[1],s=isNaN(+n[2])?1:+n[2],a=Xn.makeCompareByTagComparator(s);return new Xr(this.fieldNameSingular(),a,i)}sorterRegExp(){return/^sort by tag( reverse)?[\s]*(\d+)?/i}comparator(){return Xn.makeCompareByTagComparator(1)}static makeCompareByTagComparator(t){return(n,i)=>{if(n.tags.length===0&&i.tags.length===0)return 0;if(n.tags.length===0)return 1;if(i.tags.length===0)return-1;let s=t-1;if(n.tags.length=t)return 1;if(i.tags.length=t)return-1;if(n.tags.lengtht.tags.length==0?["(No tags)"]:t.tags}};var b_=as(T_());var Eu=class extends ke{constructor(){super(...arguments);this.basicBooleanRegexp=/(.*(AND|OR|XOR|NOT)\s*[("].*|\(.+\))/g;this.supportedOperators=["AND","OR","XOR","NOT"];this.subFields={}}filterRegExp(){return this.basicBooleanRegexp}createFilterOrErrorMessage(t){return this.parseLine(t)}fieldName(){return"boolean query"}parseLine(t){if(t.length===0)return J.fromError(t,"empty line");let n=this.preprocessExpression(t);try{let i=(0,b_.parse)(n);for(let o of i)if(o.name==="IDENTIFIER"&&o.value){let u=o.value.trim();if(!(u in this.subFields)){let l=ku(u);if(l===null)return J.fromError(t,`couldn't parse sub-expression '${u}'`);if(l.error)return J.fromError(t,`couldn't parse sub-expression '${u}': ${l.error}`);l.filter&&(this.subFields[u]=l.filter)}}else if(o.name==="OPERATOR"){if(o.value==null)return J.fromError(t,"empty operator in boolean query");if(!this.supportedOperators.includes(o.value))return J.fromError(t,`unknown boolean operator '${o.value}'`)}let s=(o,u)=>this.filterTaskWithParsedQuery(o,i,u),a=this.constructExplanation(i);return J.fromFilter(new gt(t,s,a))}catch(i){let s=i instanceof Error?i.message:"unknown error type";return J.fromError(t,`malformed boolean query -- ${s} (check the documentation for guidelines)`)}}preprocessExpression(t){return t.replace(/\(([^()]+)\)/g,'("$1")')}filterTaskWithParsedQuery(t,n,i){let s=u=>u==="true",a=u=>u?"true":"false",o=[];for(let u of n)if(u.name==="IDENTIFIER"){if(u.value==null)throw Error("null token value");let c=this.subFields[u.value.trim()].filterFunction(t,i);o.push(a(c))}else if(u.name==="OPERATOR")if(u.value==="NOT"){let l=s(o.pop());o.push(a(!l))}else if(u.value==="OR"){let l=s(o.pop()),c=s(o.pop());o.push(a(l||c))}else if(u.value==="AND"){let l=s(o.pop()),c=s(o.pop());o.push(a(l&&c))}else if(u.value==="XOR"){let l=s(o.pop()),c=s(o.pop());o.push(a(l&&!c||!l&&c))}else throw Error("Unsupported operator: "+u.value);else throw Error("Unsupported token type: "+u);return s(o[0])}constructExplanation(t){let n=[];for(let i of t)if(i.name==="IDENTIFIER"){if(i.value==null)throw Error("null token value");let s=this.subFields[i.value.trim()];n.push(s.explanation)}else if(i.name==="OPERATOR")if(i.value==="NOT"){let s=n.pop();n.push(Se.booleanNot([s]))}else if(i.value==="OR"){let s=n.pop(),a=n.pop();n.push(Se.booleanOr([a,s]))}else if(i.value==="AND"){let s=n.pop(),a=n.pop();n.push(Se.booleanAnd([a,s]))}else if(i.value==="XOR"){let s=n.pop(),a=n.pop();n.push(Se.booleanXor([a,s]))}else throw Error("Unsupported operator: "+i.value);else throw Error("Unsupported token type: "+i.name);return n[0]}};var Su=class extends Me{fieldName(){return"filename"}value(e){let t=e.filename;return t===null?"":t+".md"}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>{let t=e.filename;return t===null?["Unknown Location"]:["[["+t+"]]"]}}};var Ou=class extends Me{constructor(){super()}fieldName(){return"status.name"}value(e){return e.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};var bn=class extends ke{canCreateFilterForLine(e){let t=new RegExp(`^(?:${this.fieldNameSingularEscaped()})`,"i");return ke.lineMatchesFilter(t,e)}createFilterOrErrorMessage(e){let t=ke.getMatch(this.filterRegExp(),e);if(t===null)return this.helpMessage(e);let n=t[1].toLowerCase(),i=t[2],s=Lt[i.toUpperCase()];if(!s)return this.helpMessage(e);let a;switch(n){case"is":a=o=>o.status.type===s;break;case"is not":a=o=>o.status.type!==s;break;default:return this.helpMessage(e)}return J.fromFilter(new gt(e,a,new Se(e)))}filterRegExp(){return new RegExp(`^(?:${this.fieldNameSingularEscaped()}) (is|is not) ([^ ]+)$`,"i")}helpMessage(e){let t=Object.values(Lt).filter(i=>i!=="EMPTY").join(" "),n=`Invalid ${this.fieldNameSingular()} instruction: '${e}'. Allowed options: 'is' and 'is not' (without quotes). Allowed values: ${t} Note: values are case-insensitive, so 'in_progress' works too, for example. - Example: ${this.fieldNameSingular()} is not NON_TASK`;return J.fromError(e,n)}fieldName(){return"status.type"}value(e){return e.status.type}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=bn.groupName(e),i=bn.groupName(t);return n.localeCompare(i,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return e=>[bn.groupName(e)]}static groupName(e){return e.status.typeGroupText}};var Su=class extends Me{fieldName(){return"recurrence"}value(e){return e.recurrence!==null?e.recurrence.toText():""}supportsGrouping(){return!0}grouper(){return e=>e.recurrence!==null?[e.recurrence.toText()]:["None"]}};var Ou=class extends Me{fieldName(){return"folder"}value(e){return e.file.folder}supportsGrouping(){return!0}grouper(){return e=>[Me.escapeMarkdownCharacters(this.value(e))]}};var Du=class extends Me{fieldName(){return"root"}value(e){return e.file.root}supportsGrouping(){return!0}grouper(){return e=>[Me.escapeMarkdownCharacters(this.value(e))]}};var Ru=class extends Me{fieldName(){return"backlink"}value(e){let t=e.getLinkText({isFilenameUnique:!0});return t===null?"Unknown Location":t}createFilterOrErrorMessage(e){return J.fromError(e,"backlink field does not support filtering")}canCreateFilterForLine(e){return!1}supportsGrouping(){return!0}grouper(){return e=>{let t=e.filename;if(t===null)return["Unknown Location"];let n=e.precedingHeader;return n===null?["[["+t+"]]"]:[`[[${t}#${n}|${t} > ${n}]]`]}}};var Dp=[()=>new ku,()=>new bn,()=>new kr,()=>new mu,()=>new Vn,()=>new hu,()=>new su,()=>new pu,()=>new fu,()=>new Fi,()=>new au,()=>new Wi,()=>new Ou,()=>new Du,()=>new Ru,()=>new Kn,()=>new Qn,()=>new du,()=>new ou,()=>new Eu,()=>new qi,()=>new Su,()=>new cu,()=>new vu];function wu(r){for(let e of Dp){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function p_(r){let e=/^sort by /i;if(r.match(e)===null)return null;for(let t of Dp){let i=t().createSorterFromLine(r);if(i)return i}return null}function h_(r){let e=/^group by /i;if(r.match(e)===null)return null;for(let t of Dp){let i=t().createGrouperFromLine(r);if(i)return i}return null}var Tn=class{constructor(e,t){this.queryPath=e,this.allTasks=[...t]}static fromAllTasks(e){return new Tn(void 0,e)}queryContext(){return this.queryPath?Qo(this.queryPath):void 0}};function m_(r){return`task${r!==1?"s":""}`}var Jn=class{constructor(e,t){this.totalTasksCountBeforeLimit=0;this._searchErrorMessage=void 0;this.taskGroups=e,this.totalTasksCountBeforeLimit=t}get searchErrorMessage(){return this._searchErrorMessage}set searchErrorMessage(e){this._searchErrorMessage=e}get totalTasksCount(){return this.taskGroups.totalTasksCount()}totalTasksCountDisplayText(){let e=this.totalTasksCount,t=this.totalTasksCountBeforeLimit;return e===t?`${e} ${m_(e)}`:`${e} of ${t} ${m_(t)}`}get groups(){return this.taskGroups.groups}static fromError(e){let t=new Jn(new Yi([],[],Tn.fromAllTasks([])),0);return t._searchErrorMessage=e,t}};function g_(r){return r.endsWith("\\")}function y_(r){return r.endsWith("\\\\")}function kA(r){return r.replace(/^[ \t]*/,"")}function SA(r){return r.replace(/[ \t]*\\$/,"")}function OA(r,e){let t=r;return e&&(t=kA(r)),y_(t)?t=t.slice(0,-1):g_(r)&&(t=SA(t)),t}function DA(r,e,t){e?r[r.length-1]+=" "+t:r.push(t)}function RA(r){let e=[],t=!1;for(let n of r.split(` -`)){let i=OA(n,t);DA(e,t,i),y_(n)?t=!1:t=g_(n)}return e.join(` -`)}function b_(r){return RA(r).split(` -`).map(e=>e.trim()).filter(e=>e!=="")}var Zr=class{constructor(e,t=void 0){this._limit=void 0;this._taskGroupLimit=void 0;this._layoutOptions=new Wn;this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this._ignoreGlobalQuery=!1;this.hideOptionsRegexp=/^(hide|show) (task count|backlink|priority|created date|start date|scheduled date|done date|due date|recurrence rule|edit button|urgency|tags)/i;this.shortModeRegexp=/^short/i;this.explainQueryRegexp=/^explain/i;this.ignoreGlobalQueryRegexp=/^ignore global query/i;this.logger=Mt.getLogger("tasks.Query");this._queryId="";this.limitRegexp=/^limit (groups )?(to )?(\d+)( tasks?)?/i;this.commentRegexp=/^#.*/;this._queryId=this.generateQueryId(10),this.source=e,this.filePath=t,this.debug(`Creating query: ${this.formatQueryForLogging()}`),b_(e).forEach(n=>{let i=this.expandPlaceholders(n,t);if(this.error===void 0)switch(!0){case this.shortModeRegexp.test(i):this._layoutOptions.shortMode=!0;break;case this.explainQueryRegexp.test(i):this._layoutOptions.explainQuery=!0;break;case this.ignoreGlobalQueryRegexp.test(i):this._ignoreGlobalQuery=!0;break;case this.limitRegexp.test(i):this.parseLimit(i);break;case this.parseSortBy(i):break;case this.parseGroupBy(i):break;case this.hideOptionsRegexp.test(i):this.parseHideOptions(i);break;case this.commentRegexp.test(i):break;case this.parseFilter(i):break;default:this.setError("do not understand query",i)}})}formatQueryForLogging(){return`[${this.source.split(` + Example: ${this.fieldNameSingular()} is not NON_TASK`;return J.fromError(e,n)}fieldName(){return"status.type"}value(e){return e.status.type}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=bn.groupName(e),i=bn.groupName(t);return n.localeCompare(i,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return e=>[bn.groupName(e)]}static groupName(e){return e.status.typeGroupText}};var Du=class extends Me{fieldName(){return"recurrence"}value(e){return e.recurrence!==null?e.recurrence.toText():""}supportsGrouping(){return!0}grouper(){return e=>e.recurrence!==null?[e.recurrence.toText()]:["None"]}};var xu=class extends Me{fieldName(){return"folder"}value(e){return e.file.folder}supportsGrouping(){return!0}grouper(){return e=>[Me.escapeMarkdownCharacters(this.value(e))]}};var Ru=class extends Me{fieldName(){return"root"}value(e){return e.file.root}supportsGrouping(){return!0}grouper(){return e=>[Me.escapeMarkdownCharacters(this.value(e))]}};var Mu=class extends Me{fieldName(){return"backlink"}value(e){let t=e.getLinkText({isFilenameUnique:!0});return t===null?"Unknown Location":t}createFilterOrErrorMessage(e){return J.fromError(e,"backlink field does not support filtering")}canCreateFilterForLine(e){return!1}supportsGrouping(){return!0}grouper(){return e=>{let t=e.filename;if(t===null)return["Unknown Location"];let n=e.precedingHeader;return n===null?["[["+t+"]]"]:[`[[${t}#${n}|${t} > ${n}]]`]}}};var Cp=[()=>new Ou,()=>new bn,()=>new Sr,()=>new yu,()=>new Kn,()=>new gu,()=>new ou,()=>new mu,()=>new hu,()=>new Ui,()=>new uu,()=>new $i,()=>new xu,()=>new Ru,()=>new Mu,()=>new Qn,()=>new Xn,()=>new pu,()=>new lu,()=>new Su,()=>new Yi,()=>new Du,()=>new fu,()=>new Eu];function ku(r){for(let e of Cp){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function __(r){let e=/^sort by /i;if(r.match(e)===null)return null;for(let t of Cp){let i=t().createSorterFromLine(r);if(i)return i}return null}function v_(r){let e=/^group by /i;if(r.match(e)===null)return null;for(let t of Cp){let i=t().createGrouperFromLine(r);if(i)return i}return null}var _n=class{constructor(e,t){this.queryPath=e,this.allTasks=[...t]}static fromAllTasks(e){return new _n(void 0,e)}queryContext(){return this.queryPath?Zo(this.queryPath):void 0}};function w_(r){return`task${r!==1?"s":""}`}var ei=class{constructor(e,t){this.totalTasksCountBeforeLimit=0;this._searchErrorMessage=void 0;this.taskGroups=e,this.totalTasksCountBeforeLimit=t}get searchErrorMessage(){return this._searchErrorMessage}set searchErrorMessage(e){this._searchErrorMessage=e}get totalTasksCount(){return this.taskGroups.totalTasksCount()}totalTasksCountDisplayText(){let e=this.totalTasksCount,t=this.totalTasksCountBeforeLimit;return e===t?`${e} ${w_(e)}`:`${e} of ${t} ${w_(t)}`}get groups(){return this.taskGroups.groups}static fromError(e){let t=new ei(new Gi([],[],_n.fromAllTasks([])),0);return t._searchErrorMessage=e,t}};function E_(r){return r.endsWith("\\")}function k_(r){return r.endsWith("\\\\")}function LA(r){return r.replace(/^[ \t]*/,"")}function UA(r){return r.replace(/[ \t]*\\$/,"")}function WA(r,e){let t=r;return e&&(t=LA(r)),k_(t)?t=t.slice(0,-1):E_(r)&&(t=UA(t)),t}function qA(r,e,t){e?r[r.length-1]+=" "+t:r.push(t)}function $A(r){let e=[],t=!1;for(let n of r.split(` +`)){let i=WA(n,t);qA(e,t,i),k_(n)?t=!1:t=E_(n)}return e.join(` +`)}function S_(r){return $A(r).split(` +`).map(e=>e.trim()).filter(e=>e!=="")}var Jr=class{constructor(e,t=void 0){this._limit=void 0;this._taskGroupLimit=void 0;this._layoutOptions=new qn;this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this._ignoreGlobalQuery=!1;this.hideOptionsRegexp=/^(hide|show) (task count|backlink|priority|created date|start date|scheduled date|done date|due date|recurrence rule|edit button|postpone button|urgency|tags)/i;this.shortModeRegexp=/^short/i;this.explainQueryRegexp=/^explain/i;this.ignoreGlobalQueryRegexp=/^ignore global query/i;this.logger=St.getLogger("tasks.Query");this._queryId="";this.limitRegexp=/^limit (groups )?(to )?(\d+)( tasks?)?/i;this.commentRegexp=/^#.*/;this._queryId=this.generateQueryId(10),this.source=e,this.filePath=t,this.debug(`Creating query: ${this.formatQueryForLogging()}`),S_(e).forEach(n=>{let i=this.expandPlaceholders(n,t);if(this.error===void 0)switch(!0){case this.shortModeRegexp.test(i):this._layoutOptions.shortMode=!0;break;case this.explainQueryRegexp.test(i):this._layoutOptions.explainQuery=!0;break;case this.ignoreGlobalQueryRegexp.test(i):this._ignoreGlobalQuery=!0;break;case this.limitRegexp.test(i):this.parseLimit(i);break;case this.parseSortBy(i):break;case this.parseGroupBy(i):break;case this.hideOptionsRegexp.test(i):this.parseHideOptions(i);break;case this.commentRegexp.test(i):break;case this.parseFilter(i):break;default:this.setError("do not understand query",i)}})}formatQueryForLogging(){return`[${this.source.split(` `).join(" ; ")}]`}expandPlaceholders(e,t){if(e.includes("{{")&&e.includes("}}")&&this.filePath===void 0)return this._error=`The query looks like it contains a placeholder, with "{{" and "}}" but no file path has been supplied, so cannot expand placeholder values. The query is: -${e}`,e;let n=e;if(t){let i=Qo(t);try{n=XT(e,i)}catch(s){return s instanceof Error?this._error=s.message:this._error="Internal error. expandPlaceholders() threw something other than Error.",e}}return n}append(e){return this.source===""?e:e.source===""?this:new Zr(`${this.source} +${e}`,e;let n=e;if(t){let i=Zo(t);try{n=i_(e,i)}catch(s){return s instanceof Error?this._error=s.message:this._error="Internal error. expandPlaceholders() threw something other than Error.",e}}return n}append(e){return this.source===""?e:e.source===""?this:new Jr(`${this.source} ${e.source}`,this.filePath)}explainQuery(){let e="";if(this.error!==void 0)return e+=`Query has an error: `,e+=this.error+` `,e;let t=this.filters.length;if(t===0)e+="No filters supplied. All tasks will match the query.";else for(let i=0;i0&&(e+=` @@ -258,7 +258,7 @@ NOTE: All sort instructions, including default sort order, are disabled, due to At most ${n} task`;return n!==1&&(i+="s"),i}return this._limit!==void 0&&(e+=t(this._limit),e+=`. `),this._taskGroupLimit!==void 0&&(e+=t(this._taskGroupLimit),e+=` per group (if any "group by" options are supplied). `),e}get limit(){return this._limit}get layoutOptions(){return this._layoutOptions}get filters(){return this._filters}addFilter(e){this._filters.push(e)}get sorting(){return this._sorting}get grouping(){return this._grouping}get error(){return this._error}setError(e,t){this._error=`${e} -Problem line: "${t}"`}get ignoreGlobalQuery(){return this._ignoreGlobalQuery}applyQueryToTasks(e){this.debug(`Executing query: ${this.formatQueryForLogging()}`);let t=new Tn(this.filePath,e);try{this.filters.forEach(o=>{e=e.filter(u=>o.filterFunction(u,t))});let{debugSettings:n}=Q(),i=n.ignoreSortInstructions?e:$i.by(this.sorting,e),s=i.slice(0,this.limit),a=new Yi(this.grouping,s,t);return this._taskGroupLimit!==void 0&&a.applyTaskLimit(this._taskGroupLimit),new Jn(a,i.length)}catch(n){let i="Search failed";return Jn.fromError(zn(i,n))}}parseHideOptions(e){let t=e.match(this.hideOptionsRegexp);if(t!==null){let n=t[1].toLowerCase()==="hide";switch(t[2].toLowerCase()){case"task count":this._layoutOptions.hideTaskCount=n;break;case"backlink":this._layoutOptions.hideBacklinks=n;break;case"priority":this._layoutOptions.hidePriority=n;break;case"created date":this._layoutOptions.hideCreatedDate=n;break;case"start date":this._layoutOptions.hideStartDate=n;break;case"scheduled date":this._layoutOptions.hideScheduledDate=n;break;case"due date":this._layoutOptions.hideDueDate=n;break;case"done date":this._layoutOptions.hideDoneDate=n;break;case"recurrence rule":this._layoutOptions.hideRecurrenceRule=n;break;case"edit button":this._layoutOptions.hideEditButton=n;break;case"urgency":this._layoutOptions.hideUrgency=n;break;case"tags":this._layoutOptions.hideTags=n;break;default:this.setError("do not understand hide/show option",e)}}}parseFilter(e){var n;let t=wu(e);return t!=null?(t.filter?this._filters.push(t.filter):this.setError((n=t.error)!=null?n:"Unknown error",e),!0):!1}parseLimit(e){let t=e.match(this.limitRegexp);if(t===null){this.setError("do not understand query limit",e);return}let n=Number.parseInt(t[3],10);t[1]!==void 0?this._taskGroupLimit=n:this._limit=n}parseSortBy(e){let t=p_(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy(e){let t=h_(e);return t?(this._grouping.push(t),!0):!1}generateQueryId(e){let t="AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890";return Array.from({length:e},()=>t[Math.floor(Math.random()*t.length)]).join("")}debug(e,t){this.logger.debugWithId(this._queryId,`"${this.filePath}": ${e}`,t)}};var _n=class{constructor(e=_n.empty){this._source=e}static getInstance(){return _n.instance||(_n.instance=new _n),_n.instance}set(e){this._source=e}query(e=void 0){return new Zr(this._source,e)}hasInstructions(){return this._source.trim()!==_n.empty}},tr=_n;tr.empty="";var xu=class{constructor({obsidianEvents:e}){this.logger=Mt.getLogger("tasks.Events");this.obsidianEvents=e}onCacheUpdate(e){return this.logger.debug("TasksEvents.onCacheUpdate()"),this.obsidianEvents.on("obsidian-tasks-plugin:cache-update",e)}triggerCacheUpdate(e){this.logger.debug("TasksEvents.triggerCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:cache-update",e)}onRequestCacheUpdate(e){return this.logger.debug("TasksEvents.onRequestCacheUpdate()"),this.obsidianEvents.on("obsidian-tasks-plugin:request-cache-update",e)}triggerRequestCacheUpdate(e){this.logger.debug("TasksEvents.triggerRequestCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:request-cache-update",e)}off(e){this.logger.debug("TasksEvents.off()"),this.obsidianEvents.offref(e)}};var Da=require("obsidian");var Sa,Rp,xp,xA=["md"],Oa=Mt.getLogger("tasks.File"),T_=({metadataCache:r,vault:e,workspace:t})=>{Sa=r,Rp=e,xp=t},Au=t=>q(void 0,[t],function*({originalTask:r,newTasks:e}){if(Rp===void 0||Sa===void 0||xp===void 0){Mu("Tasks: cannot use File before initializing it.");return}Array.isArray(e)||(e=[e]),Oa.debug(`replaceTaskWithTasks entered. ${r.path}`),v_({originalTask:r,newTasks:e,vault:Rp,metadataCache:Sa,workspace:xp,previousTries:0})});function Mu(r){console.error(r),new Da.Notice(r,15e3)}function __(r){console.warn(r),new Da.Notice(r,1e4)}function MA(r){Oa.debug(r)}var vn=class extends Error{},Cu=class extends Error{},v_=a=>q(void 0,[a],function*({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s}){Oa.debug(`tryRepetitive after ${s} previous tries`);let o=()=>{if(s>10){let l=`Tasks: Could not find the correct task line to update. +Problem line: "${t}"`}get ignoreGlobalQuery(){return this._ignoreGlobalQuery}applyQueryToTasks(e){this.debug(`Executing query: ${this.formatQueryForLogging()}`);let t=new _n(this.filePath,e);try{this.filters.forEach(o=>{e=e.filter(u=>o.filterFunction(u,t))});let{debugSettings:n}=Q(),i=n.ignoreSortInstructions?e:ji.by(this.sorting,e),s=i.slice(0,this.limit),a=new Gi(this.grouping,s,t);return this._taskGroupLimit!==void 0&&a.applyTaskLimit(this._taskGroupLimit),new ei(a,i.length)}catch(n){let i="Search failed";return ei.fromError(Vn(i,n))}}parseHideOptions(e){let t=e.match(this.hideOptionsRegexp);if(t!==null){let n=t[1].toLowerCase()==="hide";switch(t[2].toLowerCase()){case"task count":this._layoutOptions.hideTaskCount=n;break;case"backlink":this._layoutOptions.hideBacklinks=n;break;case"postpone button":this._layoutOptions.hidePostponeButton=n;break;case"priority":this._layoutOptions.hidePriority=n;break;case"created date":this._layoutOptions.hideCreatedDate=n;break;case"start date":this._layoutOptions.hideStartDate=n;break;case"scheduled date":this._layoutOptions.hideScheduledDate=n;break;case"due date":this._layoutOptions.hideDueDate=n;break;case"done date":this._layoutOptions.hideDoneDate=n;break;case"recurrence rule":this._layoutOptions.hideRecurrenceRule=n;break;case"edit button":this._layoutOptions.hideEditButton=n;break;case"urgency":this._layoutOptions.hideUrgency=n;break;case"tags":this._layoutOptions.hideTags=n;break;default:this.setError("do not understand hide/show option",e)}}}parseFilter(e){var n;let t=ku(e);return t!=null?(t.filter?this._filters.push(t.filter):this.setError((n=t.error)!=null?n:"Unknown error",e),!0):!1}parseLimit(e){let t=e.match(this.limitRegexp);if(t===null){this.setError("do not understand query limit",e);return}let n=Number.parseInt(t[3],10);t[1]!==void 0?this._taskGroupLimit=n:this._limit=n}parseSortBy(e){let t=__(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy(e){let t=v_(e);return t?(this._grouping.push(t),!0):!1}generateQueryId(e){let t="AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890";return Array.from({length:e},()=>t[Math.floor(Math.random()*t.length)]).join("")}debug(e,t){this.logger.debugWithId(this._queryId,`"${this.filePath}": ${e}`,t)}};var vn=class{constructor(e=vn.empty){this._source=e}static getInstance(){return vn.instance||(vn.instance=new vn),vn.instance}set(e){this._source=e}query(e=void 0){return new Jr(this._source,e)}hasInstructions(){return this._source.trim()!==vn.empty}},tr=vn;tr.empty="";var Cu=class{constructor({obsidianEvents:e}){this.logger=St.getLogger("tasks.Events");this.obsidianEvents=e}onCacheUpdate(e){return this.logger.debug("TasksEvents.onCacheUpdate()"),this.obsidianEvents.on("obsidian-tasks-plugin:cache-update",e)}triggerCacheUpdate(e){this.logger.debug("TasksEvents.triggerCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:cache-update",e)}onRequestCacheUpdate(e){return this.logger.debug("TasksEvents.onRequestCacheUpdate()"),this.obsidianEvents.on("obsidian-tasks-plugin:request-cache-update",e)}triggerRequestCacheUpdate(e){this.logger.debug("TasksEvents.triggerRequestCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:request-cache-update",e)}off(e){this.logger.debug("TasksEvents.off()"),this.obsidianEvents.offref(e)}};var Da=require("obsidian");var Oa,Ap,Pp,YA=["md"];function Nu(){return St.getLogger("tasks.File")}var O_=({metadataCache:r,vault:e,workspace:t})=>{Oa=r,Ap=e,Pp=t},ti=t=>F(void 0,[t],function*({originalTask:r,newTasks:e}){if(Ap===void 0||Oa===void 0||Pp===void 0){Au("Tasks: cannot use File before initializing it.");return}Array.isArray(e)||(e=[e]);let n=Nu(),i="replaceTaskWithTasks()";Bo(n,i,r),Ho(n,i,e),x_({originalTask:r,newTasks:e,vault:Ap,metadataCache:Oa,workspace:Pp,previousTries:0})});function Au(r){console.error(r),new Da.Notice(r,15e3)}function D_(r){console.warn(r),new Da.Notice(r,1e4)}function jA(r){Nu().debug(r)}var wn=class extends Error{},Pu=class extends Error{},x_=a=>F(void 0,[a],function*({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s}){let o=Nu();o.debug(`tryRepetitive after ${s} previous tries`);let u=()=>{if(s>10){let c=`Tasks: Could not find the correct task line to update. The task line not updated is: ${r.originalMarkdown} @@ -273,27 +273,27 @@ Recommendations: 1. Close all panes that have the above file open, and then re-open the file. 2. Check for exactly identical copies of the task line, in this file, and see if you can make them different. -`;Mu(l);return}let u=Math.min(Math.pow(10,s),100);Oa.debug(`timeout = ${u}`),setTimeout(()=>{v_({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s+1})},u)};try{let[u,l,c]=yield w_(r,t),p=[...c.slice(0,u),...e.map(h=>h.toFileLineString()),...c.slice(u+1)];yield t.modify(l,p.join(` -`))}catch(u){if(u instanceof vn)return u.message&&__(u.message),o();if(u instanceof Cu)return o();u instanceof Error&&Mu(u.message)}});function w_(r,e){return q(this,null,function*(){if(Sa===void 0)throw new vn;let t=e.getAbstractFileByPath(r.path);if(!(t instanceof Da.TFile))throw new vn(`Tasks: No file found for task ${r.description}. Retrying ...`);if(!xA.includes(t.extension))throw new Error(`Tasks: Does not support files with the ${t.extension} file extension.`);let n=Sa.getFileCache(t);if(n==null||n===null)throw new vn(`Tasks: No file cache found for file ${t.path}. Retrying ...`);let i=n.listItems;if(i===void 0||i.length===0)throw new vn(`Tasks: No list items found in file cache of ${t.path}. Retrying ...`);let a=(yield e.read(t)).split(` -`),o=CA(r,a,i,MA);if(o===void 0)throw new Cu;return[o,t,a]})}function Mp(r,e){return q(this,null,function*(){try{let[t,n,i]=yield w_(r,e);return[t,n]}catch(t){t instanceof vn?t.message&&__(t.message):t instanceof Error&&Mu(t.message)}})}function E_(r,e){return r{x_({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s+1})},l)};try{let[l,c,f]=yield R_(r,t),h=[...f.slice(0,l),...e.map(T=>T.toFileLineString()),...f.slice(l+1)];yield t.modify(c,h.join(` +`))}catch(l){if(l instanceof wn)return l.message&&D_(l.message),u();if(l instanceof Pu)return u();l instanceof Error&&Au(l.message)}});function R_(r,e){return F(this,null,function*(){if(Oa===void 0)throw new wn;let t=e.getAbstractFileByPath(r.path);if(!(t instanceof Da.TFile))throw new wn(`Tasks: No file found for task ${r.description}. Retrying ...`);if(!YA.includes(t.extension))throw new Error(`Tasks: Does not support files with the ${t.extension} file extension.`);let n=Oa.getFileCache(t);if(n==null||n===null)throw new wn(`Tasks: No file cache found for file ${t.path}. Retrying ...`);let i=n.listItems;if(i===void 0||i.length===0)throw new wn(`Tasks: No list items found in file cache of ${t.path}. Retrying ...`);let a=(yield e.read(t)).split(` +`),o=GA(r,a,i,jA);if(o===void 0)throw new Pu;return[o,t,a]})}function Np(r,e){return F(this,null,function*(){try{let[t,n,i]=yield R_(r,e);return[t,n]}catch(t){t instanceof wn?t.message&&D_(t.message):t instanceof Error&&Au(t.message)}})}function M_(r,e){return r"",Ce.dateAttributeCalculator=(e,t)=>{let i="far";function s(o){let u=window.moment().startOf("day"),l="",c=u.diff(o,"days");return isNaN(c)?null:c===0?"today":(c>0?l+="past-":c<0&&(l+="future-"),Math.abs(c)<=7?l+=Math.abs(c).toString()+"d":l+=i,l)}let a=t[e];if(a instanceof window.moment){let o=s(a);if(o)return o}return""};var IA={createdDate:new Ce("task-created","taskCreated",Ce.dateAttributeCalculator),dueDate:new Ce("task-due","taskDue",Ce.dateAttributeCalculator),startDate:new Ce("task-start","taskStart",Ce.dateAttributeCalculator),scheduledDate:new Ce("task-scheduled","taskScheduled",Ce.dateAttributeCalculator),doneDate:new Ce("task-done","taskDone",Ce.dateAttributeCalculator),description:new Ce("task-description",Ce.noAttributeName,Ce.noAttributeValueCalculator),recurrenceRule:new Ce("task-recurring",Ce.noAttributeName,Ce.noAttributeValueCalculator),priority:new Ce("task-priority","taskPriority",(r,e)=>Vr.priorityNameUsingNormal(e.priority).toLocaleLowerCase()),blockLink:new Ce("task-block-link",Ce.noAttributeName,Ce.noAttributeValueCalculator)};var Ra=new Pu,wn=class{static obsidianMarkdownRenderer(e,t,n,i){return q(this,null,function*(){if(!i)throw new Error("Must call the Obsidian renderer with an Obsidian Component object");yield k_.MarkdownRenderer.renderMarkdown(e,t,n,i)})}constructor({textRenderer:e=wn.obsidianMarkdownRenderer,obsidianComponent:t,parentUlElement:n,layoutOptions:i}){this.textRenderer=e,this.obsidianComponent=t,this.parentUlElement=n,this.layoutOptions=i}renderTaskLine(e,t,n){return q(this,null,function*(){let i=document.createElement("li");this.parentUlElement.appendChild(i),i.classList.add("task-list-item","plugin-tasks-list-item");let s=document.createElement("span");i.appendChild(s),s.classList.add("tasks-list-text"),yield this.taskToHtml(e,s,i);let a=document.createElement("input");return i.appendChild(a),a.classList.add("task-list-item-checkbox"),a.type="checkbox",e.status.symbol!==" "&&(a.checked=!0,i.classList.add("is-checked")),a.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),a.disabled=!0;let u=e.toggleWithRecurrenceInUsersOrder();Au({originalTask:e,newTasks:u})}),i.prepend(a),i.setAttribute("data-task",e.status.symbol.trim()),i.setAttribute("data-line",t.toString()),i.setAttribute("data-task-status-name",e.status.name),i.setAttribute("data-task-status-type",e.status.type),a.setAttribute("data-line",t.toString()),this.layoutOptions.shortMode&&this.addTooltip(e,s,n),i})}taskToHtml(e,t,n){return q(this,null,function*(){let i=new fn(this.layoutOptions),s=Br.tasksPluginEmoji.taskSerializer;for(let a of i.shownTaskLayoutComponents){let o=s.componentToString(e,i,a);if(o){a==="description"&&(o=me.getInstance().removeAsWordFromDependingOnSettings(o));let u=document.createElement("span");if(t.appendChild(u),u){let l=document.createElement("span");u.appendChild(l),yield this.renderComponentText(l,o,a,e),this.addInternalClasses(a,l);let c=Ra.className(a);u.classList.add(c),Ra.addDataAttribute(u,e,a),Ra.addDataAttribute(n,e,a)}}}for(let a of i.hiddenTaskLayoutComponents)Ra.addDataAttribute(n,e,a);n.dataset.taskPriority===void 0&&Ra.addDataAttribute(n,e,"priority")})}renderComponentText(e,t,n,i){return q(this,null,function*(){if(n==="description"){let{debugSettings:s}=Q();s.showTaskHiddenData&&(t+=`
\u{1F41B} ${i.lineNumber} . ${i.sectionStart} . ${i.sectionIndex} . '${i.originalMarkdown}'
'${i.path}' > '${i.precedingHeader}'
`),yield this.textRenderer(t,e,i.path,this.obsidianComponent);let a=e.querySelector("blockquote"),o=a!=null?a:e,u=o.querySelector("p");if(u!==null){for(;u.firstChild;)o.insertBefore(u.firstChild,u);u.remove()}e.querySelectorAll("p").forEach(l=>{l.hasChildNodes()||l.remove()}),e.querySelectorAll(".footnotes").forEach(l=>{l.remove()})}else e.innerHTML=t})}addInternalClasses(e,t){function n(i){let s=/["&\x00\r\n]/g,a=i.replace(s,"-");return a=a.replace(/^[-_]+/,""),a.length>0?a:null}if(e==="description"){let i=t.getElementsByClassName("tag");for(let s=0;s{function c(y,w,R){w&&y.createDiv().setText(p({signifier:R,date:w}))}function p({signifier:y,date:w}){return`${y} ${w.format(V.dateFormat)} (${w.from(window.moment().startOf("day"))})`}let h=t.createDiv();h.addClasses(["tooltip","pop-up"]),e.recurrence&&h.createDiv().setText(`${i} ${e.recurrence.toText()}`),c(h,e.createdDate,a),c(h,e.startDate,s),c(h,e.scheduledDate,o),c(h,e.dueDate,u),c(h,e.doneDate,l);let _=e.getLinkText({isFilenameUnique:n});_&&h.createDiv().setText(`\u{1F517} ${_}`),t.addEventListener("mouseleave",()=>{h.remove()})})}};var Nu=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return q(this,null,function*(){var p;let n=new S_.MarkdownRenderChild(e);t.addChild(n);let i=e.findAll(".task-list-item").filter(h=>{var w;let _=(w=h.textContent)==null?void 0:w.split(` -`);if(_===void 0)return!1;let y=null;for(let R=0;R<_.length;R=R+1)if(_[R]!==""){y=_[R];break}return y===null?!1:me.getInstance().includedIn(y)});if(i.length===0)return;let s=t.sourcePath,a=t.getSectionInfo(e);if(a===null)return;let o=a.text.split(` -`),u=0,l=[];for(let h=a.lineStart;h<=a.lineEnd;h++){let _=o[h];if(_===void 0)continue;let y=null,w=ge.fromLine({line:_,taskLocation:new ut(s,h,a.lineStart,u,y),fallbackDate:null});w!==null&&(l.push(w),u++)}let c=new wn({obsidianComponent:n,parentUlElement:e,layoutOptions:new Wn});for(let h=0;hO_.ViewPlugin.fromClass(Ap),Ap=class{constructor(e){this.view=e,this.handleClickEvent=this.handleClickEvent.bind(this),this.view.dom.addEventListener("click",this.handleClickEvent)}destroy(){this.view.dom.removeEventListener("click",this.handleClickEvent)}handleClickEvent(e){let{target:t}=e;if(!t||!(t instanceof HTMLInputElement)||t.type!=="checkbox")return!1;let n=t.closest("ul.plugin-tasks-query-result, div.callout-content");if(n){if(n.matches("div.callout-content")){let h=`obsidian-tasks-plugin warning: Tasks cannot add or remove completion dates or make the next copy of a recurring task for tasks written inside a callout when you click their checkboxes in Live Preview. -If you wanted Tasks to do these things, please undo your change, then either click the line of the task and use the "Toggle Task Done" command, or switch to Reading View to click the checkbox.`;console.warn(h),new D_.Notice(h,45e3)}return!1}let{state:i}=this.view,s=this.view.posAtDOM(t),a=i.doc.lineAt(s),o=ge.fromLine({line:a.text,taskLocation:ut.fromUnknownPosition(""),fallbackDate:null});if(o===null)return!1;e.preventDefault();let l=o.toggleWithRecurrenceInUsersOrder().map(h=>h.toFileLineString()).join(i.lineBreak),c=i.update({changes:{from:a.from,to:a.to,insert:l}});this.view.dispatch(c);let p=t.checked;return setTimeout(()=>{t.checked=p},1),!0}};var Qi=require("obsidian");function x_(r,e,t,n=void 0){let i="";e.isEmpty()||(i+=`Only tasks containing the global filter '${e.get()}'. +${u}`);return}break}s++}}return i}var N_=require("obsidian");var P_=require("obsidian");var Iu=class{constructor(){this.data=VA}addDataAttribute(e,t,n){this.data[n].addDataAttribute(e,t,n)}className(e){return this.data[e].className}},Ip=class{constructor(e,t,n){if(e==="")throw Error("Developer note: CSS class cannot be an empty string, please specify one.");this.className=e,this.attributeName=t,this.attributeValueCalculator=n}addDataAttribute(e,t,n){this.attributeName!==Ip.noAttributeName&&(e.dataset[this.attributeName]=this.attributeValueCalculator(n,t))}},Ce=Ip;Ce.noAttributeName="",Ce.noAttributeValueCalculator=()=>"",Ce.dateAttributeCalculator=(e,t)=>{let i="far";function s(o){let u=window.moment().startOf("day"),l="",c=u.diff(o,"days");return isNaN(c)?null:c===0?"today":(c>0?l+="past-":c<0&&(l+="future-"),Math.abs(c)<=7?l+=Math.abs(c).toString()+"d":l+=i,l)}let a=t[e];if(a instanceof window.moment){let o=s(a);if(o)return o}return""};var VA={createdDate:new Ce("task-created","taskCreated",Ce.dateAttributeCalculator),dueDate:new Ce("task-due","taskDue",Ce.dateAttributeCalculator),startDate:new Ce("task-start","taskStart",Ce.dateAttributeCalculator),scheduledDate:new Ce("task-scheduled","taskScheduled",Ce.dateAttributeCalculator),doneDate:new Ce("task-done","taskDone",Ce.dateAttributeCalculator),description:new Ce("task-description",Ce.noAttributeName,Ce.noAttributeValueCalculator),recurrenceRule:new Ce("task-recurring",Ce.noAttributeName,Ce.noAttributeValueCalculator),priority:new Ce("task-priority","taskPriority",(r,e)=>Kr.priorityNameUsingNormal(e.priority).toLocaleLowerCase()),blockLink:new Ce("task-block-link",Ce.noAttributeName,Ce.noAttributeValueCalculator)};var C_=require("obsidian");function A_(r,e){return F(this,null,function*(){yield ti({originalTask:r,newTasks:e})})}var Fu=class extends C_.Menu{constructor(t){super();this.taskSaver=t}};var Lu=class extends Fu{constructor(t,n,i=A_){super(i);this.statusRegistry=t;let s="Change status to:",a=(u,l,c,f)=>{let h=`${s} [${f}] ${c}`;l.setTitle(h).setChecked(f===u.status.symbol).onClick(()=>F(this,null,function*(){if(f!==u.status.symbol){let T=this.statusRegistry.bySymbol(f),y=u.handleNewStatusWithRecurrenceInUsersOrder(T);yield this.taskSaver(u,y)}}))},o=new Pe().coreStatuses.map(u=>u.symbol);for(let u of[!0,!1])for(let l of t.registeredStatuses)o.includes(l.symbol)===u&&this.addItem(c=>a(n,c,l.name,l.symbol))}};var xa=new Iu,En=class{static obsidianMarkdownRenderer(e,t,n,i){return F(this,null,function*(){if(!i)throw new Error("Must call the Obsidian renderer with an Obsidian Component object");yield P_.MarkdownRenderer.renderMarkdown(e,t,n,i)})}constructor({textRenderer:e=En.obsidianMarkdownRenderer,obsidianComponent:t,parentUlElement:n,layoutOptions:i}){this.textRenderer=e,this.obsidianComponent=t,this.parentUlElement=n,this.layoutOptions=i}renderTaskLine(e,t,n){return F(this,null,function*(){let i=document.createElement("li");this.parentUlElement.appendChild(i),i.classList.add("task-list-item","plugin-tasks-list-item");let s=document.createElement("span");i.appendChild(s),s.classList.add("tasks-list-text"),yield this.taskToHtml(e,s,i);let a=document.createElement("input");return i.appendChild(a),a.classList.add("task-list-item-checkbox"),a.type="checkbox",e.status.symbol!==" "&&(a.checked=!0,i.classList.add("is-checked")),a.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),a.disabled=!0;let u=e.toggleWithRecurrenceInUsersOrder();ti({originalTask:e,newTasks:u})}),a.addEventListener("contextmenu",o=>{new Lu(ve.getInstance(),e).showAtPosition({x:o.clientX,y:o.clientY})}),a.setAttribute("title","Right-click for options"),i.prepend(a),i.setAttribute("data-task",e.status.symbol.trim()),i.setAttribute("data-line",t.toString()),i.setAttribute("data-task-status-name",e.status.name),i.setAttribute("data-task-status-type",e.status.type),a.setAttribute("data-line",t.toString()),this.layoutOptions.shortMode&&this.addTooltip(e,s,n),i})}taskToHtml(e,t,n){return F(this,null,function*(){let i=new pn(this.layoutOptions),s=Hr.tasksPluginEmoji.taskSerializer;for(let a of i.shownTaskLayoutComponents){let o=s.componentToString(e,i,a);if(o){let u=document.createElement("span");t.appendChild(u);let l=document.createElement("span");u.appendChild(l),yield this.renderComponentText(l,o,a,e),this.addInternalClasses(a,l);let c=xa.className(a);u.classList.add(c),xa.addDataAttribute(u,e,a),xa.addDataAttribute(n,e,a)}}for(let a of i.hiddenTaskLayoutComponents)xa.addDataAttribute(n,e,a);n.dataset.taskPriority===void 0&&xa.addDataAttribute(n,e,"priority")})}renderComponentText(e,t,n,i){return F(this,null,function*(){if(n==="description"){t=ge.getInstance().removeAsWordFromDependingOnSettings(t);let{debugSettings:s}=Q();s.showTaskHiddenData&&(t+=`
\u{1F41B} ${i.lineNumber} . ${i.sectionStart} . ${i.sectionIndex} . '${i.originalMarkdown}'
'${i.path}' > '${i.precedingHeader}'
`),yield this.textRenderer(t,e,i.path,this.obsidianComponent);let a=e.querySelector("blockquote"),o=a!=null?a:e,u=o.querySelector("p");if(u!==null){for(;u.firstChild;)o.insertBefore(u.firstChild,u);u.remove()}e.querySelectorAll("p").forEach(l=>{l.hasChildNodes()||l.remove()}),e.querySelectorAll(".footnotes").forEach(l=>{l.remove()})}else e.innerHTML=t})}addInternalClasses(e,t){function n(i){let s=/["&\x00\r\n]/g,a=i.replace(s,"-");return a=a.replace(/^[-_]+/,""),a.length>0?a:null}if(e==="description"){let i=t.getElementsByClassName("tag");for(let s=0;s{function c(y,w,D){w&&y.createDiv().setText(f({signifier:D,date:w}))}function f({signifier:y,date:w}){return`${y} ${w.format(V.dateFormat)} (${w.from(window.moment().startOf("day"))})`}let h=t.createDiv();h.addClasses(["tooltip","pop-up"]),e.recurrence&&h.createDiv().setText(`${i} ${e.recurrence.toText()}`),c(h,e.createdDate,a),c(h,e.startDate,s),c(h,e.scheduledDate,o),c(h,e.dueDate,u),c(h,e.doneDate,l);let T=e.getLinkText({isFilenameUnique:n});T&&h.createDiv().setText(`\u{1F517} ${T}`),t.addEventListener("mouseleave",()=>{h.remove()})})}};var Uu=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return F(this,null,function*(){var f;let n=new N_.MarkdownRenderChild(e);t.addChild(n);let i=e.findAll(".task-list-item").filter(h=>{var w;let T=(w=h.textContent)==null?void 0:w.split(` +`);if(T===void 0)return!1;let y=null;for(let D=0;DI_.ViewPlugin.fromClass(Fp),Fp=class{constructor(e){this.view=e,this.handleClickEvent=this.handleClickEvent.bind(this),this.view.dom.addEventListener("click",this.handleClickEvent)}destroy(){this.view.dom.removeEventListener("click",this.handleClickEvent)}handleClickEvent(e){let{target:t}=e;if(!t||!(t instanceof HTMLInputElement)||t.type!=="checkbox")return!1;let n=t.closest("ul.plugin-tasks-query-result, div.callout-content");if(n){if(n.matches("div.callout-content")){let h=`obsidian-tasks-plugin warning: Tasks cannot add or remove completion dates or make the next copy of a recurring task for tasks written inside a callout when you click their checkboxes in Live Preview. +If you wanted Tasks to do these things, please undo your change, then either click the line of the task and use the "Toggle Task Done" command, or switch to Reading View to click the checkbox.`;console.warn(h),new F_.Notice(h,45e3)}return!1}let{state:i}=this.view,s=this.view.posAtDOM(t),a=i.doc.lineAt(s),o=le.fromLine({line:a.text,taskLocation:ct.fromUnknownPosition(""),fallbackDate:null});if(o===null)return!1;e.preventDefault();let l=o.toggleWithRecurrenceInUsersOrder().map(h=>h.toFileLineString()).join(i.lineBreak),c=i.update({changes:{from:a.from,to:a.to,insert:l}});this.view.dispatch(c);let f=t.checked;return setTimeout(()=>{t.checked=f},1),!0}};var pr=require("obsidian");function U_(r,e,t,n=void 0){let i="";e.isEmpty()||(i+=`Only tasks containing the global filter '${e.get()}'. -`);let s=new Zr(r,n);return s.ignoreGlobalQuery||t.hasInstructions()&&(i+=`Explanation of the global query: +`);let s=new Jr(r,n);return s.ignoreGlobalQuery||t.hasInstructions()&&(i+=`Explanation of the global query: ${t.query(n).explainQuery()} `),i+=`Explanation of this Tasks code block query: -${s.explainQuery()}`,i}function Iu(r,e,t){let n=new Zr(r,t);return n.ignoreGlobalQuery?n:e.query(t).append(n)}var Fu=class{constructor({plugin:e,events:t}){this.addQueryRenderChild=this._addQueryRenderChild.bind(this);this.app=e.app,this.events=t,e.registerMarkdownCodeBlockProcessor("tasks",this._addQueryRenderChild.bind(this))}_addQueryRenderChild(e,t,n){return q(this,null,function*(){n.addChild(new Pp({app:this.app,events:this.events,container:t,source:e,filePath:n.sourcePath}))})}},Pp=class extends Qi.MarkdownRenderChild{constructor({app:t,events:n,container:i,source:s,filePath:a}){super(i);switch(this.app=t,this.events=n,this.source=s,this.filePath=a,this.containerEl.className){case"block-language-tasks":this.query=Iu(this.source,tr.getInstance(),this.filePath),this.queryType="tasks";break;default:this.query=Iu(this.source,tr.getInstance(),this.filePath),this.queryType="tasks";break}}onload(){this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.renderEventRef=this.events.onCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()}onunload(){this.renderEventRef!==void 0&&this.events.off(this.renderEventRef),this.queryReloadTimeout!==void 0&&clearTimeout(this.queryReloadTimeout)}reloadQueryAtMidnight(){let t=new Date;t.setHours(24,0,0,0);let n=new Date,i=t.getTime()-n.getTime();this.queryReloadTimeout=setTimeout(()=>{this.query=Iu(this.source,tr.getInstance(),this.filePath),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},i+1e3)}render(i){return q(this,arguments,function*({tasks:t,state:n}){var a;let s=this.containerEl.createEl("div");n==="Warm"&&this.query.error===void 0?yield this.renderQuerySearchResults(t,n,s):this.query.error!==void 0?this.renderErrorMessage(s,this.query.error):this.renderLoadingMessage(s),(a=this.containerEl.firstChild)==null||a.replaceWith(s)})}renderQuerySearchResults(t,n,i){return q(this,null,function*(){this.query.debug(`Render called: plugin state: ${n}; searching ${t.length} tasks`),this.query.layoutOptions.explainQuery&&this.createExplanation(i);let s=this.query.applyQueryToTasks(t);if(s.searchErrorMessage!==void 0){this.renderErrorMessage(i,s.searchErrorMessage);return}yield this.addAllTaskGroups(s.taskGroups,i);let a=s.totalTasksCount;this.addTaskCount(i,s),this.query.debug(`${a} tasks displayed`)})}renderErrorMessage(t,n){t.createDiv().innerHTML=`
Tasks query: ${n.replace(/\n/g,"
")}
`}renderLoadingMessage(t){t.setText("Loading Tasks ...")}createExplanation(t){let n=x_(this.source,me.getInstance(),tr.getInstance(),this.filePath),i=t.createEl("pre");i.addClasses(["plugin-tasks-query-explanation"]),i.setText(n),t.appendChild(i)}createTaskList(t,n){return q(this,null,function*(){let i=new fn(this.query.layoutOptions),s=n.createEl("ul");s.addClasses(["contains-task-list","plugin-tasks-query-result"]),s.addClasses(i.taskListHiddenClasses);let a=this.getGroupingAttribute();a&&a.length>0&&(s.dataset.taskGroupBy=a);let o=new wn({obsidianComponent:this,parentUlElement:s,layoutOptions:this.query.layoutOptions});for(let[u,l]of t.entries()){let c=this.isFilenameUnique({task:l}),p=yield o.renderTaskLine(l,u,c);p.querySelectorAll("[data-footnote-id]").forEach(y=>y.remove());let _=p.createSpan("task-extras");if(this.query.layoutOptions.hideUrgency||this.addUrgency(_,l),!this.query.layoutOptions.hideBacklinks){let y=this.query.layoutOptions.shortMode;this.addBacklinks(_,l,y,c)}this.query.layoutOptions.hideEditButton||this.addEditButton(_,l),s.appendChild(p)}n.appendChild(s)})}addEditButton(t,n){t.createEl("a",{cls:"tasks-edit"}).onClickEvent(s=>{s.preventDefault();let a=u=>{Au({originalTask:n,newTasks:xt.removeInferredStatusIfNeeded(n,u)})};new hn({app:this.app,task:n,onSubmit:a}).open()})}addUrgency(t,n){let i=new Intl.NumberFormat().format(n.urgency);t.createSpan({text:i,cls:"tasks-urgency"})}addAllTaskGroups(t,n){return q(this,null,function*(){for(let i of t.groups)this.addGroupHeadings(n,i.groupHeadings),yield this.createTaskList(i.tasks,n)})}addGroupHeadings(t,n){for(let i of n)this.addGroupHeading(t,i)}addGroupHeading(t,n){return q(this,null,function*(){let i="h6";n.nestingLevel===0?i="h4":n.nestingLevel===1&&(i="h5");let s=t.createEl(i,{cls:"tasks-group-heading"});yield Qi.MarkdownRenderer.renderMarkdown(n.displayName,s,this.filePath,this)})}addBacklinks(t,n,i,s){var c;let a=t.createSpan({cls:"tasks-backlink"});i||a.append(" (");let o=a.createEl("a");o.rel="noopener",o.target="_blank",o.addClass("internal-link"),i&&o.addClass("internal-link-short-mode");let u;i?u=" \u{1F517}":u=(c=n.getLinkText({isFilenameUnique:s}))!=null?c:"",o.setText(u);let l=this.app.vault;o.addEventListener("click",p=>q(this,null,function*(){let h=yield Mp(n,l);if(h){let[_,y]=h,w=this.app.workspace.getLeaf(Qi.Keymap.isModEvent(p));p.preventDefault(),yield w.openFile(y,{eState:{line:_}})}})),o.addEventListener("mousedown",p=>q(this,null,function*(){if(p.button===1){let h=yield Mp(n,l);if(h){let[_,y]=h,w=this.app.workspace.getLeaf("tab");p.preventDefault(),yield w.openFile(y,{eState:{line:_}})}}})),i||a.append(")")}addTaskCount(t,n){this.query.layoutOptions.hideTaskCount||t.createDiv({text:n.totalTasksCountDisplayText(),cls:"tasks-count"})}isFilenameUnique({task:t}){let n=t.path.match(/([^/]*)\..+$/i);if(n===null)return;let i=n[1];return this.app.vault.getMarkdownFiles().filter(a=>{if(a.basename===i)return!0}).length<2}getGroupingAttribute(){let t=[];for(let n of this.query.grouping)t.push(n.property);return t.join(",")}};var Te=require("obsidian");var Lu=class{constructor(e){this._markdown="";this.columnNames=e,this.addTitleRow()}get markdown(){return this._markdown}addTitleRow(){let e="|",t="|";this.columnNames.forEach(n=>{e+=` ${n} |`,t+=" ----- |"}),this._markdown+=`${e} +${s.explainQuery()}`,i}function Wu(r,e,t){let n=new Jr(r,t);return n.ignoreGlobalQuery?n:e.query(t).append(n)}function W_(r){for(let t of le.allDateFields()){let n=r[t];if(n&&!n.isValid())return!1}let e=r.happensDates.some(t=>!!(t!=null&&t.isValid()));return!r.isDone&&e}function Lp(r){return r.dueDate?"dueDate":r.scheduledDate?"scheduledDate":r.startDate?"startDate":null}function q_(r,e,t,n){let i=r[e],s=new rt(i).postpone(t,n),a=ht.removeInferredStatusIfNeeded(r,[new le(it(we({},r),{[e]:s}))])[0];return{postponedDate:s,postponedTask:a}}function $_(r,e){let t=r==null?void 0:r.format("DD MMM YYYY");return`Task's ${e} postponed until ${t}`}function Y_(r,e,t){return`\u2139\uFE0F ${Up(r,e,t)} (right-click for more options)`}function Up(r,e,t){function n(l){return l.charAt(0).toUpperCase()+l.slice(1)}let i=Lp(r),s=r[i],o=new rt(s).postpone(t,e).format("ddd Do MMM"),u=e>1?e:"a";return s.isSameOrBefore(window.moment(),"day")?`${n(i.replace("Date",""))} in ${u} ${t}, on ${o}`:`Postpone ${i.replace("Date"," date")} by ${u} ${t}, to ${o}`}var qu=class{constructor({plugin:e,events:t}){this.addQueryRenderChild=this._addQueryRenderChild.bind(this);this.app=e.app,this.events=t,e.registerMarkdownCodeBlockProcessor("tasks",this._addQueryRenderChild.bind(this))}_addQueryRenderChild(e,t,n){return F(this,null,function*(){n.addChild(new Wp({app:this.app,events:this.events,container:t,source:e,filePath:n.sourcePath}))})}},Wp=class extends pr.MarkdownRenderChild{constructor({app:t,events:n,container:i,source:s,filePath:a}){super(i);switch(this.app=t,this.events=n,this.source=s,this.filePath=a,this.containerEl.className){case"block-language-tasks":this.query=Wu(this.source,tr.getInstance(),this.filePath),this.queryType="tasks";break;default:this.query=Wu(this.source,tr.getInstance(),this.filePath),this.queryType="tasks";break}}onload(){this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.renderEventRef=this.events.onCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()}onunload(){this.renderEventRef!==void 0&&this.events.off(this.renderEventRef),this.queryReloadTimeout!==void 0&&clearTimeout(this.queryReloadTimeout)}reloadQueryAtMidnight(){let t=new Date;t.setHours(24,0,0,0);let n=new Date,i=t.getTime()-n.getTime();this.queryReloadTimeout=setTimeout(()=>{this.query=Wu(this.source,tr.getInstance(),this.filePath),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},i+1e3)}render(i){return F(this,arguments,function*({tasks:t,state:n}){var a;let s=this.containerEl.createEl("div");n==="Warm"&&this.query.error===void 0?yield this.renderQuerySearchResults(t,n,s):this.query.error!==void 0?this.renderErrorMessage(s,this.query.error):this.renderLoadingMessage(s),(a=this.containerEl.firstChild)==null||a.replaceWith(s)})}renderQuerySearchResults(t,n,i){return F(this,null,function*(){this.query.debug(`[render] Render called: plugin state: ${n}; searching ${t.length} tasks`),this.query.layoutOptions.explainQuery&&this.createExplanation(i);let s=this.query.applyQueryToTasks(t);if(s.searchErrorMessage!==void 0){this.renderErrorMessage(i,s.searchErrorMessage);return}yield this.addAllTaskGroups(s.taskGroups,i);let a=s.totalTasksCount;this.addTaskCount(i,s),this.query.debug(`[render] ${a} tasks displayed`)})}renderErrorMessage(t,n){t.createDiv().innerHTML=`
Tasks query: ${n.replace(/\n/g,"
")}
`}renderLoadingMessage(t){t.setText("Loading Tasks ...")}createExplanation(t){let n=U_(this.source,ge.getInstance(),tr.getInstance(),this.filePath),i=t.createEl("pre");i.addClasses(["plugin-tasks-query-explanation"]),i.setText(n),t.appendChild(i)}createTaskList(t,n){return F(this,null,function*(){let i=new pn(this.query.layoutOptions),s=n.createEl("ul");s.addClasses(["contains-task-list","plugin-tasks-query-result"]),s.addClasses(i.taskListHiddenClasses);let a=this.getGroupingAttribute();a&&a.length>0&&(s.dataset.taskGroupBy=a);let o=new En({obsidianComponent:this,parentUlElement:s,layoutOptions:this.query.layoutOptions});for(let[u,l]of t.entries()){let c=this.isFilenameUnique({task:l}),f=yield o.renderTaskLine(l,u,c);f.querySelectorAll("[data-footnote-id]").forEach(w=>w.remove());let T=f.createSpan("task-extras");this.query.layoutOptions.hideUrgency||this.addUrgency(T,l);let y=this.query.layoutOptions.shortMode;this.query.layoutOptions.hideBacklinks||this.addBacklinks(T,l,y,c),this.query.layoutOptions.hideEditButton||this.addEditButton(T,l),!this.query.layoutOptions.hidePostponeButton&&W_(l)&&this.addPostponeButton(T,l,y),s.appendChild(f)}n.appendChild(s)})}addEditButton(t,n){t.createEl("a",{cls:"tasks-edit"}).onClickEvent(s=>{s.preventDefault();let a=u=>F(this,null,function*(){yield ti({originalTask:n,newTasks:ht.removeInferredStatusIfNeeded(n,u)})});new mn({app:this.app,task:n,onSubmit:a}).open()})}addUrgency(t,n){let i=new Intl.NumberFormat().format(n.urgency);t.createSpan({text:i,cls:"tasks-urgency"})}addAllTaskGroups(t,n){return F(this,null,function*(){for(let i of t.groups)yield this.addGroupHeadings(n,i.groupHeadings),yield this.createTaskList(i.tasks,n)})}addGroupHeadings(t,n){return F(this,null,function*(){for(let i of n)yield this.addGroupHeading(t,i)})}addGroupHeading(t,n){return F(this,null,function*(){let i="h6";n.nestingLevel===0?i="h4":n.nestingLevel===1&&(i="h5");let s=t.createEl(i,{cls:"tasks-group-heading"});yield pr.MarkdownRenderer.renderMarkdown(n.displayName,s,this.filePath,this)})}addBacklinks(t,n,i,s){var c;let a=t.createSpan({cls:"tasks-backlink"});i||a.append(" (");let o=a.createEl("a");o.rel="noopener",o.target="_blank",o.addClass("internal-link"),i&&o.addClass("internal-link-short-mode");let u;i?u=" \u{1F517}":u=(c=n.getLinkText({isFilenameUnique:s}))!=null?c:"",o.setText(u);let l=this.app.vault;o.addEventListener("click",f=>F(this,null,function*(){let h=yield Np(n,l);if(h){let[T,y]=h,w=this.app.workspace.getLeaf(pr.Keymap.isModEvent(f));f.preventDefault(),yield w.openFile(y,{eState:{line:T}})}})),o.addEventListener("mousedown",f=>F(this,null,function*(){if(f.button===1){let h=yield Np(n,l);if(h){let[T,y]=h,w=this.app.workspace.getLeaf("tab");f.preventDefault(),yield w.openFile(y,{eState:{line:T}})}}})),i||a.append(")")}addPostponeButton(t,n,i){let a="day",o=Y_(n,1,a),u=t.createEl("button",{attr:{id:"postpone-button",title:o}}),l=i?["tasks-postpone","tasks-postpone-short-mode"]:["tasks-postpone"];u.addClasses(l),u.setText(" \u23E9"),u.addEventListener("click",()=>this.postponeOnClickCallback(u,n,1,a)),u.addEventListener("contextmenu",c=>F(this,null,function*(){let f=new pr.Menu,h=(T,y,w=1)=>{let D=Up(n,w,y);T.setTitle(D).onClick(()=>this.postponeOnClickCallback(u,n,w,y))};f.addItem(T=>h(T,"days",2)),f.addItem(T=>h(T,"days",3)),f.addItem(T=>h(T,"days",4)),f.addItem(T=>h(T,"days",5)),f.addItem(T=>h(T,"days",6)),f.addSeparator(),f.addItem(T=>h(T,"week")),f.addItem(T=>h(T,"weeks",2)),f.addItem(T=>h(T,"weeks",3)),f.addItem(T=>h(T,"month")),f.showAtPosition({x:c.clientX,y:c.clientY})}))}addTaskCount(t,n){this.query.layoutOptions.hideTaskCount||t.createDiv({text:n.totalTasksCountDisplayText(),cls:"tasks-count"})}isFilenameUnique({task:t}){let n=t.path.match(/([^/]*)\..+$/i);if(n===null)return;let i=n[1];return this.app.vault.getMarkdownFiles().filter(a=>{if(a.basename===i)return!0}).length<2}getGroupingAttribute(){let t=[];for(let n of this.query.grouping)t.push(n.property);return t.join(",")}postponeOnClickCallback(t,n,i,s){return F(this,null,function*(){let a=Lp(n);if(a===null){let l="\u26A0\uFE0F Postponement requires a date: due, scheduled or start.";return new pr.Notice(l,1e4)}let{postponedDate:o,postponedTask:u}=q_(n,a,s,i);yield ti({originalTask:n,newTasks:u}),this.postponeSuccessCallback(t,a,o)})}postponeSuccessCallback(t,n,i){t.disabled=!0;let s=$_(i,n);new pr.Notice(s,2e3)}};var be=require("obsidian");var $u=class{constructor(e){this._markdown="";this.columnNames=e,this.addTitleRow()}get markdown(){return this._markdown}addTitleRow(){let e="|",t="|";this.columnNames.forEach(n=>{e+=` ${n} |`,t+=" ----- |"}),this._markdown+=`${e} `,this._markdown+=`${t} `}addRow(e){let t=this.makeRowText(e);this._markdown+=`${t} `}addRowIfNew(e){let t=this.makeRowText(e);this._markdown.includes(t)||(this._markdown+=`${t} -`)}makeRowText(e){let t="|";return e.forEach(n=>{t+=` ${n} |`}),t}};function M_(r,e){return r.findIndex(t=>t.symbol===e)}function FA(r,e){let t=X.getTypeForUnknownSymbol(r.symbol);r.type!==t&&(t==="TODO"&&r.symbol!==" "||e.push(`For information, the conventional type for status symbol ${Rr(r.symbol)} is ${Rr(t)}: you may wish to review this type.`))}function LA(r,e,t){let n=M_(r,e.nextStatusSymbol);if(n===-1){t.push(`Next symbol ${Rr(e.nextStatusSymbol)} is unknown: create a status with symbol ${Rr(e.nextStatusSymbol)}.`);return}if(e.type!=="DONE")return;let i=r[n];if(i){if(i.type!=="TODO"&&i.type!=="IN_PROGRESS"){let s="https://publish.obsidian.md/tasks/Getting+Started/Statuses/Recurring+Tasks+and+Custom+Statuses";t.push(`This \`DONE\` status is followed by ${Rr(i.type)}, not \`TODO\` or \`IN_PROGRESS\`: this will not work well for recurring tasks. See [Recurring Tasks and Custom Statuses](${s}).`)}}else t.push("Unexpected failure to find the next status.")}function UA(r,e,t){let n=[];return e.symbol===X.EMPTY.symbol?(n.push("Empty symbol: this status will be ignored."),n):M_(r,e.symbol)!=t?(n.push(`Duplicate symbol '${Rr(e.symbol)}': this status will be ignored.`),n):(FA(e,n),LA(r,e,n),n)}function C_(r){let e=new Lu(["Status Symbol","Next Status Symbol","Status Name","Status Type","Problems (if any)"]),t=Ie.allStatuses(r);return t.forEach((n,i)=>{e.addRow([Rr(n.symbol),Rr(n.nextStatusSymbol),n.name,Rr(n.type),UA(t,n,i).join("
")])}),e.markdown}function A_(r,e,t,n){let s=C_(r),a=e.mermaidDiagram(!0);return`# ${t} +`)}makeRowText(e){let t="|";return e.forEach(n=>{t+=` ${n} |`}),t}};function j_(r,e){return r.findIndex(t=>t.symbol===e)}function KA(r,e){let t=X.getTypeForUnknownSymbol(r.symbol);r.type!==t&&(t==="TODO"&&r.symbol!==" "||e.push(`For information, the conventional type for status symbol ${Rr(r.symbol)} is ${Rr(t)}: you may wish to review this type.`))}function QA(r,e,t){let n=j_(r,e.nextStatusSymbol);if(n===-1){t.push(`Next symbol ${Rr(e.nextStatusSymbol)} is unknown: create a status with symbol ${Rr(e.nextStatusSymbol)}.`);return}if(e.type!=="DONE")return;let i=r[n];if(i){if(i.type!=="TODO"&&i.type!=="IN_PROGRESS"){let s="https://publish.obsidian.md/tasks/Getting+Started/Statuses/Recurring+Tasks+and+Custom+Statuses";t.push(`This \`DONE\` status is followed by ${Rr(i.type)}, not \`TODO\` or \`IN_PROGRESS\`: this will not work well for recurring tasks. See [Recurring Tasks and Custom Statuses](${s}).`)}}else t.push("Unexpected failure to find the next status.")}function XA(r,e,t){let n=[];return e.symbol===X.EMPTY.symbol?(n.push("Empty symbol: this status will be ignored."),n):j_(r,e.symbol)!=t?(n.push(`Duplicate symbol '${Rr(e.symbol)}': this status will be ignored.`),n):(KA(e,n),QA(r,e,n),n)}function G_(r){let e=new $u(["Status Symbol","Next Status Symbol","Status Name","Status Type","Problems (if any)"]),t=Pe.allStatuses(r);return t.forEach((n,i)=>{e.addRow([Rr(n.symbol),Rr(n.nextStatusSymbol),n.name,Rr(n.type),XA(t,n,i).join("
")])}),e.markdown}function B_(r,e,t,n){let s=G_(r),a=e.mermaidDiagram(!0);return`# ${t} ## About this file @@ -322,14 +322,14 @@ ${s} These are the settings actually used by Tasks. -${a}`}function Rr(r){return r===""?r:"`"+(r!==" "?r:"space")+"`"}function P_(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],['"',"Quote","x","TODO"],["0","Speech bubble 0","0","NON_TASK"],["1","Speech bubble 1","1","NON_TASK"],["2","Speech bubble 2","2","NON_TASK"],["3","Speech bubble 3","3","NON_TASK"],["4","Speech bubble 4","4","NON_TASK"],["5","Speech bubble 5","5","NON_TASK"],["6","Speech bubble 6","6","NON_TASK"],["7","Speech bubble 7","7","NON_TASK"],["8","Speech bubble 8","8","NON_TASK"],["9","Speech bubble 9","9","NON_TASK"]]}function N_(){return[[" ","incomplete","x","TODO"],["x","complete / done"," ","DONE"],["-","cancelled"," ","CANCELLED"],[">","deferred","x","TODO"],["/","in progress, or half-done","x","IN_PROGRESS"],["!","Important","x","TODO"],["?","question","x","TODO"],["R","review","x","TODO"],["+","Inbox / task that should be processed later","x","TODO"],["b","bookmark","x","TODO"],["B","brainstorm","x","TODO"],["D","deferred or scheduled","x","TODO"],["I","Info","x","TODO"],["i","idea","x","TODO"],["N","note","x","TODO"],["Q","quote","x","TODO"],["W","win / success / reward","x","TODO"],["P","pro","x","TODO"],["C","con","x","TODO"]]}function I_(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],[">","Deferred","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["r","Review","x","TODO"]]}function F_(){return[[" ","Unchecked","x","TODO"],["x","Regular"," ","DONE"],["X","Checked"," ","DONE"],["-","Dropped"," ","CANCELLED"],[">","Forward","x","TODO"],["D","Date","x","TODO"],["?","Question","x","TODO"],["/","Half Done","x","IN_PROGRESS"],["+","Add","x","TODO"],["R","Research","x","TODO"],["!","Important","x","TODO"],["i","Idea","x","TODO"],["B","Brainstorm","x","TODO"],["P","Pro","x","TODO"],["C","Con","x","TODO"],["Q","Quote","x","TODO"],["N","Note","x","TODO"],["b","Bookmark","x","TODO"],["I","Information","x","TODO"],["p","Paraphrase","x","TODO"],["L","Location","x","TODO"],["E","Example","x","TODO"],["A","Answer","x","TODO"],["r","Reward","x","TODO"],["c","Choice","x","TODO"],["d","Doing","x","IN_PROGRESS"],["T","Time","x","TODO"],["@","Character / Person","x","TODO"],["t","Talk","x","TODO"],["O","Outline / Plot","x","TODO"],["~","Conflict","x","TODO"],["W","World","x","TODO"],["f","Clue / Find","x","TODO"],["F","Foreshadow","x","TODO"],["H","Favorite / Health","x","TODO"],["&","Symbolism","x","TODO"],["s","Secret","x","TODO"]]}function L_(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],["f","Fire","x","TODO"],["k","Key","x","TODO"],["w","Win","x","TODO"],["u","Up","x","TODO"],["d","Down","x","TODO"]]}function U_(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}function W_(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}var q_=[{text:"Core Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:"

These are the core statuses that Tasks supports natively, with no need for custom CSS styling or theming.

You can add edit and add your own custom statuses in the section below.

"},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertTaskCoreStatusSettings",featureFlag:"",notice:null}]},{text:"Custom Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:`

You should first select and install a CSS Snippet or Theme to style custom checkboxes.

Then, use the buttons below to set up your custom statuses, to match your chosen CSS checkboxes.

Note Any statuses with the same symbol as any earlier statuses will be ignored. You can confirm the actually loaded statuses by running the 'Create or edit task' command and looking at the Status drop-down.

See the documentation to get started!

`},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertCustomTaskStatusSettings",featureFlag:"",notice:null}]}];var pr=require("obsidian");var ei=class{validate(e){let t=[];return t.push(...this.validateSymbol(e)),t.push(...this.validateName(e)),t.push(...this.validateNextSymbol(e)),t}validateStatusCollectionEntry(e){let[t,n,i,s]=e,a=[];if(a.push(...this.validateType(s)),t===i&&s!=="NON_TASK"&&a.push(`Status symbol '${t}' toggles to itself`),a.length>0)return a;let o=X.createFromImportedValue(e).configuration;return a.push(...this.validateSymbolTypeConventions(o)),a.push(...this.validate(o)),a}validateSymbol(e){return ei.validateOneSymbol(e.symbol,"Task Status Symbol")}validateNextSymbol(e){return ei.validateOneSymbol(e.nextStatusSymbol,"Task Next Status Symbol")}validateName(e){let t=[];return e.name.length===0&&t.push("Task Status Name cannot be empty."),t}validateType(e){let t=Lt[e],n=[];return t||n.push(`Status Type "${e}" is not a valid type`),t=="EMPTY"&&n.push('Status Type "EMPTY" is not permitted in user data'),n}validateSymbolTypeConventions(e){let t=[],n=e.symbol,i=new Se,s=n==="X"?"x":n,a=i.bySymbol(s);return a.type!=="EMPTY"&&(e.nextStatusSymbol!==a.nextStatusSymbol&&t.push(`Next Status Symbol for symbol '${n}': '${e.nextStatusSymbol}' is inconsistent with convention '${a.nextStatusSymbol}'`),e.type!==a.type&&t.push(`Status Type for symbol '${n}': '${e.type}' is inconsistent with convention '${a.type}'`)),t}static validateOneSymbol(e,t){let n=[];return e.length===0&&n.push(`${t} cannot be empty.`),e.length>1&&n.push(`${t} ("${e}") must be a single character.`),n}};var ti=new ei,$t=class extends pr.Modal{constructor(t,n,i){super(t.app);this.plugin=t;this.saved=!1;this.error=!1;this.statusSymbol=n.symbol,this.statusName=n.name,this.statusNextSymbol=n.nextStatusSymbol,this.statusAvailableAsCommand=n.availableAsCommand,this.type=n.type,this.isCoreStatus=i}statusConfiguration(){return new et(this.statusSymbol,this.statusName,this.statusNextSymbol,this.statusAvailableAsCommand,this.type)}display(){return q(this,null,function*(){let{contentEl:t}=this;t.empty();let n=t.createDiv(),i;new pr.Setting(n).setName("Task Status Symbol").setDesc("This is the character between the square braces. (It can only be edited for Custom statuses, and not Core statuses.)").addText(l=>{i=l,l.setValue(this.statusSymbol).onChange(c=>{this.statusSymbol=c,$t.setValid(l,ti.validateSymbol(this.statusConfiguration()))})}).setDisabled(this.isCoreStatus).then(l=>{$t.setValid(i,ti.validateSymbol(this.statusConfiguration()))});let s;new pr.Setting(n).setName("Task Status Name").setDesc("This is the friendly name of the task status.").addText(l=>{s=l,l.setValue(this.statusName).onChange(c=>{this.statusName=c,$t.setValid(l,ti.validateName(this.statusConfiguration()))})}).then(l=>{$t.setValid(s,ti.validateName(this.statusConfiguration()))});let a;new pr.Setting(n).setName("Task Next Status Symbol").setDesc("When clicked on this is the symbol that should be used next.").addText(l=>{a=l,l.setValue(this.statusNextSymbol).onChange(c=>{this.statusNextSymbol=c,$t.setValid(l,ti.validateNextSymbol(this.statusConfiguration()))})}).then(l=>{$t.setValid(a,ti.validateNextSymbol(this.statusConfiguration()))}),new pr.Setting(n).setName("Task Status Type").setDesc("Control how the status behaves for searching and toggling.").addDropdown(l=>{["TODO","IN_PROGRESS","DONE","CANCELLED","NON_TASK"].forEach(p=>{l.addOption(p,p)}),l.setValue(this.type).onChange(p=>{this.type=X.getTypeFromStatusTypeString(p)})}),X.tasksPluginCanCreateCommandsForStatuses()&&new pr.Setting(n).setName("Available as command").setDesc("If enabled this status will be available as a command so you can assign a hotkey and toggle the status using it.").addToggle(l=>{l.setValue(this.statusAvailableAsCommand).onChange(c=>q(this,null,function*(){this.statusAvailableAsCommand=c}))});let o=t.createDiv(),u=new pr.Setting(o);u.addButton(l=>(l.setTooltip("Save").setIcon("checkmark").onClick(()=>q(this,null,function*(){let c=ti.validate(this.statusConfiguration());if(c.length>0){let p=c.join(` +${a}`}function Rr(r){return r===""?r:"`"+(r!==" "?r:"space")+"`"}function H_(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],['"',"Quote","x","TODO"],["0","Speech bubble 0","0","NON_TASK"],["1","Speech bubble 1","1","NON_TASK"],["2","Speech bubble 2","2","NON_TASK"],["3","Speech bubble 3","3","NON_TASK"],["4","Speech bubble 4","4","NON_TASK"],["5","Speech bubble 5","5","NON_TASK"],["6","Speech bubble 6","6","NON_TASK"],["7","Speech bubble 7","7","NON_TASK"],["8","Speech bubble 8","8","NON_TASK"],["9","Speech bubble 9","9","NON_TASK"]]}function z_(){return[[" ","incomplete","x","TODO"],["x","complete / done"," ","DONE"],["-","cancelled"," ","CANCELLED"],[">","deferred","x","TODO"],["/","in progress, or half-done","x","IN_PROGRESS"],["!","Important","x","TODO"],["?","question","x","TODO"],["R","review","x","TODO"],["+","Inbox / task that should be processed later","x","TODO"],["b","bookmark","x","TODO"],["B","brainstorm","x","TODO"],["D","deferred or scheduled","x","TODO"],["I","Info","x","TODO"],["i","idea","x","TODO"],["N","note","x","TODO"],["Q","quote","x","TODO"],["W","win / success / reward","x","TODO"],["P","pro","x","TODO"],["C","con","x","TODO"]]}function V_(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],[">","Deferred","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["r","Review","x","TODO"]]}function K_(){return[[" ","Unchecked","x","TODO"],["x","Regular"," ","DONE"],["X","Checked"," ","DONE"],["-","Dropped"," ","CANCELLED"],[">","Forward","x","TODO"],["D","Date","x","TODO"],["?","Question","x","TODO"],["/","Half Done","x","IN_PROGRESS"],["+","Add","x","TODO"],["R","Research","x","TODO"],["!","Important","x","TODO"],["i","Idea","x","TODO"],["B","Brainstorm","x","TODO"],["P","Pro","x","TODO"],["C","Con","x","TODO"],["Q","Quote","x","TODO"],["N","Note","x","TODO"],["b","Bookmark","x","TODO"],["I","Information","x","TODO"],["p","Paraphrase","x","TODO"],["L","Location","x","TODO"],["E","Example","x","TODO"],["A","Answer","x","TODO"],["r","Reward","x","TODO"],["c","Choice","x","TODO"],["d","Doing","x","IN_PROGRESS"],["T","Time","x","TODO"],["@","Character / Person","x","TODO"],["t","Talk","x","TODO"],["O","Outline / Plot","x","TODO"],["~","Conflict","x","TODO"],["W","World","x","TODO"],["f","Clue / Find","x","TODO"],["F","Foreshadow","x","TODO"],["H","Favorite / Health","x","TODO"],["&","Symbolism","x","TODO"],["s","Secret","x","TODO"]]}function Q_(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],["f","Fire","x","TODO"],["k","Key","x","TODO"],["w","Win","x","TODO"],["u","Up","x","TODO"],["d","Down","x","TODO"]]}function X_(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}function Z_(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}var J_=[{text:"Core Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:"

These are the core statuses that Tasks supports natively, with no need for custom CSS styling or theming.

You can add edit and add your own custom statuses in the section below.

"},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertTaskCoreStatusSettings",featureFlag:"",notice:null}]},{text:"Custom Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:`

You should first select and install a CSS Snippet or Theme to style custom checkboxes.

Then, use the buttons below to set up your custom statuses, to match your chosen CSS checkboxes.

Note Any statuses with the same symbol as any earlier statuses will be ignored. You can confirm the actually loaded statuses by running the 'Create or edit task' command and looking at the Status drop-down.

See the documentation to get started!

`},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertCustomTaskStatusSettings",featureFlag:"",notice:null}]}];var hr=require("obsidian");var ri=class{validate(e){let t=[];return t.push(...this.validateSymbol(e)),t.push(...this.validateName(e)),t.push(...this.validateNextSymbol(e)),t}validateStatusCollectionEntry(e){let[t,n,i,s]=e,a=[];if(a.push(...this.validateType(s)),t===i&&s!=="NON_TASK"&&a.push(`Status symbol '${t}' toggles to itself`),a.length>0)return a;let o=X.createFromImportedValue(e).configuration;return a.push(...this.validateSymbolTypeConventions(o)),a.push(...this.validate(o)),a}validateSymbol(e){return ri.validateOneSymbol(e.symbol,"Task Status Symbol")}validateNextSymbol(e){return ri.validateOneSymbol(e.nextStatusSymbol,"Task Next Status Symbol")}validateName(e){let t=[];return e.name.length===0&&t.push("Task Status Name cannot be empty."),t}validateType(e){let t=Lt[e],n=[];return t||n.push(`Status Type "${e}" is not a valid type`),t=="EMPTY"&&n.push('Status Type "EMPTY" is not permitted in user data'),n}validateSymbolTypeConventions(e){let t=[],n=e.symbol,i=new ve,s=n==="X"?"x":n,a=i.bySymbol(s);return a.type!=="EMPTY"&&(e.nextStatusSymbol!==a.nextStatusSymbol&&t.push(`Next Status Symbol for symbol '${n}': '${e.nextStatusSymbol}' is inconsistent with convention '${a.nextStatusSymbol}'`),e.type!==a.type&&t.push(`Status Type for symbol '${n}': '${e.type}' is inconsistent with convention '${a.type}'`)),t}static validateOneSymbol(e,t){let n=[];return e.length===0&&n.push(`${t} cannot be empty.`),e.length>1&&n.push(`${t} ("${e}") must be a single character.`),n}};var ni=new ri,$t=class extends hr.Modal{constructor(t,n,i){super(t.app);this.plugin=t;this.saved=!1;this.error=!1;this.statusSymbol=n.symbol,this.statusName=n.name,this.statusNextSymbol=n.nextStatusSymbol,this.statusAvailableAsCommand=n.availableAsCommand,this.type=n.type,this.isCoreStatus=i}statusConfiguration(){return new He(this.statusSymbol,this.statusName,this.statusNextSymbol,this.statusAvailableAsCommand,this.type)}display(){return F(this,null,function*(){let{contentEl:t}=this;t.empty();let n=t.createDiv(),i;new hr.Setting(n).setName("Task Status Symbol").setDesc("This is the character between the square braces. (It can only be edited for Custom statuses, and not Core statuses.)").addText(l=>{i=l,l.setValue(this.statusSymbol).onChange(c=>{this.statusSymbol=c,$t.setValid(l,ni.validateSymbol(this.statusConfiguration()))})}).setDisabled(this.isCoreStatus).then(l=>{$t.setValid(i,ni.validateSymbol(this.statusConfiguration()))});let s;new hr.Setting(n).setName("Task Status Name").setDesc("This is the friendly name of the task status.").addText(l=>{s=l,l.setValue(this.statusName).onChange(c=>{this.statusName=c,$t.setValid(l,ni.validateName(this.statusConfiguration()))})}).then(l=>{$t.setValid(s,ni.validateName(this.statusConfiguration()))});let a;new hr.Setting(n).setName("Task Next Status Symbol").setDesc("When clicked on this is the symbol that should be used next.").addText(l=>{a=l,l.setValue(this.statusNextSymbol).onChange(c=>{this.statusNextSymbol=c,$t.setValid(l,ni.validateNextSymbol(this.statusConfiguration()))})}).then(l=>{$t.setValid(a,ni.validateNextSymbol(this.statusConfiguration()))}),new hr.Setting(n).setName("Task Status Type").setDesc("Control how the status behaves for searching and toggling.").addDropdown(l=>{["TODO","IN_PROGRESS","DONE","CANCELLED","NON_TASK"].forEach(f=>{l.addOption(f,f)}),l.setValue(this.type).onChange(f=>{this.type=X.getTypeFromStatusTypeString(f)})}),X.tasksPluginCanCreateCommandsForStatuses()&&new hr.Setting(n).setName("Available as command").setDesc("If enabled this status will be available as a command so you can assign a hotkey and toggle the status using it.").addToggle(l=>{l.setValue(this.statusAvailableAsCommand).onChange(c=>F(this,null,function*(){this.statusAvailableAsCommand=c}))});let o=t.createDiv(),u=new hr.Setting(o);u.addButton(l=>(l.setTooltip("Save").setIcon("checkmark").onClick(()=>F(this,null,function*(){let c=ni.validate(this.statusConfiguration());if(c.length>0){let f=c.join(` `)+` -Fix errors before saving.`;new pr.Notice(p);return}this.saved=!0,this.close()})),l)),u.addExtraButton(l=>(l.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.saved=!1,this.close()}),l))})}onOpen(){this.display()}static setValidationError(t){t.inputEl.addClass("tasks-settings-is-invalid")}static removeValidationError(t){t.inputEl.removeClass("tasks-settings-is-invalid")}static setValid(t,n){n.length===0?$t.removeValidationError(t):$t.setValidationError(t)}};var Yt=class extends Te.PluginSettingTab{constructor({plugin:t}){super(t.app,t);this.customFunctions={insertTaskCoreStatusSettings:this.insertTaskCoreStatusSettings.bind(this),insertCustomTaskStatusSettings:this.insertCustomTaskStatusSettings.bind(this)};this.plugin=t}saveSettings(t){return q(this,null,function*(){yield this.plugin.saveSettings(),t&&this.display()})}display(){let{containerEl:t}=this;t.empty(),this.containerEl.addClass("tasks-settings"),t.createEl("h3",{text:"Tasks Settings"}),t.createEl("p",{cls:"tasks-setting-important",text:"Changing any settings requires a restart of obsidian."}),t.createEl("h4",{text:"Task Format Settings"}),new Te.Setting(t).setName("Task Format").setDesc(Yt.createFragmentWithHTML('

The format that Tasks uses to read and write tasks.

Important: Tasks currently only supports one format at a time. Selecting Dataview will currently stop Tasks reading its own emoji signifiers.

See the documentation.

')).addDropdown(i=>{for(let s of Object.keys(Br))i.addOption(s,Br[s].displayName);i.setValue(Q().taskFormat).onChange(s=>q(this,null,function*(){tt({taskFormat:s}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global filter Settings"}),new Te.Setting(t).setName("Global task filter").setDesc(Yt.createFragmentWithHTML('

Recommended: Leave empty if you want all checklist items in your vault to be tasks managed by this plugin.

Use a global filter if you want Tasks to only act on a subset of your "- [ ]" checklist items, so that a checklist item must include the specified string in its description in order to be considered a task.

For example, if you set the global filter to #task, the Tasks plugin will only handle checklist items tagged with #task.
Other checklist items will remain normal checklist items and not appear in queries or get a done date set.

See the documentation.

')).addText(i=>{i.setPlaceholder("e.g. #task or TODO").setValue(me.getInstance().get()).onChange(s=>q(this,null,function*(){tt({globalFilter:s}),me.getInstance().set(s),yield this.plugin.saveSettings()}))}),new Te.Setting(t).setName("Remove global filter from description").setDesc("Enabling this removes the string that you set as global filter from the task description when displaying a task.").addToggle(i=>{let s=Q();i.setValue(s.removeGlobalFilter).onChange(a=>q(this,null,function*(){tt({removeGlobalFilter:a}),me.getInstance().setRemoveGlobalFilter(a),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global Query"}),YA(new Te.Setting(t).setDesc(Yt.createFragmentWithHTML('

A query that is automatically included at the start of every Tasks block in the vault. Useful for adding default filters, or layout options.

See the documentation.

')).addTextArea(i=>{let s=Q();i.inputEl.rows=4,i.setPlaceholder(`# For example... +Fix errors before saving.`;new hr.Notice(f);return}this.saved=!0,this.close()})),l)),u.addExtraButton(l=>(l.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.saved=!1,this.close()}),l))})}onOpen(){this.display()}static setValidationError(t){t.inputEl.addClass("tasks-settings-is-invalid")}static removeValidationError(t){t.inputEl.removeClass("tasks-settings-is-invalid")}static setValid(t,n){n.length===0?$t.removeValidationError(t):$t.setValidationError(t)}};var Yt=class extends be.PluginSettingTab{constructor({plugin:t}){super(t.app,t);this.customFunctions={insertTaskCoreStatusSettings:this.insertTaskCoreStatusSettings.bind(this),insertCustomTaskStatusSettings:this.insertCustomTaskStatusSettings.bind(this)};this.plugin=t}saveSettings(t){return F(this,null,function*(){yield this.plugin.saveSettings(),t&&this.display()})}display(){let{containerEl:t}=this;t.empty(),this.containerEl.addClass("tasks-settings"),t.createEl("h3",{text:"Tasks Settings"}),t.createEl("p",{cls:"tasks-setting-important",text:"Changing any settings requires a restart of obsidian."}),t.createEl("h4",{text:"Task Format Settings"}),new be.Setting(t).setName("Task Format").setDesc(Yt.createFragmentWithHTML('

The format that Tasks uses to read and write tasks.

Important: Tasks currently only supports one format at a time. Selecting Dataview will currently stop Tasks reading its own emoji signifiers.

See the documentation.

')).addDropdown(i=>{for(let s of Object.keys(Hr))i.addOption(s,Hr[s].displayName);i.setValue(Q().taskFormat).onChange(s=>F(this,null,function*(){tt({taskFormat:s}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global filter Settings"}),new be.Setting(t).setName("Global task filter").setDesc(Yt.createFragmentWithHTML('

Recommended: Leave empty if you want all checklist items in your vault to be tasks managed by this plugin.

Use a global filter if you want Tasks to only act on a subset of your "- [ ]" checklist items, so that a checklist item must include the specified string in its description in order to be considered a task.

For example, if you set the global filter to #task, the Tasks plugin will only handle checklist items tagged with #task.
Other checklist items will remain normal checklist items and not appear in queries or get a done date set.

See the documentation.

')).addText(i=>{i.setPlaceholder("e.g. #task or TODO").setValue(ge.getInstance().get()).onChange(s=>F(this,null,function*(){tt({globalFilter:s}),ge.getInstance().set(s),yield this.plugin.saveSettings()}))}),new be.Setting(t).setName("Remove global filter from description").setDesc("Enabling this removes the string that you set as global filter from the task description when displaying a task.").addToggle(i=>{let s=Q();i.setValue(s.removeGlobalFilter).onChange(a=>F(this,null,function*(){tt({removeGlobalFilter:a}),ge.getInstance().setRemoveGlobalFilter(a),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global Query"}),tP(new be.Setting(t).setDesc(Yt.createFragmentWithHTML('

A query that is automatically included at the start of every Tasks block in the vault. Useful for adding default filters, or layout options.

See the documentation.

')).addTextArea(i=>{let s=Q();i.inputEl.rows=4,i.setPlaceholder(`# For example... path does not include _templates/ limit 300 -show urgency`).setValue(s.globalQuery).onChange(a=>q(this,null,function*(){tt({globalQuery:a}),tr.getInstance().set(a),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=Q();q_.forEach(i=>{this.addOneSettingsBlock(t,i,n)}),t.createEl("h4",{text:"Date Settings"}),new Te.Setting(t).setName("Set created date on every added task").setDesc(Yt.createFragmentWithHTML(`Enabling this will add a timestamp \u2795 YYYY-MM-DD before other date values, when a task is created with 'Create or edit task', or by completing a recurring task.

See the documentation.

`)).addToggle(i=>{let s=Q();i.setValue(s.setCreatedDate).onChange(a=>q(this,null,function*(){tt({setCreatedDate:a}),yield this.plugin.saveSettings()}))}),new Te.Setting(t).setName("Set done date on every completed task").setDesc(Yt.createFragmentWithHTML('Enabling this will add a timestamp \u2705 YYYY-MM-DD at the end when a task is toggled to done.

See the documentation.

')).addToggle(i=>{let s=Q();i.setValue(s.setDoneDate).onChange(a=>q(this,null,function*(){tt({setDoneDate:a}),yield this.plugin.saveSettings()}))}),new Te.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(Yt.createFragmentWithHTML('Save time entering Scheduled (\u23F3) dates.
If this option is enabled, any undated tasks will be given a default Scheduled date extracted from their file name.
The date in the file name must be in one of YYYY-MM-DD or YYYYMMDD formats.
Undated tasks have none of Due (\u{1F4C5} ), Scheduled (\u23F3) and Start (\u{1F6EB}) dates.

See the documentation.

')).addToggle(i=>{let s=Q();i.setValue(s.useFilenameAsScheduledDate).onChange(a=>q(this,null,function*(){tt({useFilenameAsScheduledDate:a}),yield this.plugin.saveSettings()}))}),new Te.Setting(t).setName("Folders with default Scheduled dates").setDesc("Leave empty if you want to use default Scheduled dates everywhere, or enter a comma-separated list of folders.").addText(i=>q(this,null,function*(){let s=Q();yield this.plugin.saveSettings(),i.setValue(Yt.renderFolderArray(s.filenameAsDateFolders)).onChange(a=>q(this,null,function*(){let o=Yt.parseCommaSeparatedFolders(a);tt({filenameAsDateFolders:o}),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Recurring task Settings"}),new Te.Setting(t).setName("Next recurrence appears on the line below").setDesc(Yt.createFragmentWithHTML('Enabling this will make the next recurrence of a task appear on the line below the completed task. Otherwise the next recurrence will appear before the completed one.

See the documentation.

')).addToggle(i=>{let{recurrenceOnNextLine:s}=Q();i.setValue(s).onChange(a=>q(this,null,function*(){tt({recurrenceOnNextLine:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Auto-suggest Settings"}),new Te.Setting(t).setName("Auto-suggest task content").setDesc(Yt.createFragmentWithHTML('Enabling this will open an intelligent suggest menu while typing inside a recognized task line.

See the documentation.

')).addToggle(i=>{let s=Q();i.setValue(s.autoSuggestInEditor).onChange(a=>q(this,null,function*(){tt({autoSuggestInEditor:a}),yield this.plugin.saveSettings()}))}),new Te.Setting(t).setName("Minimum match length for auto-suggest").setDesc("If higher than 0, auto-suggest will be triggered only when the beginning of any supported keywords is recognized.").addSlider(i=>{let s=Q();i.setLimits(0,3,1).setValue(s.autoSuggestMinMatch).setDynamicTooltip().onChange(a=>q(this,null,function*(){tt({autoSuggestMinMatch:a}),yield this.plugin.saveSettings()}))}),new Te.Setting(t).setName("Maximum number of auto-suggestions to show").setDesc('How many suggestions should be shown when an auto-suggest menu pops up (including the "\u23CE" option).').addSlider(i=>{let s=Q();i.setLimits(3,12,1).setValue(s.autoSuggestMaxItems).setDynamicTooltip().onChange(a=>q(this,null,function*(){tt({autoSuggestMaxItems:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Dialog Settings"}),new Te.Setting(t).setName("Provide access keys in dialogs").setDesc(Yt.createFragmentWithHTML('If the access keys (keyboard shortcuts) for various controls in dialog boxes conflict with system keyboard shortcuts or assistive technology functionality that is important for you, you may want to deactivate them here.

See the documentation.

')).addToggle(i=>{let s=Q();i.setValue(s.provideAccessKeys).onChange(a=>q(this,null,function*(){tt({provideAccessKeys:a}),yield this.plugin.saveSettings()}))})}addOneSettingsBlock(t,n,i){let s=t.createEl("details",{cls:"tasks-nested-settings",attr:De({},n.open||i[n.text]?{open:!0}:{})});s.empty(),s.ontoggle=()=>{i[n.text]=s.open,tt({headingOpened:i}),this.plugin.saveSettings()};let a=s.createEl("summary");if(new Te.Setting(a).setHeading().setName(n.text),a.createDiv("collapser").createDiv("handle"),n.notice!==null){let o=s.createEl("div",{cls:n.notice.class,text:n.notice.text});n.notice.html!==null&&o.insertAdjacentHTML("beforeend",n.notice.html)}n.settings.forEach(o=>{if(!(o.featureFlag!==""&&!bT(o.featureFlag))&&(o.type==="checkbox"?new Te.Setting(s).setName(o.name).setDesc(o.description).addToggle(u=>{let l=Q();l.generalSettings[o.settingName]||Yn(o.settingName,o.initialValue),u.setValue(l.generalSettings[o.settingName]).onChange(c=>q(this,null,function*(){Yn(o.settingName,c),yield this.plugin.saveSettings()}))}):o.type==="text"?new Te.Setting(s).setName(o.name).setDesc(o.description).addText(u=>{let l=Q();l.generalSettings[o.settingName]||Yn(o.settingName,o.initialValue);let c=p=>q(this,null,function*(){Yn(o.settingName,p),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,Te.debounce)(c,500,!0))}):o.type==="textarea"?new Te.Setting(s).setName(o.name).setDesc(o.description).addTextArea(u=>{let l=Q();l.generalSettings[o.settingName]||Yn(o.settingName,o.initialValue);let c=p=>q(this,null,function*(){Yn(o.settingName,p),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,Te.debounce)(c,500,!0)),u.inputEl.rows=8,u.inputEl.cols=40}):o.type==="function"&&this.customFunctions[o.settingName](s,this),o.notice!==null)){let u=s.createEl("p",{cls:o.notice.class,text:o.notice.text});o.notice.html!==null&&u.insertAdjacentHTML("beforeend",o.notice.html)}})}static parseCommaSeparatedFolders(t){return t.split(",").map(n=>n.trim()).map(n=>n.replace(/^\/|\/$/g,"")).filter(n=>n!=="")}static renderFolderArray(t){return t.join(",")}insertTaskCoreStatusSettings(t,n){let{statusSettings:i}=Q();i.coreStatuses.forEach(a=>{$_(t,a,i.coreStatuses,i,n,n.plugin,!0)}),new Te.Setting(t).addButton(a=>{let o="Review and check your Statuses";a.setButtonText(o).setCta().onClick(()=>q(this,null,function*(){let l=window.moment().format("YYYY-MM-DD HH-mm-ss"),c=`Tasks Plugin - ${o} ${l}.md`,p=this.plugin.manifest.version,h=Se.getInstance(),_=A_(i,h,o,p),y=yield app.vault.create(c,_);yield this.app.workspace.getLeaf(!0).openFile(y)})),a.setTooltip("Create a new file in the root of the vault, containing a Mermaid diagram of the current status settings.")}).infoEl.remove()}insertCustomTaskStatusSettings(t,n){let{statusSettings:i}=Q();i.customStatuses.forEach(l=>{$_(t,l,i.customStatuses,i,n,n.plugin,!1)}),t.createEl("div"),new Te.Setting(t).addButton(l=>{l.setButtonText("Add New Task Status").setCta().onClick(()=>q(this,null,function*(){Ie.addStatus(i.customStatuses,new et("","","",!1,"TODO")),yield Xi(i,n)}))}).infoEl.remove();let a=[["AnuPpuccin Theme",P_()],["Aura Theme",N_()],["Ebullientworks Theme",I_()],["ITS Theme & SlRvb Checkboxes",F_()],["Minimal Theme",U_()],["Things Theme",W_()],["LYT Mode Theme (Dark mode only)",L_()]];for(let[l,c]of a)new Te.Setting(t).addButton(h=>{let _=`${l}: Add ${c.length} supported Statuses`;h.setButtonText(_).onClick(()=>q(this,null,function*(){yield $A(c,i,n)}))}).infoEl.remove();new Te.Setting(t).addButton(l=>{l.setButtonText("Add All Unknown Status Types").setCta().onClick(()=>q(this,null,function*(){let p=this.plugin.getTasks().map(_=>_.status),h=Se.getInstance().findUnknownStatuses(p);h.length!==0&&(h.forEach(_=>{Ie.addStatus(i.customStatuses,_)}),yield Xi(i,n))}))}).infoEl.remove(),new Te.Setting(t).addButton(l=>{l.setButtonText("Reset Custom Status Types to Defaults").setWarning().onClick(()=>q(this,null,function*(){Ie.resetAllCustomStatuses(i),yield Xi(i,n)}))}).infoEl.remove()}},xa=Yt;xa.createFragmentWithHTML=t=>createFragment(n=>n.createDiv().innerHTML=t);function $_(r,e,t,n,i,s,a){let o=r.createEl("pre");o.addClass("row-for-status"),o.textContent=new X(e).previewText();let u=new Te.Setting(r);u.infoEl.replaceWith(o),a||u.addExtraButton(l=>{l.setIcon("cross").setTooltip("Delete").onClick(()=>q(this,null,function*(){Ie.deleteStatus(t,e)&&(yield Xi(n,i))}))}),u.addExtraButton(l=>{l.setIcon("pencil").setTooltip("Edit").onClick(()=>q(this,null,function*(){let c=new $t(s,e,a);c.onClose=()=>q(this,null,function*(){c.saved&&Ie.replaceStatus(t,e,c.statusConfiguration())&&(yield Xi(n,i))}),c.open()}))}),u.infoEl.remove()}function $A(r,e,t){return q(this,null,function*(){Ie.bulkAddStatusCollection(e,r).forEach(i=>{new Te.Notice(i)}),yield Xi(e,t)})}function Xi(r,e){return q(this,null,function*(){tt({statusSettings:r}),Ie.applyToStatusRegistry(r,Se.getInstance()),yield e.saveSettings(!0)})}function YA(r){let{settingEl:e,infoEl:t,controlEl:n}=r,i=n.querySelector("textarea");i!==null&&(e.style.display="block",t.style.marginRight="0px",i.style.minWidth="-webkit-fill-available")}var Y_=require("obsidian");var Uu=class extends Y_.EditorSuggest{constructor(t,n){super(t);this.settings=n,t.scope.register([],"Tab",()=>{var s;let i=(s=this.context)==null?void 0:s.editor;return i?(i.exec("indentMore"),!1):!0})}onTrigger(t,n,i){if(!this.settings.autoSuggestInEditor)return null;let s=n.getLine(t.line);return hT(s,t.ch)?{start:{line:t.line,ch:0},end:{line:t.line,ch:s.length},query:s}:null}getSuggestions(t){var a,o,u;let n=t.query,i=t.editor.getCursor();return((u=(o=(a=ma()).buildSuggestions)==null?void 0:o.call(a,n,i.ch,this.settings))!=null?u:[]).map(l=>Tt(De({},l),{context:t}))}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){var u,l,c;let i=t.context.editor;if(t.suggestionType==="empty"){this.close();let p=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(l=(u=i==null?void 0:i.cm)==null?void 0:u.contentDOM)==null||l.dispatchEvent(p);return}let s=t.context.editor.getCursor(),a={line:s.line,ch:(c=t.insertAt)!=null?c:s.ch},o=t.insertSkip?{line:s.line,ch:a.ch+t.insertSkip}:void 0;t.context.editor.replaceRange(t.appendText,a,o),t.context.editor.setCursor({line:s.line,ch:a.ch+t.appendText.length})}};var G_=(r,e)=>{let t,n=new Promise((a,o)=>{t=a});return e(r,a=>{let o=a.map(u=>u.toFileLineString()).join(` -`);t(o)}).open(),n};var j_=(r,e)=>{let t=Vo({line:"",path:""});return new hn({app:r,task:t,onSubmit:e})};var B_=r=>({createTaskLineModal:()=>G_(r,j_)});var Wu=class extends H_.Plugin{get apiV1(){return B_(app)}onload(){return q(this,null,function*(){Mt.registerConsoleLogger(),Xf("info",`loading plugin "${this.manifest.name}" v${this.manifest.version}`),yield this.loadSettings();let{loggingOptions:t}=Q();Mt.configure(t),this.addSettingTab(new xa({plugin:this})),T_({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let n=new xu({obsidianEvents:this.app.workspace});this.cache=new Gn({metadataCache:this.app.metadataCache,vault:this.app.vault,events:n}),this.inlineRenderer=new Nu({plugin:this}),this.queryRenderer=new Fu({plugin:this,events:n}),this.registerEditorExtension(R_()),this.registerEditorSuggest(new Uu(this.app,Q())),new Ko({plugin:this})})}loadTaskStatuses(){return q(this,null,function*(){let{statusSettings:t}=Q();Ie.applyToStatusRegistry(t,Se.getInstance())})}onunload(){var t;Xf("info",`unloading plugin "${this.manifest.name}" v${this.manifest.version}`),(t=this.cache)==null||t.unload()}loadSettings(){return q(this,null,function*(){let t=yield this.loadData();tt(t),t=Q(),me.getInstance().set(t.globalFilter),me.getInstance().setRemoveGlobalFilter(t.removeGlobalFilter),tr.getInstance().set(t.globalQuery),yield this.loadTaskStatuses()})}saveSettings(){return q(this,null,function*(){yield this.saveData(Q())})}getTasks(){var t;return(t=this.cache)==null?void 0:t.getTasks()}}; +show urgency`).setValue(s.globalQuery).onChange(a=>F(this,null,function*(){tt({globalQuery:a}),tr.getInstance().set(a),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=Q();J_.forEach(i=>{this.addOneSettingsBlock(t,i,n)}),t.createEl("h4",{text:"Date Settings"}),new be.Setting(t).setName("Set created date on every added task").setDesc(Yt.createFragmentWithHTML(`Enabling this will add a timestamp \u2795 YYYY-MM-DD before other date values, when a task is created with 'Create or edit task', or by completing a recurring task.

See the documentation.

`)).addToggle(i=>{let s=Q();i.setValue(s.setCreatedDate).onChange(a=>F(this,null,function*(){tt({setCreatedDate:a}),yield this.plugin.saveSettings()}))}),new be.Setting(t).setName("Set done date on every completed task").setDesc(Yt.createFragmentWithHTML('Enabling this will add a timestamp \u2705 YYYY-MM-DD at the end when a task is toggled to done.

See the documentation.

')).addToggle(i=>{let s=Q();i.setValue(s.setDoneDate).onChange(a=>F(this,null,function*(){tt({setDoneDate:a}),yield this.plugin.saveSettings()}))}),new be.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(Yt.createFragmentWithHTML('Save time entering Scheduled (\u23F3) dates.
If this option is enabled, any undated tasks will be given a default Scheduled date extracted from their file name.
The date in the file name must be in one of YYYY-MM-DD or YYYYMMDD formats.
Undated tasks have none of Due (\u{1F4C5} ), Scheduled (\u23F3) and Start (\u{1F6EB}) dates.

See the documentation.

')).addToggle(i=>{let s=Q();i.setValue(s.useFilenameAsScheduledDate).onChange(a=>F(this,null,function*(){tt({useFilenameAsScheduledDate:a}),yield this.plugin.saveSettings()}))}),new be.Setting(t).setName("Folders with default Scheduled dates").setDesc("Leave empty if you want to use default Scheduled dates everywhere, or enter a comma-separated list of folders.").addText(i=>F(this,null,function*(){let s=Q();yield this.plugin.saveSettings(),i.setValue(Yt.renderFolderArray(s.filenameAsDateFolders)).onChange(a=>F(this,null,function*(){let o=Yt.parseCommaSeparatedFolders(a);tt({filenameAsDateFolders:o}),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Recurring task Settings"}),new be.Setting(t).setName("Next recurrence appears on the line below").setDesc(Yt.createFragmentWithHTML('Enabling this will make the next recurrence of a task appear on the line below the completed task. Otherwise the next recurrence will appear before the completed one.

See the documentation.

')).addToggle(i=>{let{recurrenceOnNextLine:s}=Q();i.setValue(s).onChange(a=>F(this,null,function*(){tt({recurrenceOnNextLine:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Auto-suggest Settings"}),new be.Setting(t).setName("Auto-suggest task content").setDesc(Yt.createFragmentWithHTML('Enabling this will open an intelligent suggest menu while typing inside a recognized task line.

See the documentation.

')).addToggle(i=>{let s=Q();i.setValue(s.autoSuggestInEditor).onChange(a=>F(this,null,function*(){tt({autoSuggestInEditor:a}),yield this.plugin.saveSettings()}))}),new be.Setting(t).setName("Minimum match length for auto-suggest").setDesc("If higher than 0, auto-suggest will be triggered only when the beginning of any supported keywords is recognized.").addSlider(i=>{let s=Q();i.setLimits(0,3,1).setValue(s.autoSuggestMinMatch).setDynamicTooltip().onChange(a=>F(this,null,function*(){tt({autoSuggestMinMatch:a}),yield this.plugin.saveSettings()}))}),new be.Setting(t).setName("Maximum number of auto-suggestions to show").setDesc('How many suggestions should be shown when an auto-suggest menu pops up (including the "\u23CE" option).').addSlider(i=>{let s=Q();i.setLimits(3,12,1).setValue(s.autoSuggestMaxItems).setDynamicTooltip().onChange(a=>F(this,null,function*(){tt({autoSuggestMaxItems:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Dialog Settings"}),new be.Setting(t).setName("Provide access keys in dialogs").setDesc(Yt.createFragmentWithHTML('If the access keys (keyboard shortcuts) for various controls in dialog boxes conflict with system keyboard shortcuts or assistive technology functionality that is important for you, you may want to deactivate them here.

See the documentation.

')).addToggle(i=>{let s=Q();i.setValue(s.provideAccessKeys).onChange(a=>F(this,null,function*(){tt({provideAccessKeys:a}),yield this.plugin.saveSettings()}))})}addOneSettingsBlock(t,n,i){let s=t.createEl("details",{cls:"tasks-nested-settings",attr:we({},n.open||i[n.text]?{open:!0}:{})});s.empty(),s.ontoggle=()=>{i[n.text]=s.open,tt({headingOpened:i}),this.plugin.saveSettings()};let a=s.createEl("summary");if(new be.Setting(a).setHeading().setName(n.text),a.createDiv("collapser").createDiv("handle"),n.notice!==null){let o=s.createEl("div",{cls:n.notice.class,text:n.notice.text});n.notice.html!==null&&o.insertAdjacentHTML("beforeend",n.notice.html)}n.settings.forEach(o=>{if(!(o.featureFlag!==""&&!kb(o.featureFlag))&&(o.type==="checkbox"?new be.Setting(s).setName(o.name).setDesc(o.description).addToggle(u=>{let l=Q();l.generalSettings[o.settingName]||jn(o.settingName,o.initialValue),u.setValue(l.generalSettings[o.settingName]).onChange(c=>F(this,null,function*(){jn(o.settingName,c),yield this.plugin.saveSettings()}))}):o.type==="text"?new be.Setting(s).setName(o.name).setDesc(o.description).addText(u=>{let l=Q();l.generalSettings[o.settingName]||jn(o.settingName,o.initialValue);let c=f=>F(this,null,function*(){jn(o.settingName,f),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,be.debounce)(c,500,!0))}):o.type==="textarea"?new be.Setting(s).setName(o.name).setDesc(o.description).addTextArea(u=>{let l=Q();l.generalSettings[o.settingName]||jn(o.settingName,o.initialValue);let c=f=>F(this,null,function*(){jn(o.settingName,f),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,be.debounce)(c,500,!0)),u.inputEl.rows=8,u.inputEl.cols=40}):o.type==="function"&&this.customFunctions[o.settingName](s,this),o.notice!==null)){let u=s.createEl("p",{cls:o.notice.class,text:o.notice.text});o.notice.html!==null&&u.insertAdjacentHTML("beforeend",o.notice.html)}})}static parseCommaSeparatedFolders(t){return t.split(",").map(n=>n.trim()).map(n=>n.replace(/^\/|\/$/g,"")).filter(n=>n!=="")}static renderFolderArray(t){return t.join(",")}insertTaskCoreStatusSettings(t,n){let{statusSettings:i}=Q();i.coreStatuses.forEach(a=>{ev(t,a,i.coreStatuses,i,n,n.plugin,!0)}),new be.Setting(t).addButton(a=>{let o="Review and check your Statuses";a.setButtonText(o).setCta().onClick(()=>F(this,null,function*(){let l=window.moment().format("YYYY-MM-DD HH-mm-ss"),c=`Tasks Plugin - ${o} ${l}.md`,f=this.plugin.manifest.version,h=ve.getInstance(),T=B_(i,h,o,f),y=yield app.vault.create(c,T);yield this.app.workspace.getLeaf(!0).openFile(y)})),a.setTooltip("Create a new file in the root of the vault, containing a Mermaid diagram of the current status settings.")}).infoEl.remove()}insertCustomTaskStatusSettings(t,n){let{statusSettings:i}=Q();i.customStatuses.forEach(l=>{ev(t,l,i.customStatuses,i,n,n.plugin,!1)}),t.createEl("div"),new be.Setting(t).addButton(l=>{l.setButtonText("Add New Task Status").setCta().onClick(()=>F(this,null,function*(){Pe.addStatus(i.customStatuses,new He("","","",!1,"TODO")),yield Zi(i,n)}))}).infoEl.remove();let a=[["AnuPpuccin Theme",H_()],["Aura Theme",z_()],["Ebullientworks Theme",V_()],["ITS Theme & SlRvb Checkboxes",K_()],["Minimal Theme",X_()],["Things Theme",Z_()],["LYT Mode Theme (Dark mode only)",Q_()]];for(let[l,c]of a)new be.Setting(t).addButton(h=>{let T=`${l}: Add ${c.length} supported Statuses`;h.setButtonText(T).onClick(()=>F(this,null,function*(){yield eP(c,i,n)}))}).infoEl.remove();new be.Setting(t).addButton(l=>{l.setButtonText("Add All Unknown Status Types").setCta().onClick(()=>F(this,null,function*(){let f=this.plugin.getTasks().map(T=>T.status),h=ve.getInstance().findUnknownStatuses(f);h.length!==0&&(h.forEach(T=>{Pe.addStatus(i.customStatuses,T)}),yield Zi(i,n))}))}).infoEl.remove(),new be.Setting(t).addButton(l=>{l.setButtonText("Reset Custom Status Types to Defaults").setWarning().onClick(()=>F(this,null,function*(){Pe.resetAllCustomStatuses(i),yield Zi(i,n)}))}).infoEl.remove()}},Ra=Yt;Ra.createFragmentWithHTML=t=>createFragment(n=>n.createDiv().innerHTML=t);function ev(r,e,t,n,i,s,a){let o=r.createEl("pre");o.addClass("row-for-status"),o.textContent=new X(e).previewText();let u=new be.Setting(r);u.infoEl.replaceWith(o),a||u.addExtraButton(l=>{l.setIcon("cross").setTooltip("Delete").onClick(()=>F(this,null,function*(){Pe.deleteStatus(t,e)&&(yield Zi(n,i))}))}),u.addExtraButton(l=>{l.setIcon("pencil").setTooltip("Edit").onClick(()=>F(this,null,function*(){let c=new $t(s,e,a);c.onClose=()=>F(this,null,function*(){c.saved&&Pe.replaceStatus(t,e,c.statusConfiguration())&&(yield Zi(n,i))}),c.open()}))}),u.infoEl.remove()}function eP(r,e,t){return F(this,null,function*(){Pe.bulkAddStatusCollection(e,r).forEach(i=>{new be.Notice(i)}),yield Zi(e,t)})}function Zi(r,e){return F(this,null,function*(){tt({statusSettings:r}),Pe.applyToStatusRegistry(r,ve.getInstance()),yield e.saveSettings(!0)})}function tP(r){let{settingEl:e,infoEl:t,controlEl:n}=r,i=n.querySelector("textarea");i!==null&&(e.style.display="block",t.style.marginRight="0px",i.style.minWidth="-webkit-fill-available")}var tv=require("obsidian");var Yu=class extends tv.EditorSuggest{constructor(t,n){super(t);this.settings=n,t.scope.register([],"Tab",()=>{var s;let i=(s=this.context)==null?void 0:s.editor;return i?(i.exec("indentMore"),!1):!0})}onTrigger(t,n,i){if(!this.settings.autoSuggestInEditor)return null;let s=n.getLine(t.line);return _b(s,t.ch)?{start:{line:t.line,ch:0},end:{line:t.line,ch:s.length},query:s}:null}getSuggestions(t){var a,o,u;let n=t.query,i=t.editor.getCursor();return((u=(o=(a=ga()).buildSuggestions)==null?void 0:o.call(a,n,i.ch,this.settings))!=null?u:[]).map(l=>it(we({},l),{context:t}))}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){var u,l,c;let i=t.context.editor;if(t.suggestionType==="empty"){this.close();let f=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(l=(u=i==null?void 0:i.cm)==null?void 0:u.contentDOM)==null||l.dispatchEvent(f);return}let s=t.context.editor.getCursor(),a={line:s.line,ch:(c=t.insertAt)!=null?c:s.ch},o=t.insertSkip?{line:s.line,ch:a.ch+t.insertSkip}:void 0;t.context.editor.replaceRange(t.appendText,a,o),t.context.editor.setCursor({line:s.line,ch:a.ch+t.appendText.length})}};var rv=(r,e)=>{let t,n=new Promise((a,o)=>{t=a});return e(r,a=>{let o=a.map(u=>u.toFileLineString()).join(` +`);t(o)}).open(),n};var nv=(r,e)=>{let t=Qo({line:"",path:""});return new mn({app:r,task:t,onSubmit:e})};var iv=r=>({createTaskLineModal:()=>rv(r,nv)});var ju=class extends sv.Plugin{get apiV1(){return iv(app)}onload(){return F(this,null,function*(){St.registerConsoleLogger(),tp("info",`loading plugin "${this.manifest.name}" v${this.manifest.version}`),yield this.loadSettings();let{loggingOptions:t}=Q();St.configure(t),this.addSettingTab(new Ra({plugin:this})),O_({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let n=new Cu({obsidianEvents:this.app.workspace});this.cache=new Gn({metadataCache:this.app.metadataCache,vault:this.app.vault,events:n}),this.inlineRenderer=new Uu({plugin:this}),this.queryRenderer=new qu({plugin:this,events:n}),this.registerEditorExtension(L_()),this.registerEditorSuggest(new Yu(this.app,Q())),new Xo({plugin:this})})}loadTaskStatuses(){return F(this,null,function*(){let{statusSettings:t}=Q();Pe.applyToStatusRegistry(t,ve.getInstance())})}onunload(){var t;tp("info",`unloading plugin "${this.manifest.name}" v${this.manifest.version}`),(t=this.cache)==null||t.unload()}loadSettings(){return F(this,null,function*(){let t=yield this.loadData();tt(t),t=Q(),ge.getInstance().set(t.globalFilter),ge.getInstance().setRemoveGlobalFilter(t.removeGlobalFilter),tr.getInstance().set(t.globalQuery),yield this.loadTaskStatuses()})}saveSettings(){return F(this,null,function*(){yield this.saveData(Q())})}getTasks(){var t;return(t=this.cache)==null?void 0:t.getTasks()}}; /*! * EventEmitter2 * https://github.com/hij1nx/EventEmitter2 diff --git a/.obsidian/plugins/obsidian-tasks-plugin/manifest.json b/.obsidian/plugins/obsidian-tasks-plugin/manifest.json index 08bcd855..087125fd 100644 --- a/.obsidian/plugins/obsidian-tasks-plugin/manifest.json +++ b/.obsidian/plugins/obsidian-tasks-plugin/manifest.json @@ -1,9 +1,10 @@ { "id": "obsidian-tasks-plugin", "name": "Tasks", - "version": "5.2.0", + "version": "5.3.0", "minAppVersion": "1.1.1", "description": "Task management for Obsidian", + "helpUrl": "https://publish.obsidian.md/tasks/", "author": "Martin Schenck and Clare Macrae", "authorUrl": "https://github.com/obsidian-tasks-group", "fundingUrl": "https://github.com/sponsors/claremacrae", diff --git a/.obsidian/plugins/obsidian-tasks-plugin/styles.css b/.obsidian/plugins/obsidian-tasks-plugin/styles.css index e7a1301b..1aecde82 100644 --- a/.obsidian/plugins/obsidian-tasks-plugin/styles.css +++ b/.obsidian/plugins/obsidian-tasks-plugin/styles.css @@ -3,6 +3,11 @@ } +/* Fix indentation of wrapped task lines in Tasks search results, when in Live Preview. */ +ul.contains-task-list .task-list-item-checkbox { + margin-inline-start: calc(var(--checkbox-size) * -1.5) !important; +} + .plugin-tasks-query-explanation{ /* Prevent long explanation lines wrapping, so they are more readable, especially on small screens. @@ -72,6 +77,16 @@ text-decoration: none; } +/* Postpone icon. */ +.tasks-postpone { + background-color: transparent; + padding: 0; + font-size: var(--font-text-size); + background-color: transparent; + display: contents; + cursor: pointer; +} + .tasks-list-text { position: relative; } diff --git a/.obsidian/plugins/obsidian42-brat/main.js b/.obsidian/plugins/obsidian42-brat/main.js index f73c3a9f..912331d4 100644 --- a/.obsidian/plugins/obsidian42-brat/main.js +++ b/.obsidian/plugins/obsidian42-brat/main.js @@ -671,8 +671,12 @@ var grabReleaseFileFromRepository = async (repository, version, fileName, debugL }; var grabManifestJsonFromRepository = async (repositoryPath, rootManifest = true, debugLogging = true) => { const manifestJsonPath = GITHUB_RAW_USERCONTENT_PATH + repositoryPath + (rootManifest ? "/HEAD/manifest.json" : "/HEAD/manifest-beta.json"); + if (debugLogging) + console.log("grabManifestJsonFromRepository manifestJsonPath", manifestJsonPath); try { const response = await (0, import_obsidian.request)({ url: manifestJsonPath }); + if (debugLogging) + console.log("grabManifestJsonFromRepository response", response); return response === "404: Not Found" ? null : await JSON.parse(response); } catch (error) { if (error !== "Error: Request failed, status 404" && debugLogging) { @@ -1004,11 +1008,7 @@ var AddNewTheme = class extends import_obsidian4.Modal { return; const scrubbedAddress = this.address.replace("https://github.com/", ""); if (existBetaThemeinInList(this.plugin, scrubbedAddress)) { - toastMessage( - this.plugin, - `This plugin is already in the list for beta testing`, - 10 - ); + toastMessage(this.plugin, `This theme is already in the list for beta testing`, 10); return; } if (await themeSave(this.plugin, scrubbedAddress, true)) { @@ -1023,6 +1023,7 @@ var AddNewTheme = class extends import_obsidian4.Modal { textEl.setPlaceholder( "Repository (example: https://github.com/GitubUserName/repository-name" ); + textEl.setValue(this.address); textEl.onChange((value) => { this.address = value.trim(); }); @@ -1302,6 +1303,7 @@ var AddNewPluginModal = class extends import_obsidian6.Modal { textEl.setPlaceholder( "Repository (example: https://github.com/GitubUserName/repository-name)" ); + textEl.setValue(this.address); textEl.onChange((value) => { this.address = value.trim(); }); @@ -1505,15 +1507,16 @@ The version attribute for the release is missing from the manifest file`, * @returns true if succeeds */ async addPlugin(repositoryPath, updatePluginFiles = false, seeIfUpdatedOnly = false, reportIfNotUpdted = false, specifyVersion = "", forceReinstall = false) { - console.log( - "BRAT: addPlugin", - repositoryPath, - updatePluginFiles, - seeIfUpdatedOnly, - reportIfNotUpdted, - specifyVersion, - forceReinstall - ); + if (this.plugin.settings.debuggingMode) + console.log( + "BRAT: addPlugin", + repositoryPath, + updatePluginFiles, + seeIfUpdatedOnly, + reportIfNotUpdted, + specifyVersion, + forceReinstall + ); const noticeTimeout = 10; let primaryManifest = await this.validateRepository(repositoryPath, true, false); const usingBetaManifest = primaryManifest ? true : false; @@ -1555,7 +1558,9 @@ You will need to update your Obsidian to use this plugin or contact the plugin d ); if (usingBetaManifest || rFiles.manifest === "") rFiles.manifest = JSON.stringify(primaryManifest); - if (usingBetaManifest || rFiles.mainJs === null) { + if (this.plugin.settings.debuggingMode) + console.log("BRAT: rFiles.manifest", usingBetaManifest, rFiles); + if (rFiles.mainJs === null) { const msg = `${repositoryPath} The release is not complete and cannot be download. main.js is missing from the Release`; await this.plugin.log(msg, true); @@ -2228,19 +2233,34 @@ var BratAPI = class { var ThePlugin = class extends import_obsidian11.Plugin { constructor() { super(...arguments); - this.APP_NAME = "Obsidian42 - Beta Reviewer's Auto-update Tool (BRAT)"; + this.APP_NAME = "BRAT"; this.APP_ID = "obsidian42-brat"; this.settings = DEFAULT_SETTINGS; this.betaPlugins = new BetaPlugins(this); this.commands = new PluginCommands(this); this.bratApi = new BratAPI(this); + this.obsidianProtocolHandler = (params) => { + if (!params.plugin && !params.theme) { + toastMessage(this, `Could not locate the repository from the URL.`, 10); + return; + } + for (const which of ["plugin", "theme"]) { + if (params[which]) { + const modal = which === "plugin" ? new AddNewPluginModal(this, this.betaPlugins) : new AddNewTheme(this); + modal.address = params[which]; + modal.open(); + return; + } + } + }; } async onload() { - console.log("loading Obsidian42 - BRAT"); + console.log("loading " + this.APP_NAME); await this.loadSettings(); this.addSettingTab(new BratSettingsTab(this.app, this)); addIcons(); this.showRibbonButton(); + this.registerObsidianProtocolHandler("brat", this.obsidianProtocolHandler); this.app.workspace.onLayoutReady(() => { if (this.settings.updateAtStartup) { setTimeout(() => { diff --git a/.obsidian/plugins/obsidian42-brat/manifest.json b/.obsidian/plugins/obsidian42-brat/manifest.json index f5d8704b..88a6e5bc 100644 --- a/.obsidian/plugins/obsidian42-brat/manifest.json +++ b/.obsidian/plugins/obsidian42-brat/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian42-brat", "name": "BRAT", - "version": "0.8.0", + "version": "0.8.1", "minAppVersion": "1.4.16", "description": "Easily install a beta version of a plugin for testing.", "author": "TfTHacker", diff --git a/.obsidian/workspace-mobile.json b/.obsidian/workspace-mobile.json index 6b08658d..5f27aed0 100644 --- a/.obsidian/workspace-mobile.json +++ b/.obsidian/workspace-mobile.json @@ -69,7 +69,7 @@ "state": { "type": "markdown", "state": { - "file": "00.01 Admin/Calendars/2023-12-09.md", + "file": "00.01 Admin/Calendars/2023-12-16.md", "mode": "preview", "source": true } @@ -158,7 +158,7 @@ "state": { "type": "backlink", "state": { - "file": "00.01 Admin/Calendars/2023-12-09.md", + "file": "00.01 Admin/Calendars/2023-12-16.md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -175,7 +175,7 @@ "state": { "type": "outgoing-link", "state": { - "file": "00.01 Admin/Calendars/2023-12-09.md", + "file": "00.01 Admin/Calendars/2023-12-16.md", "linksCollapsed": false, "unlinkedCollapsed": false } @@ -240,39 +240,39 @@ "meld-encrypt:New encrypted note": false, "meld-encrypt:Convert to or from an Encrypted note": false, "obsidian-read-it-later:ReadItLater: Save clipboard": false, - "obsidian-memos:Memos": false, "templater-obsidian:Templater": false, - "obsidian42-brat:BRAT": false + "obsidian42-brat:BRAT": false, + "obsidian-memos:Memos": false } }, "active": "2d9db1814950ef3b", "lastOpenFiles": [ - "03.04 Cinematheque/The Magnificent Seven (1960).md", - "00.01 Admin/Calendars/2023-12-09.md", - "03.04 Cinematheque/@Cinematheque.md", - "03.04 Cinematheque/Tschugger (2021–).md", - "00.01 Admin/Calendars/2023-12-08.md", - "03.03 Food & Wine/Chilli con Carne.md", + "02.03 Zürich/Ski Rental Zürich.md", + "04.03 Creative snippets/Working note - Project 1.md", + "03.03 Food & Wine/Chicken Schnitzel.md", + "00.01 Admin/Calendars/2023-12-16.md", + "00.01 Admin/Calendars/2023-12-15.md", "01.02 Home/@Main Dashboard.md", - "03.04 Cinematheque/Barbie (2023).md", + "01.02 Home/Life mementos.md", + "00.03 News/Inside Foxconn’s struggle to make iPhones in India.md", + "00.03 News/The Plight of the Oldest Sister.md", + "00.08 Bookmarks/Bookmarks - Work.md", + "00.01 Admin/Calendars/2023-12-14.md", "01.02 Home/@Shopping list.md", - "00.01 Admin/Calendars/2023-12-07.md", - "03.04 Cinematheque/Serpico (1973).md", - "00.08 Bookmarks/Bookmarks - Mac applications.md", - "00.01 Admin/Calendars/2023-12-06.md", - "00.03 News/Bill Watterson’s Life After “Calvin and Hobbes”.md", - "00.03 News/What Really Happened to JFK.md", - "02.02 Paris/Recommendation list (Paris).md", - "02.02 Paris/@Commerces Paris.md", - "02.02 Paris/@Bars Paris.md", - "02.02 Paris/Sürpriz.md", - "05.02 Networks/Server Tools.md", - "00.03 News/How Does the World’s Largest Hedge Fund Really Make Its Money.md", - "00.03 News/A Coder Considers the Waning Days of the Craft.md", - "00.03 News/Chasing Chop Suey Tracing Chinese Immigration Through Food.md", - "03.02 Travels/Wo Hop.md", - "03.02 Travels/Potluck Club.md", - "03.02 Travels/Bonnie's.md", + "01.02 Home/Vinyls.md", + "00.01 Admin/Calendars/2023-12-13.md", + "00.01 Admin/Calendars/Events/2023-12-13 ⚽️ Borussia - PSG (1-1).md", + "03.03 Food & Wine/Spicy Szechuan Noodles with Garlic Chilli Oil.md", + "03.03 Food & Wine/!!Wine.md", + "00.01 Admin/Calendars/2023-12-12.md", + "03.03 Food & Wine/Big Shells With Spicy Lamb Sausage and Pistachios.md", + "00.03 News/Deep in the Wilderness, the World’s Largest Beaver Dam Endures.md", + "00.03 News/@News.md", + "00.01 Admin/Calendars/2023-12-11.md", + "03.03 Food & Wine/Udon in Buttery Tomato n Soy broth.md", + "01.02 Home/Life - Practical infos.md", + "00.01 Admin/Calendars/2023-12-10.md", + "00.03 News/The call of Tokitae.md", "00.01 Admin/Pictures/Kolkowitzia/IMG_3910.jpg", "00.01 Admin/Pictures/Kolkowitzia/IMG_3911.jpg", "00.01 Admin/Pictures/Kolkowitzia", diff --git a/00.01 Admin/Calendars/2023-10-30.md b/00.01 Admin/Calendars/2023-10-30.md index 0fc0630a..eeb0d2bf 100644 --- a/00.01 Admin/Calendars/2023-10-30.md +++ b/00.01 Admin/Calendars/2023-10-30.md @@ -101,7 +101,7 @@ hide task count This section does serve for quick memos.   -- [ ] 14:46 :man_in_tuxedo: [[Polo Park Zürich|PPZ]]: recontacte Katja pour un verre 📅2023-12-14 +- [ ] 14:46 :man_in_tuxedo: [[Polo Park Zürich|PPZ]]: recontacte Katja pour un verre 📅 2024-01-14 %% --- %%   diff --git a/00.01 Admin/Calendars/2023-12-02.md b/00.01 Admin/Calendars/2023-12-02.md index 88ee9748..d33abec6 100644 --- a/00.01 Admin/Calendars/2023-12-02.md +++ b/00.01 Admin/Calendars/2023-12-02.md @@ -103,7 +103,7 @@ This section does serve for quick memos.   - [ ] 15:02 :bowl_with_spoon: [[Household]]: Acheter des bols (Depot ou en face sur Rennweg) 📅2023-12-30 ^4uxhak -- [ ] 18:27 :racehorse: [[@Sally|Sally]]: Organise trip on 22nd December 📅2023-12-15 +- [x] 18:27 :racehorse: [[@Sally|Sally]]: Organise trip on 22nd December 📅 2023-12-15 ✅ 2023-12-15 %% --- %%   diff --git a/00.01 Admin/Calendars/2023-12-09.md b/00.01 Admin/Calendars/2023-12-09.md index 832ee820..d7aaee56 100644 --- a/00.01 Admin/Calendars/2023-12-09.md +++ b/00.01 Admin/Calendars/2023-12-09.md @@ -16,9 +16,9 @@ Stress: 25 FrontHeadBar: 5 EarHeadBar: 30 BackHeadBar: 20 -Water: 1 +Water: 3 Coffee: 4 -Steps: +Steps: 11009 Weight: Ski: IceSkating: @@ -103,7 +103,7 @@ This section does serve for quick memos.   - [ ] 13:58 :family: [[Amaury de Villeneuve]]: Buy a set of knives for Xmas 📅2023-12-21 - [ ] 15:16 :handshake: [[@Lifestyle|Social]]: Buy a Xmas gift for Pam 📅2023-12-27 -- [ ] 15:18 :train2: [[@Life Admin|Admin]]: Buy train tickets for Paris 📅2023-12-15 +- [x] 15:18 :train2: [[@Life Admin|Admin]]: Buy train tickets for Paris 📅 2023-12-15 ✅ 2023-12-12 %% --- %% @@ -121,6 +121,8 @@ This section does serve for quick memos. 🍴: [[Chilli con Carne]] +📺: [[2023-12-09 ⚽️ PSG - FC Nantes]] +   --- diff --git a/00.01 Admin/Calendars/2023-12-10.md b/00.01 Admin/Calendars/2023-12-10.md new file mode 100644 index 00000000..52a93483 --- /dev/null +++ b/00.01 Admin/Calendars/2023-12-10.md @@ -0,0 +1,136 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-12-10 +Date: 2023-12-10 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 8 +Happiness: 85 +Gratefulness: 90 +Stress: 25 +FrontHeadBar: 5 +EarHeadBar: 30 +BackHeadBar: 20 +Water: 2.5 +Coffee: 2 +Steps: 1873 +Weight: +Ski: 6 +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-12-09|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-12-11|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-12-10Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-12-10NSave + +  + +# 2023-12-10 + +  + +> [!summary]+ +> Daily note for 2023-12-10 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-12-10 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  +- [x] 13:47 :telephone_receiver: [[@Life Admin|Admin]]: Call Mondial Relay 📅 2023-12-16 ✅ 2023-12-14 +- [x] 13:48 :car: [[@Life Admin|Admin]]: Call the garage for the crack in front window 📅 2023-12-15 ✅ 2023-12-15 + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +🎿: [[Atzmännig Goldingen]] + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-12-10]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2023-12-11.md b/00.01 Admin/Calendars/2023-12-11.md new file mode 100644 index 00000000..889c2ea3 --- /dev/null +++ b/00.01 Admin/Calendars/2023-12-11.md @@ -0,0 +1,136 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-12-11 +Date: 2023-12-11 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 7.5 +Happiness: 85 +Gratefulness: 90 +Stress: 25 +FrontHeadBar: 5 +EarHeadBar: 30 +BackHeadBar: 20 +Water: 4 +Coffee: 5 +Steps: 19290 +Weight: +Ski: +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-12-10|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-12-12|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-12-11Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-12-11NSave + +  + +# 2023-12-11 + +  + +> [!summary]+ +> Daily note for 2023-12-11 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-12-11 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  +- [x] 07:46 :necktie: [[@Life Admin|Admin]]: Contacter chasseurs 📅 2023-12-15 ✅ 2023-12-15 +- [x] 11:06 :racehorse: [[@Lifestyle|Lifestyle]]: Book weekend for snow polo 📅 2023-12-17 ✅ 2023-12-12 + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +🍽: [[Udon in Buttery Tomato n Soy broth]] + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-12-11]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2023-12-12.md b/00.01 Admin/Calendars/2023-12-12.md new file mode 100644 index 00000000..caaaa6e5 --- /dev/null +++ b/00.01 Admin/Calendars/2023-12-12.md @@ -0,0 +1,134 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-12-12 +Date: 2023-12-12 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 7 +Happiness: 85 +Gratefulness: 90 +Stress: 25 +FrontHeadBar: 5 +EarHeadBar: 30 +BackHeadBar: 20 +Water: 2.5 +Coffee: 5 +Steps: 12173 +Weight: 90.4 +Ski: +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-12-11|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-12-13|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-12-12Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-12-12NSave + +  + +# 2023-12-12 + +  + +> [!summary]+ +> Daily note for 2023-12-12 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-12-12 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +🍽: [[Big Shells With Spicy Lamb Sausage and Pistachios]] + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-12-12]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2023-12-13.md b/00.01 Admin/Calendars/2023-12-13.md new file mode 100644 index 00000000..0633e8c8 --- /dev/null +++ b/00.01 Admin/Calendars/2023-12-13.md @@ -0,0 +1,136 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-12-13 +Date: 2023-12-13 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 8 +Happiness: 85 +Gratefulness: 90 +Stress: 25 +FrontHeadBar: 30 +EarHeadBar: 20 +BackHeadBar: 5 +Water: 2.5 +Coffee: 4 +Steps: 18306 +Weight: +Ski: +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-12-12|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-12-14|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-12-13Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-12-13NSave + +  + +# 2023-12-13 + +  + +> [!summary]+ +> Daily note for 2023-12-13 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-12-13 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +🍽: [[Spicy Szechuan Noodles with Garlic Chilli Oil]] + +📺: [[2023-12-13 ⚽️ Borussia - PSG (1-1)]] + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-12-13]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2023-12-14.md b/00.01 Admin/Calendars/2023-12-14.md new file mode 100644 index 00000000..48868d92 --- /dev/null +++ b/00.01 Admin/Calendars/2023-12-14.md @@ -0,0 +1,134 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-12-14 +Date: 2023-12-14 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 7.5 +Happiness: 85 +Gratefulness: 90 +Stress: 25 +FrontHeadBar: 5 +EarHeadBar: 30 +BackHeadBar: 20 +Water: 3 +Coffee: 4 +Steps: 14296 +Weight: +Ski: +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-12-13|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-12-15|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-12-14Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-12-14NSave + +  + +# 2023-12-14 + +  + +> [!summary]+ +> Daily note for 2023-12-14 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-12-14 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +Loret ipsum + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-12-14]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2023-12-15.md b/00.01 Admin/Calendars/2023-12-15.md new file mode 100644 index 00000000..14650a57 --- /dev/null +++ b/00.01 Admin/Calendars/2023-12-15.md @@ -0,0 +1,136 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-12-15 +Date: 2023-12-15 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 7.5 +Happiness: 85 +Gratefulness: 90 +Stress: 25 +FrontHeadBar: 5 +EarHeadBar: 30 +BackHeadBar: 20 +Water: 4 +Coffee: 6 +Steps: 17865 +Weight: +Ski: +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-12-14|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-12-16|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-12-15Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-12-15NSave + +  + +# 2023-12-15 + +  + +> [!summary]+ +> Daily note for 2023-12-15 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-12-15 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +🍴: [[Spicy Szechuan Noodles with Garlic Chilli Oil]] + +🍽: [[Korean Barbecue-Style Meatballs]] + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-12-15]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2023-12-16.md b/00.01 Admin/Calendars/2023-12-16.md new file mode 100644 index 00000000..948dd151 --- /dev/null +++ b/00.01 Admin/Calendars/2023-12-16.md @@ -0,0 +1,134 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-12-16 +Date: 2023-12-16 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 7.5 +Happiness: 85 +Gratefulness: 90 +Stress: 25 +FrontHeadBar: 5 +EarHeadBar: 30 +BackHeadBar: 20 +Water: 1 +Coffee: 4 +Steps: +Weight: +Ski: +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-12-15|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-12-17|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-12-16Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-12-16NSave + +  + +# 2023-12-16 + +  + +> [!summary]+ +> Daily note for 2023-12-16 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-12-16 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +🍴: [[Chicken Schnitzel]] + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-12-16]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/Events/2023-12-09 ⚽️ PSG - FC Nantes.md b/00.01 Admin/Calendars/Events/2023-12-09 ⚽️ PSG - FC Nantes.md new file mode 100644 index 00000000..13cd33ff --- /dev/null +++ b/00.01 Admin/Calendars/Events/2023-12-09 ⚽️ PSG - FC Nantes.md @@ -0,0 +1,12 @@ +--- +title: ⚽️ PSG - FC Nantes +allDay: false +startTime: 21:00 +endTime: 23:00 +date: 2023-12-09 +completed: null + +--- + +[[2023-12-09|Ce jour]], [[Paris SG]] - FC Nantes Atlantique: 2-1 +Buteurs:: ⚽️ Barcola
⚽️ Kolo Muani
⚽️ Mohamed (FCNA) diff --git a/00.01 Admin/Calendars/Events/2023-12-13 ⚽️ Borussia - PSG (1-1).md b/00.01 Admin/Calendars/Events/2023-12-13 ⚽️ Borussia - PSG (1-1).md new file mode 100644 index 00000000..ed87eaf9 --- /dev/null +++ b/00.01 Admin/Calendars/Events/2023-12-13 ⚽️ Borussia - PSG (1-1).md @@ -0,0 +1,11 @@ +--- +title: ⚽️ Borussia - PSG (1-1) +allDay: false +startTime: 21:00 +endTime: 23:00 +date: 2023-12-13 +completed: null +--- + +[[2023-12-13|Ce jour]], Borussia Dortmund - [[Paris SG]]: 1-1 +Buteurs:: ⚽️ Adeyemi (BvB)
⚽️ Zaïre-Emery diff --git a/00.01 Admin/Calendars/Events/2023-12-13 ⚽️ Borussia - PSG.md b/00.01 Admin/Calendars/Events/2023-12-13 ⚽️ Borussia - PSG.md deleted file mode 100644 index 306a0500..00000000 --- a/00.01 Admin/Calendars/Events/2023-12-13 ⚽️ Borussia - PSG.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: ⚽️ Borussia - PSG -allDay: false -startTime: 21:00 -endTime: 23:00 -date: 2023-12-13 -completed: null ---- - -[[2023-12-13|Ce jour]], Borussia Dortmund - [[Paris SG]]: -Buteurs:: diff --git a/00.03 News/Deep in the Wilderness, the World’s Largest Beaver Dam Endures.md b/00.03 News/Deep in the Wilderness, the World’s Largest Beaver Dam Endures.md new file mode 100644 index 00000000..746b0efd --- /dev/null +++ b/00.03 News/Deep in the Wilderness, the World’s Largest Beaver Dam Endures.md @@ -0,0 +1,113 @@ +--- + +Tag: ["🏕️", "🇨🇦", "🦫", "🪵"] +Date: 2023-12-12 +DocType: "WebClipping" +Hierarchy: +TimeStamp: 2023-12-12 +Link: https://e360.yale.edu/features/worlds-largest-beaver-dam +location: +CollapseMetaTable: true + +--- + +Parent:: [[@News|News]] +Read:: 🟥 + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-theWorldsLargestBeaverDamEnduresNSave + +  + +# Deep in the Wilderness, the World’s Largest Beaver Dam Endures + +### WILDLIFE + +The largest beaver dam on Earth was discovered via satellite imagery in 2007, and since then only one person has trekked into the Canadian wild to see it. It’s a half-mile long and has created a 17-acre lake in the northern forest — a testament to the beaver’s resilience. + +Wood Buffalo National Park, the largest national park in Canada, covers an area the size of Switzerland and stretches from Northern Alberta into the Northwest Territories. Only one road enters it from Alberta, and one from the NWT. If not for people observing it from airplanes and helicopters, and satellites photographing it, little would be known about big parts of it. The park is a variety of landscapes — boreal swamps, fens, bogs, black spruce forests, salt flats, gypsum karst, permafrost islands, and prairies that extend the continent’s central plains to their northern limit. The wood buffalo in the park’s name are bison related to the Great Plains bison. In this remoteness, the buffalo descend from the original population, and the wolves that prey on them are also the wild originals. Millions of birds summer and breed here. The park holds one of the last remaining breeding grounds of the whooping crane. + +Other superlatives and near-superlatives: the delta in the park’s southeast where the Peace River and the Athabasca River come together is one of the largest freshwater deltas in the world; last summer, some of Canada’s largest forest fires burned in the park and around it; and — just inside the park’s southern border — is the largest beaver dam in the world. + +> Animal technology created the largest beaver dam in the world, but human technology revealed it. + +The dam is about a half-mile long and in the shape of an arc made of connected arcs, like a recurve bow. The media has known about it for 16 years, and in that time no bigger beaver dam has come to light, so it’s still known as the biggest, and scientists believe it almost certainly is. Animal technology created it, but human technology revealed it. In 2007, Jean Thie, a Dutch-born landscape ecologist who lives near Ottawa, was looking at the latest satellite imagery of places he had examined via satellite in 1973 and 1974, when he was studying permafrost. It’s hard to remember, but in the early ‘70s some scientists thought the Earth might be cooling. Thie’s research had showed evidence of the opposite; the paper about permafrost melting that he published in 1974 is now considered one of the pioneering studies of climate change. + +As he looked over 1970s images taken by NASA’s Landsat satellite and compared them with the latest images from Google Earth and other sources, he noticed that in certain landscapes the evidence of beavers now was everywhere. From being almost wiped out by the fur trade between about 1600 and the 20th century, beavers had bounced back. Just one example was a belt about 1,100 miles long that extended into Wood Buffalo Park. Among the hundreds of beaver dams in this area Thie came across one that looked bigger. He measured it and found it to be 2,790 feet long, or about a half-mile. The 17-acre lake created by the dam reposed undisturbed, shiny and opaque in its swampy northern forest, and in the middle of the lake the small brown dot of a beaver lodge could be seen. + +[![](https://e360.yale.edu/assets/site/_400xAUTO_stretch_center-center/Beaver-Dam-Map.png)](https://e360.yale.edu/assets/site/Beaver-Dam-Map.png) + +Yale Environment 360 + +On October 5, 2007, Thie posted the satellite photo of the dam on the Google Earth Community Forum, with text explaining that it was probably the world’s largest. Seven months later, a reporter for Canadian Broadcasting Company Radio saw the posting and did a story about it. Other outlets picked up the story, and “the world’s largest beaver dam,” a phrase that’s satisfying to say and think about, achieved a modest international fame. + +Many of the beavers that have reestablished themselves globally are descended from beavers that were planted by wildlife biologists. The thriving beaver population of Tierra del Fuego (another place Thie has studied) is descended from beavers brought to Argentina from Canada’s Saskatchewan River, who are themselves scions of beavers transplanted from upstate New York. No reintroduction of beavers was done in Wood Buffalo Park. Thie believes that the beavers who built the dam are of original stock. Like the wood buffalo and the wolves, they were too remote to be wiped out. + +> At the request of the Mikisew Cree First Nation, UNESCO has investigated environmental threats to Wood Buffalo National Park. + +The officials who run the park heard about the world’s largest beaver dam because of Thie’s discovery, like everybody else. Until the CBC reporter called them for comment, they had not known that their park contained the world’s largest beaver dam. None of the park’s personnel had ever been to it, or has visited it on the ground (or what passes for ground there), to this day. When I called Tim Gauthier, the park’s external relations manager, he said that he had flown over the dam many times but never stood on or near it. He did not know if the water in the lake was still deep enough to cover the entrance to the lodge or lodges. In these remoter areas of the park, he said, “we tend to let such things regulate themselves.” + +Since 1983, Wood Buffalo National Park has been listed as a World Heritage Site by UNESCO, the environmental and cultural agency of the United Nations. In more recent years, this designation has become shaky; at the request of the Mikisew Cree First Nation, whose members gather traditional resources in the park and depend on it for cultural survival, UNESCO has twice investigated environmental threats to the park and has come close to declaring it officially endangered. Wood Buffalo Park is now on UNESCO probation, and the governments of Canada and Alberta are supposed to fix its problems. + +[![A North American beaver (Castor canadensis).](https://e360.yale.edu/assets/site/_400xAUTO_stretch_center-center/Canada-Beaver_Getty.jpg)](https://e360.yale.edu/assets/site/_1500x1500_fit_center-center_80/Canada-Beaver_Getty.jpg) + +A North American beaver (Castor canadensis). Rainer Erl / McPhoto / ullstein bild via Getty Images + +The park is suffering the worst drought in its history. Flows are down by half in many places, owing to climate change, water diversion, poor seasonal snowpack, and dams on the Peace River, upstream in British Columbia. A danger that seems inescapable comes from the oil sands that are being mined for crude-oil-containing bitumen, and from tailing ponds that hold trillions of liters of mine-contaminated water. The ponds are near the banks of the Athabasca River, just upstream from the park boundary. They are fatal to birds that land on them. Given the direction that water flows, conservationists and native people fear the tailings will pollute the park eventually. Toxic chemicals have already been found in McClelland Lake, just southeast of the park. Locals stopped taking their drinking water from the lake years ago. + +Gillian Chow-Fraser, the boreal program manager for the Northern Alberta chapter of the Canadian Parks and Wilderness Society, in Edmonton, travels in the park often by helicopter, canoe, and foot. She has described the park’s environment as “super degraded.” When I spoke with her by phone not long ago, she talked about a recent tailing basin leak that was not reported to the First Nations downstream of it for nine months. In places that used to flood regularly but now don’t, the land is drying out and vegetation disappearing. Though she crisscrosses the park, she has never seen the world’s largest beaver dam, but she’s grateful that it’s there and bringing the park attention. + +> The idea of going to the world’s largest beaver dam came to Rob Mark after reading about Thie’s discovery. + +Another expert, Phillip Meintzer, conservation specialist with the Alberta Wilderness Association, told me that he hadn’t seen the dam, either, but that the park’s difficulty of access is a good thing, in a way, because it keeps people from visiting in large numbers and putting stress on the area. The downside is that environmental degradation, like the recent tailings seepage, can happen without many watchers finding out. Meintzer’s main worry is that when the economy shifts to renewables, the oil sands will be abandoned and taxpayers stuck with the cleanup. What will be done about the multi-trillion liters of toxic tailings is unknown. “Last summer I was on a trip to test water quality in and around McClelland Lake,” he said. “We camped by the shore, and all night in this remote and uninhabited place we could hear the propane cannons at the nearby tailings ponds firing to scare off the birds.” + +--- + +As far as is known, only one person has ever been to the world’s largest beaver dam. In July 2014, Rob Mark, of Maplewood, New Jersey, 44 years old at the time, reached the dam after a challenging journey. Holding the flag of the Explorers Club, the international organization with headquarters in New York City, he took a photo of himself standing on the dam. The top of the structure was the only solid ground he had encountered for miles. After he got back, a newspaper in Edmonton did a story about him, and he appeared in other newspapers and a travel magazine. His achievement is like the dam in that so far no one has said it isn’t unique. + +[![A beaver lodge sits in the middle of a 17-acre lake created by the dam.](https://e360.yale.edu/assets/site/_400xAUTO_stretch_center-center/WBNP-Beaver-Dam-Parks-Canada-3-2.jpg)](https://e360.yale.edu/assets/site/_1500x1500_fit_center-center_80/WBNP-Beaver-Dam-Parks-Canada-3-2.jpg) + +A beaver lodge sits in the middle of a 17-acre lake created by the dam. Parks Canada + +Mark is now a blueberry farmer in Virginia. When I reached him by phone, he told me he did solo extreme treks unsponsored and for his own pleasure. In 2007, he crossed South America from the Pacific Ocean to the Amazon River by hiking over the Andes. The idea of going to the world’s largest beaver dam occurred to him after he read about Jean Thie’s discovery. He planned the trek for several years, and in 2011, he flew to Fort McMurray — the Alberta town, more than 100 miles from the dam, that is the hub of the oil sands industry — to see how he could get from A to B. + +His plan was to go down the Athabasca River by boat, then hike through the muskeg peatland. That proving impracticable, he returned home and decided he would come at the dam from another direction, by way of Lake Claire, whose southwestern edge is about 10 miles from it. Crossing the lake by boat, a distance of about 25 miles, and then hiking to the dam, seemed straightforward enough. But the lake is more like a wetter spot in a swamp than a lake. Sometimes it does not have enough water for boats. Mark waited three years for that problem to improve. In 2014 it did, and Mark went to the town of Fort Chipewyan, east of Lake Claire, and hired a man to ferry him. + +The lake has no real shore, it just gets shallower at the edges. At a chosen point Mark got out and arranged for the boatman to return and pick him up there in six days. Mark noted the coordinates in his handheld GPS and told them to the boatman. The boatman replied that he had no GPS. That was a detail Mark had not thought of. The boatman told him to cut one of the nearby willows and stick it in a more conspicuous place in the swamp-lake, and they arranged to meet by it. Then the boatman left, and Mark began his trek. + +> Mostly the route, which required two days of slogging, was just swamp. The last mile to the dam took Mark five hours. + +The mosquitos swarmed like nothing he’d seen in the Amazon. He was ready for that and for trying not to go crazy from their noise. The sphagnum moss islands submerged slowly under his weight, step by step, as he grasped at willows to sort of brachiate on. By looking at the tree species shown on satellite photos he had plotted a route along comparatively higher ground, and he tried to keep to that. Mostly the route, which required two days of slogging, was just swamp. The last mile to the beaver dam took him five hours. + +Late in the long subarctic afternoon he emerged into the clear patch of sky created by the dam’s lake, waded to the dam, and stepped onto it. The dam is no more than three feet high at any point. He realized that a person seeing it up close would never guess it extended for half a mile. To grasp its full size and the ingenuity of its construction you needed a photograph from space. A lone beaver appeared, looked at him, and slapped its tail. Mark got a sense that his presence enraged the beaver. + +Bringing out his Explorers Club flag from his pack, he took the selfie. To be allowed to carry that flag he had had to apply to the club, which reviewed his plan of exploration and deemed it worthwhile. Mark became the 851st explorer in the club’s 110 years to carry the flag, joining a list that includes Thor Heyerdahl and James Cameron. After a supper of granola and peanut butter, he hiked to some larger spruce nearby, lashed his hammock between two of them, draped the mosquito netting, and prepared to spend the night. + +[![Rob Mark at the dam, with the beaver lodge behind him.](https://e360.yale.edu/assets/site/_400xAUTO_stretch_center-center/MAC39_BEAVERDAM_CAROUSEL-3.jpg)](https://e360.yale.edu/assets/site/MAC39_BEAVERDAM_CAROUSEL-3.jpg) + +Rob Mark at the dam, with the beaver lodge behind him. Rob Mark + +Hiking out occupied three more days. When he reached the lake, he could not wait next to the willow marker for his ride, because that would mean standing thigh-deep in water. He sat on a drier patch of ground back in the trees, too far from the lake to see it, and listened for the engine. At mid-morning of the day appointed, he heard a sound that got louder. The boatman went right to the unlikely willow and Mark walked through swamp to the lake and waded out to the boat, so exhausted he could barely climb in. + +--- + +The world’s largest beaver dam is not like human dams. It does not stopper a river, or even a stream or rivulet. Its low half-mile barrier collects small trickles that come off a plateau called the Birch Mountains. Along the margin of this comparatively higher ground, it accommodates itself to a slope of less than two percent. The gathered-up trickles have amounted to a lake, and after the beavers eat the plants that grow in it, they may relocate to another dam and another pond, graze that area, then move on again, in a sort of crop rotation. Other dams in this beaver belt are up to three-quarters the length of the longest dam. These long, low dams may help the beavers adapt to drought. + +Places almost impossible to get to undergird all of existence. In my car there are regions under the front seats where, when my cell phone falls into them, I must almost take the car apart to get it out. Beavers create hard-to-access places that are good for them, less so for us. Jean Thie had beavers on land he owned near Ottawa, and they built dams and made swampy ponds and cut down trees. He got a trapper to remove them but they or other beavers came back. Finally, he gave up and just put chicken wire around the trunks of trees on the property and lived with the beaver landscape. + +In the big picture, Thie is pro-beaver nonetheless. “Of course, I’m not very positively minded about our own future on the planet,” he told me. “But I am an optimist about beavers. Their presence improves water management, reduces water flows, reduces the loss of runoff, and creates and improves wetlands. In drier landscapes of the future all this could be of benefit. I think the worldwide flourishing of beavers is a small step in a good direction.” + +  +  + +--- +`$= dv.el('center', 'Source: ' + dv.current().Link + ', ' + dv.current().Date.toLocaleString("fr-FR"))` \ No newline at end of file diff --git a/00.03 News/In Uvalde, Students Followed Active Shooter Protocol. The Cops Did Not..md b/00.03 News/In Uvalde, Students Followed Active Shooter Protocol. The Cops Did Not..md new file mode 100644 index 00000000..5a010805 --- /dev/null +++ b/00.03 News/In Uvalde, Students Followed Active Shooter Protocol. The Cops Did Not..md @@ -0,0 +1,487 @@ +--- + +Tag: ["🚔", "🇺🇸", "🔫", "🏫"] +Date: 2023-12-10 +DocType: "WebClipping" +Hierarchy: +TimeStamp: 2023-12-10 +Link: https://www.propublica.org/article/uvalde-officer-student-trainings-mass-shootings +location: +CollapseMetaTable: true + +--- + +Parent:: [[@News|News]] +Read:: 🟥 + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-InUvaldeStudentsFollowedActiveShooterProtocolNSave + +  + +# In Uvalde, Students Followed Active Shooter Protocol. The Cops Did Not. + +The children hid. They dropped to the floor, crouching under desks and countertops, far from the windows. They lined up against the walls, avoiding the elementary school doors that separated them from a mass shooter about a decade older than them. Some held up the blunted scissors that they often used to cut shapes as they prepared to fight. A few grabbed bloodied phones and dialed 911. And as students across the country have been instructed for years, they remained quiet, impossibly quiet. At times, they hushed classmates who screamed in agony from the bullets that tore through their small bodies. + +Then, they waited. Waited for the adults, whom they could hear in the hallway. If they were just patient, those adults would save them. + +Hundreds of law enforcement officers descended on Robb Elementary School in Uvalde, Texas, that day in May 2022. They, too, waited. They waited for someone, anyone, to tell them what to do. They waited for the right keys and specialized equipment to open doors. They waited out of fear that the lack of ballistic shields and flash-bangs would leave them vulnerable against the power of an AR-15-style rifle. Most astonishingly, they waited for the children’s cries to confirm that people were still alive inside the classrooms. + +“I’m watching that door. No screams. No nothing. No nothing. You know. Things you would think you would hear if there had been kids in there,” Cpl. Gregory Villa, who had been with the Uvalde Police Department for 11 years, told an investigator days after the attack that left 19 children and two teachers dead. + +If there were children inside, Villa said, officers would have probably heard the shooter saying, “‘Hey, everybody shut up,’ and then kids are like, ‘Oh no, I gotta, I want my mommy.’” + +![](https://img.assets-d.propublica.org/v5/images/frontline_texas_tribune_logos_side_by_side-copy.png?crop=focalpoint&fit=crop&fm=webp&fp-x=0.5&fp-y=0.5&h=187&q=80&w=800&s=e63a3e7d6f8208a923ee59fae37b5b9c) + +Villa, who received active shooter training four years earlier, was among several officers who told investigators that they didn’t believe children were in the classrooms because they were so quiet. The children’s strict adherence to remaining silent was, in fact, part of their training. Officers’ own training instructs them to confront a shooter if there is reason to believe someone is hurt. + +“I just honestly thought that they were in the cafeteria because it seemed like all the lights were off and it seemed like it was really quiet. I didn’t hear any screaming, any yelling. I literally didn’t hear anything at all,” Uvalde police Staff Sgt. Eduardo Canales recalled to an investigator. “You would think kids would be yelling and screaming.” + +The accounts of law enforcement’s actions during one of the worst school shootings in history are among a trove of recorded investigative interviews and body camera footage obtained by ProPublica, The Texas Tribune and FRONTLINE. Together, the hundreds of hours of audio and video offer a startling finding: The children in Uvalde were prepared, dutifully following what they had learned during active shooter drills, even as their friends and teachers were bleeding to death. Many of the officers, who had trained at least once during their careers for such a situation, were not. + +Mass shootings have become a fact of American life, with [at least](https://www.theviolenceproject.org/mass-shooter-database/) [](https://www.theviolenceproject.org/mass-shooter-database/)[12](https://www.theviolenceproject.org/mass-shooter-database/)[0](https://www.theviolenceproject.org/mass-shooter-database/) since the 1999 Columbine High School shooting. Debates often erupt along partisan lines as anguished communities demand change. When children are gunned down, calls for tighter gun laws are matched with plans for arming teachers and hardening schools. + +One thing that seemingly unites all sides is the notion of better training for law enforcement. But, in actuality, few laws exist requiring such instruction. + +In the wake of the Columbine shooting, law enforcement agencies across the country began retooling protocols to prevent long delays like the one that kept officers there from stopping the two shooters. Key among the changes was an effort to ensure that all officers had enough training to engage a shooter without having to wait for more specialized teams. + +More than two decades later, law enforcement’s chaotic response in Uvalde and officers’ subsequent explanations of their inaction show that the promise of adequate training to respond to a mass shooting has yet to be fully realized. + +Officers failed to set up a clear command structure. They spread incorrect information that caused them to treat the shooter as a barricaded suspect and not an active threat even as children and teachers called 911 pleading for help. And no single officer engaged the shooter despite training that says they should do so as quickly as possible if anyone is hurt. It took 77 minutes to breach the classroom and take down the shooter. + +“It’s pretty stunning that we’re 24 years after the Columbine massacre and we’re still dealing with a lack of training on how to deal with these active assailants,” said Mo Canady, executive director of the National Association of School Resource Officers. “I’m not sure who is to be held responsible for that, but it really is unacceptable that officers are not getting that training.” + +A nationwide analysis by the news organizations shows states require far more training to prepare students and teachers for a mass shooting than they do for the police who are expected to protect them. + +At least 37 states have laws mandating that schools conduct active shooter-related drills. All but four of those states require them at least annually. + +In contrast, only Texas and Michigan have laws requiring training for all officers after they graduate from police academies. Texas’ law is the strongest in the country, mandating that officers train for 16 hours every two years. That requirement came about only after the Uvalde massacre. + +The absence of legislation has created an uneven and inconsistent approach, which fails to ensure that officers not only receive the training they need to confront a mass shooter, but drill often enough to follow it in the adrenaline-soaked atmosphere of a real shooting, law enforcement experts said. Some also emphasize the importance of multiagency training so that officers are not responding to a crisis alongside people they’ve never worked with before. Yet few states, if any, require agencies to train together. + +About 72% of the at least 116 state and local officers who arrived at Robb Elementary before the gunman was killed had received some form of active shooter training during their careers, according to an analysis of records obtained by ProPublica, the Tribune and FRONTLINE. Officers who received training before the Uvalde shooting had most commonly taken it only once, which law enforcement experts say is not enough. Only three officers would have met Texas’ new standard for training. + +The news organizations reached out to each of the officers in this piece. An attorney representing officers with the Uvalde Police Department said the city has ordered them not to comment because of an ongoing internal investigation. Officers with other agencies did not return phone calls, texts and emails or declined to comment. + +Across the country, officers are increasingly responding to situations with active shooters, some of whom have access to weapons originally designed for war. In the absence of gun control legislation, sales of these types of weapons have increased. + +Unlike military service members who spend the majority of their time training for the possibility that they may someday see combat, police spend the bulk of their days responding to a variety of incidents, most of which do not involve violent encounters. Experts say that leaves many unprepared as the nation’s tally of mass shootings grows. + +No clear consensus exists on just how much training is sufficient, though experts agree on the need for repetition. Even then, consistent training cannot guarantee that officers will do everything right, said John Curnutt, assistant director at Texas State University’s Advanced Law Enforcement Rapid Response Training Center, which is rated as the national standard by the FBI. Still, Curnutt said, routine training is the best way to improve officers’ response. + +“It has to be really driven into somebody to the point where it becomes instinctive, habitual,” Curnutt said. “Before you really get a chance to think about it, you’re already doing it. And it takes more than 10 or 11 times to get that good at something like this that is going to be incredibly difficult to do when you know that, ‘I’m about to die, but I’m going to do this anyway.’ Who thinks like that? Not everybody. We know that. Not everybody that’s in uniform does.” + + Your browser does not support the video tag. + +It was 11:30 a.m. on May 24, 2022. The timer that Elsa Avila set had just gone off, notifying her fourth grade class that the extra minutes she’d given them to make shoes out of newspapers for a STEM challenge had drawn to a close. Now they were going outside to test how long the shoes held up on the school track. + +Avila gathered the children for a photo before they formed a single-file line. At the front, one of the students peered into the hallway. “Miss, there’s a class coming in and they’re screaming and they’re running to their room,” Avila recalled the student saying as the teacher of 27 years described the details of that day to investigators. + +![](https://img.assets-d.propublica.org/v5/images/20231204-uvalde-newspaper-shoes-pixelated.jpg?crop=focalpoint&fit=crop&fm=webp&fp-x=0.5&fp-y=0.5&h=679&q=75&w=800&s=919008798e21e7d60addb73a37b98668) + +Elsa Avila’s students pose for a picture in their newspaper shoes moments before the shooter entered their school. Children’s faces are shown with parental consent. Credit: Courtesy of Elsa Avila, pixelated by ProPublica, The Texas Tribune, and FRONTLINE + +“You let their teacher worry about them,” Avila replied, believing that the student was simply reporting unruly behavior. + +This was different, the girl insisted. The children were scared. So, Avila peeked into the hallway. + +“Get in your rooms!” Avila heard a woman scream. + +“So I just slammed my door back in, turned off the lights and, at that time, the kids know, because we practice these drills, they know: ‘OK, shut the door, you know. Slam the lights. We’ve got to go into our positions,’” Avila recalled. + +Listen to Avila + +“So I just slammed my door back in, turned off the lights and, at that time, the kids know, because we practice these drills, they know.”" + +The educator and her students formed an “L,” crouching down against the two walls that were farthest from the doors and windows. It was a drill they’d practiced so much that, at times, it had become tiresome. The training that Avila had hoped they’d never have to use: Run. Hide. Fight. + +For now, they hid. + +Avila stood up momentarily to make sure that her students were safe. + +It was then that a bullet pierced the wall, ripping into the teacher’s stomach. + +Avila fell to the ground and dropped her phone. After dragging herself to the phone, she scrolled through previous texts to find one that included a group of teachers from the school. + +“Im shot,” she wrote at 11:35 a.m., mistakenly texting her siblings before eventually also messaging her colleagues. + +Only five minutes had passed since Avila’s timer rang for what was intended to be a celebratory moment. + +In that time, the gunman had entered the building after crashing a truck into a nearby ditch and police had received their first 911 call from a teacher informing them that the shooter was in the school. In those five minutes, the teenage shooter unleashed nearly 100 rounds of gunfire. + +![](https://propublica.s3.amazonaws.com/projects/graphics/2023-uvalde/assets/20231107-uvalde-children-map-1.png) + +A child’s drawing for investigators shows how students in Room 109, two doors away from the shooter, followed their training. + +Children and teachers formed an “L,” crouching against the walls farthest from doors and windows. + +In the drawing, the child wrote “hide,” reflecting a key part of the training. + +One of Avila’s students was among those injured. Bullet fragments struck 10-year-old Leann Garcia on the nose and mouth. Blood dripped onto her clothes as her friend, Ailyn Ramos, held her and tried to keep her from screaming out in pain. + +“If I die, I love you,” Leann whispered to Ailyn. + +“As long as you’re in here with me, you’re not going to die,” Ailyn later recalled responding in an interview with the news organizations. (Ailyn’s account, like those of all the children named in this piece, is included with the permission of a parent.) + +With their teacher flitting in and out of consciousness, the children huddled together. For a moment they did something that their lockdown training had not taught them, but that their teacher had always told them to do in difficult times, Ailyn told the news organizations. + +They prayed. + +“Please let the cops come in.” + + Your browser does not support the video tag. + +Outside of the school, Uvalde police Sgt. Daniel Coronado heard the unmistakable gunfire from the shooter’s semiautomatic rifle. “Oh, shit, shots fired! Get inside,” Coronado yelled at about 11:35 a.m. while breathlessly running toward the building. + +Entering a smoke-filled hallway, Coronado, a 17-year veteran of the department, walked past printouts of summer sandals that had been brightly colored by children, who were now nearing their last day of school. Seconds later, there was another round of gunfire from rooms 111 and 112, the adjoining classrooms from which the shooter was terrorizing teachers and children. + +The shots injured Canales and Lt. Javier Martinez, two Uvalde police officers who had initially approached the classrooms. Blood trickled from Canales’ ear and bullet fragments grazed Martinez’s head. Both officers retreated. Though hurt, Martinez again ran toward the door. No one followed. He eventually pulled back. The officers had taken active shooter training only once: Martinez in 2014 and Canales the year before the shooting. + +The failure to engage the shooter was the first in a handful of critical missteps by officers in the initial 10 minutes. Each ran counter to what the training teaches. + +Among the missteps was the fact that no one took charge or set up a command post to guide the response, which experts say should happen quickly after arrival. Another was Coronado’s decision to relay an unconfirmed report from a school resource officer that the suspect was holed up in an office. The information proved to be inaccurate, and the misunderstanding helped shape officers’ approach to the incident. + +“Male subject is in the school on the west side of the building,” Coronado radioed at 11:41 a.m. “He’s contained. We got multiple officers inside the building at this time. Believe he’s, uh, barricaded in one of the offices. Male subject’s still shooting.” + +Though some officers struggled with malfunctioning radios, Coronado’s words reached enough of them to contribute to a widespread belief that the shooter was possibly alone inside a room with no victims, even as evidence mounted that children and teachers were in danger. + +Initially believing he was responding to an active shooter, Texas Department of Public Safety Special Agent Colten Valenzuela told an investigator that his mindset changed after arriving at the school. + +“When we did get there, we were told that it was a barricaded subject, so that kind of flipped the direction,” Valenzuela said. + +Asked by an investigator about the determination that the shooter was barricaded, Coronado, who completed active shooter training a decade earlier, said: “I don’t know where that came out of, you know what I mean? You’re just reacting to what you’re dealing with at that moment in time.” + +“You don’t see any bodies,” Coronado added. “You don’t see any blood. You don’t see anybody yelling, screaming for help. Those are motivators for you to say, ‘Hey, get going, move,’ but if you don’t have that, then slow down.” + +Listen to Coronado + +"You don't see any bodies. You don't see any blood. You don't see anybody yelling, screaming for help. Those are motivators for you to say, ‘Hey, get going, move,’ but if you don't have that, then slow down." + +Uvalde is among the most striking examples of a botched police response to a mass shooting, but officers’ failures to immediately stop a shooter despite being trained extend beyond the Texas city, according to a ProPublica, Tribune and FRONTLINE review of dozens of after-action reports and publicly released video. In some cases, the delays are well-known. In Orlando, Florida, officers waited about three hours to take down a shooter at the Pulse night club in 2016 despite 911 calls indicating some hostages were shot. The initial officer who responded to the 2018 shooting at Marjory Stoneman Douglas High School in Parkland, Florida, never entered the building where a shooter killed 17 students and staff. + +Other missteps have not been as widely scrutinized. In Las Vegas in 2017, two officers stayed on the hotel floor below a shooter instead of rushing upstairs to confront him as he spewed bullets into a crowd of concertgoers. The next year in Thousand Oaks, California, officers attempted to confront a shooter within minutes of arriving at the scene. Some retreated after he shot at them. Police did not reenter to engage the shooter again for more than 40 minutes, even as victims remained inside. + +In contrast, several officers credited their repeated training after they were celebrated for acting expeditiously to take down a shooter in March at a private Christian school in Nashville, Tennessee. Such instruction, they said, allowed them to momentarily ignore the emotion of stepping over a victim to get to the shooter so as to prevent further harm. About two months later, an officer in Allen, a Dallas suburb, shot a gunman minutes after his killing spree began at an outlet mall. Police and fire officials later praised years of joint training as key to the swift response. + +The ability to work together was absent in Uvalde, Ruby Gonzalez, a school resource officer, told an investigator. Despite most of the officers being trained, various agencies that arrived at the scene were not accustomed to working together and had their own operating procedures, Gonzalez said. + +“We couldn’t find a way to work together because each agency wanted to do things how they, how they see fit,” she said when asked if she believed the response that day followed the training she had taken. + +At the time of the Uvalde shooting, Texas required only that school resource officers take an eight-hour active shooter course. The requirement did not apply to thousands of officers in police departments and sheriff’s offices across the state, contributing to vast disparities in training. + +About 84% of the DPS officers who responded to the Uvalde shooting before the gunman was killed had been trained. Yet only about 67% of the Uvalde Police Department officers and roughly 36% of the Uvalde County Sheriff’s Office deputies had taken active shooter courses, according to an analysis of records that detail training after officers graduate from academies. + +Collectively, local and state agencies sent at least 116 officers to the Uvalde shooting before the breach. While a majority of those officers had received some instruction to confront an active shooter, about half had not been trained since 2018 or before. That was the year a gunman entered Santa Fe High School near Houston and killed 10 people. + +Federal law enforcement agencies, who sent about 180 officers to the scene before and after the breach, declined to provide training records for their officers, leaving the amount of instruction they received unclear. A spokesperson for Customs and Border Protection, the agency with the majority of the federal officers on scene, said in a statement that it continues to review the response and is “committed to identifying any improvements to training or tactics.” + +Source: Texas Commission on Law Enforcement + +DPS and the Uvalde sheriff’s office did not respond to questions about their departments’ training. A spokesperson for the city of Uvalde said that since the shooting, officials have purchased equipment like shields and breaching tools and have expanded training to include surrounding agencies. + +Uvalde officers will also be among those required to meet Texas’ new standard — 16 hours of instruction every two years. + +The post-Uvalde mandate is rare. + +In the vast majority of states, officers are only required to prepare to confront a shooter in academies that train new recruits, but even that can vary widely between four and dozens of hours of instruction. Once those officers get the training, most are not required under the law to ever take it again. + +“If we’re not training the right way and we’re not preparing ourselves and our kids and our responders, then we’re going to keep doing this for the next 25 years,” said John McDonald, who developed the school safety program in Jefferson County, Colorado, which includes Columbine, after the 1999 shooting. “We’re going to say, ‘Geez, for 50 years we haven’t figured it out.’ Well, shame on us.” + + Your browser does not support the video tag. + +Nicole Ogburn, a teacher in Room 102, used her Apple Watch to dial 911 three times but couldn’t get through. On her fourth try, at 11:40 a.m., one of the city’s two dispatchers finally picked up. + +Ogburn reported that there was an active shooter at the school, saying she could hear the gunshots outside of her classroom. + +911 dispatcher: You can hear the gunshots being fired? + +Ogburn: Yeah, they’re in the building. I don’t know. There’s been a lot. A whole lot. And I got a message that somebody, somebody is shot in another classroom. + +911 dispatcher: Somebody is shot in a classroom, ma’am? OK, can you tell me … + +Ogburn: Not mine. In another one. Another classroom. I don’t know. I don’t know. Please hurry. Hurry. + +911 dispatcher: What room number? What room number? Can you tell me what room? + +Ogburn: I’m in Room 102. + +911 dispatcher: Is he going to be across from you? + +Ogburn: I don’t know where he’s at right now. I got to go. I can’t let him hear me. I can’t let him hear me. + +While Ogburn was on the phone with 911, dispatchers received another call. This time from Pete Arredondo. The school district police chief, who had taken active shooter training four times during his nearly 30-year career, was supposed to take charge, according to the district’s active shooter plan. + +Arredondo, who had dropped his radio on the way into the school and didn’t have a body camera, asked the dispatcher for backup and more equipment. + +“I’m inside the building with this man. He has an AR-15. He shot a whole bunch of times. We’re, yes, we’re inside the building,” Arredondo told the dispatcher. “He’s in one room. I need a lot of firepower, so I need this building surrounded, surrounded with as many AR-15s as possible.” + +In that brief moment, Arredondo would learn from the dispatcher what police could not see on the other side of the classroom doors: Someone was injured. + +Arredondo does not appear to have shared the information with other officers, according to body camera footage and radio calls reviewed by the news organizations. + +Active shooter training instructs that officers should act immediately if there is reliable evidence that an attacker is killing people or preventing critically injured victims from getting medical attention. + +But 17 more minutes passed before officers opened the door to Ogburn’s classroom. Even then, their discovery of children was an accident. + +Uvalde County Sheriff’s Deputy Reymundo Lara recalled to investigators how he came to realize there were children in the room. Lara, who had not taken active shooter training, said he took a tactical position, aiming at the classroom where the shooter remained. + +“I was like, you know what, my feet need to be a little bit more comfortable,” Lara added. “So, I get up, open the door. I propped it open so I could stick my leg in and lay back down and aim at the classroom where this suspect’s at. Something is telling me, ‘Hey, just check the classroom.’” + +At first, Lara did not see anything. The lights were off and a movie played on the TV. + +Then, the deputy spotted children. + +“Hey,” Lara yelled. “We got kids in this room.” + +Officers rushed to help Ogburn and her students escape through the window. “Kids coming out. Kids coming out. Kids coming out,” Coronado said, his body camera picking up the moment they were pulled out through the window. + +Coronado’s heart sank. “Oh shit, there’s kids,” he recalled thinking while speaking with investigators. “That was the first time that we realized, no, there are kids inside the building.” + +11:56 a.m. + +Uvalde police Sgts. Daniel Coronado and Donald Page tell another officer outside of the school that there are no children inside. + +Coronado Body Camera Footage + +11:57 a.m. + +Uvalde County Sheriff's Deputy Reymundo Lara opens a classroom door and discovers children inside. + +Lara Body Camera Footage + +11:58 a.m. + +The children are evacuated from their classroom through the window. + +Coronado Body Camera Footage + + Your browser does not support the video tag. + +Though officers were now aware that children and teachers remained in classrooms, Avila and her students continued to wait to be rescued. + +Still losing blood from the gunshot wound to her stomach, the teacher knew she had to stay awake for her students. + +“I didn’t want to pass out because I didn’t want to leave them alone,” she recalled in an interview with an investigator. + +Moments of darkness were punctuated by the children trying to keep her calm. She could hear some of them saying, “Don’t let her go to sleep.” + +“Miss, we love you. We love you,” she recalled one telling her. “Miss, you’re going to be OK.” + +Avila could hear the school district chief, who began trying to negotiate with the shooter 24 minutes after officers entered the school. + +“Can you please put your firearm down? We don’t want anyone else hurt,” Arredondo said. + +At one point, the children in Avila’s class heard people fiddling with their door. “Police open up!” + +“I thought it was a trick,” Leann, the injured 10-year-old, recalled thinking during an interview with investigators. + +None of the children said anything. How could they know it was not the shooter? + +Indeed, the students did as they were taught to do in their drills. + +“We tell kids if someone’s knocking on a door and says, ‘Police officer, open up,’ don’t open the door. We tell teachers that all the time. And we test it,” said McDonald, who now serves as chief operating officer of The Council for School Safety Leadership, an organization that helps school leaders respond to threats and tragedies. “That could be someone trying to trick you to come out. Cops have keys. They have the ability to breach. They have tools to get in. They will come in.” + +But the police didn’t come into Avila’s classroom at that moment. They also did not try to enter rooms 111 and 112, where the shooter remained, after learning from Ruben Ruiz, a school resource officer, that his wife, Eva Mireles, was injured in one of them. + +At 11:56 a.m., Ruiz pushed urgently through a scrum of officers, attempting to get closer to his wife’s classroom after she’d called to tell him what happened. + +“She says she’s shot, Johnny,” Ruiz said as an officer stopped him from pressing forward. + +Instead of acting on the information, officers guided him outside and took away his gun. + +One of the officers who heard Ruiz was Justin Mendoza. The rookie officer, who had only been with the Uvalde Police Department for about two years, had not received active shooter training, according to state records. + +Mendoza said officers knew they needed to get into the classrooms, including Mireles’, but they didn’t have the right equipment. His sentiment was shared by more than a dozen officers who, in interviews with investigators, expressed [fear of the shooter’s semiautomatic rifle](https://www.propublica.org/article/uvalde-police-gunman-ar-15-delays). + +“Like I said, we didn’t have any shields, no, no flash-bangs, no nothing that we could’ve used to create a distraction,” Mendoza recalled, “to, not only, like, not to sound selfish, but make sure we go home at the end of the day, but at least more of these kids can go home at the end of the day.” + +Though officers signed up for the job knowing that they were putting their lives at risk, they’d never been confronted with a mass shooter, Mendoza said. + +“None of us ever thought any of this situation would ever happen here, in Uvalde,” he said. + +Listen to Mendoza + +“Like I said, we didn’t have any shields, no, no flash-bangs, no nothing that we could’ve used to create a distraction, to, not only, like, not to sound selfish, but make sure we go home at the end of the day, but at least more of these kids can go home at the end of the day.” + + Your browser does not support the video tag. + +About 40 minutes after the shooting began, officers received an urgent broadcast over their police radios that experts said marked another crucial moment that should have prompted them to immediately confront the shooter. + +A child who was in one of the adjoining rooms with the shooter had reported a “room full of victims. Full of victims at this moment,” a dispatcher said over the radio. + +“Fuck, full of victims,” one officer said aloud after hearing the radio communication. “Child called 911 and said room’s full of victims.” + +Minutes later, the dispatcher radioed again: “Be advised, we do have one teacher that is still alive with wounds and eight to nine children.” + +Officers did not hear the grueling 17-minute call in which 10-year-old Khloie Torres and her friend Miah Cerrillo pleaded for help, repeatedly asking for police assistance. They didn’t hear Khloie, who had been struck by shrapnel from the shooter’s bullets, as she quietly begged for them to hurry, telling the 911 operator: “There’s a lot of dead bodies. Please help. I don’t want to die.” The same officers who said that the children’s silence kept them from rushing the classroom didn’t get to listen in as the dispatcher repeatedly told Khloie to keep the children quiet. They didn’t hear her promises that officers were on their way to save Khloie and her classmates. + +Despite some radios not working inside the school, officers who heard the dispatcher’s broadcast now knew that children and at least one adult remained alive, trapped with the shooter on the other side of the door. Those details, along with earlier signs that included sporadic gunfire and information that an officer’s wife was shot but still alive in the classroom, should have jogged in their minds a key lesson from training. They should have moved swiftly to stop the killing and stop the dying, experts said. + +“You know kids are in there. You know you have a teacher that’s hurt. You’ve been shot at already. You’ve got an officer that’s been wounded. I mean, I think the intel is there,” said McDonald, the school safety expert who reviewed the footage at the request of the news organizations. “The environment is there. So how do you get in that room? What are your options to get in that room? And I think that has to be a priority. You already had one officer who said his wife was in there several minutes ago. Stop the dying.” + +Instead, law enforcement officers, including members of a highly trained Border Patrol tactical team that had just arrived, continued to wait, even as they received some specialized equipment that they said they needed to breach the metal door and enter the classroom. No one ever checked the door to see if it was unlocked, although a state House committee that later reviewed the shooting determined it probably was. + +Days after the attack, Uvalde police Officer Michael Wally recalled to an investigator the moment he heard there were victims in the classroom with the shooter. It didn’t make sense, Wally told him. Since he arrived at the school, he’d been asking who was leading the response. Who was the officer in charge? No one provided an answer, but he was repeatedly told the school district police chief was negotiating with the shooter. + +Arredondo later told the Tribune and investigators that he did not view himself as in charge. He defended his actions and those of others. + +“I kept going back to who is OIC. Who is, who’s, who’s fucking in charge? Excuse my language, but who’s, who’s in charge?” recalled Wally, who last took an active shooter course in 2015. “I’m a patrol officer. I can’t, you know, I’m not in there. I’m not in the hallway. I’m not talking to our gunman. I’m not talking to the guy who’s talking to our gunman. No communication is coming back out to me. So there’s got to be someone else. There’s got to be someone else that’s in charge. Someone tell me what to do. + +Listen to Wally + +“I kept going back to who is OIC. Who is, who’s, who’s fucking in charge? Excuse my language, but who’s, who’s in charge?” + +“And you know this, you’ve probably been wearing a badge a lot longer than I have,” Wally told the investigator, “but chain of command is everything. And, it was not there.” + +In the absence of clear leadership and communication, misinformation continued to spread. + +Shortly after the radio communication from the dispatcher, a Border Patrol medic arrived. He asked about the victims. A state game warden quickly replied that they had not heard of any injuries. “Uh, yes there are,” an Uvalde police detective responded. + +The medic pushed his way into the building and began setting up a triage station to treat the wounded. There, law enforcement officers, including members of the Border Patrol strike team, huddled, body camera footage shows. + +The minutes continued to tick away as the team prepared to enter the room. + +12:12 p.m. + +Uvalde police Officer Justin Mendoza and Uvalde police Detective Jose Rodriguez hear a dispatcher tell officers that a child said Room 112 was full of victims. + +Mendoza Body Camera Footage + +12:18 p.m. + +Six minutes later, state game warden Dennis Gazaway mistakenly tells Border Patrol medic Diego Merino-Ruiz that there are no injured children inside but is quickly corrected by Rodriguez. + +Gazaway Body Camera Footage + + Your browser does not support the video tag. + +Though officers had already broken through windows to evacuate students, they fixated on finding keys to unlock the three classrooms that still had children in them. + +Arredondo had earlier decided that they would not enter the two adjoining classrooms that would force them to confront the shooter until they cleared others first, according to his interview with investigators and body camera footage. + +That left Avila’s classroom. Over the years, the teacher had learned that the only way the door to Room 109 would lock was if she slammed it closed. That is just what she did that day to ensure that the shooter could not enter. + +Arredondo later told investigators that he knew his decision would likely be scrutinized, but he did what he thought was best at the time. He said that he believed the shooter had probably killed at least one person inside rooms 111 and 112, but that he knew that children in other classrooms remained alive. + +“The preservation of life around everything around him, I felt was priority,” Arredondo said. + +Officers tried prying Avila’s door open with a knife. They also tested various keys that did not work in search of a master key. Eventually, they decided that the only way in would be through the outside and began breaking the window. + +Avila’s students started crying as officers yelled, “Police, we’re here to help you!” Some ran toward the window. Others waited, Avila recalled. They still did not know whether to trust the voices from outside. + +“They didn’t want to move until I told them to move,” the injured teacher recalled. “So, then I stood up, and I told them, ‘Come on guys.’” + +As soon as the classroom was cleared at 12:26 p.m., Arredondo signaled that officers could begin breaching the classrooms with the shooter. “Got a team ready to go? Have at it,” he can be heard saying on body camera footage as officers stood around him. + +It’s unclear if that message ever made it to the Border Patrol tactical team, which was on the other end of the hallway, or if anyone, at that point, was heeding the school district chief’s direction. + + Your browser does not support the video tag. + +Over the next 24 minutes, Khloie and other children in Room 112 continued to rely on one another for survival. + +Despite the excruciating wait, now more than 50 minutes from the time the shooter had fired the initial volley of shots, the children continued to follow their training. They hid and remained quiet, even as several of them had injuries that made such silence inconceivable. + +“I looked around, and I was like, people were cuddling up to each other, they were like, ‘I’m going to die,’” Khloie later told an investigator. “And I was like: ‘You’re not going to die. Just be really quiet.’” + +“I remember telling everybody that ‘we’re going to get through this, and just don’t make a sound,’” she added. “‘Just be as quiet as a mouse.’” + +Listen to Torres + +“I remember telling everybody that ‘we’re going to get through this, and just don’t make a sound. Just be as quiet as a mouse.’” + +Instead of being protected, Khloie told the investigator, she became the protector. + +Khloie worked to calm her classmate Kendall Olivarez, who wailed in pain. Kendall was wedged under a teacher who had been killed by the shooter, and bullets had pierced the girl’s arm, back and leg. Khloie helped pull Kendall from under her teacher. They crawled beneath a table as they hid from the shooter who was in the adjoining classroom. Meanwhile, Mireles, their other teacher, was losing blood and cried out for her daughter. + +Khloie grabbed her foot and tried to comfort her. “Don’t be scared,” she told her. + +Desperate for help, Khloie’s friend Miah dialed 911 one last time, pleading with the operator to send police. They were coming, the dispatcher assured her, adding that if anyone entered the classroom, the children should pretend to be asleep. + +As she waited, Miah, who had been struck by shrapnel, sobbed quietly into the phone. + +Finally, 77 minutes after the shooter entered the school, 54 minutes after one of the officers reported that his wife had been shot and 38 minutes after a dispatcher shared that there were victims in the classroom, the adults had arrived to help. + +At 12:50 p.m., a team led by the Border Patrol strike team entered Room 111. The gunman jumped out of a closet, firing at a federal officer and grazing him in the head. Officers returned fire, killing the shooter. + +Still on the phone with the 911 operator, Miah, who was hiding in Room 112, mistakenly thought the gunman was coming for her. + +She later recalled the moment to an investigator, saying, “I was, like, thinking it was him, he came back in the classroom. And then I look up and it was the police and all my friends started running towards them. And me and my friend were crying because we were scared. We ran to the hallway and I saw people, pass — dead and then blood on all of the floor.” + +Listen to Cerrillo + +“I was, like, thinking it was him, he came back in the classroom. And then I look up and it was the police and all my friends started running towards them. And me and my friend were crying because we were scared. We ran to the hallway and I saw people, pass — dead and then blood on all of the floor.” + +First responders tried to rush out the living, taking Mireles, who still had a pulse, outside to be treated by medics. EMS declared her dead [about an hour later in an ambulance that never left the school](https://www.propublica.org/article/uvalde-emt-medical-response). Two children also had a pulse when they were taken out but later died. With insufficient ambulances to treat victims, police placed six children in a school bus, including Miah, Khloie and Kendall. + +With them were two state troopers who were suddenly forced to act as medics, although they lacked qualifications. With blood from those who were injured around her soaked into her hair and clothes, and smeared on her face and hands, Khloie cried. She wanted her dad and she wanted to know if one of her friends survived, though she knew the answer even before asking. + +She also wanted the officer to know that she had tried. + +“Ma’am, I was on the phone with the police officer,” Khloie told a state trooper through tears. + +“Oh, that was you?” the trooper asked. + +“Yes, ma’am.” + +“OK, OK, you were so brave. Y’all were so brave, OK?” the officer said, stroking her head. + +“I was trying not to cry,” Khloie replied. + +1:02 p.m. + +Khloie Torres, on a school bus with other classmates, tells Department of Public Safety Special Trooper Crimson Elizondo that she called 911. + +Warning: The following video has a loud ringing sound and shows a distressed child covered in blood that is not her own. We are publishing it with the family's consent. + +Elizondo Body Camera Footage + +More than two hours after the shooting began, the school was quiet once again. + +David Joy, a Border Patrol supervisor in Uvalde, picked up a body camera that an officer dropped. It was still recording. + +Once in his car, he called his daughters’ school. + +“I need, I need to talk to the principal as soon as I possibly can,” Joy said to the woman who answered the phone, explaining that he was a Border Patrol agent working out of the Uvalde station. After asking if she had heard about what happened, he said, “There’s some stuff that was extremely like, I, like there are some issues that I have with the way things, I want to be able to talk with somebody to just give you some advice and stuff that kind of slowed us down a little bit that maybe would be able to, God forbid something, God forbid something happen and y’all aren’t set up for it.” + +In the weeks that followed the shooting, hundreds of officers recounted their role in the failed response during interviews with state and federal investigators. + +Some said they did all that they could under the circumstances. Others sobbed. They recalled seeing the children’s lifeless bodies, the fear in the faces of the survivors. They had already felt the anger from residents in the city of 15,000 people who were forced to bury two teachers and 19 children, some of whom were related to officers. Several wrestled with whether they could have done more. A few wondered if any amount of training could have prepared them for that day. + +“It, it, it was a horrific thing and we lost no matter what. Um, I, I, I want to learn from it, you know,” Coronado, the Uvalde police sergeant, told an investigator. “I, I want, I, I, I want, I want an opportunity to have someone better than me tell me, ‘Hey, we could’ve done this or we could’ve done that.’ You know what I mean? I, I, I, I, I, I want that.” + +Listen to Coronado + +“It, it, it was a horrific thing and we lost no matter what. Um, I, I, I want to learn from it, you know. I, I want, I, I, I want, I want an opportunity to have someone better than me tell me, ‘Hey, we could’ve done this or we could’ve done that.’ You know what I mean? I, I, I, I, I, I want that.” + +Two children in his family died that day. He did not attend their funerals, telling an investigator that some of his relatives “think that we fucking let ’em die.” + +The initial probe by the Texas Rangers, the DPS’ investigative arm, is complete but has not been made public. Of the hundreds of officers who responded that day, less than a handful have been fired, including Arredondo. An attorney representing Arredondo [released a statement before he was terminated](https://www.texastribune.org/2022/08/24/uvalde-school-police-chief-pete-arredondo-termination-board-vote/), saying that his client was being used as a “fall guy.” Several officers from various agencies either resigned, were reassigned or retired. + +News organizations, including ProPublica and the Tribune, have sued the state for records that would help families and the public better understand what happened that day. The state has repeatedly fought their release, citing an ongoing criminal investigation by the Uvalde district attorney, who has said that she plans to present a case before a grand jury this year. A state district judge [ruled in the newsrooms’ favor](https://www.propublica.org/article/texas-judge-orders-release-of-uvalde-shooting-records), though DPS has said it plans to appeal. + +The wait for the findings has now grown to 18 months. It’s unclear whether and when they will be released. + +“I just wish someone would have taken charge. I wish someone would’ve …,” Wally, the Uvalde police officer, said while talking with an investigator in the days after the shooting, his voice trailing off. “And I know this is going to be open record one day. Let it be on open record. Fuck politics. Someone take charge. Let’s fix this. That’s what I wanted. That’s what everybody wanted.” + +Juanita Ceballos, Michelle Mizner and Lauren Prestileo of FRONTLINE and Zach Despart of the Texas Tribune contributed reporting. + +Illustrations by Pei-Hsin Cho for ProPublica, The Texas Tribune and FRONTLINE + +Design and Development by [Zisiga Mukulu](https://www.propublica.org/people/zisiga-mukulu). + +Graphics and Development by [Lucas Waldron](https://www.propublica.org/people/lucas-waldron). + +  +  + +--- +`$= dv.el('center', 'Source: ' + dv.current().Link + ', ' + dv.current().Date.toLocaleString("fr-FR"))` \ No newline at end of file diff --git a/00.03 News/Inside Foxconn’s struggle to make iPhones in India.md b/00.03 News/Inside Foxconn’s struggle to make iPhones in India.md index 15b0fc65..54bac452 100644 --- a/00.03 News/Inside Foxconn’s struggle to make iPhones in India.md +++ b/00.03 News/Inside Foxconn’s struggle to make iPhones in India.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- Parent:: [[@News|News]] -Read:: 🟥 +Read:: [[2023-12-16]] --- @@ -275,7 +275,7 @@ The same day that Apple executives unveiled the iPhone 15, Foxconn workers in Su The Hindu ritual, common in India’s manufacturing industry, asks for a smooth production process. In front of a truck loaded up with new phones, workers placed framed pictures of Hindu gods decorated with flower garlands. They lit incense and offered bananas in prayer while the curious foreign employees watched. At the end, a worker smashed a coconut and a pumpkin on the ground. -When the made-in-India iPhone 15s hit local stores on launch day, the moment sparked a wave of nationalist pride. “Proud and thrilled to own the MADE IN INDIA IPHONE 15.. #MakeInIndia,” [actor Ranganathan Madhavan posted on X](https://twitter.com/ActorMadhavan/status/1704941840875565070). +When the made-in-India iPhone 15s hit local stores on launch day, the moment sparked a wave of nationalist pride. “Proud and thrilled to own the MADE IN INDIA IPHONE 15.. `#MakeInIndia`,” [actor Ranganathan Madhavan posted on X](https://twitter.com/ActorMadhavan/status/1704941840875565070). At the factory, Foxconn threw a party. While assembly line workers remained bent over their workstations to produce more phones, engineers and office staff ate cake and other snacks while executives thanked them for their hard work. “It was like launching a rocket,” Li said. “After all the research and preparation, we finally sent the rocket into the sky.” diff --git a/00.03 News/Reuters, New York Times Top List of Fossil Fuel Industry’s Favorite Media Partners.md b/00.03 News/Reuters, New York Times Top List of Fossil Fuel Industry’s Favorite Media Partners.md new file mode 100644 index 00000000..3f1fcfcc --- /dev/null +++ b/00.03 News/Reuters, New York Times Top List of Fossil Fuel Industry’s Favorite Media Partners.md @@ -0,0 +1,155 @@ +--- + +Tag: ["🏕️", "🌞", "🗞️", "🛢️"] +Date: 2023-12-10 +DocType: "WebClipping" +Hierarchy: +TimeStamp: 2023-12-10 +Link: https://drilled.media/news/drilled-mediagreenwashing +location: +CollapseMetaTable: true + +--- + +Parent:: [[@News|News]] +Read:: 🟥 + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-ReutersTopListofOilIndustryFavoriteMediaNSave + +  + +# Reuters, New York Times Top List of Fossil Fuel Industry’s Favorite Media Partners + +*This story was co-reported with DeSmog and co-published by The Intercept and The Nation.* + +As she begins a recent episode of the podcast “Powered By How,” award-winning journalist Nisha Pillai talks about the difficulty of scaling innovation, then introduces her guests: a business psychologist, a renewable energy investor, and the head of an innovation lab. The guests go on to describe the complexities of climate change, the challenges to scaling any sort of technology, and what’s needed to engineer real solutions. + +It sounds like any other business or energy podcast, but each episode in this eight-part series is actually an ad. The casual listener could easily miss the first 5 seconds, set to jangly, stereotypically podcast-y music, when Pillai, a former BBC World News presenter whose voice instills instant confidence, announces that this is a podcast from Reuters Plus in partnership with Saudi Aramco. + +Pillai never explains that Reuters Plus is the internal ad studio at Reuters, not part of the newsroom. Nor does she remind listeners of the show’s sponsor when the head of the innovation lab, an Aramco executive, trots out the fossil fuel industry’s favorite line on climate: “We need to have collective action from all: government, industry, the developer of the technologies and the end consumer.” + +Reuters is one of at least seven major news outlets whose internal brand studio creates and publishes misleading promotional content for fossil fuel companies, according to a [new report](https://www.documentcloud.org/documents/24183641-drilleddesmog_mediagreenwashingreport) [released today.](https://www.documentcloud.org/documents/24182162-drilleddesmog_mediagreenwashingreport) Known as advertorials or native advertising, the sponsored material is created to look like a publication’s authentic editorial work, lending a veneer of journalistic credibility to the fossil fuel industry’s key climate talking points. + +In collaboration with The Intercept and The Nation, Drilled and DeSmog analyzed hundreds of advertorials and events, as well as ad data from Media Radar. Our analysis focused on the three years spanning October 2020 to October 2023, when the public ramped up calls for [media](https://www.worldwithoutfossilads.org/), [public relations, and advertising companies](https://cleancreatives.org/) to cut their commercial ties with fossil fuel clients amid growing awareness that the industry’s deceptive [messaging](https://ideas.repec.org/a/spr/climat/v159y2020i1d10.1007_s10584-019-02582-8.html) was slowing climate action. + +All of the media companies reviewed — *Bloomberg, The Economist, the Financial Times, the New York Times, Politico, Reuters,* and *The Washington Post* — consistently top lists of “most-trusted” news outlets. They also all have internal brand studios that create advertising content for major oil and gas companies, furnishing the industry with an air of legitimacy as it pushes misleading climate claims to trusting readers. In addition to podcasts, newsletters, and videos, some of these outlets allow fossil fuel companies to sponsor their events. Reuters goes even further; its events staff creates custom summits for the industry explicitly designed to remove the [“pain points” holding back faster production of oil and gas.](https://events.reutersevents.com/oilandgas/data-driven-usa)\[*Disclosure: Matthew Green previously worked as a climate reporter for Reuters*\] + +With United Nations climate talks underway in the United Arab Emirates, oil and gas companies have been sponsoring even more advertorials and events with media partners than usual, primarily designed to portray the industry as a climate leader. + +“It's really outrageous that outlets like *The New York Times* or *Bloomberg* or *Reuters* would lend their imprimatur to content that is misleading at best and in some cases outright false,” said Naomi Oreskes, a climate disinformation expert and professor at Harvard University. “They’re manufacturing content that at best is completely one-sided, and at worst is disinformation, and pushing that to their readers.” + +Spokespeople for *Bloomberg, the Financial Times, The New York Times, Reuters*, and *The Washington Post* told us that advertorial content is created by staff that are separate from the newsroom, and their journalists are independent from their ad sales efforts. (*Politico* and *The Economist* did not respond to requests for comment). But the independence of these outlets’ journalists is not in question; what’s important is whether readers understand the difference between reporting and advertising. According to a growing body of peer-reviewed research, they do not. + +A 2016 Georgetown University study, for example, found that advertorials are confused for “real” content by about [two thirds of people](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2816655). Another study, conducted in [2018 by Boston University researchers,](https://open.bu.edu/handle/2144/27308) found that only one in 10 people recognized native advertising as advertising, rather than reporting. In the context of climate change, the sponsored content often directly contradicts the news articles. + +Michelle Amazeen, the lead author on the Boston University study, found that those who did recognize sponsored content for what it was thought less of the outlet they were reading. “It tarnishes the reputation of that news outlet,” Amazeen said. “So it’s baffling to me why newsrooms are continuing to pursue this.” + +**“Crafting Your Climate Narrative”** + +This year’s 28th annual UN climate negotiations, known as the Conference of the Parties or COP28, is currently being held in Dubai, the largest city in one of the world’s top oil-producing countries. Presided over by Sultan Ahmed Al Jaber, the head of the UAE’s state-owned oil company, Adnoc, it is the most industry-influenced COP yet. + +Fossil fuel companies, including Adnoc, are seeking to preserve their business models by promoting carbon capture and storage, hydrogen power, and carbon offsets as viable climate solutions, despite the fact that these technologies are on track to do little more than extend the life of the fossil fuel industry. As COP28 president, Al Jaber has backed these technologies in the leadup to the summit. + +The enormous influence oil and gas executives are wielding at COP28 has thrown commercial partnerships between media outlets and the fossil fuel industry into sharper focus. Climate reporters at every outlet we analyzed have diligently covered the challenges that the industry’s so-called solutions face, but when that reporting is placed alongside corporate-sponsored content touting the technology’s benefits, it leaves readers confused. + +In addition to the Reuters Plus [podcast](https://plus.reuters.com/powered-by-how/p/1) produced this year for Aramco, which touts the benefits of industry-backed “innovations” like synthetic fuels and “non-metallic” drilling materials—both of which have the added benefit of creating new revenue streams for the company’s petrochemical business—The New York Times’ T Brand Studio also created [“The Energy Trilemma,”](https://www.nytimes.com/paidpost/bp/energy-trilemma.html) a 2022 podcast for BP about how high-emitting industries are decarbonizing, mostly through technology and not by reducing the development or use of fossil fuels. Bloomberg Media Studios, meanwhile, [created a video](https://www.youtube.com/watch?app=desktop&v=TbUOTqytvzE&t=48s) for ExxonMobil touting hydrogen power, as well as carbon capture and storage, or CCS. In the video, Exxon CEO Darren Woods says the company is “ready to deploy CCS to reduce the world’s emissions,” but leaves out the fact that the company also plans to increase annual carbon dioxide emissions by as much as the output of the entire nation of Greece — news [Bloomberg’s own climate reporters broke](https://www.bloomberg.com/news/articles/2020-10-05/exxon-carbon-emissions-and-climate-leaked-plans-reveal-rising-co2-output?sref=Ptu9QECN). + +Reuters Events also offered to help corporations hone their “climate narrative” at COP28, via opportunities to secure “exclusive interviews,” seats at high-level roundtables, coverage on the Reuters website, exclusive dinner invites, and a Reuters presence in corporate pavilions at the Dubai expo center where negotiations are held. + +![](https://imagedelivery.net/wTzk2S2Vnup17_3QtUMt7w/i51ce4ccf42fa88fe4fbdaa8b7d8f8cbb/public) + +The media plays a fundamental role in shaping both policymakers’ and the public’s understanding of climate issues. According to communications agency BCW’s [annual survey of media brands](https://www.bcw-global.com/newsroom/belgium/eu-media-poll-2022-politico-most-influential-media-for-eu-decision-makers) in Europe, Politico, Reuters, the Financial Times, and The Economist top the list of most influential media for European Union decision-makers. No surprise, then, that they are also amongst the fossil fuel industry’s favorite media partners. + +“The considerations around what is the role of carbon-based industry in partnering with media organizations is not too dissimilar to the debates and discussions around what kind of role the carbon-based industry interests have in the climate talks themselves,” said Max Boykoff, who contributed research and analysis to the most recent [climate mitigation report](https://www.ipcc.ch/report/ar6/wg3/) from the United Nations-backed Intergovernmental Panel on Climate Change, or IPCC. + +“People aren't picking up the IPCC report or peer-reviewed research to understand climate change,” he added. “People are reading about it in the news. That’s what shapes their understanding.” + +**“Gross, Undermining, and Dangerous”** + +News outlets’ in-house ad agencies haven’t just helped greenwash the fossil fuel industry’s preferred climate solutions in the leadup to COP28. Over the past three years, the Financial Times’ FT Commercial team has created dedicated web pages for various fossil majors, including [Equinor](https://equinor.ft.com/) and [Aramco](https://aramco.ft.com/), along with [native content](https://aramco.ft.com/how-one-industry-can-help-push-the-world-towards-net-zero) and [videos](https://equinor.ft.com/videos/carbon-removal-and-reduction?utm_source=FT&utm_medium=Premium_Native_Amplification), all focused on promoting oil and gas as a key component of the energy transition. FT’s recent Energy Transition Summit platformed talking points from executives at BP, Chevron, Eni, and Essar. At The Economist’s 2020 Sustainability Week event, BP featured as a platinum sponsor, while Petronas and Chevron sponsored the magazine’s [Future of Energy Week](https://events.economist.com/future-of-energy-week/sponsors/) in 2022. + +Politico is one of the most consistent publishing partners for the fossil fuel industry. Over the past three years, it has run native ads more than 50 times for the American Petroleum Institute, the most powerful fossil fuel lobby in the U.S.; organized 37 email campaigns for ExxonMobil; and sent dozens of newsletters sponsored by BP and Chevron, the latter of which also sponsors Politico’s annual “Women Rule” summit. Since 2017, Shell has sponsored every one of Politico’s Energy Visions events (and companion web series), which examines “the politics and issues driving the energy transition conversation.” + +According to data from Media Radar, The New York Times took in more than $20 million in revenue from fossil fuel advertisers from October 2020 to October 2023 — twice what any other outlet earned from the industry. That number is due largely to the paper’s relationship with Saudi Aramco, which brought in $13 million in ad revenue during that three-year period, via a combination of print, mobile, and video ads, as well as sponsored newsletters. + +The revenue figure does not include creative services fees paid to the Times’s internal brand studio. New York Time*s* spokesperson Alexis Mortenson said that the T Brand Studio creates custom content for fossil fuel advertisers in print, video, and digital, including podcasts, and promotes it to the New York Times audience via “dark social posts” — advertisements that cannot be found organically and do not appear on a brand's timeline. “We no longer allow organic social posts,” Mortenson noted. “Additionally, we allow fossil fuel advertisers to sponsor some newsletters. Fossil fuel advertisers, however, cannot sponsor any climate-related newsletter.” + +Climate reporters at these outlets, who requested anonymity to avoid professional repercussions, described the practice as “gross,” “undermining,” and “dangerous.” + +“Not only does it undermine the climate journalism these outlets are producing, but it actually signals to readers that climate change is not a serious issue,” one climate reporter said. + +Another journalist at a major media organization said the outlet had undermined its credibility by striking commercial deals with oil and gas companies with a long history of hiring public relations agencies to cast doubt on climate science. + +“Where is our integrity?” they said. “How can we expect people to take our climate coverage seriously after everything these oil companies have done to hide the truth?” + +**“Vast Sums of Money”** + +The fossil fuel industry’s attempts to extend its social license by buying friendly advertorials and other sponsored content date back to 1970, when Mobil Oil vice president of public affairs Herb Schmertz worked with the New York Times to create the first advertorial. The company proceeded to run these pieces, which Schmertz described as “political pamphlets,” in the Times every week for decades — a program that Mobil Oil extended to dozens of other outlets. The rest of the industry followed suit, and the practice has continued ever since. A peer-reviewed [2017 study](https://iopscience.iop.org/article/10.1088/1748-9326/aa815f) of Mobil and then ExxonMobil’s New York Times advertorials found that 81 percent of the ones that mentioned climate change emphasized doubt in the science. + +The advent of “brand studios” inside most major media outlets over the past decade has super-charged such content programs. Now many publications have staff dedicated to creating content for advertisers, and the outlets market their ability to tailor content to their readership. These offerings come at a higher cost than traditional ad buys, making them increasingly important to for-profit newsrooms facing a crisis in the traditional revenue models. And fossil fuel companies have been happy to pay. + +“They wouldn't be spending vast sums of money on these campaigns if they didn't have a payoff, and it’s well-documented that for decades the fossil fuel industry has leveraged and weaponized and innovated the media technology of the day to its advantage,” said University of Miami researcher Geoffrey Supran, a co-author of the 2017 advertorial study with Oreskes. “It’s sometimes treated as a historical phenomenon, but in reality we’re living today with the digital descendants of the editorial campaigns pioneered by the fossil-fuel industry — the old strategy is very much alive and well.” + +Taking a page from Schmertz’s book, [The Washington Post Creative Group](https://www.washingtonpost.com/creativegroup/archive/) — the paper’s internal brand studio — describes on its website how it goes about “influencing the influencers.” + +![](https://imagedelivery.net/wTzk2S2Vnup17_3QtUMt7w/i524b9b3e1c7f6ca73cfc2af555ef2c59/public) + +In 2022 alone, ExxonMobil sponsored more than 300 editions of Washington Post newsletters. Throughout [2020](https://www.washingtonpost.com/creativegroup/sponsor/api/) and [2021](https://www.washingtonpost.com/creativegroup/sponsor/americanpetroleuminstitute/), it also ran a series of editorials for the American Petroleum Institute on its website, including [a multimedia piece](https://www.washingtonpost.com/brand-studio/api-why-natural-gas-will-thrive-in-the-age-of-renewables/) that argued fossil gas is a complement to renewable energy and repeated claims that renewable energy is unreliable — talking points that the paper’s news reporters [often](https://www.washingtonpost.com/world/2022/02/02/green-energy-gas-nuclear-taxonomy/) [debunk.](https://www.washingtonpost.com/weather/2022/02/20/texas-energy-winter-renewable-jacobson-dessler-rogan/) During this time, the Washington Post editorial team published [Pulitzer prize-winning climate reporting](https://www.washingtonpost.com/pr/2020/05/04/washington-post-wins-2020-pulitzer-prize-explanatory-reporting-groundbreaking-climate-change-coverage/) and [expanded its climate coverage](https://www.washingtonpost.com/climate-environment/2022/11/28/introducing-posts-expanded-climate-coverage/). + +**Reuters tops the list** + +Of all the outlets we reviewed, only Reuters offers fossil fuel advertisers every possible avenue to reach its audience. Its event arm even produces custom events for the industry, despite counting “freedom from bias” as a core pillar of its “[Trust Principles](https://matthewgreenglobal.substack.com/p/processing-my-reuters-climate-karma),” which were adopted to protect the publication’s independence during World War II. + +Since Reuters News, a subsidiary of Canadian media conglomerate Thomson Reuters, [acquired](https://www.reuters.com/article/us-fcbi-m-a-thomsonreuters-idUSKBN1WJ0ZW) an events business in 2019, the distinction between the company’s newsroom and its commercial ventures has become increasingly [blurred](https://matthewgreenglobal.substack.com/p/processing-my-reuters-climate-karma). Reuters’ in-house creative studio produces native print, audio, video, and newsletter content for multiple oil majors, including [Shell](https://www.reuters.com/plus/shell/collaboration-counts), [Saudi Aramco](https://plus.reuters.com/powered-by-how/), and [BP](https://www.reutersagency.com/en/reuters-plus/bp-energy-outlook-2019/), while Reuters journalists routinely take part as moderators and interviewers and propose guest speakers for Reuters Events. + +In a [media kit](https://www.documentcloud.org/documents/24042466-reutersmediakit) for “content opportunities in the upstream industry,” Reuters Events staff offers to produce webinars, whitepapers, and live-event interviews for those hoping to get in front of its “unrivalled audience reach of decision makers in the oil & gas industry.” For its Hydrogen 2023 event, Reuters Events produced [a companion whitepaper](https://www.documentcloud.org/documents/24042318-reuters_hydrogen2023_whitepaper-1) on the top 100 hydrogen innovators, which it then used to market the event in various other outlets. Topping the list of innovators were key event sponsors, Chevron and Shell. + +Reuters Events also stages [fossil fuel industry trade shows](https://events.reutersevents.com/petchem/downstream-usa/exhibition) aimed at maximizing production of oil and gas, and it creates digital events and webinars for vendors in the fossil fuel supply chain looking to connect with oil and gas companies. In June 2023, Reuters Events convened hundreds of oil, gas, and tech executives in Houston for “[Reuters Events Data-driven Oil & Gas USA 2023](https://events.reutersevents.com/oilandgas/data-driven-usa/become-sponsor),” a conference held under the banner “Scaling Digital to Maximize Profit.” + +“Time is money, which is why our agenda gets straight to key pain points holding back drilling and production maximization,” the conference website said. + +Reuters has also partnered with Chevron, the “diamond” sponsor of both its flagship Reuters Impact climate event in London in September 2023 and its Global Energy Transition Summit in New York this coming June 2024. + +In December 2022, Reuters ran [an event](https://events.reutersevents.com/impact/ogci) sponsored by t[he Oil and Gas Climate Initiative,](https://desmog.com/oil-and-gas-climate-initiative) a lobby group which includes many of the world’s largest oil companies, to discuss the “major part” fossil fuel companies “play in ensuring a sustainable energy transition.” During the event, industry talking points were tweeted directly from the [Reuters Events Twitter account.](https://twitter.com/reutersevents/status/1585999153540530176) + +![](https://imagedelivery.net/wTzk2S2Vnup17_3QtUMt7w/if6634f2da16ccfb9ee03290e146bad94/public) + +A Reuters spokesperson said its Reuters Plus studio allows companies to connect with audiences attending Reuters Events via clearly labelled sponsored content. + +"Reuters Events serves multiple professional audiences involved in the most important discussions of our day; facilitating these discussions is an important part of the Reuters Events business," the spokesperson said. + +“Business-to-business publishers always had an events revenue stream, but consumer-facing news publications didn’t really get into the events business until digital advertising became commodified,” media analyst Ken Doctor said. Now, events represent 20 to 30 percent of revenue for some publications. Doctor called them a “thought-leader exercise” for the advertisers. “There are only a few top media brands out there, and if you are associated with any of them, there is a lot of tangential brand building benefit to that.” + +The additional revenue may come at a reputational cost for news outlets. After seeing the scope of Reuters’ involvement with the fossil fuel industry, we wondered how an outlet that’s producing events for fossil fuel companies, aimed at increasing oil and gas development, could qualify for membership in [Covering Climate Now](https://coveringclimatenow.org/), an organization that offers newsrooms the opportunity to “demonstrate leadership among their peers — and to show readers, listeners and viewers that they’re committed to telling the climate story with the rigor, focus, and urgency it deserves.” + +“Covering Climate Now has had no communication with Reuters about any activities backing faster development of fossil fuels,” Mark Hertsgaard, the executive director of Covering Climate Now, said in a written statement. \[Disclosure: Amy Westervelt is a member of the steering committee of Covering Climate Now, of which both Drilled and DeSmog are members.\] + +“Covering Climate Now has always taken a big-tent approach to our partnership with news organizations. This story raises serious questions about news media responsibility in climate reporting, and Covering Climate Now plans to think more deeply about these questions and how we might adjust our policies going forward.” + +Journalism is facing a crisis, and in the midst of declining revenues, trailing subscriptions, and shuttering newsrooms, outlets should be considering new ways to fund their work. But experts say that the seemingly wholesale embrace of powerful industries that we’re seeing from some of the world’s most trusted names in news requires a much more rigorous conversation than these outlets seem interested in having. + +“In theory, these complaints \[around advertorials\] could possibly be addressed with better labeling and smarter design,” Jay Rosen, journalism professor at New York University, said. “But if you're saying that even when they are properly labeled and carefully set off from the real journalism, these advertorials weaken trust and miscommunicate about climate change, that is a problem that cannot be solved within the industry consensus around sponsored content. It’s implicitly calling for a new consensus.” + +As their content marketing about the journey to net zero continues to get bigger and better, oil majors’ investments in fossil fuel development have only increased. A [peer-reviewed study](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0263596) comparing oil majors’ advertising claims and actions, published in the journal *Plos One* in 2022, found that while the companies are talking more than ever about energy transition and decarbonization, they are not actually investing in either. “The companies are pledging a transition to clean energy and setting targets more than they are making concrete actions,” the study’s authors wrote. + +Reporters at the publications we reviewed often cover this disconnect between advertising and action, challenging fossil fuel companies’ claims. Their employers, however, then sell the space next to those stories for industry-sponsored takes that research shows many readers take equally as seriously. + +“I feel like it's really important not to beat around the bush and to just recognize these activities for what they are, which is literally Big Oil and mainstream media collaborating in PR campaigns for the industry,” said Supran, the University of Miami researcher. “It’s nothing short of that.” + +*Joey Grostern also contributed reporting to this story.* + +  +  + +--- +`$= dv.el('center', 'Source: ' + dv.current().Link + ', ' + dv.current().Date.toLocaleString("fr-FR"))` \ No newline at end of file diff --git a/00.03 News/Taylor Swift Is TIME's 2023 Person of the Year.md b/00.03 News/Taylor Swift Is TIME's 2023 Person of the Year.md new file mode 100644 index 00000000..47020946 --- /dev/null +++ b/00.03 News/Taylor Swift Is TIME's 2023 Person of the Year.md @@ -0,0 +1,219 @@ +--- + +Tag: ["🎭", "🎶", "🎤", "🇺🇸", "👤", "🗞️"] +Date: 2023-12-10 +DocType: "WebClipping" +Hierarchy: +TimeStamp: 2023-12-10 +Link: https://time.com/6342806/person-of-the-year-2023-taylor-swift/ +location: +CollapseMetaTable: true + +--- + +Parent:: [[@News|News]] +Read:: 🟥 + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-TaylorSwiftIsTIMEs2023PersonoftheYearNSave + +  + +# Taylor Swift Is TIME's 2023 Person of the Year + +Taylor Swift is telling me a story, and when [Taylor Swift](https://time.com/collection/100-most-influential-people-2019/5567666/taylor-swift/) tells you a story, you listen, because you know it’s going to be good—not only because she’s had an extraordinary life, but because she’s an extraordinary storyteller. This one is about a time she got her heart broken, although not in the way you might expect. + +She was 17, she says, and she had booked the biggest opportunity of her life so far—a highly coveted slot opening for country superstar Kenny Chesney on tour. “This was going to change my career,” she remembers. “I was so excited.” But a couple weeks later, Swift arrived home to find her mother Andrea sitting on the front steps of their house. “She was weeping,” Swift says. “Her head was in her hands as if there had been a family emergency.” Through sobs, Andrea told her daughter that Chesney’s tour had been sponsored by a beer company. Taylor was too young to join. “I was devastated,” Swift says.  + +But some months later, at Swift’s 18th birthday party, she saw Chesney’s promoter. He handed her a card from Chesney that read, as Swift recalls, “I’m sorry that you couldn’t come on the tour, so I wanted to make it up to you.” With the note was a check. “It was for more money than I’d ever seen in my life,” Swift says. “I was able to pay my band bonuses. I was able to pay for my tour buses. I was able to fuel my dreams.” + +![](https://api.time.com/wp-content/uploads/2023/12/SWIFT.FINAL_.COVER3_.jpg?quality=75&w=2400) + +Photograph by Inez and Vinoodh for TIME + +Listening to Swift share this, on a clear fall afternoon in her New York City apartment, I’m struck by how satisfying the story is. There are high stakes at the outset; there are details, vivid and sensory; there’s a twist that flips the action on its head; and there’s a happy ending for its hero. It takes her only about 30 seconds to recount this, but those 30 seconds contain an entire narrative world. + +[*Buy the Taylor Swift Person of the Year issue here*](https://magazineshop.us/products/time-person-of-the-year/?utm_source=TIME-Email&utm_medium=Client-Title-Email&utm_campaign=231201_Time-Person-of-the-Year-Email&utm_content=Time-Email-Landing-Time-Person-of-the-Year-Product-Page) + +I’m not surprised. Swift has a preternatural skill for finding the story. Her anecdote about Chesney symbolizes a larger narrative in Swift’s life, one about redemption—where our protagonist discovers new happiness not despite challenges, but because of them. Swift, as we’ll discuss, took a few hits to get here. “I’ve been raised up and down the flagpole of public opinion so many times in the last 20 years,” she says as we tuck into a cozy den off the kitchen to talk, and she kicks off her shoes and curls up onto the sofa. “I’ve been given a tiara, then had it taken away.” She is seemingly unguarded in conversation, reflective about both where she’s been and where she finds herself now. After all, while she’s long been one of the biggest entertainers in the world, this year is different. “It feels like the breakthrough moment of my career, happening at 33,” she says. “And for the first time in my life, I was mentally tough enough to take what comes with that.” This is her story—even if she’s now so high that it’s hard to believe she was ever low. + +![](https://api.time.com/wp-content/uploads/2023/12/SWIFT.FINAL_.COVER2_.jpg?quality=75&w=2400) + +Photograph by Inez and Vinoodh for TIME + +Swift’s accomplishments as an artist—culturally, critically, and commercially—are so legion that to recount them seems almost beside the point. As a pop star, she sits in rarefied company, alongside Elvis Presley, Michael Jackson, and Madonna; as a songwriter, she has been compared to Bob Dylan, Paul McCartney, and Joni Mitchell. As a businesswoman, she has built an empire worth, by some estimates, over $1 billion. And as a celebrity—who by dint of being a woman is scrutinized for everything from whom she dates to what she wears—she has long commanded constant attention and knows how to use it. (“I don’t give Taylor advice about being famous,” Stevie Nicks tells me. “She doesn’t need it.”) But this year, something shifted. To discuss her movements felt like discussing politics or the weather—a language spoken so widely it needed no context. She became the main character of the world. + +If you’re skeptical, consider it: How many conversations did you have about Taylor Swift this year? How many times did you see a photo of her while scrolling on your phone? Were you one of the people who made a pilgrimage to a city where she played? Did you buy a ticket to her concert film? Did you double-tap an Instagram post, or laugh at a tweet, or click on a headline about her? Did you find yourself humming “[Cruel Summer](https://time.com/6287902/cruel-summer-taylor-swift-single/)” while waiting in line at the grocery store? Did a friend confess that they watched clips of the [Eras Tour](https://time.com/6341858/taylor-swift-eras-tour-movie-streaming/) night after night on TikTok? Or did you? + +![](https://api.time.com/wp-content/uploads/2023/12/SWIFT.FINAL_.COVER1_.jpg?quality=75&w=2400) + +Photograph by Inez and Vinoodh for TIME + +Her epic career-retrospective tour recounting her artistic “eras,” which played 66 dates across the Americas this year, is projected to become the biggest of all time and the first to gross over a billion dollars; analysts talked about the “Taylor effect,” as politicians from Thailand, Hungary, and Chile implored her to play their countries. Cities, stadiums, and streets were renamed for her. Every time she came to a new place, a mini economic boom took place as hotels and restaurants saw a surge of visitors. In [releasing her concert movie](https://time.com/6323858/taylor-swift-the-eras-tour-movie-review/), Swift bypassed studios and streamers, instead forging an unusual pact with AMC, giving the theater chain its highest single-day ticket sales in history. There are at least 10 college classes devoted to her, including one at Harvard; the professor, Stephanie Burt, tells TIME she plans to compare Swift’s work to that of the poet William Wordsworth. Friendship bracelets traded by her fans at concerts became a hot accessory, with one line in a song causing as much as a 500% increase in sales at craft stores. When Swift started dating Travis Kelce, the Kansas City Chief and two-time Super Bowl champion, his games saw a massive increase in viewership. (Yes, she somehow made one of America’s most popular things—football—even more popular.) And then there’s her critically hailed songbook—a catalog so beloved that as [she rereleases it](https://time.com/5949979/why-taylor-swift-is-rerecording-old-albums/), she’s often breaking chart records she herself set. She’s the last monoculture left in our stratified world. + +It’s hard to see history when you’re in the middle of it, harder still to distinguish Swift’s impact on the culture from her celebrity, which emits so much light it can be blinding. But something unusual is happening with Swift, without a contemporary precedent. She deploys the most efficient medium of the day—the pop song—to tell her story. Yet over time, she has harnessed the power of the media, both traditional and new, to create something wholly unique—a narrative world, in which her music is just one piece in an interactive, shape-shifting story. Swift is that story’s architect and hero, protagonist and narrator. + +![](https://api.time.com/wp-content/uploads/2023/12/taylor-swift-person-of-the-year.jpg?quality=75&w=2400) + +Inez and Vinoodh for TIME + +This was the year she perfected her craft—not just with her music, but in her position as the master storyteller of the modern era. The world, in turn, watched, clicked, cried, danced, sang along, swooned, caravanned to stadiums and movie theaters, let her work soundtrack their lives. For Swift, it’s a peak. “This is the proudest and happiest I’ve ever felt, and the most creatively fulfilled and free I’ve ever been,” Swift tells me. “Ultimately, we can convolute it all we want, or try to overcomplicate it, but there’s only one question.” Here, she adopts a booming voice. *“Are you not entertained?”* + +--- + +**A few months before** I sit with Swift in New York, on a summer night in Santa Clara, Calif., which has been temporarily renamed Swiftie Clara in her honor, I am in a stadium with nearly 70,000 other people having a religious experience. The crowd is rapturous and Swift beatific as she gazes out at us, all high on the same drug. Her fans are singularly passionate, not just in the venue but also online, as they analyze clues, hints, and secret messages in everything from her choreography to her costumes—some deliberately planted, others not. (“Taylor Swift fans are the modern-day equivalent of those cults who would consistently have inaccurate rapture predictions like once a month,” [as one viral tweet noted](https://twitter.com/Coll3enG/status/1582520477175533568).) + +[*Subscribe now and get the Person of the Year issue*](http://time.com/subscribe) + +Standing in the arena, it’s not hard to understand why this is the biggest thing in the world. “Beatlemania and *Thriller* have nothing on these shows,” says Swift’s friend and collaborator Phoebe Bridgers. Fans in Argentina pitched tents outside the venue for months to get prime spots, with some quitting their jobs to commit to fandom full time. Across the U.S., others lined up for days, while those who didn’t get in “Taylor-gated” in nearby parking lots so they could pick up the sound. When tickets went on sale last year, Ticketmaster crashed. Although 4.1 million tickets were sold for the 2023 shows—including over 2 million on the first day, a new record—scalpers jacked up prices on the secondary market to more than $22,000. Multiple fans filed lawsuits. The Justice Department moved forward with an investigation. The [Senate held a hearing](https://time.com/6249730/ticketmaster-taylor-swift-hearing-congress/). Given these stakes, Swift had to deliver. + +![](https://api.time.com/wp-content/uploads/2023/12/taylor-swift-person-of-the-year-senate-ticketmaster.jpg?quality=75&w=2400) + +Ticketmaster and Live Nation executives testified at a Senate hearing after demand for tickets overwhelmed the siteAl Drago—Bloomberg/Getty Images + +“I knew this tour was harder than anything I’d ever done before by a long shot,” Swift says. Each show spans over 180 minutes, including 40-plus songs from at least nine albums; there are 16 costume changes, pyrotechnics, an optical illusion in which she appears to dive into the stage and swim, and not one but two cottagecore worlds, which feature an abundance of moss. + +In the past, Swift jokes, she toured “like a frat guy.” This time, she began training six months ahead of the first show. “Every day I would run on the treadmill, singing the entire set list out loud,” she said. “Fast for fast songs, and a jog or a fast walk for slow songs.” Her gym, Dogpound, created a program for her, incorporating strength, conditioning, and weights. “Then I had three months of dance training, because I wanted to get it in my bones,” she says. “I wanted to be so over-rehearsed that I could be silly with the fans, and not lose my train of thought.” She worked with choreographer Mandy Moore—recommended by her friend Emma Stone, who worked with Moore on *La La Land*—since, as Swift says, “Learning choreography is not my strong suit.” With the exception of Grammy night—which was “hilarious,” she says—she also stopped drinking. “Doing that show with a hangover,” she says ominously. “I don’t want to know that world.” + +**Read More:** *[Taylor Swift Shares Her Eras Tour Workout and Self-Care Regimen](https://time.com/6343028/taylor-swift-workout-routine-eras-tour/)* + +Swift’s arrival in a city energized the local economy. When Eras kicked off in Glendale, Ariz., she generated more revenue for its businesses than the 2023 Super Bowl, which was held in the same stadium. Fans flew across the country, stayed in hotels, ate meals out, and splurged on everything from sweatshirts to limited-edition vinyl, with the average Eras attendee reportedly spending nearly $1,300. Swift sees the expense and effort incurred by fans as something she needs to repay: “They had to work really hard to get the tickets,” she says. “I wanted to play a show that was longer than they ever thought it would be, because that makes me feel good leaving the stadium.” The “Taylor effect” was noticed at the highest levels of government. “When the Federal Reserve mentions you as the reason economic growth is up, that’s a big deal,” says Ed Tiryakian, a finance professor at Duke University.  + +Carrying an economy on your back is a lot for one person. After she plays a run of shows, Swift takes a day to rest and recover. “I do not leave my bed except to get food and take it back to my bed and eat it there,” she says. “It’s a dream scenario. I can barely speak because I’ve been singing for three shows straight. Every time I take a step my feet go *crunch, crunch, crunch* from dancing in heels.” Maintaining her strength through workouts between shows is key. “I know I’m going on that stage whether I’m sick, injured, heartbroken, uncomfortable, or stressed,” she says. “That’s part of my identity as a human being now. If someone buys a ticket to my show, I’m going to play it unless we have some sort of force majeure.” (A heat wave in Rio de Janeiro caused chaos during Swift’s November run as one fan, Ana Clara Benevides Machado, reportedly collapsed during the show and later died; Swift wrote on Instagram that she had a “shattered heart.” She rescheduled the next show because of unsafe conditions, and spent time with Benevides Machado’s family at her final tour date in Brazil.) + +![Taylor Swift Tour Rehearsal](https://api.time.com/wp-content/uploads/2023/12/taylor-swift-person-of-the-year-tour-rehearsal.jpg?quality=75&w=2400) + +Swift told TIME she started training six months in advance of the Eras Tour, which kicked off in MarchCourtesy TAS Rights Management + +Swift is many things onstage—vulnerable and triumphant, playful and sad—but the intimacy of her songcraft is front and center. “Her work as a songwriter is what speaks most clearly to me,” says filmmaker Greta Gerwig, whose feminist *Barbie* was its own testament to the idea that women can be anything. “To write music that is from the deepest part of herself and have it directly speak into the souls of other people.” As Swift whips through the eras, she’s not trying to update her old songs, whether the earnest romance of “You Belong With Me” or the millennial ennui of “22,” so much as she is embracing them anew. She’s modeling radical self-acceptance on the world’s largest stage, giving the audience a space to revisit their own joy or pain, once dismissed or forgotten. I tell Swift that the show made me think of a meme that says, “Do not kill the part of you that is cringe—kill the part of you that cringes.” “Yes!” she exclaims. “Every part of you that you’ve ever been, every phase you’ve ever gone through, was you working it out in that moment with the information you had available to you at the time. There’s a lot that I look back at like, ‘Wow, a couple years ago I might have cringed at this.’ You should celebrate who you are now, where you’re going, and where you’ve been.” + +**Read More:** *[How We Chose Taylor Swift as TIME's 2023 Person of the Year](https://time.com/6342816/person-of-the-year-2023-taylor-swift-choice/)* + +Getting to this place of harmony with her past took work; there’s a dramatic irony, she explains, to the success of the tour. “It’s not lost on me that the two great catalysts for this happening were two horrendous things that happened to me,” Swift says, and this is where the story takes a turn. “The first was getting canceled within an inch of my life and sanity,” she says plainly. “The second was having my life’s work taken away from me by someone who hates me.” + +--- + +**Swift shows me** some things she loves in her apartment: a Stevie Nicks Barbie that sits still boxed in her kitchen, sent to her by the artist; the framed note from Paul McCartney that hangs in her bathroom; tiles around the fireplace that Swift found shopping in Paris with her mother. Connections to her family are everywhere, including a striking photo of her grandmother Marjorie, an opera singer and the inspiration for a track on her album *evermore.* Swift grew up on a Christmas-tree farm in Pennsylvania, with her younger brother Austin; her father Scott was a stockbroker at Merrill Lynch, and Andrea worked in marketing. Her family still works closely with her today. “My dad, my mom, and my brother come up with some of the best ideas in my career,” Swift says. “I always joke that we’re a small family business.” + +![](https://api.time.com/wp-content/uploads/2023/12/taylor-swift-person-of-the-year-family-commencement.jpg?quality=75&w=2400) + +Austin, Andrea, and Scott Swift with Taylor at NYU graduation in 2022 where she received an honorary Doctorate of Fine ArtsCourtesy TAS Rights Management + +After moving to Nashville as a teen, she signed with Scott Borchetta’s Big Machine Records. Swift’s songwriting ability was evident from the first lyrics of “Tim McGraw,” her debut single: “He said the way my blue eyes shined put those Georgia stars to shame that night—I said, ‘That’s a lie.’” Even for country music these lyrics are literary—conjuring a romantic fantasy, then deflating it a line later. The fairy-tale promise of love and intimacy became a runner in Swift’s work as a songwriter, something she’d repeatedly espouse, then skewer; she was self-aware about the role narrative played in her expectations. She was seen as a gifted pop-country ingenue when, in a now infamous moment, Kanye West interrupted Swift onstage at the 2009 VMAs while she was accepting an award. The incident set in motion a chain of events that would shape the next decade of both artists’ lives.  + +It was around that time, Swift remembers now, that she began trying to shape-shift. “I realized every record label was actively working to try to replace me,” she says. “I thought instead, I’d replace myself first with a new me. It’s harder to hit a moving target.” Swift wrote songs solo, incorporated diverse sonic influences, and placed more clues about personal relationships in her lyrics and album materials for fans to decode. Her epic ballad “All Too Well,” from 2012’s *Red,* epitomizes Swift’s superpower as a songwriter, deploying tossed-off details like a forgotten scarf that comes back at the song’s end to stab you in the heart—but it also had a secret message hidden in the liner notes. When an extended version of the song hit No. 1 last year upon its rerelease, it wasn’t only because the song is extraordinary, but because it has its own lore, like Carly Simon’s “You’re So Vain” if it came with an experiential puzzle for fans to solve. “She’s like a whole room of writers as one person, with that voice and charisma,” Bridgers says. “She’s everything at once.” + +[](https://timecoverstore.com/collections/2023+person+of+the+year)[*Buy a print of the Person of the Year covers now*](https://timecoverstore.com/collections/2023+person+of+the+year) + +Swift knew she had to keep innovating. “By the time an artist is mature enough to psychologically deal with the job, they throw you out at 29, typically,” she says. “In the ’90s and ’00s, it seems like the music industry just said: ‘OK, let’s take a bunch of teenagers, throw them into a fire, and watch what happens. By the time they’ve accumulated enough wisdom to do their job effectively, we’ll find new teenagers.’” She went [full-throttle pop for 2014’s *1989*](https://time.com/6328790/taylor-swift-1989-2/)*,* putting her [on top of the world](https://time.com/3583129/power-of-taylor-swift-cover/)—“an imperial phase,” she calls it. She didn’t realize it would also give her much farther to fall. Public sentiment turned—sniping about everything from her perceived overexposure to conspiracy theories about her politics. “I had all the hyenas climb on and take their shots,” she says. West wrote a song with vulgar lyrics about her, and claimed that Swift had consented to it, which Swift denied; West’s then wife, Kim Kardashian, released a video of a conversation between West and Swift that seemed to indicate that Swift had been on board with the song. The scandal was tabloid catnip; it made Swift look like a snake, which is what people called her. She felt it was “a career death,” she says. “Make no mistake—my career was taken away from me.” + +![](https://api.time.com/wp-content/uploads/2023/12/taylor-swift-person-of-the-year-4.jpg?quality=75&w=2400) + +Inez and Vinoodh for TIME + +It was a bleak moment. “You have a fully manufactured frame job, in an illegally recorded phone call, which Kim Kardashian edited and then put out to say to everyone that I was a liar,” she says. “That took me down psychologically to a place I’ve never been before. I moved to a foreign country. I didn’t leave a rental house for a year. I was afraid to get on phone calls. I pushed away most people in my life because I didn’t trust anyone anymore. I went down really, really hard.” (Kardashian wrote, in a 2020 social media post, that the situation “forced me to defend him.”) Swift’s next album, 2017’s *Reputation,* featured snake imagery; the video for “Look What You Made Me Do” saw her killing off younger versions of herself. She remembers *Reputation* being met with uproar and skepticism. “I thought that moment of backlash was going to define me negatively for the rest of my life,” she says. She had also satisfied her record deal with Borchetta, and knew she wanted out. “The molecular chemistry of that old label was that every creative choice I wanted to make was second-guessed,” she says. “I was really overthinking these albums.” + +She met with Lucian Grainge, the CEO of Universal Music Group, and Monte Lipman, who runs Universal’s top label Republic Records, to talk about signing a deal that would give her more agency. Today, Grainge is perhaps the most powerful executive in the music industry, but, as I sit with him in his office in Los Angeles, he describes himself as an “old punk” who operates on instinct more than metrics. He told Swift, he says, “We will utilize everything that we’ve got as a company for you.” Swift felt like she’d been given carte blanche: “Lucian and Monte basically said to me, ‘Whatever you turn in, we will be proud to put out. We give you 100% creative freedom and trust.’” It was exactly what she needed to hear most when the chips were down. + +Yet the release of Swift’s first album with Republic, 2019’s *[Lover](https://time.com/5651207/taylor-swift-lover-songs-explained/),* coincided with the second big upheaval in her professional life: Borchetta had sold Big Machine—and with it, Swift’s catalog, valued then at a reported $140 million—to Ithaca Holdings, which is owned by music manager Scooter Braun, a former ally of West’s. “With the Scooter thing, my masters were being sold to someone who actively wanted them for nefarious reasons, in my opinion,” Swift says. (“It makes me sad that Taylor had that reaction to the deal,” Braun told *Variety* in 2021.) The sale meant that the [rights to Swift’s first six albums](https://time.com/5618336/taylor-swift-scooter-braun-masters/) moved to Braun, so whenever someone wanted to license one of those songs, he would be the one to profit. Swift rallied her fans against the deal, but still felt powerless. “I was so knocked on my ass by the sale of my music, and to whom it was sold,” she says. “I was like, ‘Oh, they got me beat now. This is it. I don’t know what to do.’” She went back to work, using the pandemic lockdown to pare back her sound on critically acclaimed albums *[folklore](https://time.com/5871159/taylor-swift-folklore-explained/)* and *[evermore](https://time.com/5920105/taylor-swift-evermore/).* + +Around the same time, she started thinking about rerecording her old albums in an effort to wrest back control. “I’d run into Kelly Clarkson and she would go, ‘Just redo it,’” Swift says. “My dad kept saying it to me too. I’d look at them and go, ‘How can I possibly do that?’ Nobody wants to redo their homework if on the way to school, the wind blows your book report away.” Since Swift wrote her own songs, she retained the musical composition copyright and could rerecord them. She also negotiated to own the master rights for her material when she moved over to Republic in 2018, so she now owns her new material and the rerecorded songs. (Major labels have since made it more difficult for artists to rerecord their music.) She began rerecording subtly different versions of her old albums, tagging them “(Taylor’s Version)” and adding unreleased tracks to redirect listenership to them. She frames the strategy as a coping mechanism. “It’s all in how you deal with loss,” she says. “I respond to extreme pain with defiance.” + +![](https://api.time.com/wp-content/uploads/2023/12/taylor-swift-person-of-the-year-eras-tour.jpg?quality=75&w=2400) + +Swift performs at Foro Sol in Mexico City on Aug. 24Hector Vivas—TAS23/Getty Images for TAS Rights Management + +Grainge calls the rerecording project “bizarrely brilliant and unique”—something that only an artist at her level could pull off. “It’s got such a narrative—there’s a reason for it.” He shakes his head. “Imagine Picasso painting something that he painted a few years ago, then re-creating it with the colors of today.” Part of the success story, Swift says, is the freedom she received from the label to follow her instincts. “If you look at what I’ve put out since then, it’s more albums in the last few years than I did in the first 15 years of my career,” she says. That prolific output has fueled her ascension. “She could serve two terms as President of the United States and then go to Las Vegas,” Grainge says. “Who else can do that?”  + +In the grand narrative of Swift’s life, as she rose this year, her foes’ fortunes also seemed to turn. Over the summer, it was reported that several of Braun’s key clients—chief among them Justin Bieber and Ariana Grande—were no longer being managed by his company, while West’s antisemitic and other offensive remarks led to his losing key endorsement deals. Swift knows firsthand that fame is a seesaw. “Nothing is permanent,” she says. “So I’m very careful to be grateful every second that I get to be doing this at this level, because I’ve had it taken away from me before. There is one thing I’ve learned: My response to anything that happens, good or bad, is to keep making things. Keep making art.” She considers. “But I’ve also learned there’s no point in actively trying to quote unquote defeat your enemies,” she says. “Trash takes itself out every single time.” + +--- + +**The premiere for** Swift’s concert film takes place at the Grove, an outdoor mall in Los Angeles, which has been shut down for the event; Swift has packed 13 screens with thousands of fans. She goes, one by one, to each theater thanking sobbing audience members for being there. Like the tour, the film, which was released directly to theaters without a traditional partner, is an event. “We met with all the studios,” she tells me, “and we met with all the streamers, and we sized up how it was perceived and valued, and if they had high hopes and dreams for it. Ultimately I did what I tend to do more and more often these days, which is to bet on myself.” She credits her father with the idea. “He just said, why does there have to be a—for lack of a better word—middleman?” + +**Read More:** *['I Bet on Myself.' How Taylor Swift's Deal With AMC Came Together](https://time.com/6342992/taylor-swift-amc-eras-tour-movie-deal/)* + +In the theater excitement ripples through the crowd, a mix of fans and Swift’s friends, as we wait for her. To my left are two dedicated Swifties, sisters who introduce themselves as Madison, 23, and McCall, 20, and who are still reeling from taking a selfie with Swift on the red carpet. Their wrists are covered in friendship bracelets, some of which are deep cuts—such as no it’s BECKY, a reference to a beloved Tumblr meme, and BLEACHELLA STAN, for Swift’s 2016 platinum blond bob—and Madison reveals a tattoo on her forearm that says “Taylor’s Version.” Both tell me their favorite album is *Reputation.* They are my favorite people I have ever met, and I want to talk to only them for the rest of my life. Madison admires Swift for her vulnerability—“which is insane, when she’s under endless scrutiny”—while McCall cites her consistency, which she calls “a lost art form.” When I ask how McCall feels about Swift’s romantic life, she fields the question elegantly. “It’s a disservice to her to focus on that stuff,” she says. “She’s so good at making her personal experience relate to millions of people. When I listen to her songs, I think about what I’ve been through—not what she’s been through.” + +Swift’s private life has long served as both grist for the tabloid mill and inspiration for her own work; she split from her longtime boyfriend, actor Joe Alwyn, earlier this year. Most recently, she’s been dating the [NFL star Travis Kelce](https://time.com/6317898/travis-kelce-taylor-swift-relationship/), as has been well documented when she attends his games. “I don’t know how they know what suite I’m in,” she says. “There’s a camera, like, a half-mile away, and you don’t know where it is, and you have no idea when the camera is putting you in the broadcast, so I don’t know if I’m being shown 17 times or once.” She is sensitive to the attention that’s put on her when she shows up. “I’m just there to support Travis,” she says. “I have no awareness of if I’m being shown too much and pissing off a few dads, Brads, and Chads.” + +![](https://api.time.com/wp-content/uploads/2023/12/taylor-swift-person-of-the-year-nfl.jpg?quality=75&w=2400) + +After playing Kansas City in July, Swift returned in October to support her boyfriend, Chiefs star Travis KelceDavid Eulitt—Getty Images + +I point out that it’s a net positive for the NFL to have a few Swifties watching. “Football is awesome, it turns out,” Swift says playfully. “I’ve been missing out my whole life.” (A [game she attended in October](https://time.com/6319422/taylor-swift-travis-kelce-nfl-tv/) was the most-watched Sunday show since the Super Bowl.) + +Given her complex history with public interest in her dating life, I say, it seems noteworthy that her relationship with Kelce has played out so publicly. Swift gently pushes back: “This all started when Travis very adorably put me on blast on his podcast, which I thought was metal as hell,” she says. “We started hanging out right after that. So we actually had a significant amount of time that no one knew, which I’m grateful for, because we got to get to know each other. By the time I went to that first game, we were a couple. I think some people think that they saw our first date at that game? We would never be psychotic enough to hard launch a first date.” The larger point, for her, is that there’s nothing to hide. “When you say a relationship is public, that means I’m going to see him do what he loves, we’re showing up for each other, other people are there and we don’t care,” she says. “The opposite of that is you have to go to an extreme amount of effort to make sure no one knows that you’re seeing someone. And we’re just proud of each other.” + +Swift’s openness is one part of why her fan base leans heavily, though not exclusively, female. The Eras Tour was one critical piece of what Swift calls “a three-part summer of feminine extravaganza”—the other two parts being Gerwig’s box-office bonanza *Barbie* and Beyoncé’s blockbuster, culture-shifting Renaissance Tour. “To make a fun, entertaining blast of a movie, with that commentary,” she says of *Barbie,* “I cannot imagine how hard that was, and Greta made it look so easy.” (“I’m just a sucker for a gal who is good with words, and she is the best with them,” Gerwig says about Swift, whom she calls “Bruce Springsteen meets Loretta Lynn meets Bob Dylan.”) + +Swift is no less effusive in talking about Beyoncé, who brokered a similar deal with AMC and shows up to Swift’s Los Angeles premiere; the next month, Swift returns the favor by attending Beyoncé’s in London. “She’s the most precious gem of a person—warm and open and funny,” Swift says. “And she’s such a great disrupter of music-industry norms. She taught every artist how to flip the table and challenge archaic business practices.” That her tour and Beyoncé’s were frequently juxtaposed is vexing. “There were so many stadium tours this summer, but the only ones that were compared were me and Beyoncé,” she says. “Clearly it’s very lucrative for the media and stan culture to pit two women against each other, even when those two artists in question refuse to participate in that discussion.” + +**Read More:** *[‘The Most Precious Gem of a Person:’ Taylor Swift on Her Friendship With Beyoncé](https://time.com/6343062/taylor-swift-beyonce-friendship-renaissance/)* + +To Swift, the success of all three feels like an inflection point. “If we have to speak stereotypically about the feminine and the masculine,” she says, “women have been fed the message that what we naturally gravitate toward—” She has a few examples: “Girlhood, feelings, love, breakups, analyzing those feelings, talking about them nonstop, glitter, sequins! We’ve been taught that those things are more frivolous than the things that stereotypically gendered men gravitate toward, right?” Right, I say. “And what has existed since the dawn of time? A patriarchal society. What fuels a patriarchal society? Money, flow of revenue, the economy. So actually, if we’re going to look at this in the most cynical way possible, feminine ideas becoming lucrative means that more female art will get made. It’s extremely heartening.” + +![](https://api.time.com/wp-content/uploads/2023/12/taylor-swift-person-of-the-year-beyonce.jpg?quality=75&w=2400) + +Beyoncé joined Swift in Los Angeles on Oct. 11 for the first screening of her Eras Tour filmJohn Shearer—Getty Images for TAS + +Amid so much attention, it seems noteworthy that Swift appears more relaxed in the public eye, not less—although I wonder out loud whether it just appears that way. She nods. “Over the years, I’ve learned I don’t have the time or bandwidth to get pressed about things that don’t matter. Yes, if I go out to dinner, there’s going to be a whole chaotic situation outside the restaurant. But I still want to go to dinner with my friends.” She sounds thoughtful. “Life is short. Have adventures. Me locking myself away in my house for a lot of years—I’ll never get that time back. I’m more trusting now than I was six years ago.”  + +She’s also having more fun. At her premiere, Swift sits in the same row as me, Madison, and McCall, singing along and dancing in her seat; we keep craning our necks to look at her, sharing thunderstruck looks: *Isn’t this surreal?* There are moments in the film when the cameras capture the enormous screens behind Swift onstage, and it feels like a house of mirrors, these myriad reflections of Taylor Swift—us watching her watch herself on a screen, which is itself showing Swift’s image on so many screens, the thousands of fans onscreen in the stadium and us in this theater, with Swift in the middle of it—all of us rapt, unable to look away. + +**Read More:** *[Taylor Swift Makes History as Person of the Year. Here’s How](https://time.com/6343069/taylor-swift-history-person-of-the-year/)* + +--- + +**Swift and I have been talking** for a while now at her apartment, long enough that our coffees have gone cold and her cat Benjamin Button has trundled into the room, then gotten bored and left. She tells me about revisiting *Reputation,* which is perhaps the most charged era in the tour. “It’s a goth-punk moment of female rage at being gaslit by an entire social structure,” she says, laughing. “I think a lot of people see it and they’re just like, Sick snakes and strobe lights.” The upcoming vault tracks for *Reputation* will be “fire,” she promises. The rerecordings project feels like a mythical quest to her. “I’m collecting horcruxes,” she says. “I’m collecting infinity stones. Gandalf’s voice is in my head every time I put out a new one. For me, it is a movie now.” + +![](https://api.time.com/wp-content/uploads/2023/12/taylor-swift-person-of-the-year-5.jpg?quality=75&w=2400) + +Inez and Vinoodh for TIME + +It strikes me then that for all the talk about eras, it’s also worth thinking about genres—how Swift has moved between them in the stories she’s told. At first, it was a coming-of-age story, one about a young woman finding her way in the world and honing her voice before a fickle public. Then there were romances, great ones—tales of enchantment and desire, heartbreak and disillusionment, relationships that she both excavated for her songs and that the media documented for her with either joy or schadenfreude, depending on the day. There have been dramas with stakes so high and turns so twisty they feel Shakespearean in their scope, betrayals both personal and professional that have shaped her life. Occasionally, these stories have tipped into screwball comedy—like when a crowd in Seattle cheered so loudly it registered as an earthquake, or when, on a tour stop in Brazil, the local archdiocese allowed messages celebrating her to be projected onto the 124-ft. Christ the Redeemer statue. But they have one thing in common: Swift.  + +She is a maestro of self-determination, of writing her own story. The multihyphenate television creator Shonda Rhimes—no stranger to a plot twist—who has known Swift since she was a teenager, puts it simply: “She controls narrative not only in her work, but in her life,” she says. “It used to feel like people were taking shots at her. Now it feels like she’s providing the narrative—so there aren’t any shots to be taken.” + +**Read More:** *[Behind the Scenes of TIME’s 2023 Person of the Year Issue](https://time.com/6342829/person-of-the-year-2023-editors-letter/)* + +Here, Swift has told me a story about redemption, about rising and falling only to rise again—a hero’s journey. I do not say to her, in our conversation, that it did not always look that way from the outside—that, for example, when *Reputation*’s lead single “Look What You Made Me Do” reached No. 1 on the charts, or when the album sold 1.3 million albums in the first week, second only to *1989,* she did not look like someone whose career had died. She looked like a superstar who was mining her personal experience as successfully as ever. I am tempted to say this. + +But then I think, Who am I to challenge it, if that’s how she felt? The point is: she *felt* canceled. She *felt* as if her career had been taken from her. Something in her had been lost, and she was grieving it. Maybe this is the real Taylor Swift effect: That she gives people, many of them women, particularly girls, who have been conditioned to accept dismissal, gaslighting, and mistreatment from a society that treats their emotions as inconsequential, permission to believe that their interior lives matter. That for your heart to break, whether it’s from being kicked off a tour or by the memory of a scarf still sitting in a drawer somewhere or because somebody else controls your life’s work, is a valid wound, and no, you’re not crazy for being upset about it, or for wanting your story to be told.  + +After all, not to be corny, haven’t we all become selective autobiographers in the digital age as we curate our lives for our own audiences of any size—cutting away from the raw fabric of our lived experience to reveal the shape of the story we most want to tell, whether it’s on our own feeds or the world’s stage? I can’t blame her for being better at it than everyone else. It’s also not like she hasn’t admitted it. She sang it herself, in her song “Mastermind,” off last year’s *[Midnights](https://time.com/6223793/taylor-swift-midnights-album-takeaways/),* in a bridge so feathery you could almost miss that it marks some of the rawest, most naked songwriting of her career: “No one wanted to play with me as a little kid/ So I’ve been scheming like a criminal ever since/ To make them love me and make it seem effortless/ This is the first time I’ve felt the need to confess/ And I swear I’m only cryptic and Machiavellian because I care.” + +![](https://api.time.com/wp-content/uploads/2023/12/taylor-swift-person-of-the-year-2.jpg?quality=75&w=2400) + +Inez and Vinoodh for TIME + +She tells me she wrote that song after watching the Paul Thomas Anderson film *Phantom Thread,* which—spoiler—culminates in the reveal of a vast, layered manipulation. “Remember that last scene?” she says. “I thought, wouldn’t it be fun to have a lyric about being calculated?” She pauses. “It’s something that’s been thrown at me like a dagger, but now I take it as a compliment.”  + +It *is* a compliment. After I leave Swift’s house, I can’t stop thinking about how perfectly she crafted this story for me—the one about redemption, how she lost it all and got it back. Storytelling is what she’s always done; that’s why, Chesney tells me, he gave her that gift all those years ago. “She was a writer who had something to say,” he says. “That isn’t something you can fake by writing clichés. You can only live it, then write it as real as possible.”  + +She must have known that all the references she made had hidden meanings, that I’d see all the tossed-off details for the Easter eggs they were. The way she told me that story about Chesney, she knew there was a lesson, about the power of generosity, and how a crushing defeat can give way to a great and surprising gift. The way she said, “Are you not entertained?”—surely we both knew it was a quote from *Gladiator,* a movie in which a hero falls from grace, is forced to perform blood sport for the pleasure of spectators, and emerges victorious, having survived humiliation and debasement to soar higher than ever. And the way before I left, she showed me the note from Paul McCartney hanging in her bathroom, which has a Beatles lyric written on it—and not just any Beatles lyric, but this one: “Take these broken wings and learn to fly.” —*With reporting by* Leslie Dickstein *and* Megan McCluskey • + +Styled by Heidi Bivens at Honey Artists; hair by Holli Smith; make-up by Diane Kendal; nails by Maki Sakamoto; production by VLM Productions + +On the covers:  + +*Jacket, denim shirt and turtleneck by Polo Ralph Lauren; dress by Area; bodysuit by Bardot, tights by Wolford; earrings are artist’s own* + +On the inside:  + +*Jacket, denim shirt and turtleneck by Polo Ralph Lauren; tuxedo jacket, tuxedo shirt, vest and pocket square by Ralph Lauren Collection, jeans by Polo Ralph Lauren; dress by Alaia; rings by Anna Sheffield and Cartier; earrings are artist’s own* + +  +  + +--- +`$= dv.el('center', 'Source: ' + dv.current().Link + ', ' + dv.current().Date.toLocaleString("fr-FR"))` \ No newline at end of file diff --git a/00.03 News/The Plight of the Oldest Sister.md b/00.03 News/The Plight of the Oldest Sister.md index 41399bf8..3ea38663 100644 --- a/00.03 News/The Plight of the Oldest Sister.md +++ b/00.03 News/The Plight of the Oldest Sister.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- Parent:: [[@News|News]] -Read:: 🟥 +Read:: [[2023-12-16]] --- diff --git a/00.03 News/The call of Tokitae.md b/00.03 News/The call of Tokitae.md new file mode 100644 index 00000000..aba80118 --- /dev/null +++ b/00.03 News/The call of Tokitae.md @@ -0,0 +1,325 @@ +--- + +Tag: ["🏕️", "🇺🇸", "🐋"] +Date: 2023-12-10 +DocType: "WebClipping" +Hierarchy: +TimeStamp: 2023-12-10 +Link: https://www.washingtonpost.com/lifestyle/interactive/2023/tokitae-lolita-orca/ +location: +CollapseMetaTable: true + +--- + +Parent:: [[@News|News]] +Read:: 🟥 + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-ThecallofTokitaeNSave + +  + +# The call of Tokitae + +*Deep Reads features The Washington Post’s best immersive reporting and narrative writing.* + +She was 3 or maybe 4 years old on the last day she saw her family, when the men came in spotter planes and speedboats, hurling seal bombs that sent 200-decibel blasts reverberating through the currents of Puget Sound. She stayed close to her mother, the pair of them among nearly 100 terrified and disoriented southern resident orcas who were driven north along the eastern shore of Whidbey Island, until they were trapped in the shallower waters of Penn Cove. + +It was unusually cold that August of 1970, and Terrell C. Newby still remembers that he arrived at Whidbey Island wearing a thick red-and-blue sweater that his mother had knitted for him. He was 30 years old, a student of marine biology and a Vietnam veteran who had returned from the war less than two years before. He had come to Penn Cove because he’d been invited by the men who were leading the orca capture: Ted Griffin, who owned the Seattle Marine Aquarium, and his business partner, Don Goldsberry. Their intent was to pull roughly half a dozen orcas from the water — young ones, 10 to 12 feet long, old enough that they wouldn’t perish when separated from their mothers but young enough to be compliant — and sell them to marine parks around the world for display. + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/UTHLKMFBKZGVLAAJ33JDRPEDSI.jpg&high_res=true&w=2048) + +Mothers and calves are separated during the Penn Cove capture in 1970. (Courtesy of Terrell Newby) + +By the time Newby set foot on the dock, the most desirable whales had already been cordoned off behind nets in the water, and his job was to sit in an eight-foot pram and try to keep the panicked mother orcas away from their babies. It was exhilarating and frightening at once — virtually nothing was known about orcas at the time, and Newby had no idea what might happen to him if they tipped his boat and he fell into the water — but despite the desperation of the whales, none showed aggression toward him. + +He found the scene disturbing, but he didn’t feel truly horrified until he heard shrill cries and saw that the men had trapped the juvenile female orca against the dock. She was squealing frantically as a net was pulled over her body, and her mother was calling out in response, lifting her eyes above the surface to maintain sight of her calf. + +The young whale was lifted from the water, wrapped in moist towels and loaded onto the back of a flatbed truck, and Newby was told to ride with her down to Seattle. He took his place at her side, and found himself fixed in her wide, dark gaze. *Here,* he would say, five decades later, *is where I started getting really undone*. He watched her eye move from his face to the buildings shuddering past along the highway, and he wondered how foreign it all must seem to her — to be outside the only element she’d ever known, her body unfamiliar with the burden of its own weight. + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/5U6P5Z2CJTHK54MPPXFONUBAWA.jpg&high_res=true&w=2048) + +A close-up of Tokitae's eye, taken as Newby rode with her to Seattle. (Courtesy of Terrell Newby) + +She stared and stared. He took a photograph of her, and a sickened feeling began to spread in his chest. His mind carried him back to the Mekong Delta, where he had been tasked with making solatium payments to families who had lost livestock or loved ones to American attacks. He’d once sat beside a mother who wept over the body of her baby on a rice mat, as they tried to determine a fair price for a lost child. That moment returned to him as he looked into the piercing eye of the young whale. + +It took nearly two hours for the truck to lumber south to the city, and the orca never made a sound. Newby gently rubbed her head, poured water over her, murmured *It’s going to be okay,* not believing his own words. + +In Seattle, he touched her one last time before he slipped off the back of the truck. *Bye, baby,* he whispered. Then he got in a car bound for Penn Harbor to prepare the next whale for transport. He would finish his job, and then devote his life to the study and protection of marine mammals, fighting to outlaw captures like the one he had just participated in. Riding north in stunned silence, Newby had become only the first of many who would describe themselves as forever changed by the orca known as Tokitae. + +She was sold for $20,000 to the Miami Seaquarium, where she would spend the next half a century performing in the smallest orca tank in North America, 80 feet long and 35 feet wide, dubbed the “whale bowl.” Of the nearly 50 southern resident orcas taken from the Pacific Northwest during the 1960s and ’70s, most died within the first years after their capture — but Tokitae endured, becoming the last member of her family alive in captivity. Her life was shaped by an expansive constellation of people drawn into her orbit: devoted trainers who cared for her; marine mammal scientists who understood the toll of her captivity; conservation advocates and legions of fans who called for her freedom; the Indigenous people of the Lummi Nation, who consider orcas to be sacred relatives of their tribe; a Latin American business executive who agreed in 2022 that the whale did not belong in the stadium he’d just purchased; a billionaire NFL team owner who pledged to spend upward of $20 million to bring Tokitae home to the Salish Sea. + +To Raynell Morris, a 67-year-old matriarch of the Lummi Nation who spent the past six years working to return Tokitae to the Pacific Northwest, the remarkable alignment of people devoted to the orca — across different cultures and convictions — made perfect sense. “She had a purpose, and it was bringing people together,” Morris said. Tokitae, known by the name Sk’aliCh’ehl-tenaut + +in the Lhaq’temish language of the Lummi, always held a singular magnetism, Morris said: “When her left eye walks on you, you are hers forever.” + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/2QW5KRUWR2TAVJDGSXV3OPSVBA_size-normalized.jpg&high_res=true&w=2048) + +Raynell Morris, a matriarch of the Lummi Nation, prays near the tribe's reservation. (Nick Cote for The Washington Post) + +In March, a plan was announced to move Tokitae to a 10-acre netted sanctuary in the San Juan Islands, where she could live out her life in her natal waters. To Morris, helping the whale complete this journey was a sacred obligation on behalf of her people. + +The team working toward her relocation began logistical preparations, addressing state and federal requirements and consulting with Native tribes. After enduring lonely periods of neglect, Tokitae seemed to flourish with the constant dedication of the trainers and veterinarians who were readying her for the transition. Her return home was finally within sight, a milestone that felt ecstatic to the many who had fought for her for so long. + +And then, on Aug. 18, 53 years after she arrived at the Miami Seaquarium and just months before she was due to leave it, Tokitae died there. + +What followed was a moment of reckoning. The hopeful symbolism of her rescue was gone, replaced by searching questions about the past and future of our relationship with her species, and the natural world we share. In life, Tokitae was a beloved but involuntary ambassador for her kind. In death, she had become something more: a parable and a guide, revealing the full spectrum of our human potential — to ruin, and to repair. + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/KMZWYEZ254PJM4MQDMAWRXRMIM.jpg&high_res=true&w=2048) + +Tokitae at the Miami Seaquarium in January 2014. (Walter Michot/Getty Images) + +In her prime, she was magnificent: over 7,500 pounds and 22 feet long, liquid lines of obsidian black and white, a sleek, strong body built to swim vast distances and dive hundreds of feet deeper than the 20-foot floor of the barren concrete tank where she performed every day in the center of a crowded stadium. + +Her name, Tokitae — Toki for short — was given to her by the first veterinarian to care for her at the Miami Seaquarium; it was a nod to her region of origin, a Coast Salish greeting roughly translated as “nice day, pretty colors.” But to audiences packed into the Seaquarium, she was known only as Lolita. + +In the beginning, Tokitae performed 20-minute shows multiple times per day alongside her companion, Hugo, a fellow captured southern resident orca. The whale bowl was small even for a single whale, but the pair shared the space until 1980, when Hugo was found motionless at the bottom of the pool. The young bull — 15 years old, far short of the 50 or 60 years he might have lived in the wild — was dead of a brain aneurysm after repeatedly ramming his head against the side of the tank. His body was reportedly disposed of at a Dade County landfill. Tokitae would continue to share her tank with other cetaceans, but she would never again be in the company of her own kind. + +Former trainer Marcia Henton Davis and scientist Deborah Giles discuss what living in a small tank for more than 50 years meant for Tokitae's quality of life. (Joshua Carroll/The Washington Post) + +The grim details of Tokitae’s years at the Seaquarium are chronicled in Sandra Pollard’s book “[A Puget Sound Orca in Captivity”](https://www.amazon.com/Puget-Sound-Orca-Captivity-Lolita/dp/1467140376?itid=lk_inline_enhanced-template): Tokitae’s body was marred by sores and abrasions from the concrete pool, and “rake” marks from the Pacific white-sided dolphins who scraped their teeth over her skin. Her favorite toy was an old wet suit — some theorized it might have reminded her of kelp. She was sunburned, with no shelter to shade her, and her eyes suffered from constant exposure to dust and UV radiation. Tokitae regularly performed with injuries — bloody teeth, abscesses, infections — and was kept on a cocktail of antibiotics and medications. + +“Her \[tail\] flukes dragged on the floor of that tank,” Pollard said. “She was never able to fully submerge in a vertical position.” + +As our knowledge of orcas grew, and our cultural perception of captivity began to shift, the calls to release Tokitae reached a new intensity. In 1995, [Ken Balcomb](https://www.washingtonpost.com/obituaries/2022/12/15/ken-balcomb-orcas-killer-whales-dead/?itid=lk_inline_enhanced-template), the pioneering marine mammal researcher who founded the [Center for Whale Research](https://www.whaleresearch.com/?itid=lk_inline_enhanced-template) and spent his life tracking the southern resident killer whale population, announced a campaign to push for Tokitae’s return to Washington state. Balcomb’s brother, Howard Garrett, formed a nonprofit organization to support this effort, eventually called [Orca Network](https://www.orcanetwork.org/?itid=lk_inline_enhanced-template). + +For several years, Garrett campaigned in Miami, “trying to drum up awareness, media, do demonstrations, write open letters to the owners — everything that I could think of,” he said. But there was never a response from the Seaquarium. County records indicated that the marine park was making around $1 million per year on Tokitae at that time, he said, “so they certainly weren’t going to listen to me.” + +Others listened, though. Garrett’s efforts drew widespread public attention, rallying support from state and federal elected officials as well as a few high-profile names. “I have been deeply moved by the efforts to free Lolita,” Elton John wrote in a 1999 letter, “and wish to add my name to the campaign to return her to her home waters.” + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/4UK7F5DLSWTJD2R4QTKKMYDN4Q.jpg&high_res=true&w=2048) + +Marcia Henton Davis feeds Tokitae at the Miami Seaquarium in July. (Matias J. Ocner/Getty Images) + +Over Tokitae’s years at the Seaquarium, several of her trainers developed committed bonds with the orca. Marcia Henton Davis saw Tokitae for the first time in 1988 as a 22-year-old visitor to the park, where she was instantly struck by the smallness of the tank and the lethargy of the whale within. Davis stared into one of Tokitae’s eyes, “and there was just such depth there,” she said. “I kind of started crying a little bit, just seeing her like that. … I knew right at that moment, ‘I need to be with this animal.’” She was hired by the Seaquarium a few months later. + +Tokitae was gentle and patient, and often exhibited protective instincts, Davis said. She recalled one afternoon when she was joking around with another trainer and tossed a squid tentacle that stuck to his wet suit. In response, the trainer scooped Davis up as if he might drop her into the pool — and Tokitae came racing over from the opposite side of the tank, furiously bobbing her head in disapproval. “She thought that was aggression,” Davis said. “She got upset by that.” The trainers were careful to never play around in that way again. + +Davis left the Seaquarium in 1995, after new management took over and implemented policies that she found irresponsible, including limiting the time that trainers could interact with Tokitae. “I cried for months about that,” she said. “But I couldn’t effect any change.” + +Sarah Onnen, who joined the Seaquarium in 2001, spent more than 20 years working with the orca. At first, Onnen felt challenged by Tokitae, who had a stubborn streak and a sense of humor that sometimes frustrated her trainers. She had an impeccable memory, Onnen said, and would needle specific trainers with certain behavioral quirks. For years, Tokitae made a particular sound when she saw Onnen, an exhale like air hissing from a flat tire, which Onnen interpreted as something akin to a mocking snort. When Onnen learned to laugh at this — when she began to embrace Tokitae’s expressiveness — their connection deepened, she said. + +She felt a responsibility to protect that relationship, Onnen said, because she knew the orca had lost so many others. Trainers would build rapport with her, and then leave for other jobs or to raise families. “It wasn’t their fault,” Onnen said, “but I saw people come and go. It always kind of broke my heart. So I kind of vowed to myself that I wouldn’t leave her.” + +Everything about Tokitae’s existence — her routines, her relationships, her environment — was defined by humans; she’d grown familiar with the hum of motorized pumps, the blare of loudspeakers and screaming crowds. But when the stadium emptied at night, she would often vocalize in the quiet, calling out + +in the way her mother had once taught her. + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/TUAW2WXPOZ4ALMVCURGYFRVG7A.jpg&high_res=true&w=2048) + +Tokitae performs in 2014. (Walter Michot/Getty Images) + +In our collective imagination, the stories of individual orcas transform our understanding of what these animals feel and experience — as with Tilikum, the SeaWorld orca who was involved in [the deaths of three people](https://www.outsideonline.com/outdoor-adventure/environment/killer-pool/?itid=lk_inline_enhanced-template) and became the subject of the 2013 documentary “Blackfish.” The impact of his story was significant: In the year after “Blackfish” was released, [SeaWorld’s attendance plummeted](https://www.washingtonpost.com/news/wonk/wp/2014/12/12/chart-what-the-documentary-blackfish-has-done-to-seaworld/?itid=lk_inline_enhanced-template), and in 2016, the company announced an end to its orca breeding program. + +For years, Tokitae’s experience was less visible but no less illuminating, said Lori Marino, president of the Whale Sanctuary Project and a neuroscientist who has studied cetacean brains for 35 years. Structurally, an orca has a larger portion of its brain devoted to higher thinking than a human does, Marino said; Tokitae’s mind had afforded her extraordinary resilience, an unknowable inner life that allowed her to persist for so long in such an impoverished environment. + +“She was coping in a way that she had worked out for herself,” Marino said. “There was a narrative there, a story she told herself about what was happening to her, and that allowed her to live.” + +It is possible to fully understand the contrast between Tokitae’s life in the whale bowl and the one she would have lived in the wild, because her family is the most studied population of whales on the planet, with a complete annual census dating back 47 years. + +Deborah Giles explains some of the unique characteristics of southern resident orcas and why they are endangered. (Joshua Carroll/The Washington Post) + +All orcas around the world are the same species, the largest of the dolphin family, but they are divided into distinct populations that do not interbreed and rarely interact with one another. Tokitae’s family of southern resident orcas range from Northern California to southeastern Alaska, with their core habitat in the Salish Sea. They are known for their close-knit social culture, said Michael Weiss, research director at the Center for Whale Research on San Juan Island. The three matrilineal pods of southern resident whales — J pod, K pod and L pod — each communicate in their own specific dialect, and all are exceptionally bonded to their mothers. + +“No one leaves their mom’s group for their whole life, not the males nor the females,” Weiss said. Female southern residents have been known to live as long as 90 or 100 years; males, on the other hand, are more than eight times as likely to die the year after their mother does. + +Some say Tokitae might be the daughter of the oldest living orca, an L pod matriarch known as Ocean Sun, but this has never been confirmed. At nearly 100 years old, Ocean Sun is the only southern resident who was alive at the time of the captures — the only one who would remember Tokitae. + +For creatures of such intelligence and social sophistication, the trauma of the capture era was profound and enduring. After the last of the young whales were pulled from the water in 1970, the fractured family of southern residents made their way back out to sea without the seven juveniles who were taken and the four whales who had died — three babies and a mother who drowned in the nets. By the time whale captures in the United States ended in 1976, roughly a third of the southern residents had been culled, Weiss said. Before the capture era, their population was more than 100 whales; as of the census in July, there were 75. Since 2005, the southern residents have been listed as endangered under the Endangered Species Act. + +The whales have faced new threats in more recent years, particularly the [precipitous decline](https://www.wildorca.org/declining-salish-sea-salmon-increasingly-absent-endangered-orcas/?itid=lk_inline_enhanced-template#:~:text=How%20does%20this%20decline%20in,50%25%20over%20the%20same%20period.) of their primary prey, the Chinook salmon, said Deborah Giles, science and research director at the conservation [research organization Wild Orca](https://www.wildorca.org/?itid=lk_inline_enhanced-template). In the absence of sufficient salmon, other dangers to the orcas — the stress of boat traffic, the infiltration of chemical pollutants — are exacerbated, causing illness, death and pregnancy loss. + +In 2018, the plight of the southern residents drew worldwide attention when an orca known as Tahlequah gave birth to a female calf who died less than an hour later. The grieving mother [carried the body](https://www.washingtonpost.com/news/animalia/wp/2018/08/10/the-stunning-devastating-weeks-long-journey-of-an-orca-and-her-dead-calf/?itid=lk_inline_enhanced-template) of her newborn for 17 days, sometimes in her mouth, sometimes draped over her head or back. Her vigil made global headlines, and many expressed astonishment to see an animal perform such an undeniable ritual of mourning. + +Two years later, Tahlequah stunned onlookers again after giving birth to a healthy male calf. Giles was on the water with Tahlequah’s pod near San Juan Island on the afternoon when the new calf was first spotted, and suddenly the two other southern resident pods came charging in from the west, scores of whales soaring up and out of the water as they swam at top speed. Every member of the population was in attendance. + +It was a “superpod,” a cultural phenomenon unique to southern residents, in which all three pods of whales come together in one group. Superpods have anecdotally been observed to occur around occasions of social significance to the animals — such as the birth or death of an orca — and this one was the first to occur in the area in several years. + +“There’s not many animal populations*, period*, let alone other marine mammals … where they’re all socializing with one another, and they *all* know each other,” Weiss said. + +For hours, Giles remembered, the whales breached and vocalized, slapping their fins and flukes against the water. The timing of the gathering, so closely following the arrival of the new calf, was especially striking. + +“It feels metaphysical to me,” Giles said. “How did they hear? How did they know?” + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/UYNAUBAOTL4J65ZRTIX6AH6TXQ_size-normalized.jpg&high_res=true&w=2048) + +Morris in her ceremonial orca-themed regalia. Orcas are considered sacred kin of the Lummi Nation. (Nick Cote for The Washington Post) + +To the people of the Lummi Nation, orcas are considered to be people, sacred kin of the tribe; they are called qwe’lhol’mechen + +, meaning “our relations under the waves.” But for decades, the Lummi did not know that dozens of southern resident orcas had been trapped and sold. + +“We weren’t asked, in 1970, what our feelings were about the state of Washington issuing a permit to capture our relatives,” Morris said. “We didn’t hear about the captures. We didn’t know about them. We didn’t know about *her* until 2017.” + +When a member of the Lummi business council learned of Tokitae, the tribe’s Sovereignty and Treaty Protection Office began to investigate her story. What it discovered felt painfully resonant, Morris said, echoing the abduction of Native children who were sent to [American boarding schools](https://www.washingtonpost.com/history/2023/08/07/indian-boarding-school-survivors-abuse-trauma/?itid=lk_inline_enhanced-template) and stripped of their families, culture and language. The council soon passed a unanimous motion, declaring their sacred obligation to bring Tokitae — Sk’aliCh’ehl-tenaut to the Lummi — back to the Salish Sea. This task was bestowed upon Morris by Lummi Hereditary Chief Tsi’li’xw Bill James before his death in 2020. He described the world as an interconnected web of life; bringing the orca home would mend the strand broken by her capture, he told Morris, and allow a new cycle of healing to begin. + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/BX6PNUGFCTPCHYSV5EJ6X5MXYI_size-normalized.jpg&high_res=true&w=2048) + +A totem pole on San Juan Island memorializes the life of Tokitae, also known as Sk’aliCh’ehl-tenaut to the Lummi. (Nick Cote for The Washington Post) + +But there was little precedent for such an endeavor, so Morris and [fellow tribal elder Ellie Kinley](https://sacredsea.org/who-we-are/?itid=lk_inline_enhanced-template) approached [Charles Vinick](https://whalesanctuaryproject.org/people/charles-vinick/?itid=lk_inline_enhanced-template), executive director of the [Whale Sanctuary Project](https://whalesanctuaryproject.org/?itid=lk_inline_enhanced-template), for guidance. Vinick prepared a proposed operation plan with [Jeffrey Foster](https://whalesanctuaryproject.org/people/jeffrey-foster/?itid=lk_inline_enhanced-template), a marine mammal expert who once collected orcas from the wild for SeaWorld before pivoting toward conservation, and his wife, [Katy Foster](https://whalesanctuaryproject.org/people/katy-laveck/?itid=lk_inline_enhanced-template). Numerous leading experts contributed to their work, and Vinick and Jeffrey Foster drew on their own experience as part of the team involved in the 1998 [relocation of Keiko](https://www.washingtonpost.com/archive/politics/1998/09/10/free-willy-the-true-sequel/7ef59991-c3a1-4567-aeb7-e990fac21d85/?itid=lk_inline_enhanced-template), the star of “Free Willy,” from the Oregon Coast Aquarium to a sea pen in Iceland. + +The involvement of the Lummi breathed new life into the campaign to free Tokitae, but it wasn’t until August 2021 that her release began to feel truly possible. That month, the Dolphin Co. — the largest marine park operator in Latin America, led by CEO Eduardo Albor — announced its intent to buy the Miami Seaquarium. Soon after, the U.S. Agriculture Department issued a [scathing inspection report](https://www.peta.org/wp-content/uploads/2021/09/miami-seaquarium-inspection-report.pdf?itid=lk_inline_enhanced-template) of Tokitae’s living conditions, revealing that the orca had been fed rotting fish, given insufficient quantities of food and forced to perform with injuries. + +When Albor purchased the Seaquarium in March 2022, Tokitae was officially retired from performance. The stadium itself had been condemned — only Tokitae’s caregivers were allowed within — which meant Albor found himself the new owner of an orca who could not be displayed to the public, contained at an unusable facility with an outdated, rapidly deteriorating infrastructure. He was a businessman with a liability. + +He was also a father who had made a promise, years before, when he took his young adult daughter to watch Tokitae’s show. His daughter was distressed to see the whale in that environment, he said: “She told me, ‘If you ever buy the park, promise you are going to look for a better place for Lolita.’” + +Charles Vinick describes the plan to tend to Tokitae’s fragile health and eventually move her from the Miami Seaquarium. (Joshua Carroll/The Washington Post) + +Meanwhile, Vinick and Morris had joined forces with [marine conservationist Pritam Singh](https://seashepherd.org/pritam-singh/?itid=lk_inline_enhanced-template), who had created a nonprofit — ultimately known as [Friends of Toki](https://friendsoftoki.org/?itid=lk_inline_enhanced-template) — to advocate for higher-quality care for Tokitae, and announced that he would personally fund $1 million toward that goal. Soon after Albor bought the Seaquarium, Vinick and Singh traveled to Miami, prepared to hold a news conference calling for independent veterinarians to assess Tokitae. But Albor made it clear that a media frenzy would not set the tone for a productive conversation — so Vinick and Singh canceled their plans and agreed to talk privately instead. “That showed great credibility,” Albor said. + +The resulting partnership was unprecedented: It was the first time a marine park owner had agreed to work with people who might be considered activists, Vinick said. “What was this collaboration based on? It was based on identifying an area of mutual agreement, on being able to respect one another, and speak with one another as collaborators and even partners, without worrying about all the things we disagree about.” + +At first, Friends of Toki was focused on improving Tokitae’s daily care; there wasn’t enough funding to consider a permanent relocation to a sanctuary in the Pacific Northwest. + +Then, in early January 2023, Vinick spoke with Jim Irsay, the billionaire owner of the NFL’s Indianapolis Colts. He wanted to see the whale. + +Irsay had watched Tokitae perform long ago, as a 12-year-old boy, and he’d never forgotten her. He’d always been enamored with animals, and whales in particular; to him, their staggering power and benevolence felt something like God. He told Vinick that he was interested in helping take Tokitae back to her native waters. + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/DU7RSCT73NLTC5D3RDMQ3XPFRE_size-normalized.jpg&high_res=true&w=2048) + +Charles Vinick looks out at the Salish Sea in Bellingham, Wash. (Nick Cote for The Washington Post) + +Later that month, when Irsay walked up to Tokitae’s tank, she came to the edge of the pool to greet him. She lifted her head out of the water and met his gaze. Then she “baptized” him, as Vinick recalled, spraying a jet of water that soaked Irsay’s expensive suit. He laughed, instantly besotted. “I’m in,” he told Vinick, right then. “I’m in.” Irsay was every bit as dazzled by her as he’d been decades before, but now he was seeing something more. + +“I know how it feels — to be held captive,” he said recently, during a video call from his home in Indianapolis. He wore a dark cowboy hat and sunglasses, and lit a cigarette as he spoke. He grew up in an abusive, alcoholic household, he said, in a family scarred by tragedy. “My sister died in a car crash when I was 11. My brother died from birth defects.” For much of his adult life, Irsay struggled with alcoholism and opioid addiction; he finally achieved sobriety many years ago, he said, because he didn’t want to die the way his father and grandfather had. + +When he looked at Tokitae, he said, he understood what it meant to be the last one left, to be grieving, to be trapped. + +So he knew what he had to do for her. “My goal, my job, whatever you want to call it, is to get her to freedom,” he said. “She *told* me that she wanted to be free. I mean, she told me. I’m telling you. She looked me in the eye.” + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/5LECOIT42BAZQ3UMWG7FWCS7DA_size-normalized.jpg&high_res=true&w=2048) + +San Juan Island and the Salish Sea. (Nick Cote for The Washington Post) + +The announcement was made at a news conference in Miami in March: Within 18 to 24 months, Tokitae would leave the Miami Seaquarium at last, bound for a netted sea sanctuary in the Salish Sea, where she would receive supportive care for the rest of her life. Irsay was prepared to spend upward of $20 million to fund her journey and remaining years. + +The plan was not universally embraced. Some of Tokitae’s former trainers and veterinarians said that the stress of the move could kill her, that she couldn’t tolerate such radical change so late in her life. Some marine scientists were initially concerned about the potential impact of Tokitae’s presence in the Salish Sea. + +There were also misunderstandings by some members of the public who were envisioning a more idealistic outcome. Tokitae would not be set free into the wild; it simply wasn’t possible. She was a captive whale with chronic infections, potentially carrying harmful pathogens. The southern residents were an endangered, fragile population that were already facing significant threats. Tokitae would live out her life supported by caregivers and veterinarians, her sea pen in a location where scientists were confident that nothing — not a drift of her exhalation, not the sound of her calls — could reach her family. + +To Tokitae’s team, there was no question that her life would be monumentally better there. But what had been taken from her could never be fully given back. + +The first time Jeffrey Foster saw Tokitae, when he arrived at the Miami Seaquarium as part of the Friends of Toki care team in September 2022, she seemed listless, barely moving beneath the surface of the pool. + +“I watched her sitting in a corner, staring at a wall. She rocked back and forth,” Foster said. “It was one of the saddest things I’ve ever seen.” + +She nearly died that October, after developing a serious pulmonary infection, but under the care of her team of veterinarians, she swiftly recovered. By early 2023, with her trainers offering constant engagement, she began to show more energy and vitality than she had in many months. Instead of retreating to a corner of the tank when trainers weren’t working with her, “she started swimming a lot more on her own,” said Mike Partica, her lead trainer. “She had people there to interact with her whenever she wanted.” + +Partica came to know her idiosyncrasies, the meaning of her gestures and expressions. She was gentle and good-natured, but also direct in her communication, he said: A vigorous head bob meant “don’t do that.” If you touched her when she didn’t want contact, her eyes would widen. She loved company in proximity, so Partica and the other trainers spent a lot of time floating in the water by her side. + +Over those months, Foster said, Tokitae became “just a totally different animal.” She would play with Li’i, the pacific white-sided dolphin who had shared her tank with her for 40 years, the two often racing through the water. “You could never imagine an animal that size swimming that fast in a pool like that,” Foster said. “You could tell that she was responding very well to what we were trying to do.” + +To prepare for Tokitae’s eventual transport to the Pacific Northwest, the care team began to introduce her to the stretcher that would be used to lift her from her tank. The team hung it over the side of the pool, then lowered it farther and farther into the water. They offered her food beside it and taught her to line up against it. + +Former trainer Marcia Henton Davis had joined the care team, after contacting Friends of Toki to ask if she could be of service once more to the whale she’d loved for so long. That time was filled with a sense of hope and possibility, she said, and she wanted Tokitae to feel it, too. “Every day,” she said, “I’d tell her, ‘You’re going home.’” + +In June, Raynell Morris made her seventh trip to Miami to visit and pray with Tokitae. The orca had never seemed so exuberant, slapping her flukes against the water as Morris stood by the pool in her ceremonial regalia and played her drum. “Sk’aliCh’ehl-tenaut, you have such a strong spirit!” Morris exclaimed. When she sang her prayers, the orca called in response, each voice answering the other. + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/CPZPN4EFPRZI32GVIR2ZYU2BLQ.jpg&high_res=true&w=2048) + +Mike Partica, Tokitae's lead trainer, feeds her in July. (Matias J. Ocner/Getty Images) + +When Tokitae began to show signs of illness early in the week of Aug. 14, her caregivers were not alarmed. She was moving her body in ways that indicated discomfort, refusing to eat her usual volume of fish, but she’d had episodes of gastrointestinal distress before. Her veterinary team — including Tom Reidarson, a prominent expert in the medical care of cetaceans, and James McBain, considered a pioneer in the field of marine mammal veterinary medicine — had been encouraged by Tokitae’s recent return to health. + +But her appetite and energy level dwindled over the following days, until it became clear that an urgent intervention was needed. The team members formulated a plan to drop the water in her tank Friday morning, to allow them to take a blood sample and administer fluids and medication. It was the same protocol they’d followed months before, and there was no doubt in anyone’s mind that she would recover once again. + +“We weren’t cavalier,” Reidarson said, “but we knew how to take care of her.” + +Their treatment was already underway Aug. 18, when an initial blood test revealed a rising level of creatinine, a sign that her kidneys were failing. Reidarson was distressed, he said, but the team was resolute. “There was no giving up,” he said. “It was as simple as that.” + +Tokitae’s condition deteriorated as hours passed. She regurgitated bile and kept listing to the side, seemingly disoriented. Divers rotated in and out of the 55-degree pool, trying to hold her upright. Then, as they tried to raise the water level in the tank, there came a harrowing moment when the orca abruptly rolled over and sank toward the bottom. Foster dove down to lift her, along with several other trainers who labored to guide Tokitae back toward the surface. + +Partica directed the staff to start draining the water again. A crane lowered Tokitae’s stretcher, and the team guided her into it. They were in the midst of providing more fluids and medications when her respiration grew erratic, the minutes stretching longer and longer between breaths. Partica and trainer Kyra Wadsworth were perched along the sides of the stretcher, and Wadsworth looked at him. “Are we losing her?” she asked. “Yes,” he said. Several members of the team had started to cry. + +Sarah Onnen was cradling Tokitae’s head in her hands. Over her long tenure at the Seaquarium, she’d been present when other cetaceans had died; she knew they often experienced involuntary spasms as their bodies shut down, blindly thrashing or biting. She realized that Tokitae could hurt her without intending to, but Onnen stayed as close as she could, gently caressing the orca’s face. + +Partica kept moving, climbing toward Tokitae’s head, waving his fingers near her eye and searching for a response. Submerged beside Tokitae, Foster did the same, and he saw her focus on him briefly. Then her gaze softened and drifted, and she closed her eyes. Her final breath left her like a whisper: *Shhhhh.* + +In the water near Tokitae’s pectoral fin, Davis pressed her hand flat against the orca’s side, the place where Davis had always loved to feel that massive heart pumping against her palm. She felt it beat for the last time. In the moment that followed, a low roll of thunder echoed through the stadium — “as if the sky received her,” she would recall later — and a soft rain began to fall. + +A stillness fell over Tokitae. She lay cradled by the stretcher that was always meant to lift her away from there, toward the escape she’d finally been granted, but she had already found her own. + +Lummi elder Raynell Morris recalls her shock at hearing of Tokitae‘s sudden passing after her health had seemed to be improving. (Joshua Carroll/The Washington Post) + +Within hours of Tokitae’s death, her body was transported to the University of Georgia for a necropsy. The invasive work meant she would need to be cremated, a development that surprised and disturbed the Lummi, who do not cremate their dead and said they had not been consulted. Morris, who had flown to Miami to bring the orca’s body home to her tribe for burial, returned to Washington to wait for the weeks-long process to be completed. + +In Facebook groups and online forums, thousands of strangers around the world demanded to know *what happened*, as if searching for one discernible cause, a precise target to blame. In October, the [necropsy results](https://friendsoftoki.org/wp-content/uploads/2023/10/Tokitae-Necropsy-Veterinary-Care-Team-Statement.pdf?itid=lk_inline_enhanced-template) would show that Tokitae had died of a convergence of chronic illnesses: pneumonia, inflammation, heart disease and ultimately kidney failure. + +This offered a more holistic understanding of her death, the outcome of damage accumulated over many years, until a tipping point was reached. It was a warning and a galvanizing truth: Help came too late for Tokitae, but there were others who still had time. + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/7XZT25LIZOAUSXQXWTMCJSZ77M_size-normalized.jpg&high_res=true&w=2048) + +Davis visited San Juan Island after Tokitae's death. (Nick Cote for The Washington Post) + +In September, Marcia Henton Davis stood on a bluff on San Juan Island, overlooking the Salish Sea. She’d once planned to move there with her husband, to be a permanent part of Tokitae’s care team after her relocation to the sea pen; now Davis had come to see Tokitae’s home for the first time, the place of her birth and burial. + +“I thought she was going to change the world by coming here alive,” Davis said. + +Instead, a sense of urgency had followed Tokitae’s death, the channeling of communal grief into action. Across the world, people were sharing information about the effort to [breach four dams](https://se-si-le.org/all-our-relations/?itid=lk_inline_enhanced-template) along the Snake River to help restore the population of Chinook salmon. They were making donations to marine conservation organizations. They were writing letters to SeaWorld imploring the marine park to release Corky, a wild-born northern resident orca captured in 1969, [to a sanctuary](https://doublebaysanctuary.org/the-sanctuary/?itid=lk_inline_enhanced-template) off the coast of British Columbia. + +Lummi elder Raynell Morris and former trainer Marcia Henton Davis reflect on Tokitae’s legacy. (Joshua Carroll/The Washington Post) + +“So Toki *is* going to change the world,” Davis said. “I just wish she didn’t have to die to do that. But sometimes we humans have to get punched in the face before we take the right action. So maybe this is how she makes a difference.” + +Tokitae’s circumstances were unique, Vinick said, but her account is both groundbreaking and instructive. An impenetrable wall has historically stood between marine parks and those who are branded as environmentalists — but Tokitae transcended that divide. + +“She brought us together in a way that we would not, and have not, come together otherwise,” Vinick said. He hopes such unity will be possible again: The Whale Sanctuary Project is preparing to open a [100-acre ocean sanctuary](https://whalesanctuaryproject.org/the-sanctuary/?itid=lk_inline_enhanced-template) in Nova Scotia as soon as next year, and it’s already eyeing animals that might be candidates for placement there. + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/G7PUEZVHRDX4VF7A7VMDSCYQXE_size-normalized.jpg&high_res=true&w=2048) + +Vinick looks toward where Tokitae's sea pen would have been. (Nick Cote for The Washington Post) + +Vinick feels this work is now bound to Tokitae’s legacy, that her story demonstrates the need to act on behalf of the more than 3,000 cetaceans who remain in captivity worldwide, including approximately 53 orcas. The Whale Sanctuary Project’s ultimate goal is for the breeding of captive whales and dolphins to cease, and for the last of them to live out their lives in sanctuaries where they can explore larger spaces, interact with other animals, feel the currents of the tide. + +“We cannot move them all. But if we can demonstrate a way to create a sanctuary, others will do the same — and collectively, we’ll be able to do it,” Vinick said. “Is it enough? No. But it’s probably the best we can do. Did we do enough for Toki? No. But we did the best that we could.” + +Southern resident orcas from the J, K and L pods were spotted in the Haro Strait on Aug. 17, 2023. (Center for Whale Research, Permit NMFS 27038) + +They began arriving on the afternoon of Aug. 17. Members of all three pods of southern resident orcas made their way into the Haro Strait off the western shore of San Juan Island, dozens of dark bodies surfacing together beneath scattered clouds and the distant Olympic Mountains. It was technically a “near-superpod” — a few of the whales would not arrive in the Salish Sea until days later — and the awed onlookers who watched the orcas greeting and socializing with one another that day did not yet realize the synchronicity, that the gathering was taking place in Tokitae’s final hours. Three thousand miles apart from the last survivor of their stolen family, the southern residents came together in the waters where she was born, filling the air with the sound of their voices. + +By the following day, when Tokitae died, only a small group of L pod whales remained near the southern shore of the island. Deborah Giles was on the water with them in her research boat, and she watched Ocean Sun — the matriarch who is possibly Tokitae’s mother — as she distanced herself from the others, almost as if she were seeking a moment alone. + +“Whether they somehow know, even across space or distance, that something is happening, a birth or that an animal is dying … I can’t possibly say,” Giles said. “What I *can* say is these animals are smarter than I think we know.” She doesn’t gravitate toward the mystical, she said, but neither does she dismiss a sense of possibility. Against the limits of our own understanding, we can only wonder at theirs. + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/OR3TMYMTCSA6CNANOMQNEKTO6A_size-normalized.jpg&high_res=true&w=2048) + +Morris feels a deep connection to the orcas when she prays by the sea. (Nick Cote for The Washington Post) + +Tokitae came home on a chartered jet late in the afternoon on Sept. 20, in a custom-made white cedar box holding her cremated remains, the lid painted with the precise outline of her tail flukes. Before the flight, Morris had brushed the box with sacred cedar boughs, a ritual meant to cleanse away negative energy. + +There was still an undercurrent of sorrow, but Morris also felt relief — joy, even — that her relative was finally where she belonged. Of all the orcas who have died in captivity, Tokitae was the first to be returned to an Indigenous tribe; she would be the first to be buried in her rightful home. The Lummi believed Tokitae’s spirit had already joined the ancestors, but she would not be whole until her remains were put back in the sea. + +“That cultural work in finishing this sacred obligation is everything, to give her the honor and respect that she has earned and deserves as a sacred being,” Morris said, as she sat by the Salish Sea at Cherry Point, a hallowed site near the Lummi reservation where she often comes to pray. “Only then, the healing can begin.” + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/TY3DSRAPX5O7OCPOBN2AUWHSSQ_size-normalized.jpg&high_res=true&w=2048) + +Indigenous artwork of the orca, or qwe’lhol’mechen, meaning “our relations under the waves.” (Nick Cote for The Washington Post) + +On the morning of Sept. 23, Morris arrived before dawn at the funeral home in Bellingham where the whale’s ashes were awaiting the final transport. She draped the box in a black-and-white burial shroud printed with the orca’s Indigenous name, laid cedar boughs atop it and whispered softly: “This is your day.” + +They left as dawn was breaking, seven members of the Lummi Nation aboard the patrol boat carrying the box of ashes, escorted at a distance by the Coast Guard. The boat paused offshore near the Lummi Stommish Grounds, where other members of the tribe were gathered to pray and bid the orca farewell. At a Lummi burial ceremony, Morris said, it is traditional for pallbearers to lift a casket and rotate it in a circle; it is a gesture of honor, symbolizing a person’s final movement upon the earth. The mourners on the shoreline watched as the boat spun slowly on its axis, one last full turn for Sk’aliCh’ehl-tenaut. + +The sun was rising through a cloud-dappled sky as they continued on their way. They traveled for an hour before arriving at the site they had chosen, then stopped and spoke the prayers to welcome their relative home. + +When their work was done, Morris unlocked the cremation box and the seven people aboard the boat took turns scooping nearly 300 pounds of fine, dove-gray ash into the sea. They watched as the final essence of the whale vanished in the swells, borne out at last to open water. + +![](https://img.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/I4GCKBEUN72CJ475GRKQJIKEQQ_size-normalized.jpg&high_res=true&w=2048) + +Sunset over the Salish Sea on the day of Tokitae's burial. (Nick Cote for The Washington Post) + +  +  + +--- +`$= dv.el('center', 'Source: ' + dv.current().Link + ', ' + dv.current().Date.toLocaleString("fr-FR"))` \ No newline at end of file diff --git a/00.03 News/This Maine Fish House Is an Icon. But of What, Exactly.md b/00.03 News/This Maine Fish House Is an Icon. But of What, Exactly.md new file mode 100644 index 00000000..28bb677a --- /dev/null +++ b/00.03 News/This Maine Fish House Is an Icon. But of What, Exactly.md @@ -0,0 +1,180 @@ +--- + +Tag: ["🤵🏻", "🇺🇸", "📸"] +Date: 2023-12-10 +DocType: "WebClipping" +Hierarchy: +TimeStamp: 2023-12-10 +Link: https://downeast.com/our-towns/cape-porpoise-fish-house/ +location: +CollapseMetaTable: true + +--- + +Parent:: [[@News|News]] +Read:: 🟥 + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-ThisMaineFishHouseIsanIconNSave + +  + +# This Maine Fish House Is an Icon. But of What, Exactly? + +##### By Brian Kevin +Photographed by Benjamin Williamson +Opener mosaic featuring [these Instagram photographers](https://downeast.com/photography/follow-these-42-maine-instagrammers/) +*From our [December 2019 issue](https://downeast.com/issues/december-2019/)* + +If you’re active on Instagram and you follow Maine-y hashtags like [`#mainelife`](https://www.instagram.com/explore/tags/mainelife/), [`#mainething`](https://www.instagram.com/explore/tags/mainething/), or [`#thewaylifeshouldbe`](https://www.instagram.com/explore/tags/thewaylifeshouldbe/), then you have seen it. If you happen to follow the hashtag specifically for [`#capeporpoise`](https://www.instagram.com/explore/tags/capeporpoise/), then you have seen an awful lot of it, as there have been times this year when photos of it have made up nearly half the top results of the more than 10,000 `#capeporpoise-tagged` images posted to the popular photo-sharing social platform. + +![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20360%20540'%3E%3C/svg%3E) + +The first time I saw it was last December, when *Down East* staff photographer [Benjamin Williamson](https://www.instagram.com/benjaminwilliamsonphotography/) came back from a photo assignment in Cape Porpoise, the postage-stamp harbor village often described as “the quiet side of Kennebunkport.” It was a natural-shingled, colonial-shed–like structure suspended on stilts over — and perfectly reflected in — the glassy waters of a low-tide Porpoise Cove. Behind it blazed a chorus-of-angels sunrise, with rows of ochre, saffron, and lavender stretching from the waterline up through the clouds. Golden light shone through parallel windows on the building’s longer sides, while a row of lightning rods on the roof seemed to genuflect to the sky. It was the kind of scene that prompts iPhone-toting observers to hashtag their photos [#thewaylifeshouldbe](https://www.instagram.com/explore/tags/thewaylifeshouldbe/).  + +“Wow,” I said to Ben. “What is that?” + +What I didn’t know then was how many people have had a hard time answering that question. + +In the year since, I’ve talked to a dozen or so Instagrammers whose photos of the place have amassed hundreds of thousands, maybe millions of views, almost none of whom were sure just what they were photographing. Meanwhile, between the two people who know the most about the structure — its owner, who built it, and his neighbor, whose granddad once owned the parcel it’s built on — there is disagreement and, frankly, bad blood over just what the building is and is not. + +Ben theorized it was some kind of “party pad.” In the months that followed, he and I noticed it appearing more regularly in our Instagram feeds, where it was referred to as a “stilt house,” a “barn on the water,” and a “love shack.” Then, as shots of it became even more ubiquitous, Instagram posters took to calling it “the Cape Porpoise fish house,” “the often-photographed fish shack,” or simply, “that building.” + +“I’m not sure if this is someone’s home, boathouse, or business (can you imagine what they could charge for a wedding here?),” one Instagrammer wrote [in his caption](https://www.instagram.com/p/B0Qj_gNAAAW/), “but it looks like one of the most peaceful spots in the world to sit out the zombie apocalypse.” + +Indeed it does. But Maine is rotten with idyllic-looking places where one might take refuge from the undead. I can think of a magazine that’s published photos of them every month for 66 years. This place seemed to come out of nowhere and go startlingly viral. I wanted to know why. So I opened my Instagram app and started sending direct messages. + +I met photographer [Robert Dennis](https://www.kportimages.com/) in Cape Porpoise on an unseasonably drizzly day in February, at a restaurant called [Musette](https://downeast.com/guide/musette/). Until three years ago, it was called The Wayfarer, a diner that had been open for 60 years, serving eggs to fishermen in the mornings and a good haddock chowder the rest of the day. Musette still has the chowder — it actually still has The Wayfarer’s sign, hanging above its lunch counter — but it also has avocado toast and a lobster roll on brioche and overall just feels a bit swankier than the place did a decade or two back. The same can be said about Cape Porpoise as a whole. + +A former Boston-area financial advisor, Dennis has lived since 2011 on Langsford Road, a dead-end street overlooking Porpoise Cove and, on the cove’s far side, the Cape Porpoise municipal pier, where the daily catch of the year-round fishing fleet has been the town’s economic lifeblood for most of its 350ish years. These days, tourism gives it a run for its money. Where Langsford Road meets Route 9 — the summer tourism artery — “downtown” Cape Porpoise consists of a 100-year-old former firehouse called Atlantic Hall, a gift shop in a barn, a scatter of restaurants, the fisherman-owned [Nunan’s Lobster Hut](http://www.nunanslobsterhut.com/), and [Bradbury Brothers Market](https://bradburybros.com/), the village’s only source of groceries and primary source of gossip since 1944, as well as its post office. + +Dennis started spending summers in the twin seaside vacation towns of Kennebunk and Kennebunkport — and obsessively photographing them — back in the ’80s. He’s done a popular Kennebunks coffee-table book, and, since the 1990s, he’s been the primary photographer for the regional chamber of commerce. He adores the Bushes and has often photographed (at a distance) their Walker’s Point estate, the epicenter of the Kennebunks’ WASPy prestige. He has no beef with the commercial bustle and summertime tour buses around central Kennebunkport’s Dock Square, but he always knew that if he moved full-time, he’d want to settle 2 miles up the road, in comparatively tranquil Cape Porpoise. + +“I’m passionately in love with the place,” he told me, “and one of the reasons is because it’s so beautifully scenic at all seasons of the year and times of day, but also because it’s so quiet.” + +Near as I can tell, Dennis is patient zero for the Instagram virality of the structure that sits basically in his backyard, in a tidal marsh along Langsford Road. His street is dotted with former “fish houses” that the Kennebunks are known for — waterside wooden shacks where fishermen once stowed and mended wooden gear and traps, maybe sold a few lobsters. Dennis has been shooting such shanties for decades, including one that formerly stood on the site of the current Instagram phenomenon. After our lunch at Musette, he sent me some undated photos of it: its shingles were weathered to brownish, its windows boarded and roof slightly bowed — the ugly duckling to the current incarnation’s swan. It collapsed during a storm in the early ’90s. + +Most of the town’s remaining fish houses are dilapidated or have been converted to other uses — vacation cottages, for instance. It’s just one of the changes Dennis has observed through his lens. He goes almost nightly to the pier to shoot the sunset and the lobsterboats, and he says there are fewer of the latter than in his photos from 20 year ago. “I guess lobstermen passed away, or it’s not economical for them to live here anymore,” he said. “It’s no question there are fewer full-time people living here than there used to be.” + +A lot of nice new homes have popped up along Langsford Road since the old brownish-shingled fish house collapsed, and some modest older Capes remain, but fishermen don’t occupy either of them. “It’s all rental people,” Dennis said. “I don’t see them more than a couple weeks of the year.”  + +So when a local builder named Bob Zuke started erecting a new Langsford Road fish house in 2016, Dennis was intrigued. And once the building’s exterior was completed, he wasted no time getting a sunrise photo.  + +Dennis posted his first [Instagram](https://www.instagram.com/portimages/) shot of the Zuke fish house on February 19, 2017, with the caption, “Sunrise this morning!”, followed by a mess of hashtags. By year’s end, he’d posted four more shots of the new structure, most of them with another, converted Langsford Road fish house, a striking red one, in the foreground. His posts the next winter had three times the hearts as his early ones (a heart is the Instagram equivalent of a Facebook “like”), and they were widely shared by accounts like [@newengland\_igers](https://www.instagram.com/newengland_igers/), which has 53,000 Instagram followers, and, well, [@downeastmagazine](https://www.instagram.com/downeastmagazine/), which has 87,000. + +> Dennis posted his first Instagram shot of the Zuke fish house on February 19, 2017, with the caption, “Sunrise this morning!”, followed by a mess of hashtags. + +This summer, Dennis said, he sometimes stepped out to find four or five people standing off Langsford Road, photographing the Zuke fish house — far fewer than come to visit the lobster shack a few doors down, he points out, but still. Of the Instagrammers I talked to, more than half said they came to Cape Porpoise to shoot the fish house after seeing one of Dennis’s shots. Many of the rest name-checked someone who then told me *they* had first seen it in Dennis’s photos. When I told him this, Dennis seemed bewildered. It’s “nutty,” he said, to imagine someone driving to Cape Porpoise in the middle of the night just to photograph this fish house at dawn. + +“When it first went up, I wasn’t a big fan — I didn’t think it was all that picturesque. But the more I worked around it, I found there were a lot of creative ways to take a photo,” Dennis said. “When it’s reflecting in the water, it does present a pretty attractive sight. I guess people think it sort of exemplifies Maine.” + +As I would learn, though, not everyone thinks this. + +It didn’t seem nutty to [Steven Perlmutter](https://www.instagram.com/perlmutterphotography/), of North Andover, Massachusetts, to get up in the dark and drive to Cape Porpoise to shoot the Zuke fish house at sunrise. He did so in March of 2018 after seeing Dennis’s Instagram posts. + +“So many of the iconic locations in Maine have been photographed forever,” he said. “This is one of those more obscure things that, once a few people get wind of it and see a beautiful shot, it’s like, ‘Hey, cool, I can go do that too, and I’ve never photographed it before.’ Everyone has done Nubble, everyone has done Portland Head Light, everyone has done Jordan Pond, you name it.” + +That’s the culture of Instagram, for better or for worse, said [Dave Dostie](https://www.instagram.com/dostiephoto/), of Augusta, who has likewise made the pre-dawn drive — you see a shot you like, you want to try it, maybe put your own spin on it.  + +“In the last several months, people have taken to it even more, from what I see,” he said. “As photographers, we’re not typically drawn to things that have that newish look, but this particular fish house, I’ve just seen so many phenomenal photos of it.” + +“People do drive down there just to get that shot,” said [Beth Currie](https://www.instagram.com/wheniwas21_/), of Sarnia, Ontario, who’s been coming to Kennebunkport seasonally long enough to remember the old structure on the same site. She posted her first pic of the new one last January, with a caption that read, “To me, this fish house looks like it’s been in this place for years!” It got more Instagram hearts than anything she’d ever posted before. + +“It looks like that house was put there for the purpose of taking pictures,” said [Isaac Crabtree](https://www.instagram.com/northwoodsaerial/), of Greenville, who made the trip to Cape Porpoise in July to shoot it with his drone. “It’s like Portland Head Light — that lighthouse was built for taking pictures. I didn’t know the fish house was new when I saw the photos. I thought they must have done some work to it, but in my head, when I saw it, it evoked these older pictures of fish houses on stilts. It was like they built this as the quintessential building, like they were honoring all those old ones people get nostalgic about.” + +No one, I suspect, is more delighted to read these comments than Bob Zuke, who, with his wife, Linda, took me out to their fish house one afternoon in September. The tide was high, and there is no boardwalk to access the building — putting one in requires permits the Zukes don’t have. I had no boots, so I took off my socks, rolled my jeans to my knees, and squelched in my sneakers through calf-high water to a wooden ladder that reached the fish house door. + +“I like my stuff to look old,” Bob declared, as we picked our way through the marsh grasses. “I like to build stuff that could be 100 years old.” + +Bob, who is 57, started building stuff professionally when he was 18, starting his own roofing and construction company when he was 22. Before that, as a high school kid in nearby Biddeford, he worked part-time as a sternman on a lobsterboat out of Cape Porpoise Harbor. When the boat would pass the old brownish-shingled structure — ramshackle, then, but still standing — Bob said he would point to it and proclaim out loud, “I’m going to own that someday.” + +Not that he ever wanted to fish — both his and Linda’s families go back generations in Maine, but neither are fishing families. He was, he told me, just “an odd duck” who, even as a kid, was preoccupied with owning real estate and fixing things up. These days, he does plenty of both, and you can’t drive for long around the Kennebunks or neighboring Arundel, where the Zukes live, without spotting a sign proclaiming ZUKE in large, blocky white letters on a truck or at a project site. + +Bob and Linda welcomed me into the fish house like I was a neighbor dropping by for coffee. Bob is a gregarious, sturdy guy with a crew cut who jokes in a respectable Maine accent about wearing the same white work shirt and Dickies every day. He could be cast as a lovably gruff blue-collar dad in a ’50s sitcom. Linda, 53, is equally warm, if quieter than her booming husband. She’s an owner and controller at an auto dealership her father founded, and she’s active on boards and committees around the Kennebunks, including as a trustee at the [Kennebunkport Conservation Trust](http://www.kporttrust.org/). (Full disclosure: While chitchatting in the fish house, I learned that Linda has sat on the planning board for a Kennebunks festival that *Down East* has sponsored.) + +On the inside, the one-and-a-half-story fish house marries rustic and snazzy much as it does on the outside — it’s like somebody’s upscale summer cottage. The walls are made from weathered fir planks Bob salvaged from a Drake’s Island cottage he worked on more than 20 years ago (he has a tendency to hoard such things). The oak trim and flooring were leftovers gifted from a client whose house he worked on more recently. The reupholstered furniture belonged to a cousin. Paintings by local artists — mostly colorful folk-art seascapes — adorn the walls, and a beautifully carved wooden whale hangs from the ceiling of a kitchen area that wouldn’t look out of place in a stylish homes magazine (stove-free, as there’s wiring and lights but no power unless the Zukes hook up a generator). + +“Everything in here comes with a story, most of it’s salvaged, and it all comes from the state of Maine,” Bob said proudly. + +On one side of the open-concept first floor, next to a pair of bay doors, stood a couple of sawhorses next to a workbench scattered with tools. This area, Bob and Linda said, will be the shop for their lobsterman kids to stash and work on their gear. The Zukes have three adult sons, the youngest of whom, Wyatt, is a welder. The older two are fishermen. Julian, 24, started apprenticing with local lobstermen when he was 10 and got his first boat at 14. Joe, 22, is a student at Maine Maritime Academy. When I showed up at the Zukes’ house that morning, Joe was out front, loading traps into a pickup truck. Julian was fishing offshore, his charts spread all over the dining room table. + +![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201024%20512'%3E%3C/svg%3E) + +*Most of the Cape Porpoise fleet fishes year-round.* + +It’s thanks to his sons that Bob fulfilled his teenage dream of owning the fish house. The Zukes bought the parcel from a lobsterman, Robert O’Reilly, who had owned it — along with the former building and its post-collapse remnants — since 1986. In 2008, O’Reilly applied for a building permit from the town of Kennebunkport to build a replacement structure on the site, and the permit was granted, stipulating that any replacement would be limited to water-dependent uses, consistent with Cape Porpoise’s traditional working waterfront. O’Reilly’s attempts at construction started and sputtered, and his permit was renewed twice before being transferred to the Zukes when they bought the property in 2016. They renewed the permit, envisioning a first-class space that Julian and Joe — who, like most of the village’s fleet, don’t live in Kennebunkport — could use instead of trucking their gear to Arundel or elsewhere.  + +“I paid $200,000 for like an eighth of an acre of mud,” Bob said. + +“And a permit,” Linda chimed in.  + +> “It looks like that house was put there for the purpose of taking pictures. . . . It was like they built this as the quintessential building, like they were honoring all those old ones people get nostalgic about.” + +“Everybody thinks it’s a house we’ve built out here,” Bob went on, “but it’s not a residence, and I’d never want it to be one.” He’d also never be permitted to build one over coastal wetlands — or, in all likelihood, any other project that wasn’t a marine commercial building replacing a marine commercial building. + +The Zukes said they’re wading through the permitting process to put in a wharf, so their kids can tie up their boats. In the meantime, Bob said, some neighbors have given him a hard time for putting up a structure that seems, well, a bit elegant for a working building. But even the saltiest lobstermen appreciate a nice place to sit and snack, Bob said. What was he supposed to do, hang sheet metal on the sides and tie a blue tarp to the roof? + +“When you’re used to doing quality work all the time, it’s just what you do,” he said. + +Both Zukes told me they fear a day when Cape Porpoise loses all its fishing-village character, as they think Langsford Road largely has. They see their fish house — however spiffy, however perched above sensitive marshland — as an effort to restore a piece of it. + +“Conservation, to me, is not only about a view or making a path to walk on,” Linda said. “Conservation is about heritage, and it’s about a way of life.” + +Bob worries about a day when Bradbury Brothers, the town market, can’t stay open all year for lack of year-round residents. This summer, he went to Stonington, Maine’s top fishing port by landings, and he told me it reminded him of the Cape Porpoise of his youth. + +“Because of all the lobsterboats?” I asked.  + +“Because the people there mow their own lawns,” he said. + +The Zukes are proud that their boys are among a handful of Cape Porpoise fishermen under 30, but they wonder what those demographics might mean for the future of the fleet.  + +“If the commercial fishery were to go away, then what is this?” Bob said, gesturing out the open bay doors at the shore. “It’s just going to be a shell, no local color, no local flavor. People will come here just to see the same thing they left.” + +They may still come to see the Zuke fish house, of course. Bob and Linda said they’re constantly pulling up on Langsford Road to find someone snapping a photo. Paintings of the building, by local and visiting artists, fill a whole wall of Linda’s office at the dealership. “It’s just a great compliment to what it is and where it is,” Bob said. + +Gary Eaton sees things differently. + +Eaton is the Zukes’ neighbor on Langsford Road. He owns that striking red former fish house that Robert Dennis — and swarms of Instagrammers since — used to frame shots of the Zukes’ building. And if photographers or painters are drawn to Langsford Road, he told me on the phone, it’s because of the cove’s natural beauty, the chain of islands at the harbor’s mouth, and the white pillar of Goat Island Light silhouetted against the sky — *not* because of the Zuke fish house, which inhibits that view. Eaton, with some other neighbors who’ve publicly echoed him, thinks it shouldn’t have been built and ought to be demolished, and he’s spent much of the last two years approaching town committees and officials, state agencies, and newspaper editorial pages to explain why. + +Eaton is 64 and grew up on Langsford Road. His granddad moved to the neighborhood from Nova Scotia, fished a while, then started a wholesale lobster business that Eaton’s dad eventually took over. In his childhood, his grandparents lived two doors down and his aunt and uncle up the street. “It was fishermen and lobstermen and everybody knew everybody,” he said. + +He worked summers with his dad and loved being on the water, but he didn’t want a life in fishing. So he moved out west in his 20s and has bounced around since, mostly working in the energy industry. He never got back much, but in recent years, he’s been spending summers in Cape Porpoise. He and his wife sailed up this year from their home in southwest Florida. They’ve worked on the family’s red fish house — “gentrified into a clubhouse,” Eaton joked, with a bar and nautical memorabilia. His 96-year-old mother’s house is still a few doors down, but his grandparents’ place was sold and “McMansioned,” he said, like many other houses on his street. His aunt and uncle’s house was demolished and replaced with rental units. Eaton said he doesn’t know much of anybody on Langsford Road anymore. + +He has multiple criticisms of the process that allowed for the Zuke fish house, and these can bog down a bit in legalese. Eaton emailed me a 20-point summary, with many attachments. Concisely, he argues that the town of Kennebunkport violated its own ordinances — first, by repeatedly renewing a building permit for the lobsterman who sold it to the Zukes, and secondly, by renewing that permit when the Zukes bought the land, without review from the town’s planning board. (In an emailed response, Kennebunkport’s director of planning and development essentially wrote that Eaton misreads the ordinances.) + +> The whole tenor of the town now and the fabric of it . . . it’s just a whole different thing now, and I didn’t realize how good it was. + +What’s more, Eaton insists, the whole narrative of the site once hosting a fish house was ginned up to boost the “working waterfront” cred of permit applications. His grandfather sold the property, structure-less, to a neighbor in the 1920s. The building that went up afterwards, Eaton says, was only ever used for boat storage, never to facilitate lobstering. He has testimonials supporting this. (The Zukes, for their part, point to old postcard images showing what they say is a fish house and wharf on the site before Eaton’s grandfather owned it. Robert O’Reilly, who sold them the site, has claimed he used the former building for his lobstering business before its collapse in the early ’90s.) + +Eaton is aware that his arguments defy quick summary. “If you’re just picking pieces from all this,” he told me gingerly, “it can make me look like an utter ass when you piece it together.”  + +So for the record, Eaton does not strike me as an utter ass. Or even as some NIMBYite with an axe to grind. Like the Zukes, he laments a loss of cohesion on Langsford Road and around Cape Porpoise — but he sees the permitting of their fish house as a symptom of a heedlessness that’s driving it. Atop his more granular misgivings is an overarching one: that what the Zukes really want is a recreational hangout, plush and Instagram-chic, and that their sons — who could get by fine without a fish house, like most every lobsterman — are the “loophole” by which they’re obtaining it.  + +“The whole tenor of the town now and the fabric of it, how people interact, it’s all different,” he told me. “When I come back here — and the Zuke issue is part and parcel of this — it’s hard for me to accept what’s gone on.” He paused. “It’s just a whole different thing now,” he said, “and I didn’t realize how good it was.” + +The Zukes didn’t want to talk much about Eaton or others who object to their fish house. What little they had to say was tinged with an old-school Maine skepticism of those who’ve gone “away” and then come back complaining — Eaton, born and raised in Cape Porpoise, committed the cardinal Maine sin of relinquishing his birthright, his native status. + +Their reactions also seemed tinged with hurt. At their home, the morning I visited, the Zukes showed me a photo album with shots of their boys as teens and tweens. (Bob is “not on the computer,” he said — never mind Instagram — so he likes having photos printed in albums.) Linda pointed to an old picture of her sons, just kids, wearing full oil gear and standing on the deck of a fishing boat.  + +“There they are,” she said wryly, “our ‘loopholes.’” + +Gary Eaton looks at a building over the water and sees a symbol of the forces transforming his community. The Zukes look at the same building and see a symbol of resistance against those forces. I can’t say which side is right. I can say that both seem genuine in their love of Cape Porpoise and their hopes for its future, and it saddens me to see them at odds — because all across Maine are towns like Cape Porpoise that need voices as passionate as theirs. + +In June, I brought my sons to the Cape Porpoise pier on a Sunday morning to watch the annual Blessing of the Fleet, a centuries-old tradition in maritime communities. We sat cross-legged as a robed Episcopal minister read from Psalms, offered a prayer, then sprinkled water on the pier while relaying his blessing, fishing boats bobbing behind him.  + +I took a picture of that last part, and naturally, I posted it to Instagram. I added a caption with a line I liked from the benediction. “For all who draw pleasure from the beauty of the sea,” the minister said, “bring us all to the harbor of light and peace.” + +  +  + +--- +`$= dv.el('center', 'Source: ' + dv.current().Link + ', ' + dv.current().Date.toLocaleString("fr-FR"))` \ No newline at end of file diff --git a/00.08 Bookmarks/Bookmarks - Work.md b/00.08 Bookmarks/Bookmarks - Work.md index 0af147ac..1cbf51df 100644 --- a/00.08 Bookmarks/Bookmarks - Work.md +++ b/00.08 Bookmarks/Bookmarks - Work.md @@ -69,7 +69,8 @@ image: https://cdn.wallpaper.com/main/styles/fp_1540x944/s3/07_no_6_babmaes_stre   -- [ ] :label: [[Bookmarks - Work]]: review bookmarks %%done_del%% 🔁 every 3 months 📅 2023-12-16 +- [ ] :label: [[Bookmarks - Work]]: review bookmarks %%done_del%% 🔁 every 3 months 📅 2024-03-16 +- [x] :label: [[Bookmarks - Work]]: review bookmarks %%done_del%% 🔁 every 3 months 📅 2023-12-16 ✅ 2023-12-16 - [x] :label: [[Bookmarks - Work]]: review bookmarks %%done_del%% 🔁 every 3 months 📅 2023-09-16 ✅ 2023-09-11 - [x] :label: [[Bookmarks - Work]]: review bookmarks %%done_del%% 🔁 every 3 months 📅 2023-06-16 ✅ 2023-06-16 - [x] :label: [[Bookmarks - Work]]: review bookmarks %%done_del%% 🔁 every 3 months 📅 2023-03-16 ✅ 2023-03-16 diff --git a/01.01 Life Orga/@Finances.md b/01.01 Life Orga/@Finances.md index fc7e4261..0ce09689 100644 --- a/01.01 Life Orga/@Finances.md +++ b/01.01 Life Orga/@Finances.md @@ -112,7 +112,8 @@ hide task count - [ ] :moneybag: [[@Finances]]: Transfer UK pension to CH %%done_del%% 🔁 every year 📅 2024-10-31 - [x] :moneybag: [[@Finances]]: Transfer UK pension to CH %%done_del%% 🔁 every year 📅 2023-10-31 ✅ 2023-10-28 -- [ ] :heavy_dollar_sign: [[@Finances|Finances]]: update crypto prices within Obsidian %%done_del%% 🔁 every month on the 2nd Tuesday 📅 2023-12-12 +- [ ] :heavy_dollar_sign: [[@Finances|Finances]]: update crypto prices within Obsidian %%done_del%% 🔁 every month on the 2nd Tuesday 📅 2024-01-09 +- [x] :heavy_dollar_sign: [[@Finances|Finances]]: update crypto prices within Obsidian %%done_del%% 🔁 every month on the 2nd Tuesday 📅 2023-12-12 ✅ 2023-12-12 - [x] :heavy_dollar_sign: [[@Finances|Finances]]: update crypto prices within Obsidian %%done_del%% 🔁 every month on the 2nd Tuesday 📅 2023-11-14 ✅ 2023-11-10 - [x] :heavy_dollar_sign: [[@Finances|Finances]]: update crypto prices within Obsidian %%done_del%% 🔁 every month on the 2nd Tuesday 📅 2023-10-10 ✅ 2023-10-10 - [x] :heavy_dollar_sign: [[@Finances|Finances]]: update crypto prices within Obsidian %%done_del%% 🔁 every month on the 2nd Tuesday 📅 2023-09-12 ✅ 2023-09-11 diff --git a/01.02 Home/@Shopping list.md b/01.02 Home/@Shopping list.md index ef52de20..aac0e36e 100644 --- a/01.02 Home/@Shopping list.md +++ b/01.02 Home/@Shopping list.md @@ -119,15 +119,15 @@ style: number - [x] 🍎 Fruit ✅ 2023-12-08 - [x] 🍌 Bananas ✅ 2023-09-23 -- [x] 🍅 Tomatoes ✅ 2023-12-02 +- [x] 🍅 Tomatoes ✅ 2023-12-15 - [x] 🫑 Bell pepper ✅ 2023-12-08 - [x] 🥦 Fennel ✅ 2022-10-29 - [x] 🥦 Radish ✅ 2022-10-29 - [x] 🥦 Broccoli ✅ 2023-12-08 - [x] 🫛 Green beans ✅ 2023-10-25 - [x] 🫘 Red beans ✅ 2023-12-08 -- [x] 🧅 Onions ✅ 2023-11-22 -- [x] 🧅 Spring onion ✅ 2023-09-06 +- [x] 🧅 Onions ✅ 2023-12-15 +- [x] 🧅 Spring onion ✅ 2023-12-15 - [x] 🧄 Garlic ✅ 2023-11-22 - [x] 🍋 Lemon ✅ 2023-12-08 - [x] 🍋 Lime ✅ 2023-11-22 @@ -139,11 +139,11 @@ style: number - [x] 🥩 Cured meat ✅ 2022-12-31 - [x] 🍖 Fresh meat ✅ 2023-11-04 -- [x] 🍖 Minced meat ✅ 2023-12-08 +- [x] 🍖 Minced meat ✅ 2023-12-15 - [x] 🥓 Bacon ✅ 2023-04-07 - [x] 🐔 Chicken thighs ✅ 2023-10-07 -- [x] 🐔 Chicken breasts ✅ 2023-12-02 -- [x] 🌭 Spicy sausage ✅ 2023-12-08 +- [x] 🐔 Chicken breasts ✅ 2023-12-15 +- [x] 🌭 Spicy sausage ✅ 2023-12-15 - [x] 🐟 Salmon fillet ✅ 2022-10-29   @@ -151,10 +151,10 @@ style: number #### Bases - [x] 🍝 Pasta ✅ 2023-10-26 -- [x] 🍜 Noodles ✅ 2023-12-08 +- [x] 🍜 Noodles ✅ 2023-12-15 - [x] 🌾 Bulgur ✅ 2022-10-29 - [x] 🍚 Rice ✅ 2023-11-10 -- [x] 🥔 Potatoes ✅ 2023-11-25 +- [x] 🥔 Potatoes ✅ 2023-12-15 - [x] 🥣 Soup ✅ 2023-06-12   @@ -189,7 +189,7 @@ style: number - [x] 🌿 Bay leaves ✅ 2022-08-05 - [x] 🌿 Oregano ✅ 2022-03-14 - [x] 🌿 Herbes de Provence ✅ 2022-03-14 -- [x] 🌿 Coriander ✅ 2023-12-02 +- [x] 🌿 Coriander ✅ 2023-12-15 - [x] 🌿 Parsley ✅ 2023-10-08 - [x] 🌿 Fresh mint ✅ 2023-01-09 @@ -198,8 +198,8 @@ style: number #### Condiments - [x] 🌭 Mustard ✅ 2022-12-24 -- [x] 🫒 Olive oil ✅ 2023-09-13 -- [x] 🥑 Avocado oil ✅ 2023-06-15 +- [x] 🫒 Olive oil ✅ 2023-12-14 +- [x] 🥑 Avocado oil ✅ 2023-12-14 - [x] 🥗 Vinegar ✅ 2023-01-19 - [x] 🥣 Beef broth ✅ 2022-08-05 - [x] 🥣 Chicken broth ✅ 2023-04-18 @@ -239,7 +239,7 @@ style: number   -- [x] 🚿 shower gel ✅ 2023-09-13 +- [x] 🚿 shower gel ✅ 2023-12-15 - [x] 🧴shampoo ✅ 2023-03-26 - [x] 🪥 toothbrush ✅ 2022-02-06 - [x] 🦷 toothpaste ✅ 2023-03-26 diff --git a/01.02 Home/Household.md b/01.02 Home/Household.md index 09632f09..3ce7600f 100644 --- a/01.02 Home/Household.md +++ b/01.02 Home/Household.md @@ -75,7 +75,8 @@ style: number - [ ] ♻ [[Household]]: *Paper* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-12-19 - [x] ♻ [[Household]]: *Paper* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-12-05 ✅ 2023-12-05 -- [ ] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-12-12 +- [ ] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-12-26 +- [x] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-12-12 ✅ 2023-12-12 - [x] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-11-28 ✅ 2023-11-28   @@ -83,7 +84,8 @@ style: number #### 🏠 House chores - [ ] 🛎️ :house: [[Household]]: Pay rent %%done_del%% 🔁 every month on the last 📅 2023-12-31 -- [ ] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-12-18 +- [ ] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-12-25 +- [x] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-12-18 ✅ 2023-12-16 - [x] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-12-11 ✅ 2023-12-08 - [x] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-12-04 ✅ 2023-12-01 - [ ] :bed: [[Household]] Change bedsheets %%done_del%% 🔁 every 2 weeks on Saturday 📅 2023-12-23 diff --git a/01.02 Home/Life mementos.md b/01.02 Home/Life mementos.md index ec95f5a9..0158971d 100644 --- a/01.02 Home/Life mementos.md +++ b/01.02 Home/Life mementos.md @@ -107,7 +107,7 @@ title: *Rudyard Kipling*, **If**, 1910   -### Wealth +### Self   @@ -124,6 +124,27 @@ favicon: https://m.youtube.com/static/favicon.ico   +--- + +  + +### Friends + +  + +> [!quote] *Martin Luther King* +> > In the End, we will remember not the words of our enemies, but the silence of our friends + +  + +--- + +  + +### Wealth + +  + > [!quote] *Lao Tseu* > > Celui qui se contente est riche. > diff --git a/01.02 Home/Vinyls.md b/01.02 Home/Vinyls.md index 67880df1..3c1b119d 100644 --- a/01.02 Home/Vinyls.md +++ b/01.02 Home/Vinyls.md @@ -116,6 +116,7 @@ style: number - [ ] Metallica - [ ] Nirvana - [ ] Noir Désir +- [ ] The Clash - London Calling   diff --git a/02.02 Paris/@@Paris.md b/02.02 Paris/@@Paris.md index a3f36d5e..c242f52a 100644 --- a/02.02 Paris/@@Paris.md +++ b/02.02 Paris/@@Paris.md @@ -114,7 +114,8 @@ dv.view("00.01 Admin/dv-views/query_place", {placetype: dv.current().QPType, dat   -- [ ] :birthday: **Virginie Parent**, [[@@Paris|Paris]] %%done_del%% 🔁 every year 📅 2023-12-12 +- [ ] :birthday: **Virginie Parent**, [[@@Paris|Paris]] %%done_del%% 🔁 every year 📅 2024-12-12 +- [x] :birthday: **Virginie Parent**, [[@@Paris|Paris]] %%done_del%% 🔁 every year 📅 2023-12-12 ✅ 2023-12-12 - [x] :birthday: **Virginie Parent**, [[@@Paris|Paris]] %%done_del%% 🔁 every year 📅 2022-12-12 ✅ 2022-12-15   diff --git a/03.02 Travels/Atzmännig Goldingen.md b/03.02 Travels/Atzmännig Goldingen.md new file mode 100644 index 00000000..077f53ec --- /dev/null +++ b/03.02 Travels/Atzmännig Goldingen.md @@ -0,0 +1,125 @@ +--- + +Alias: [""] +Tag: ["🏔️", "🎿", "🇨🇭"] +Date: 2023-12-10 +DocType: "Place" +Hierarchy: "NonRoot" +TimeStamp: +location: [47.2847985,8.9963674] +Place: + Type: Sport + SubType: Skiing + Style: Swiss + Location: Zürich + Country: CH + Status: Tested +CollapseMetaTable: true +Phone: "+41 55 284 64 34" +Email: "info@atzmaennig.ch" +Website: "[Rodelbahn, Seilpark, Freizeitpark und Erlebnisweg im Atzmännig im Sommer / Atzmännig](https://www.atzmaennig.ch/)" + +--- + +Parent:: [[@Switzerland|Switzerland]], [[Skiing in Switzerland]] + +  + +```dataviewjs +let tempPhone = dv.current().Phone ? dv.current().Phone.replaceAll(" ", "") : '+000' +let tempMail = dv.current().Email ? dv.current().Email : "" +let tempCoorSet = dv.current().location ? dv.current().location : [0,0] +dv.el('center', '[📲](tel:' + tempPhone + ')     [📧](mailto:' + tempMail + ')     [🗺️](' + "https://waze.com/ul?ll=" + tempCoorSet[0] + "%2C" + tempCoorSet[1] + "&navigate=yes" + ')') +``` + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-AtzmaennigGoldingenSave + +  + +# Atzmännig Goldingen + +  + +> [!summary]+ +> Note Description + +  + +```toc +style: number +``` + +  + +--- + +  + +### 📇 Contact + +  + +> [!address] 🗺 +> RestTalstation Atzmännig 821 +> 8735 Rüeterswil +> Switzerland + +  + +☎️ `= this.Phone` + +📧 `= this.Email` + +🌐 `= this.Website` + +  + +--- + +  + +### 🗒 Notes + +  + +[infosnow.ch](http://www.infosnow.ch/~apgmontagne/?tab=web&xid=187&saison=1&lang=de) + +  + +|   |   | +| --------------------- |:--------------------------:| +| **Day pass** | *35 CHF / 27 CHF (4h)* | +| **Size of domain** | *Small* | +| **Restaurants** | *2* | +| **Time to ZH** | Car: *45m* | +| **Easy car park** | *Yes: Schutt* | +| **Parking for 1 day** | *5 CHF* | + +  + +--- + +  + +### 🔗 Other activity + +  + +```dataview +Table DocType as "Doc type" from [[Atzmännig Goldingen]] +where !contains(file.name, "@@Travel") +sort DocType asc +``` + +  +  \ No newline at end of file diff --git a/03.03 Food & Wine/!!Wine.md b/03.03 Food & Wine/!!Wine.md index 8e946c1a..cd833a95 100644 --- a/03.03 Food & Wine/!!Wine.md +++ b/03.03 Food & Wine/!!Wine.md @@ -74,6 +74,19 @@ style: number   +### Notes + +  + +1. erich Meier +2. Schwarzerbach + +  + +--- + +  + ### Search [[#^Top|TOP]]   diff --git a/05.01 Computer setup/Storage and Syncing.md b/05.01 Computer setup/Storage and Syncing.md index db9148e9..d741eead 100644 --- a/05.01 Computer setup/Storage and Syncing.md +++ b/05.01 Computer setup/Storage and Syncing.md @@ -183,7 +183,8 @@ The following Apps require a manual backup: - [x] :floppy_disk: Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] %%done_del%% 🔁 every 3 months on the 1st Friday 📅 2023-10-06 ✅ 2023-10-06 - [x] :floppy_disk: Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] %%done_del%% 🔁 every 3 months on the 1st Friday 📅 2023-07-07 ✅ 2023-07-07 - [x] :floppy_disk: Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] %%done_del%% 🔁 every 3 months on the 1st Friday 📅 2023-04-07 ✅ 2023-04-06 -- [ ] :cloud: [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] %%done_del%% 🔁 every 3 months on the 2nd Monday 📅 2023-12-11 +- [ ] :cloud: [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] %%done_del%% 🔁 every 3 months on the 2nd Monday 📅 2024-03-11 +- [x] :cloud: [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] %%done_del%% 🔁 every 3 months on the 2nd Monday 📅 2023-12-11 ✅ 2023-12-16 - [x] :cloud: [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] %%done_del%% 🔁 every 3 months on the 2nd Monday 📅 2023-09-11 ✅ 2023-09-11 - [x] :cloud: [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] %%done_del%% 🔁 every 3 months on the 2nd Monday 📅 2023-06-12 ✅ 2023-06-12 - [ ] :camera: [[Storage and Syncing|Storage & Sync]]: Transfer pictures to ED %%done_del%% 🔁 every 3 months on the 2nd Thursday 📅 2024-01-11 diff --git a/05.02 Networks/Configuring UFW.md b/05.02 Networks/Configuring UFW.md index d0ca1ddd..9ced653b 100644 --- a/05.02 Networks/Configuring UFW.md +++ b/05.02 Networks/Configuring UFW.md @@ -237,7 +237,8 @@ sudo bash /etc/addip4ban/addip4ban.sh #### Ban List Tasks -- [ ] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-12-16 +- [ ] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-12-23 +- [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-12-16 ✅ 2023-12-16 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-12-09 ✅ 2023-12-08 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-12-02 ✅ 2023-12-01 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-11-25 ✅ 2023-11-24 @@ -285,7 +286,8 @@ sudo bash /etc/addip4ban/addip4ban.sh - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-08-12 ✅ 2023-08-07 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-08-05 ✅ 2023-08-05 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-07-29 ✅ 2023-08-04 -- [ ] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-12-16 +- [ ] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-12-23 +- [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-12-16 ✅ 2023-12-16 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-12-09 ✅ 2023-12-08 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-12-02 ✅ 2023-12-01 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-11-25 ✅ 2023-11-24 diff --git a/06.02 Investments/Crypto Tasks.md b/06.02 Investments/Crypto Tasks.md index 0e50fb4d..7ea35624 100644 --- a/06.02 Investments/Crypto Tasks.md +++ b/06.02 Investments/Crypto Tasks.md @@ -83,7 +83,8 @@ All tasks and to-dos Crypto-related. - [x] :ballot_box: [[Crypto Tasks]]: Vote for [[EOS]] block producers %%done_del%% 🔁 every month on the 1st Tuesday 📅 2023-03-07 ✅ 2023-03-07 - [x] :ballot_box: [[Crypto Tasks]]: Vote for [[EOS]] block producers %%done_del%% 🔁 every month on the 1st Tuesday 📅 2023-02-07 ✅ 2023-02-06 - [x] :ballot_box: [[Crypto Tasks]]: Vote for [[EOS]] block producers %%done_del%% 🔁 every month on the 1st Tuesday 📅 2023-01-03 ✅ 2023-01-03 -- [ ] :chart: Check [[Nimbus]] earnings %%done_del%% 🔁 every month on the 2nd Monday 📅 2023-12-11 +- [ ] :chart: Check [[Nimbus]] earnings %%done_del%% 🔁 every month on the 2nd Monday 📅 2024-01-08 +- [x] :chart: Check [[Nimbus]] earnings %%done_del%% 🔁 every month on the 2nd Monday 📅 2023-12-11 ✅ 2023-12-11 - [x] :chart: Check [[Nimbus]] earnings %%done_del%% 🔁 every month on the 2nd Monday 📅 2023-11-13 ✅ 2023-11-10 - [x] :chart: Check [[Nimbus]] earnings %%done_del%% 🔁 every month on the 2nd Monday 📅 2023-10-09 ✅ 2023-10-09 - [x] :chart: Check [[Nimbus]] earnings %%done_del%% 🔁 every month on the 2nd Monday 📅 2023-09-11 ✅ 2023-09-11