You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

352 lines
449 KiB

2 years ago
/*
3 years ago
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
3 years ago
if you want to view the source visit the plugins github repository
*/
/*
License obsidian-tasks:
MIT License
Copyright (c) 2021 Martin Schenck and Clare Macrae
3 years ago
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/*
License rrule (included library):
rrule.js: Library for working with recurrence rules for calendar dates.
=======================================================================
Copyright 2010, Jakub Roztocil <jakub@roztocil.name> and Lars Schöning
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of The author nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
./rrule.js and ./test/tests.js is based on python-dateutil. LICENCE:
python-dateutil - Extensions to the standard Python datetime module.
====================================================================
Copyright (c) 2003-2011 - Gustavo Niemeyer <gustavo@niemeyer.net>
Copyright (c) 2012 - Tomi Pieviläinen <tomi.pievilainen@iki.fi>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
License chrono-node (included library):
The MIT License
Copyright (c) 2014, Wanasit Tanakitrungruang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
8 months ago
"use strict";var Gk=Object.create;var fa=Object.defineProperty,Yk=Object.defineProperties,Bk=Object.getOwnPropertyDescriptor,Hk=Object.getOwnPropertyDescriptors,Vk=Object.getOwnPropertyNames,eu=Object.getOwnPropertySymbols,zk=Object.getPrototypeOf,xc=Object.prototype.hasOwnProperty,Vh=Object.prototype.propertyIsEnumerable;var Hh=(r,e,t)=>e in r?fa(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,X=(r,e)=>{for(var t in e||(e={}))xc.call(e,t)&&Hh(r,t,e[t]);if(eu)for(var t of eu(e))Vh.call(e,t)&&Hh(r,t,e[t]);return r},be=(r,e)=>Yk(r,Hk(e));var tu=(r,e)=>{var t={};for(var n in r)xc.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&eu)for(var n of eu(r))e.indexOf(n)<0&&Vh.call(r,n)&&(t[n]=r[n]);return t};var k=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Kk=(r,e)=>{for(var t in e)fa(r,t,{get:e[t],enumerable:!0})},zh=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Vk(e))!xc.call(r,i)&&i!==t&&fa(r,i,{get:()=>e[i],enumerable:!(n=Bk(e,i))||n.enumerable});return r};var pa=(r,e,t)=>(t=r!=null?Gk(zk(r)):{},zh(e||!r||!r.__esModule?fa(t,"default",{value:r,enumerable:!0}):t,r)),Qk=r=>zh(fa({},"__esModule",{value:!0}),r);var L=(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 De=k($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.matchAnyPattern=$n.extractTerms=$n.repeatedTimeunitPattern=void 0;function eE(r,e){let t=e.replace(/\((?!\?)/g,"(?:");return`${r}${t}\\s{0,5}(?:,?\\s{0,5}${t}){0,10}`}$n.repeatedTimeunitPattern=eE;function Kh(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}$n.extractTerms=Kh;function tE(r){return`(?:${Kh(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}$n.matchAnyPattern=tE});var _e=k((Mc,Cc)=>{(function(r,e){typeof Mc=="object"&&typeof Cc!="undefined"?Cc.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(Mc,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",d="year",p="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|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,E={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("_")},R=function(G,N,O){var B=String(G);return!B||B.length>=N?G:""+Array(N+1-B.length).join(O)+G},x={s:R,z:function(G){var N=-G.utcOffset(),O=Math.abs(N),B=Math.floor(O/60),U=O%60;return(N<=0?"+":"-")+R(B,2,"0")+":"+R(U,2,"0")},m:function G(N,O){if(N.date()<O.date())return-G(O,N);var B=12*(O.year()-N.year())+(O.month()-N.month()),U=N.clone().add(B,l),Q=O-U<0,f=N.clone().add(B+(Q?-1:1),l);return+(-(B+(O-U)/(Q?U-f:f-U))||0)},a:function(G){return G<0?Math.ceil(G)||0:Math.floor(G)},p:function(G){return{M:l,y:d,w:u,d:o,D:p,h:a,m:s,s:i,ms:n,Q:c}[G]||String(G||"").toLowerCase().replace(/s$/,"")},u:function(G){return G===void 0}},v="en",V={};V[v]=E;var $=function(G){return G instanceof de},ee=function(G,N,O){var B;if(!G)return v;if(typeof G=="string")V[G]&&(B=G),N&&(V[G]=N,B=G);else{var U=G.name;V[U]=G,B=U}return!O&&B&&(v=B),B||!O&&v},Y=function(G,N){if($(G))return G.clone();var O=typeof N=="object"?N:{};return O.date=G,O.args=arguments,new de(O)},q=x;q.l=ee,q.i=$,q.w=function(G,N){return Y(G,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var de=function(){function G(O){this.$L=ee(O.locale,null,!0),this.parse(O)}var N=G.prototype;return N.parse=function(O){this.$d=function(B){var U=B.date,Q=B.utc;if(U===null)return new Date(NaN);if(q.u(U))return new Date;if(U instanceof Date)return new Date(U);if(typeof U=="string"&&!/Z$/i.test(U)){var f=U.match(b);if(f){var h=f[2]-1||0,y=(f[7]||"0").substring(0,3);return Q?new
`).map(RP).filter(function(t){return t!==null});return gt(gt({},e[0]),e[1])}function _o(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=go(i),e}function RP(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return W_(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return W_(r);case"DTSTART":return _o(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function W_(r){var e=r.replace(/^RRULE:/i,""),t=_o(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=fe[o.toUpperCase()];break;case"WKST":t.wkst=yr[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=MP(o),l=a.toLowerCase();t[l]=u;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=CP(o);break;case"DTSTART":case"TZID":var c=_o(r);t.tzid=c.tzid,t.dtstart=c.dtstart;break;case"UNTIL":t.until=go(o);break;case"BYEASTER":t.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),t}function MP(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(q_)}return q_(r)}function q_(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function CP(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return yr[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=yr[s].weekday;return new Ke(a,i)})}var xi=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=bs(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:M_(this.date,this.tzid)},r}();function wo(r){for(var e=[],t="",n=Object.keys(r),i=Object.keys(To),s=0;s<n.length;s++)if(n[s]!=="tzid"&&!!ge(i,n[s])){var a=n[s].toUpperCase(),o=r[n[s]],u="";if(!(!Pe(o)||ht(o)&&!o.length)){switch(a){case"FREQ":u=z.FREQUENCIES[r.freq];break;case"WKST":Qt(o)?u=new Ke(o).toString():u=o.toString();break;case"BYWEEKDAY":a="BYDAY",u=E_(o).map(function(m){return m instanceof Ke?m:ht(m)?new Ke(m[0],m[1]):new Ke(m)}).toString();break;case"DTSTART":t=AP(o,r.tzid);break;case"UNTIL":u=bs(o,!r.tzid);break;default:if(ht(o)){for(var l=[],c=0;c<o.length;c++)l[c]=String(o[c]);u=l.toString()}else u=String(o)}u&&e.push([a,u])}}var d=e.map(function(m){var b=m[0],g=m[1];return"".concat(b,"=").concat(g.toString())}).join(";"),p="";return d!==""&&(p="RRULE:".concat(d)),[t,p].filter(function(m){return!!m}).join(`
`)}function AP(r,e){return r?"DTSTART"+new xi(new Date(r),e).toString():""}function PP(r,e){return Array.isArray(r)?!Array.isArray(e)||r.length!==e.length?!1:r.every(function(t,n){return t.getTime()===e[n].getTime()}):r instanceof Date?e instanceof Date&&r.getTime()===e.getTime():r===e}var j_=function(){function r(){this.all=!1,this.before=[],this.after=[],this.between=[]}return r.prototype._cacheAdd=function(e,t,n){t&&(t=t instanceof Date?tl(t):km(t)),e==="all"?this.all=t:(n._value=t,this[e].push(n))},r.prototype._cacheGet=function(e,t){var n=!1,i=t?Object.keys(t):[],s=function(c){for(var d=0;d<i.length;d++){var p=i[d];if(!PP(t[p],c[p]))return!0}return!1},a=this[e];if(e==="all")n=this.all;else if(ht(a))for(var o=0;o<a.length;o++){var u=a[o];if(!(i.length&&s(u))){n=u._value;break}}if(!n&&this.all){for(var l=new En(e,t),o=0;o<this.all.length&&l.accept(this.all[o]);o++);n=l.getValue(),this._cacheAdd(e,n,t)}return ht(n)?km(n):n instanceof Date?tl(n):n},r}();var $_=W(W(W(W(W(W(W(W(W(W(W(W(W([],he(1,31),!0),he(2,28),!0),he(3,31),!0),he(4,30),!0),he(5,31),!0),he(6,30),!0),he(7,31),!0),he(8,31),!0),he(9,30),!0),he(10,31),!0),he(11,30),!0),he(12,31),!0),he(1,7),!0),G_=W(W(W(W(W(W(W(W(W(W(W(W(W([],he(1,31),!0),he(2,29),!0),he(3,31),!0),he(4,30),!0),he(5,31),!0),he(6,30),!0),he(7,31),!0),he(8,31),!0),he(9,30),!0),he(10,31),!0),he(11,30),!0),he(12,31),!0),he(1,7),!0),NP=gr(1,29),IP=gr(1,30),Kn=gr(1,31),_t=gr(1,32),Y_=W(W(W(W(W(W(W(W(W(W(W(W(W([],_t,!0),IP,!0),_t,!0),Kn,!0),_t,!0),Kn,!0),_t,!0),_t,!0),Kn,!0),_t,!0),Kn,!0),_t,!0),_t.slice(0,7),!0),B_=W(W(W(W(W(W(W(W(W(W(W(W(W([],_t,!0),NP,!0),_t,!0),Kn,!0),_t,!0),Kn,!0),_t,!0),_t,!0),Kn,!0),_t,!0),Kn,!0),_t,!0),_t.slice(0,7),!0),FP=gr(-28,0),LP=gr(-29,0),Qn=gr(-30,0),vt=gr(-31,0),H_=W(W(W(W(W(W(W(W(W(W(W(W(W([],vt,!0),LP,!0),vt,!0),Qn,!0),vt,!0),Qn,!0),vt,!0),vt,!0),Qn,!0),vt,!0),Qn,!0),vt,!0),vt.slice(0,7),!0),V_=W(W(W(W(W(W(W(W(W(W(W(W(W([],vt,!0),FP,!0),vt,!0),Qn,!0),vt,!0),Qn,!0),vt,!0),vt,!0),Qn,!0),vt,!0),Qn,!0),vt,!0),vt.slice(0,7),!0),z_=[0,31,60,91,121,152,182,213,244,274,305,335,366],K_=[0,31,59,90,120,151,181,212,243,273,304,334,365],Dm=function(){for(var r=[],e=0;e<55;e++)r=r.concat(gr(7));return r}();function Q_(r,e){var t=Qr(r,1,1),n=ys(r)?366:365,i=ys(r+1)?366:365,s=ho(t),a=wn(t),o=gt(gt({yearlen:n,nextyearlen:i,yearordinal:s,yearweekday:a},UP(r)),{wnomask:null});if(Xt(e.byweekno))return o;o.wnomask=he(0,n+7);var u,l,c=u=Tt(7-a+e.wkst,7);c>=4?(c=0,l=o.yearlen+Tt(a-e.wkst,7)):l=n-c;for(var d=Math.floor(l/7),p=Tt(l,7),m=Math.floor(d+p/4),b=0;b<e.byweekno.length;b++){var g=e.byweekno[b];if(g<0&&(g+=m+1),g>0&&g<=m){var E=void 0;g>1?(E=c+(g-1)*7,c!==u&&(E-=7-u)):E=c;for(var R=0;R<7&&(o.wnomask[E]=1,E++,o.wdaymask[E]!==e.wkst);R++);}}if(ge(e.byweekno,1)){var E=c+m*7;if(c!==u&&(E-=7-u),E<n)for(var b=0;b<7&&(o.wnomask[E]=1,E+=1,o.wdaymask[E]!==e.wkst);b++);}if(c){var x=void 0;if(ge(e.byweekno,-1))x=-1;else{var v=wn(Qr(r-1,1,1)),V=Tt(7-v.valueOf()+e.wkst,7),$=ys(r-1)?366:365,ee=void 0;V>=4?(V=0,ee=$+Tt(v-e.wkst,7)):ee=n-c,x=Math.floor(52+Tt(ee,7)/4)}if(ge(e.byweekno,x))for(var E=0;E<c;E++)o.wnomask[E]=1}return o}function UP(r){var e=ys(r)?366:365,t=Qr(r,1,1),n=wn(t);return e===365?{mmask:$_,mdaymask:B_,nmdaymask:V_,wdaymask:Dm.slice(n),mrange:K_}:{mmask:G_,mdaymask:Y_,nmdaymask:H_,wdaymask:Dm.slice(n),mrange:z_}}function X_(r,e,t,n,i,s){var a={lastyear:r,lastmonth:e,nwdaymask:[]},o=[];if(s.freq===z.YEARLY)if(Xt(s.bymonth))o=[[0,t]];else for(var u=0;u<s.bymonth.length;u++)e=s.bymonth[u],o.push(n.slice(e-1,e+1));else s.freq===z.MONTHLY&&(o=[n.slice(e-1,e+1)]);if(Xt(o))return a;a.nwdaymask=he(0,t);for(var u=0;u<o.length;u++)for(var l=o[u],c=l[0],d=l[1]-1,p=0;p<s.bynweekday.length;p++){var m=void 0,b=s.bynweekday[p],g=b[0],E=b[1];E<0?(m=d+(E+1)*7,m-=Tt(i[m]-g,7)):(m=c+(E-1)*7,m+=Tt(7-i[m]+g,7)),c<=m&&m<=d&&(a.nwdaymask[m]=1)}return a}function Z_(r,e){e===void 0&&(e=0);var t=r%19,n=Math.floor(r/100),i=r%100,s=Math.floor(n/4),a=n%4,o=Math.floor((n+8)/25),u=Math.floor((n-o+1)/3),l=Math.floor(19*t+n-s-u+15)%30,c=Math.floor(i/4),d=i%4,p=Math.floor(32+2*a+2*c-l-d)%7,m=Math.floor((t+11*l
`),n=0;n<t.length;){var i=t[n]=t[n].replace(/\s+$/g,"");i?n>0&&i[0]===" "?(t[n-1]+=i.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function KP(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function iv(r,e){return KP(e),r.split(",").map(function(t){return go(t)})}function sv(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;n<e._rrule.length;n++){var i=e._rrule[n].origOptions[r];if(i)return i}}}var Rm=function(r){Ts(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=sv.apply(n,["dtstart"]),n.tzid=sv.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return rv(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){av(t,this._rrule)},e.prototype.exrule=function(t){av(t,this._exrule)},e.prototype.rdate=function(t){ov(t,this._rdate)},e.prototype.exdate=function(t){ov(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return nl(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return nl(t.toString())})},e.prototype.rdates=function(){return this._rdate.map(function(t){return new Date(t.getTime())})},e.prototype.exdates=function(){return this._exdate.map(function(t){return new Date(t.getTime())})},e.prototype.valueOf=function(){var t=[];return!this._rrule.length&&this._dtstart&&(t=t.concat(wo({dtstart:this._dtstart}))),this._rrule.forEach(function(n){t=t.concat(n.toString().split(`
2 years ago
`))}),this._exrule.forEach(function(n){t=t.concat(n.toString().split(`
8 months ago
`).map(function(i){return i.replace(/^RRULE:/,"EXRULE:")}).filter(function(i){return!/^DTSTART/.test(i)}))}),this._rdate.length&&t.push(uv("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(uv("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}(z);function av(r,e){if(!(r instanceof z))throw new TypeError(String(r)+" is not RRule instance");ge(e.map(String),String(r))||e.push(r)}function ov(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");ge(e.map(Number),Number(r))||(e.push(r),kn(e))}function uv(r,e,t){var n=!t||t.toUpperCase()==="UTC",i=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),s=e.map(function(a){return bs(a.valueOf(),n)}).join(",");return"".concat(i).concat(s)}var Mm=pa(Je());function br(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()?-1:r.isAfter(e)?1:r.isBefore(e)?-1:0:0}function QP(r,e,t=void 0){if(!e)return`<i>no ${r} date</i>`;let n=Mm.parseDate(e,t,{forwardDate:t!=null});return n!==null?window.moment(n).format("YYYY-MM-DD"):`<i>invalid ${r} date</i>`}function lv(r,e,t){return QP(r,e,t?new Date:void 0)}function Ri(r,e){let t=null,n=Mm.parseDate(r,new Date,{forwardDate:e});return n!==null&&(t=window.moment(n)),t}var ct=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=z.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 z(u);return new ct({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(e=window.moment()){let t=this.nextReferenceDate(e);if(t!==null){let n=null,i=null,s=null;if(this.referenceDate){if(this.startDate){let a=window.moment.duration(this.startDate.diff(this.referenceDate));n=window.moment(t),n.add(Math.round(a.asDays()),"days")}if(this.scheduledDate){let a=window.moment.duration(this.scheduledDate.diff(this.referenceDate));i=window.moment(t),i.add(Math.round(a.asDays()),"days")}if(this.dueDate){let a=window.moment.duration(this.dueDate.diff(this.referenceDate));s=window.moment(t),s.add(Math.round(a.asDays()),"days")}}return{startDate:n,scheduledDate:i,dueDate:s}}return null}identicalTo(e){return this.baseOnToday!==e.baseOnToday||br(this.startDate,e.startDate)!==0||br(this.scheduledDate,e.scheduledDate)!==0||br(this.dueDate,e.dueDate)!==0?!1:this.toText()===e.toText()}nextReferenceDate(e){return this.baseOnToday?this.nextReferenceDateFromToday(e).toDate():this.nextReferenceDateFromOriginalReferenceDate().toDate()}nextReferenceDateFromToday(e){let t=new z(be(X({},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=ct.nextAfterMonths(e,n,t,s[1])));let a=i.match(/every( \d+)? year(s)?(.*)?/);return a!==null&&(n=ct.nextAfterYears(e,n,t,a[1])),ct.addTimezone(n)}static nextAfterMonths(e,t,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));ct.isSkippingTooManyMonths(e,t,s);)t=ct.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
`})),o=o.slice(0,a.autoSuggestMaxItems),o}}function Pm(r,e,t){let n=tN(e.substring(0,t),[["(",")"],["[","]"]])=="("?")":"]",i=r?n+" ":" ",s=r&&e.length>t&&e.charAt(t)===n?1:0;return{postfix:i,insertSkip:s}}function XP(r,e,t,n,i){let s=d=>Object.values(n.prioritySymbols).some(p=>p.length>0&&d.includes(p)),a=[],{postfix:o,insertSkip:u}=Pm(i,r,e);if(r.includes(n.dueDateSymbol)||a.push({displayText:`${n.dueDateSymbol} due date`,appendText:`${n.dueDateSymbol} `}),r.includes(n.startDateSymbol)||a.push({displayText:`${n.startDateSymbol} start date`,appendText:`${n.startDateSymbol} `}),r.includes(n.scheduledDateSymbol)||a.push({displayText:`${n.scheduledDateSymbol} scheduled date`,appendText:`${n.scheduledDateSymbol} `}),!s(r)){let d=n.prioritySymbols,p=["High","Medium","Low","Highest","Lowest"];for(let m=0;m<p.length;m++){let b=p[m],g=d[b];a.push({displayText:i?`${g} priority`:`${g} ${b.toLowerCase()} priority`,appendText:`${g}${o}`,insertSkip:i?u:void 0})}}if(r.includes(n.recurrenceSymbol)||a.push({displayText:`${n.recurrenceSymbol} recurring (repeat)`,appendText:`${n.recurrenceSymbol} `}),!r.includes(n.createdDateSymbol)){let p=Kt.parseDate("today",!0).format(Z.dateFormat);a.push({textToMatch:`${n.createdDateSymbol} created`,displayText:`${n.createdDateSymbol} created today (${p})`,appendText:`${n.createdDateSymbol} ${p}`+o,insertSkip:i?u:void 0})}let l=Nm(r,/([a-zA-Z'_-]*)/g,e),c=[];if(l&&l.length>0){let d=l[0];if(d.length>=Math.max(1,t.autoSuggestMinMatch)){let p=a.filter(m=>(m.textToMatch||m.displayText).toLowerCase().includes(d.toLowerCase()));for(let m of p){let b=i&&(m.displayText.includes("priority")||m.displayText.includes("created"))?d.length+u:d.length;c.push({suggestionType:"match",displayText:m.displayText,appendText:m.appendText,insertAt:l.index,insertSkip:b})}}}return c.length===0&&t.autoSuggestMinMatch===0?a:c}function ZP(r,e,t,n,i,s){let a=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],{postfix:o,insertSkip:u}=Pm(s,r,e),l=[],c=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),d=Nm(r,c,e);if(d&&d.length>=2){let p=d[1],m=d[2];if(m.length<t.autoSuggestMinMatch)return[];let b=m&&m.length>1?Kt.parseDate(Ku(m),!0):null;b&&b.isValid()&&l.push({displayText:`${b.format(Z.dateFormat)}`,appendText:`${p} ${b.format(Z.dateFormat)} `,insertAt:d.index,insertSkip:d[0].length});let g=1,E=a.filter(R=>m&&m.length>=g&&R.toLowerCase().includes(m.toLowerCase())).slice(0,i);E.length===0&&(E=a.slice(0,i));for(let R of E){let v=`${Kt.parseDate(R,!0).format(Z.dateFormat)}`,V=s?d[0].length+u:d[0].length;l.push({suggestionType:"match",displayText:`${R} (${v})`,appendText:`${p} ${v}`+o,insertAt:d.index,insertSkip:V})}}return l}function JP(r,e,t,n,i){var d;let s=["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"],{postfix:a,insertSkip:o}=Pm(i,r,e),u=[],l=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),c=Nm(r,l,e);if(c&&c.length>=2){let p=c[1],m=c[2];if(m.length<t.autoSuggestMinMatch)return[];if(m.length>0){let R=(d=ct.fromText({recurrenceRuleText:m,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:d.toText();if(R){let x=`${p} ${R}`+a,v=i?c[0].length+o:c[0].length;if(u.push({suggestionType:"match",displayText:`\u2705 ${R}`,appendText:x,insertAt:c.index,insertSkip:v}),c[0]==x)return[]}}let b=1,g=t.autoSuggestMaxItems/2,E=s.filter(R=>m&&m.length>=b&&R.toLowerCase().includes(m.toLowerCase())).slice(0,g);E.length===0&&m.trim().length===0&&(E=s.slice(0,g));for(let R of E)u.push({suggestionType:"match",displayText:`${R}`,appendText:`${p} ${R} `,insertAt:c.index,insertSkip:c[0].length})}return u}function Nm(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 eN(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
\`\`\`${n}
flowchart LR
1 year ago
classDef TODO stroke:#f33,stroke-width:3px;
classDef DONE stroke:#0c0,stroke-width:3px;
classDef IN_PROGRESS stroke:#fa0,stroke-width:3px;
classDef CANCELLED stroke:#ddd,stroke-width:3px;
classDef NON_TASK stroke:#99e,stroke-width:3px;
11 months ago
${i.join(`
`)}
8 months ago
${s.join(`
`)}
1 year ago
linkStyle default stroke:gray
\`\`\`
8 months ago
`}addEdgeIfNotToInternal(e,t,n,i,s){let a=e.findIndex(l=>l.symbol===t.symbol),o=a!==-1,u=t.type!=="EMPTY";if(o&&u){let l;s?l='-. "\u{1F501}" .-> ':l=" --> ";let c=`${i+1}${l}${a+1}`;n.push(c)}}getMermaidNodeLabel(e,t){let n=yv(e.name),i=e.type;if(t){let s=ul(e.symbol),a=ul(e.nextStatusSymbol),o=`[${s}] -> [${a}]`,u=`'${n}'`,l=`(${i})`;return`["${u}<br>${o}<br>${l}"]:::${i}`}else return`["${n}"]:::${i}`}};var bv=require("obsidian");var en=class{constructor(e,t){this.name=e,this.sortOrder=t}get groupText(){return this.name!==""?`%%${this.sortOrder}%% ${this.name}`:""}};var Ye=class{constructor(e){this._date=null;this._date=e}get moment(){return this._date}formatAsDate(e=""){return this.format(Z.dateFormat,e)}formatAsDateAndTime(e=""){return this.format(Z.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 en("Overdue",1):t.isSame(e,"day")?new en("Today",2):t.isValid()?new en("Future",3):new en("Invalid date",0):new en("Undated",4)}get fromNow(){let e=this.moment;if(!e)return new en("",0);let t=this.fromNowOrder(e);return new en(e.fromNow(),t)}fromNowOrder(e){if(!e.isValid())return 0;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 bv.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 Es=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 xn=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 xn.priorityNameUsingNone(e).replace("None","Normal")}};var iN=require("obsidian"),wv=pa(vv());var Um=class extends wv.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 Wm(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)}},Pt=new Um,Wm=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)<this.minLevel)return;let s={level:e,module:this.module,message:t,objects:
`),o=a.length,u=new So(()=>wt.fromPath(i.path)),l=null,c=0;for(let d of t)if(d.task!==void 0){let p=d.position.start.line;if(p>=o)return this.logger.debug(`${i.path} Obsidian gave us a line number ${p} past the end of the file. ${o}.`),s;if((l===null||l.position.end.line<p)&&(l=Pi.getSection(p,n.sections),c=0),l===null)continue;let m=a[p];if(m===void 0){this.logger.debug(`${i.path}: line ${p} - ignoring 'undefined' line.`);continue}let b;try{b=oe.fromLine({line:m,taskLocation:new yt(i.path,p,l.position.start.line,c,Pi.getPrecedingHeader(p,n.headings)),fallbackDate:u.value})}catch(g){this.reportTaskParsingErrorToUser(g,i,d,m);continue}b!==null&&(c++,s.push(b))}return s}reportTaskParsingErrorToUser(e,t,n,i){let s=`There was an error reading one of the tasks in this vault.
The following task has been ignored, to prevent Tasks queries getting stuck with 'Loading Tasks ...'
Error: ${e}
File: ${t.path}
Line number: ${n.position.start.line}
8 months ago
Task line: ${i}
Please create a bug report for this message at
https://github.com/obsidian-tasks-group/obsidian-tasks/issues/new/choose
to help us find and fix the underlying issue.
Include:
- either a screenshot of the error popup, or copy the text from the console, if on a desktop machine.
- the output from running the Obsidian command 'Show debug info'
The error popup will only be shown when Tasks is starting up, but if the error persists,
it will be shown in the console every time this file is edited during the Obsidian
session.
8 months ago
`;this.logger.error(s),e instanceof Error&&this.logger.error(e.stack?e.stack:"Cannot determine stack"),this.state==="Initializing"&&new Ss.Notice(s,1e4)}static getSection(e,t){if(t===void 0)return null;for(let n of t)if(n.position.start.line<=e&&n.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 lh=require("obsidian");var _w=require("obsidian");function kt(){}function Ym(r){return r()}function kv(){return Object.create(null)}function Tr(r){r.forEach(Ym)}function pl(r){return typeof r=="function"}function Ms(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function Ev(r){return Object.keys(r).length===0}var Sv=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global,Do=class{constructor(e){this.options=e,this._listeners="WeakMap"in Sv?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)Do.entries.set(i.target,i),(n=this._listeners.get(i.target))===null||n===void 0||n(i)})}};Do.entries="WeakMap"in Sv?new WeakMap:void 0;var Ov=!1;function sN(){Ov=!0}function aN(){Ov=!1}function A(r,e){r.appendChild(e)}function Ie(r,e,t){r.insertBefore(e,t||null)}function Ce(r){r.parentNode&&r.parentNode.removeChild(r)}function Cs(r,e){for(let t=0;t<r.length;t+=1)r[t]&&r[t].d(e)}function K(r){return document.createElement(r)}function oN(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Fe(r){return document.createTextNode(r)}function te(){return Fe(" ")}function xe(r,e,t,n){return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function Dv(r){return function(e){return e.preventDefault(),r.call(this,e)}}function F(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function xv(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 uN(r){return Array.from(r.childNodes)}function Pr(r,e){e=""+e,r.data!==e&&(r.data=e)}function Nr(r,e){r.value=e==null?"":e}function Bm(r,e,t){for(let n=0;n<r.options.length;n+=1){let i=r.options[n];if(i.__value===e){i.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function Rv(r){let e=r.querySelector(":checked");return e&&e.__value}var dl;function lN(){if(dl===void 0){dl=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(r){dl=!0}}return dl}function Mv(r,e){getComputedStyle(r).position==="static"&&(r.style.position="relative");let n=K("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;let i=lN(),s;return i?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=xe(window,"message",a=>{a.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{s=xe(n.contentWindow,"resize",e),e()}),A(r,n),()=>{(i||s&&n.contentWindow)&&s(),Ce(n)}}function Ir(r,e,t){r.classList[t?"add":"remove"](e)}var Rs=class{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,n=null){this.e||(this.is_svg?this.e=oN(t.nodeName):this.e=K(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)Ie(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(Ce)}};var xo;function Oo(r){xo=r}function cN(){if(!xo)throw new Error("Function called outside component initialization");return xo}function Hm(r){cN().$$.on_mount.push(r)}var Ds=[];var rt=[],xs=[],$m=[],dN=Promise.resolve(),Gm=!1;function fN(
9 months ago
The task line not updated is:
${r.originalMarkdown}
In this markdown file:
"${r.taskLocation.path}"
Note: further clicks on this checkbox will usually now be ignored until the file is opened (or certain, specific edits are made - it's complicated).
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.
8 months ago
`;ml(c);return}let l=Math.min(Math.pow(10,s),100);o.debug(`timeout = ${l}`),setTimeout(()=>L(void 0,null,function*(){yield Wv({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s+1})}),l)});try{let[l,c,d]=yield qv(r,t),p=[...d.slice(0,l),...e.map(m=>m.toFileLineString()),...d.slice(l+1)];yield t.modify(c,p.join(`
`))}catch(l){if(l instanceof ei){l.message&&Uv(l.message),yield u();return}else if(l instanceof hl){yield u();return}else l instanceof Error&&ml(l.message)}});function qv(r,e){return L(this,null,function*(){if(Ro===void 0)throw new ei;let t=e.getAbstractFileByPath(r.path);if(!(t instanceof Mo.TFile))throw new ei(`Tasks: No file found for task ${r.description}. Retrying ...`);if(!bN.includes(t.extension))throw new Error(`Tasks: Does not support files with the ${t.extension} file extension.`);let n=Ro.getFileCache(t);if(n==null||n===null)throw new ei(`Tasks: No file cache found for file ${t.path}. Retrying ...`);let i=n.listItems;if(i===void 0||i.length===0)throw new ei(`Tasks: No list items found in file cache of ${t.path}. Retrying ...`);let a=(yield e.read(t)).split(`
`),o=_N(r,a,i,TN);if(o===void 0)throw new hl;return[o,t,a]})}function Xm(r,e){return L(this,null,function*(){try{let[t,n,i]=yield qv(r,e);return[t,n]}catch(t){t instanceof ei?t.message&&Uv(t.message):t instanceof Error&&ml(t.message)}})}function jv(r,e){return r<e.length}function _N(r,e,t,n){let i=vN(r,e);return i!==void 0||(i=wN(r,e),i!==void 0)?i:kN(r,e,t,n)}function vN(r,e){let t=r.taskLocation.lineNumber;if(jv(t,e)&&e[t]===r.originalMarkdown)return gl().debug(`Found original markdown at original line number ${t}`),t}function wN(r,e){let t=[];for(let n=0;n<e.length;n++)e[n]===r.originalMarkdown&&t.push(n);if(t.length===1)return t[0]}function kN(r,e,t,n){let i,s=0;for(let a of t){let o=a.position.start.line;if(!jv(o,e))return;if(o<r.taskLocation.sectionStart||a.task===void 0)continue;let u=e[o];if(ye.getInstance().includedIn(u)){if(s===r.taskLocation.sectionIndex){if(u===r.originalMarkdown)i=o;else{n(`Tasks: Unable to find task in file ${r.taskLocation.path}.
9 months ago
Expected task:
${r.originalMarkdown}
Found task:
8 months ago
${u}`);return}break}s++}}return i}function EN(r){let e,t,n,i,s,a,o,u;return{c(){e=K("input"),t=te(),n=K("code"),i=Fe(r[3]),s=te(),a=new Rs(!1),F(e,"id",r[2]),F(e,"type","text"),F(e,"class","input"),F(e,"placeholder",SN),F(e,"accesskey",r[4]),Ir(e,"tasks-modal-error",!r[1]),a.a=null,F(n,"class","results")},m(l,c){Ie(l,e,c),Nr(e,r[0]),Ie(l,t,c),Ie(l,n,c),A(n,i),A(n,s),a.m(r[5],n),o||(u=xe(e,"input",r[7]),o=!0)},p(l,[c]){c&4&&F(e,"id",l[2]),c&16&&F(e,"accesskey",l[4]),c&1&&e.value!==l[0]&&Nr(e,l[0]),c&2&&Ir(e,"tasks-modal-error",!l[1]),c&8&&Pr(i,l[3]),c&32&&a.p(l[5])},i:kt,o:kt,d(l){l&&Ce(e),l&&Ce(t),l&&Ce(n),o=!1,u()}}}var SN="Try 'Monday' or 'tomorrow', or [td|tm|yd|tw|nw|we] then space.";function ON(r,e,t){let{id:n}=e,{dateSymbol:i}=e,{date:s}=e,{isDateValid:a}=e,{forwardOnly:o}=e,{accesskey:u}=e,l;function c(){s=this.value,t(0,s),t(2,n),t(6,o),t(5,l)}return r.$$set=d=>{"id"in d&&t(2,n=d.id),"dateSymbol"in d&&t(3,i=d.dateSymbol),"date"in d&&t(0,s=d.date),"isDateValid"in d&&t(1,a=d.isDateValid),"forwardOnly"in d&&t(6,o=d.forwardOnly),"accesskey"in d&&t(4,u=d.accesskey)},r.$$.update=()=>{if(r.$$.dirty&101){e:t(0,s=Ku(s)),t(5,l=lv(n,s,o)),t(1,a=!l.includes("invalid"))}},[s,a,n,i,u,l,o,c]}var Zm=class extends Jn{constructor(e){super(),As(this,e,ON,EN,Ms,{id:2,dateSymbol:3,date:0,isDateValid:1,forwardOnly:6,accesskey:4})}},Fi=Zm;var Li=Math.min,qt=Math.max,Ao=Math.round;var Cn=r=>({x:r,y:r}),DN={left:"right",right:"left",bottom:"top",top:"bottom"},xN={start:"end",end:"start"};function Jm(r,e,t){return qt(r,Li(e,t))}function Ps(r,e){return typeof r=="function"?r(e):r}function An(r){return r.split("-")[0]}function Ns(r){return r.split("-")[1]}function eh(r){return r==="x"?"y":"x"}function th(r){return r==="y"?"height":"width"}function Is(r){return["top","bottom"].includes(An(r))?"y":"x"}function rh(r){return eh(Is(r))}function $v(r,e,t){t===void 0&&(t=!1);let n=Ns(r),i=rh(r),s=th(i),a=i==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=Co(a)),[a,Co(a)]}function Gv(r){let e=Co(r);return[yl(r),e,yl(e)]}function yl(r){return r.replace(/start|end/g,e=>xN[e])}function RN(r,e,t){let n=["left","right"],i=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(r){case"top":case"bottom":return t?e?i:n:e?n:i;case"left":case"right":return e?s:a;default:return[]}}function Yv(r,e,t,n){let i=Ns(r),s=RN(An(r),t==="start",n);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(yl)))),s}function Co(r){return r.replace(/left|right|bottom|top/g,e=>DN[e])}function MN(r){return X({top:0,right:0,bottom:0,left:0},r)}function Bv(r){return typeof r!="number"?MN(r):{top:r,right:r,bottom:r,left:r}}function Ui(r){return be(X({},r),{top:r.y,left:r.x,right:r.x+r.width,bottom:r.y+r.height})}function Hv(r,e,t){let{reference:n,floating:i}=r,s=Is(e),a=rh(e),o=th(a),u=An(e),l=s==="y",c=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,p=n[o]/2-i[o]/2,m;switch(u){case"top":m={x:c,y:n.y-i.height};break;case"bottom":m={x:c,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:d};break;case"left":m={x:n.x-i.width,y:d};break;default:m={x:n.x,y:n.y}}switch(Ns(e)){case"start":m[a]-=p*(t&&l?-1:1);break;case"end":m[a]+=p*(t&&l?-1:1);break}return m}var Vv=(r,e,t)=>L(void 0,null,function*(){let{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:a}=t,o=s.filter(Boolean),u=yield a.isRTL==null?void 0:a.isRTL(e),l=yield a.getElementRects({reference:r,floating:e,strategy:i}),{x:c,y:d}=Hv(l,n,u),p=n,m={},b=0;for(let g=0;g<o.length;g++){let{name:E,fn:R}=o[g],{x,y:v,data:V,reset:$}=yield R({x:c,y:d,initialPlacement:n,placement:p,strategy:i,middlewareData:m,rects:l,platform:a,elements:{reference:r,floating:e}});if(c=x!=null?x:c,d=v!=null?v:d,m=be(X({},m),{[E]:X(X({},m[E]),V)}),$&&b<=50){b++,typeof $=="object"&&($.placement&&(p=$.placement),$.rects&&(l=$.rects===!0?yield a.getElementRects({reference:r,floating:e,strategy:i}):$.rects),{x:c,y:d}=Hv(l,p,u)),g=-1;continue}}return{x:c,y:d,placement:p,strategy:i,middlewareData:m}});function bl(r,e){return L(this,null,function*(){var t;e===void 0&&(e={});le
<span class="accesskey-first">future</span> dates:`,Un=te(),bt=K("input"),Wn=te(),It=K("hr"),Qe=te(),ci=K("div"),Yt.c(),Bo=te(),Ho=K("hr"),Vo=te(),j=K("div"),Xe=K("label"),Xe.innerHTML='Stat<span class="accesskey">u</span>s',Ze=te(),Ue=K("select");for(let C=0;C<xt.length;C+=1)xt[C].c();di=te(),Be=K("div"),fi=K("label"),fi.textContent="Created",Yr=te(),Mn(ur.$$.fragment),oa=te(),qn=K("label"),qn.textContent="Done",zo=te(),Mn(Er.$$.fragment),Uh=te(),Ko=K("label"),Ko.textContent="Cancelled",Wh=te(),Mn(fn.$$.fragment),qh=te(),Zi=K("div"),pi=K("button"),jh=Fe("Apply"),$h=te(),ua=K("button"),ua.textContent="Cancel",F(i,"for","description"),F(a,"id","description"),F(a,"class","tasks-modal-description"),F(a,"placeholder","Take out the trash"),F(a,"accesskey",o=r[17]("t")),F(n,"class","tasks-modal-section"),F(c,"for",p="priority-"+r[3].priority),F(l,"class","tasks-modal-section tasks-modal-priorities"),F(E,"for","recurrence"),F(E,"class","accesskey-first"),F(x,"id","recurrence"),F(x,"type","text"),F(x,"class","input"),F(x,"placeholder","Try 'every 2 weeks on Thursday'."),F(x,"accesskey",v=r[17]("r")),Ir(x,"tasks-modal-error",!r[10]),q.a=null,F($,"class","results"),F(g,"class","tasks-modal-section tasks-modal-dates"),F(O,"for","due"),F(O,"class","accesskey-first"),F(y,"for","scheduled"),F(y,"class","accesskey-first"),F(_,"for","start"),F(We,"for","forwardOnly"),F(bt,"id","forwardOnly"),F(bt,"type","checkbox"),F(bt,"class","input task-list-item-checkbox tasks-modal-checkbox"),F(bt,"accesskey",or=r[17]("f")),F(N,"class","tasks-modal-section tasks-modal-dates"),F(ci,"class","tasks-modal-section tasks-modal-dates"),F(Xe,"for","status"),F(Ue,"id","status-type"),F(Ue,"class","dropdown"),F(Ue,"accesskey",Gr=r[17]("u")),r[12]===void 0&&Ii(()=>r[47].call(Ue)),F(j,"class","tasks-modal-section"),F(fi,"for","created"),F(qn,"for","done"),F(Ko,"for","cancelled"),F(Be,"class","tasks-modal-section tasks-modal-dates"),pi.disabled=Qo=!r[15],F(pi,"type","submit"),F(pi,"class","mod-cta"),F(ua,"type","button"),F(Zi,"class","tasks-modal-section tasks-modal-buttons"),Ir(t,"with-accesskeys",r[11]),F(e,"class","tasks-modal")},m(C,ie){Ie(C,e,ie),A(e,t),A(t,n),A(n,i),A(n,s),A(n,a),Nr(a,r[3].description),r[36](a),A(t,u),A(t,l),A(l,c),A(c,d),A(l,m);for(let Rt=0;Rt<Dt.length;Rt+=1)Dt[Rt]&&Dt[Rt].m(l,null);A(t,b),A(t,g),A(g,E),A(g,R),A(g,x),Nr(x,r[3].recurrenceRule),A(g,V),A(g,$),A($,ee),A($,Y),q.m(r[14],$),A(t,de),A(t,Te),A(t,G),A(t,N),A(N,O),A(N,B),tn(U,N,null),A(N,h),A(N,y),A(N,T),tn(w,N,null),A(N,P),A(N,_),A(N,D),tn(I,N,null),A(N,le),A(N,Ee),A(Ee,We),A(Ee,Un),A(Ee,bt),bt.checked=r[3].forwardOnly,A(t,Wn),A(t,It),A(t,Qe),A(t,ci),jn[Ft].m(ci,null),A(t,Bo),A(t,Ho),A(t,Vo),A(t,j),A(j,Xe),A(j,Ze),A(j,Ue);for(let Rt=0;Rt<xt.length;Rt+=1)xt[Rt]&&xt[Rt].m(Ue,null);Bm(Ue,r[12],!0),A(t,di),A(t,Be),A(Be,fi),A(Be,Yr),tn(ur,Be,null),A(Be,oa),A(Be,qn),A(Be,zo),tn(Er,Be,null),A(Be,Uh),A(Be,Ko),A(Be,Wh),tn(fn,Be,null),A(t,qh),A(t,Zi),A(Zi,pi),A(pi,jh),A(Zi,$h),A(Zi,ua),Bt=!0,_c||(Gh=[xe(a,"input",r[35]),xe(a,"keydown",r[29]),xe(a,"paste",r[30]),xe(a,"drop",r[30]),xe(l,"keyup",r[27]),xe(x,"input",r[39]),xe(bt,"change",r[46]),xe(Ue,"change",r[47]),xe(Ue,"change",r[26]),xe(ua,"click",r[28]),xe(t,"submit",Dv(r[31]))],_c=!0)},p(C,ie){if((!Bt||ie[0]&131072&&o!==(o=C[17]("t")))&&F(a,"accesskey",o),ie[0]&8&&Nr(a,C[3].description),(!Bt||ie[0]&8&&p!==(p="priority-"+C[3].priority))&&F(c,"for",p),ie[0]&33685512){Ji=C[25];let Ne;for(Ne=0;Ne<Ji.length;Ne+=1){let da=gw(C,Ji,Ne);Dt[Ne]?Dt[Ne].p(da,ie):(Dt[Ne]=yw(da),Dt[Ne].c(),Dt[Ne].m(l,null))}for(;Ne<Dt.length;Ne+=1)Dt[Ne].d(1);Dt.length=Ji.length}(!Bt||ie[0]&131072&&v!==(v=C[17]("r")))&&F(x,"accesskey",v),ie[0]&8&&x.value!==C[3].recurrenceRule&&Nr(x,C[3].recurrenceRule),(!Bt||ie[0]&1024)&&Ir(x,"tasks-modal-error",!C[10]),(!Bt||ie[0]&16384)&&q.p(C[14]);let Rt={};ie[0]&8&&(Rt.forwardOnly=C[3].forwardOnly),ie[0]&131072&&(Rt.accesskey=C[17]("d")),!Q&&ie[0]&8&&(Q=!0,Rt.date=C[3].dueDate,er(()=>Q=!1)),!f&&ie[0]&128&&(f=!0,Rt.isDateValid=C[7],er(()=>f=!1)),U.$set(Rt);let la={};ie[0]&8&&(la.forwardOnly=C[3].forwardOnly),ie[
`);e.setLine(o,b)};new ti({app:n,task:l,onSubmit:c,allTasks:i}).open()};var ch=require("obsidian");var ww=(r,e,t)=>{var u;if(r)return t instanceof ch.MarkdownView;if(!(t instanceof ch.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=nI(a,n);e.setLine(s,o.text),e.setCursor(iI(i,o))},nI=(r,e)=>{let t=oe.fromLine({line:r,taskLocation:yt.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(Z.taskRegex);if(n!==null){let i=n[3],a=Oe.getInstance().bySymbol(i).nextStatusSymbol;return{text:r.replace(Z.taskRegex,`$1- [${a}] $4`)}}else if(Z.listItemRegex.test(r)){let i=r.replace(Z.listItemRegex,"$1$2 [ ]");return{text:i,moveTo:{ch:i.length}}}else{let i=r.replace(Z.indentationRegex,"$1- ");return{text:i,moveTo:{ch:i.length}}}}},iI=(r,e)=>{var s;let t={line:0,ch:r.ch},n=X(X({},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 Sl=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)=>vw(t,n,i,this.app,this.plugin.getTasks())}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:ww})}};var ri=class{constructor(){this.hidePostponeButton=!1;this.hideTaskCount=!1;this.hideBacklinks=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.shortMode=!1;this.explainQuery=!1}};function ji(r,e){let t=`Error: ${r}.
9 months ago
The error message was:
8 months ago
`,n="";return e instanceof Error?n+=e:n+="Unknown error",`${t}"${n}"`}var sI=Object.prototype.toString,Ws=Array.isArray||function(e){return sI.call(e)==="[object Array]"};function fh(r){return typeof r=="function"}function aI(r){return Ws(r)?"array":typeof r}function dh(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function kw(r,e){return r!=null&&typeof r=="object"&&e in r}function oI(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var uI=RegExp.prototype.test;function lI(r,e){return uI.call(r,e)}var cI=/\S/;function dI(r){return!lI(cI,r)}var fI={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function pI(r){return String(r).replace(/[&<>"'`=\/]/g,function(t){return fI[t]})}var mI=/\s*/,hI=/\s+/,Ew=/\s*=/,gI=/\s*\}/,yI=/#|\^|\/|>|\{|&|=|!/;function bI(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 d,p,m;function b(q){if(typeof q=="string"&&(q=q.split(hI,2)),!Ws(q)||q.length!==2)throw new Error("Invalid tags: "+q);d=new RegExp(dh(q[0])+"\\s*"),p=new RegExp("\\s*"+dh(q[1])),m=new RegExp("\\s*"+dh("}"+q[1]))}b(e||vr.tags);for(var g=new Lo(r),E,R,x,v,V,$;!g.eos();){if(E=g.pos,x=g.scanUntil(d),x)for(var ee=0,Y=x.length;ee<Y;++ee)v=x.charAt(ee),dI(v)?(s.push(i.length),u+=v):(o=!0,t=!0,u+=" "),i.push(["text",v,E,E+1]),E+=1,v===`
`&&(c(),u="",l=0,t=!1);if(!g.scan(d))break;if(a=!0,R=g.scan(yI)||"name",g.scan(mI),R==="="?(x=g.scanUntil(Ew),g.scan(Ew),g.scanUntil(p)):R==="{"?(x=g.scanUntil(m),g.scan(gI),g.scanUntil(p),R="&"):x=g.scanUntil(p),!g.scan(p))throw new Error("Unclosed tag at "+g.pos);if(R==">"?V=[R,x,E,g.pos,u,l,t]:V=[R,x,E,g.pos],l++,i.push(V),R==="#"||R==="^")n.push(V);else if(R==="/"){if($=n.pop(),!$)throw new Error('Unopened section "'+x+'" at '+E);if($[1]!==x)throw new Error('Unclosed section "'+$[1]+'" at '+E)}else R==="name"||R==="{"||R==="&"?o=!0:R==="="&&b(x)}if(c(),$=n.pop(),$)throw new Error('Unclosed section "'+$[1]+'" at '+g.pos);return _I(TI(i))}function TI(r){for(var e=[],t,n,i=0,s=r.length;i<s;++i)t=r[i],t&&(t[0]==="text"&&n&&n[0]==="text"?(n[1]+=t[1],n[3]=t[3]):(e.push(t),n=t));return e}function _I(r){for(var e=[],t=e,n=[],i,s,a=0,o=r.length;a<o;++a)switch(i=r[a],i[0]){case"#":case"^":t.push(i),n.push(i),t=i[4]=[];break;case"/":s=n.pop(),s[5]=i[2],t=n.length>0?n[n.length-1][4]:e;break;default:t.push(i)}return e}function Lo(r){this.string=r,this.tail=r,this.pos=0}Lo.prototype.eos=function(){return this.tail===""};Lo.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};Lo.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 Us(r,e){this.view=r,this.cache={".":this.view},this.parent=e}Us.prototype.push=function(e){return new Us(e,this)};Us.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<a.length;)o===a.length-1&&(u=kw(s,a[o])||oI(s,a[o])),s=s[a[o++]];else s=i.view[e],u=kw(i.view,e);if(u){n=s;break}i=i.parent}t[e]=n}return fh(n)&&(n=n.call(this.view)),n};function Nt(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}Nt.prototype.clearCache=function(){typeof this.templateCache!="undefined"&&this.templateCache.clear()};Nt.prototype.parse=function(e,t){var n=this.templateCache,i=e+":"+(t||vr.tags).join(":"),s=typeof n!="undefined",a=s?n.get(i):void 0;return a==null&&(a=bI(e,t),s&&n.set(i,a)),a};Nt.prototype.render=function(e,t,n,i){var s=this.getConfigTags(i),a=this.parse(e,s),o=t instanceof Us?t:new Us(t,void 0);return this.renderTokens(a,o,n,e,i)};Nt.prototype.renderTokens=function(e,t,n,i,s){for(var a="",o,u,l,c=0,d=e.length;c<d;++c)l=void 0,o=e[c],u=o[0],u==="#"?l=this.renderSection(o,t,n,i,s):u==="^"?l=this.renderInverted(o,t,n,i,s):u===">"?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};Nt.prototype.renderSection=function(e,t,n,i,s){var a=this,o="",u=t.lookup(e[1]);function l(p){return a.render(p,t,n,s)}if(!!u){if(Ws(u))for(var c=0,d=u.length;c<d;++c)o+=this.renderTokens(e[4],t.push(u[c]),n,i,s);else if(typeof u=="object"||typeof u=="string"||typeof u=="number")o+=this.renderTokens(e[4],t.push(u),n,i,s);else if(fh(u)){if(typeof i!="string")throw new Error("Cannot use higher-order sections without the original template");u=u.call(t.view,i.slice(e[3],e[5]),l),u!=null&&(o+=u)}else o+=this.renderTokens(e[4],t,n,i,s);return o}};Nt.prototype.renderInverted=function(e,t,n,i,s){var a=t.lookup(e[1]);if(!a||Ws(a)&&a.length===0)return this.renderTokens(e[4],t,n,i,s)};Nt.prototype.indentPartial=function(e,t,n){for(var i=t.replace(/[^ \t]/g,""),s=e.split(`
`),a=0;a<s.length;a++)s[a].length&&(a>0||!n)&&(s[a]=i+s[a]);return s.join(`
`)};Nt.prototype.renderPartial=function(e,t,n,i){if(!!n){var s=this.getConfigTags(i),a=fh(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 d=this.parse(c,s);return this.renderTokens(d,t,n,c,i)}}};Nt.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(n!=null)return n};Nt.prototype.escapedValue=function(e,t,n){var i=this.getConfigEscape(n)||vr.escape,s=t.lookup(e[1]);if(s!=null)return typeof s=="number"&&i===vr.escape?String(s):i(s)};Nt.prototype.rawValue=function(e){return e[1]};Nt.prototype.getConfigTags=function(e){return Ws(e)?e:e&&typeof e=="object"?e.tags:void 0};Nt.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!Ws(e))return e.escape};var vr={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){Fo.templateCache=r},get templateCache(){return Fo.templateCache}},Fo=new Nt;vr.clearCache=function(){return Fo.clearCache()};vr.parse=function(e,t){return Fo.parse(e,t)};vr.render=function(e,t,n,i){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+aI(e)+'" was given as the first argument for mustache#render(template, view, partials)');return Fo.render(e,t,n,i)};vr.escape=pI;vr.Scanner=Lo;vr.Context=Us;vr.Writer=Nt;var ph=vr;var Rw=pa(xw());function Mw(r,e){ph.escape=function(t){return t};try{return ph.render(r,(0,Rw.default)(e))}catch(t){let n="";throw t instanceof Error?n=`There was an error expanding one or more placeholders.
1 year ago
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:
8 months ago
${r}`,Error(n)}}function Cw(r){return hh(r,[])}function hh(r,e){return{query:{file:new Es(r),allTasks:e}}}var qs=class{constructor(e=""){this.indentation=e}explainQuery(e){if(e.error!==void 0)return this.explainError(e);let t=[];return t.push(this.explainFilters(e)),t.push(this.explainGroups(e)),t.push(this.explainSorters(e)),t.push(this.explainQueryLimits(e)),t.push(this.explainDebugSettings()),t.filter(n=>n!=="").join(`
9 months ago
`)}explainError(e){let t="";return t+=`Query has an error:
`,t+=e.error+`
`,t}explainFilters(e){return e.filters.length===0?this.indent(`No filters supplied. All tasks will match the query.
`):e.filters.map(n=>n.explainFilterIndented(this.indentation)).join(`
`)}explainGroups(e){let t=e.grouping.length;if(t===0)return this.indent(`No grouping instructions supplied.
8 months ago
`);let n="";for(let i=0;i<t;i++)n+=this.indentation+e.grouping[i].instruction+`
9 months ago
`;return n}explainSorters(e){let t=e.sorting.length;if(t===0)return this.indent(`No sorting instructions supplied.
8 months ago
`);let n="";for(let i=0;i<t;i++)n+=this.indentation+e.sorting[i].instruction+`
`;return n}explainQueryLimits(e){function t(i){let s=`At most ${i} task`;return i!==1&&(s+="s"),s}let n=[];if(e.limit!==void 0){let i=t(e.limit)+`.
`;n.push(this.indent(i))}if(e.taskGroupLimit!==void 0){let i=t(e.taskGroupLimit)+` per group (if any "group by" options are supplied).
`;n.push(this.indent(i))}return n.join(`
`)}explainDebugSettings(){let e="",{debugSettings:t}=J();return t.ignoreSortInstructions&&(e+=this.indent(`NOTE: All sort instructions, including default sort order, are disabled, due to 'ignoreSortInstructions' setting.
`)),e}indent(e){return this.indentation+e}};var Re=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 Re("None of",e,"NOT")}static booleanXor(e){return new Re("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<this.children.length;i++)t+=`
${this.children[i].asString(n)}`;return t}static combineOrCreateExplanation(e,t,n){if(t.length===2){let i=t[0],s=t[1];if(i.symbol===n&&s.symbol==="")return i.children.push(s),i}return new Re(e,t,n)}};var js=class{matchesAnyOf(e){return e.some(t=>this.matches(t))}};var $s=class extends js{constructor(t){super();this.stringToFind=t}matches(t){return $s.stringIncludesCaseInsensitive(t,this.stringToFind)}static stringIncludesCaseInsensitive(t,n){return t.toLocaleLowerCase().includes(n.toLocaleLowerCase())}explanation(t){return new Re(t)}};var ni=class extends js{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 ni(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
1 year ago
Regular expressions must look like this:
/pattern/
or this:
/pattern/flags
Where:
- pattern: The 'regular expression' pattern to search for.
- flags: Optional characters that modify the search.
i => make the search case-insensitive
u => add Unicode support
Examples: /^Log/
/^Log/i
/File Name\.md/
/waiting|waits|waited/i
/\d\d:\d\d/
The following characters have special meaning in the pattern:
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.
8 months ago
`}explanation(t){let i=vI(t,"using regex: ",this.regexAsString());return new Re(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 vI(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 Wr=class{constructor(e,t,n,i){this.instruction=e,this.property=t,this.comparator=Wr.maybeReverse(i,n)}static maybeReverse(e,t){return e?Wr.makeReversedComparator(t):t}static makeReversedComparator(e){return(t,n,i)=>e(t,n,i)*-1}};var ii=class{constructor(e,t,n,i){this.instruction=e,this.property=t,this.grouper=n,this.reverse=i}};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 il(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")}sorterInstruction(e){let t=`sort by ${this.fieldNameSingular()}`;return e&&(t+=" reverse"),t}comparator(){throw Error(`comparator() unimplemented for ${this.fieldNameSingular()}`)}createSorter(e){return new Wr(this.sorterInstruction(e),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")}grouperInstruction(e){let t=`group by ${this.fieldNameSingular()}`;return e&&(t+=" reverse"),t}grouper(){throw Error(`grouper() unimplemented for ${this.fieldNameSingular()}`)}createGrouper(e){return new ii(this.grouperInstruction(e),this.fieldNameSingular(),this.grouper(),e)}createNormalGrouper(){return this.createGrouper(!1)}createReverseGrouper(){return this.createGrouper(!0)}};var Gs=class{constructor(e,t){this._rawInstruction=e,this._anyContinuationLinesRemoved=t.trim(),this._anyPlaceholdersExpanded=this._anyContinuationLinesRemoved}recordExpandedPlaceholders(e){this._anyPlaceholdersExpanded=e}get rawInstruction(){return this._rawInstruction}get anyContinuationLinesRemoved(){return this._anyContinuationLinesRemoved}get anyPlaceholdersExpanded(){return this._anyPlaceholdersExpanded}explainStatement(e){function t(a,o){o!==a&&(s+=` =>
${e}${o}`)}let n=this._rawInstruction.trim(),i=n.split(`
`).join(`
`+e),s=`${e}${i}`;return this._rawInstruction.includes(`
`)&&(s+=`
`+e),t(n,this._anyContinuationLinesRemoved),t(this._anyContinuationLinesRemoved,this._anyPlaceholdersExpanded),s}};var Et=class{constructor(e,t,n){this._statement=new Gs(e,e),this.explanation=n,this.filterFunction=t}get statement(){return this._statement}setStatement(e){this._statement=e}get instruction(){return this._statement.anyPlaceholdersExpanded}explainFilterIndented(e){let t=this.explanation,n=t.asString(),i=this._statement.explainStatement(e);return n===this.instruction?`${i}
`:`${i} =>
9 months ago
${t.asString(e+" ")}
8 months ago
`}};var sn=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}isValid(){return this._queryComponent!==void 0}static fromObject(e,t){let n=new sn(e);return n._queryComponent=t,n}static fromError(e,t){let n=new sn(e);return n._error=t,n}};var re=class{constructor(e){this.object=e}get instruction(){return this.object.instruction}get filter(){return this.object.queryComponent}isValid(){return this.object.isValid()}get error(){return this.object.error}get filterFunction(){if(this.filter)return this.filter.filterFunction}static fromFilter(e){return new re(sn.fromObject(e.instruction,e))}static fromError(e,t){return new re(sn.fromError(e,t))}};var Ae=class extends we{createFilterOrErrorMessage(e){let t=we.getMatch(this.filterRegExp(),e);if(t===null)return re.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 $s(i);else if(n.includes("regex")){try{s=ni.validateAndConstruct(i)}catch(u){let l=ji("Parsing regular expression",u)+`
1 year ago
8 months ago
${ni.helpMessage()}`;return re.fromError(e,l)}if(s===null)return re.fromError(e,`Invalid instruction: '${e}'
9 months ago
8 months ago
${ni.helpMessage()}`)}if(s===null)return re.fromError(e,`do not understand query filter (${this.fieldName()})`);let a=n.match(/not/)!==null,o=new Et(e,this.getFilter(s,a),s.explanation(e));return re.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 Ae{fieldName(){return"description"}value(e){return ye.getInstance().removeAsSubstringFrom(e.description)}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=$i.cleanDescription(e.description),i=$i.cleanDescription(t.description);return n.localeCompare(i,void 0,{numeric:!0})}}static cleanDescription(e){e=ye.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 Ol=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.
9 months ago
Possible causes:
- The query is an a template file, and is not intended to be searched.
- A command such as "Replace templates in the active file" needs to be run.
- The core "Daily notes" plugin is in use, and the template contained
date calculations that it does not support.
- Some sample template text was accidentally pasted in to a tasks query,
instead of in to a template file.
1 year ago
9 months ago
See: https://publish.obsidian.md/tasks/Advanced/Instruction+contains+unexpanded+template+text
8 months ago
`}};var Dl=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e.toLocaleLowerCase()===this._instruction.toLocaleLowerCase()}createFilterOrErrorMessage(e){return this.canCreateFilterForLine(e)?re.fromFilter(new Et(e,this._filter,new Re(e))):re.fromError(e,`do not understand filter: ${e}`)}};var $t=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new Dl(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 re.fromError(e,`do not understand filter: ${e}`)}};var dt=class extends we{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new $t,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 p;let n=this.checkForUnexpandedTemplateText(t);if(n)return re.fromError(t,n);let i=this.filterInstructions.createFilterOrErrorMessage(t);if(i.isValid())return i;let s=we.getMatch(this.filterRegExp(),t);if(s===null)return re.fromError(t,"do not understand query filter ("+this.fieldName()+" date)");let a=s[1],o=(p=s[2])==null?void 0:p.toLowerCase(),u=s[3],l=Kt.parseDateRange(u);if(!l.isValid()){let m=Kt.parseDate(a);m.isValid()&&(l=new Ct(m,m))}if(!l.isValid())return re.fromError(t,"do not understand "+this.fieldName()+" date");let c=this.buildFilterFunction(o,l),d=dt.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),l);return re.fromFilter(new Et(t,c,d))}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:`,d=[new Re(`${s.start.format(o)} and`),new Re(`${s.end.format(o)} inclusive`)];return i&&d.push(new Re(`OR no ${t} date`)),new Re(c,d)}a="on",u=s.start.format(o);break}let l=`${t} date is ${a} ${u}`;return i&&(l+=` OR no ${t} date`),new Re(l)}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(t,n)=>br(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.isValid()?[n.format("YYYY-MM-DD dddd")]:["%%0%% Invalid "+this.fieldName()+" date"]}}checkForUnexpandedTemplateText(t){return new Ol().findUnexpandedDateText(t)}};var xl=class extends dt{fieldName(){return"created"}date(e){return e.createdDate}filterResultIfFieldMissing(){return!1}};var Rl=class extends dt{fieldName(){return"done"}date(e){return e.doneDate}filterResultIfFieldMissing(){return!1}};var Ys=class extends dt{fieldName(){return"due"}date(e){return e.dueDate}filter
9 months ago
Allowed options: 'is' and 'is not' (without quotes).
Allowed values: ${t}
Note: values are case-insensitive,
so 'in_progress' works too, for example.
8 months ago
Example: ${this.fieldNameSingular()} is not NON_TASK`;return re.fromError(e,n)}fieldName(){return"status.type"}value(e){return e.status.type}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=cn.groupName(e),i=cn.groupName(t);return n.localeCompare(i,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return e=>[cn.groupName(e)]}static groupName(e){return e.status.typeGroupText}};var Hl=class extends Ae{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 Vl=class extends Ae{fieldName(){return"folder"}value(e){return e.file.folder}supportsGrouping(){return!0}grouper(){return e=>[Ae.escapeMarkdownCharacters(this.value(e))]}};var zl=class extends Ae{fieldName(){return"root"}value(e){return e.file.root}supportsGrouping(){return!0}grouper(){return e=>[Ae.escapeMarkdownCharacters(this.value(e))]}};var Kl=class extends Ae{fieldName(){return"backlink"}value(e){let t=e.getLinkText({isFilenameUnique:!0});return t===null?"Unknown Location":t}createFilterOrErrorMessage(e){return re.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 Ql=class extends dt{fieldName(){return"cancelled"}date(e){return e.cancelledDate}filterResultIfFieldMissing(){return!1}};var Xl=class extends an{constructor(){super(),this._filters.add("is blocking",(e,t)=>e.isBlocking(t.allTasks)),this._filters.add("is not blocking",(e,t)=>!e.isBlocking(t.allTasks)),this._filters.add("is blocked",(e,t)=>e.isBlocked(t.allTasks)),this._filters.add("is not blocked",(e,t)=>!e.isBlocked(t.allTasks))}fieldName(){return"blocking"}};var Zl=class extends Ae{constructor(){super();this.filterInstructions=new $t;this.filterInstructions.add("has id",t=>t.id.length>0),this.filterInstructions.add("no id",t=>t.id.length===0)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.isValid()?n:super.createFilterOrErrorMessage(t)}fieldName(){return"id"}value(t){return t.id}supportsSorting(){return!0}supportsGrouping(){return!0}};var Jl=class extends we{constructor(){super();this.filterInstructions=new $t;this.filterInstructions.add("has depends on",t=>t.dependsOn.length>0),this.filterInstructions.add("no depends on",t=>t.dependsOn.length===0)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.isValid()?n:re.fromError(t,"Unknown instruction")}fieldName(){return"blocked by"}filterRegExp(){return null}};var Mh=[()=>new Bl,()=>new cn,()=>new si,()=>new Ll,()=>new Gi,()=>new Fl,()=>new Ql,()=>new xl,()=>new Il,()=>new Nl,()=>new Ys,()=>new Rl,()=>new Bs,()=>new Vl,()=>new zl,()=>new Kl,()=>new $i,()=>new Yi,()=>new Pl,()=>new Ml,()=>new Yl,()=>new ea,()=>new Hl,()=>new Al,()=>new Zl,()=>new Jl,()=>new Xl,()=>new Js];function Gl(r){for(let e of Mh){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function Vw(r){let e=/^sort by /i;if(r.match(e)===null)return null;for(let t of Mh){let i=t().createSorterFromLine(r);if(i)return i}return null}function zw(r){let e=/^group by /i;if(r.match(e)===null)return null;for(let t of Mh){let i=t().createGrouperFromLine(r);if(i)return i}return null}var ec=class{constructor(e,t,n){this.nestingLevel=e,this.displayName=t,this.property=n}};var tc=class{constructor(e,t){this.lastHeadingAtLevel=new Array;this.groupers=t;let i=e.keys().next().value.length;for(let s=0;s<i;s++)this.lastHeadingAtLevel.push("")}getHeadingsForTaskGroup(e){let t=new Array;for(let n=0;n<e.length;n++){let i=e[n];if(i!=this.la
3 years ago
`;return e}toString(){let e=`
`;e+=`Group names: [${this.groups}]
1 year ago
`;for(let t of this.groupHeadings)e+=`${"#".repeat(4+t.nestingLevel)} [${t.property}] ${t.displayName}
8 months ago
`;return e+=this.tasksAsStringOfLines(),e}};var ta=class{constructor(e,t,n){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length,this._groupers=e;let s=new ic(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}
1 year ago
`}for(let n of this.groups)e+=n.toString(),e+=`
3 years ago
---
`;return e+=`
${this.totalTasksCount()} tasks
8 months ago
`,e}addTaskGroups(e){for(let[t,n]of e){let i=new sc(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<i.length;a++){let o=this._groupers[a],u=i[a].localeCompare(s[a],void 0,{numeric:!0});if(u!==0)return o.reverse?-u:u}return 0};this._groups.sort(e)}setGroupsHeadings(e){let t=new tc(e,this._groupers);for(let n of this._groups)n.setGroupHeadings(t.getHeadingsForTaskGroup(n.groups))}applyTaskLimit(e){this._groupers.length!==0&&(this._groups.forEach(t=>{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 ai=class{constructor(e,t){this.queryPath=e,this.allTasks=[...t]}static fromAllTasks(e){return new ai(void 0,e)}queryContext(){return this.queryPath?hh(this.queryPath,this.allTasks):void 0}};function Kw(r){return`task${r!==1?"s":""}`}var Vi=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} ${Kw(e)}`:`${e} of ${t} ${Kw(t)}`}get groups(){return this.taskGroups.groups}static fromError(e){let t=new Vi(new ta([],[],ai.fromAllTasks([])),0);return t._searchErrorMessage=e,t}};function Qw(r){return r.endsWith("\\")}function Xw(r){return r.endsWith("\\\\")}function ZI(r){return r.replace(/^[ \t]*/,"")}function JI(r){return r.replace(/[ \t]*\\$/,"")}function eF(r,e){let t=r;return e&&(t=ZI(r)),Xw(t)?t=t.slice(0,-1):Qw(r)&&(t=JI(t)),t}function Zw(r){let e=[],t=!1,n="",i="";for(let s of r.split(`
`)){let a=eF(s,t);t?(n+=`
`+s,i+=" "+a):(n=s,i=a),Xw(s)?t=!1:t=Qw(s),t||(i.trim()!==""&&e.push(new Gs(n,i)),n="",i="")}return e}var ra=class{static by(e,t,n){let i=this.defaultSorters().map(a=>a.comparator),s=[];for(let a of e)s.push(a.comparator);return t.sort(ra.makeCompositeComparator([...s,...i],n))}static defaultSorters(){return[new cn().createNormalSorter(),new ea().createNormalSorter(),new Ys().createNormalSorter(),new Gi().createNormalSorter(),new Bs().createNormalSorter()]}static makeCompositeComparator(e,t){return(n,i)=>{for(let s of e){let a=s(n,i,t);if(a!==0)return a}return 0}}};var Fn=class{constructor(e,t=void 0){this._limit=void 0;this._taskGroupLimit=void 0;this._taskLayoutOptions=new Zr;this._queryLayoutOptions=new ri;this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this._ignoreGlobalQuery=!1;this.hideOptionsRegexp=/^(hide|show) (task count|backlink|priority|cancelled date|created date|start date|scheduled date|done date|due date|recurrence rule|edit button|postpone button|urgency|tags|depends on|id)/i;this.shortModeRegexp=/^short/i;this.fullModeRegexp=/^full/i;this.explainQueryRegexp=/^explain/i;this.ignoreGlobalQueryRegexp=/^ignore global query/i;this.logger=Pt.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()}`),Zw(e).forEach(n=>{let i=this.expandPlaceholders(n,t);if(this.error===void 0)try{this.parseLine(i,n)}catch(s){let a;s instanceof Error?a=s.message:a="Unknown error",this.setError(a,i);return}})}parseLine(e,t){switch(!0){case this.shortModeRegexp.test(e):this._queryLayoutOptions.shortMode=!0;break;case this.fullModeRegexp.test(e):this._queryLayoutOptions.shortMode=!1;break;case this.explainQueryRegexp.test(e):this._queryLayoutOptions.explainQuery=!0;break;case this.ignoreGlobalQueryRegexp.test(e):this._ignoreGlobalQuery=!0;break;case this.limitRegexp.test(e):this.parseLimit(e);break;case this.parseSortBy(e):break;case this.parseGroupBy(e):break;case this.hideOptionsRegexp.test(e):this.parseHideOptions(e);break;case this.commentRegexp.test(e):break;case this.parseFilter(e,t):break;default:this.setError("do not understand query",e)}}formatQueryForLogging(){return`[${this.source.split(`
`).join(" ; ")}]`}expandPlaceholders(e,t){let n=e.anyContinuationLinesRemoved;if(n.includes("{{")&&n.includes("}}")&&this.filePath===void 0)return this._error=`The query looks like it contains a placeholder, with "{{" and "}}"
1 year ago
but no file path has been supplied, so cannot expand placeholder values.
The query is:
8 months ago
${n}`,n;let i=n;if(t){let s=Cw(t);try{i=Mw(n,s)}catch(a){return a instanceof Error?this._error=a.message:this._error="Internal error. expandPlaceholders() threw something other than Error.",n}}return e.recordExpandedPlaceholders(i),i}append(e){return this.source===""?e:e.source===""?this:new Fn(`${this.source}
${e.source}`,this.filePath)}explainQuery(){return new qs().explainQuery(this)}get limit(){return this._limit}get taskGroupLimit(){return this._taskGroupLimit}get taskLayoutOptions(){return this._taskLayoutOptions}get queryLayoutOptions(){return this._queryLayoutOptions}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 ai(this.filePath,e);try{this.filters.forEach(o=>{e=e.filter(u=>o.filterFunction(u,t))});let{debugSettings:n}=J(),i=n.ignoreSortInstructions?e:ra.by(this.sorting,e,t),s=i.slice(0,this.limit),a=new ta(this.grouping,s,t);return this._taskGroupLimit!==void 0&&a.applyTaskLimit(this._taskGroupLimit),new Vi(a,i.length)}catch(n){let i="Search failed";return Vi.fromError(ji(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._queryLayoutOptions.hideTaskCount=n;break;case"backlink":this._queryLayoutOptions.hideBacklinks=n;break;case"postpone button":this._queryLayoutOptions.hidePostponeButton=n;break;case"priority":this._taskLayoutOptions.setVisibility("priority",!n);break;case"cancelled date":this._taskLayoutOptions.setVisibility("cancelledDate",!n);break;case"created date":this._taskLayoutOptions.setVisibility("createdDate",!n);break;case"start date":this._taskLayoutOptions.setVisibility("startDate",!n);break;case"scheduled date":this._taskLayoutOptions.setVisibility("scheduledDate",!n);break;case"due date":this._taskLayoutOptions.setVisibility("dueDate",!n);break;case"done date":this._taskLayoutOptions.setVisibility("doneDate",!n);break;case"recurrence rule":this._taskLayoutOptions.setVisibility("recurrenceRule",!n);break;case"edit button":this._queryLayoutOptions.hideEditButton=n;break;case"urgency":this._queryLayoutOptions.hideUrgency=n;break;case"tags":this._taskLayoutOptions.setTagsVisibility(!n);break;case"id":this._taskLayoutOptions.setVisibility("id",!n);break;case"depends on":this._taskLayoutOptions.setVisibility("dependsOn",!n);break;default:this.setError("do not understand hide/show option",e)}}}parseFilter(e,t){var i;let n=Gl(e);return n!=null?(n.filter?(n.filter.setStatement(t),this._filters.push(n.filter)):this.setError((i=n.error)!=null?i:"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=Vw(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy(e){let t=zw(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 oi=class{constructor(e=oi.empty){this._source=e}static getInstance(){return oi.instance||(oi.instance=new oi),oi.instance}set(e){this._source=e}query(e=void 0){return new Fn(this._source,e)}hasInstructions(){return this._source.trim()!==oi.empty}},kr=oi;kr.empty="";var ac=class{constructor({obsidianEvents:e}){this.logger=Pt.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 rk=require("obsidian");var tk=require("obsidian");var Ch=class{constructor(e){this.newStatus=e}apply(e){return this.isCheckedForTask(e)?[e]:e.handleNewStatusWithRecurrenceInUsersOrder(this.newStatus)}instructionDisplayName(){return`Change status to: [${this.newStatus.symbol}] ${this.newStatus.name}`}isCheckedForTask(e){return this.newStatus.symbol===e.status.symbo
`);if(m===void 0)return!1;let b=null;for(let E=0;E<m.length;E=E+1)if(m[E]!==""){b=m[E];break}return b===null?!1:ye.getInstance().includedIn(b)});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 p=a.lineStart;p<=a.lineEnd;p++){let m=o[p];if(m===void 0)continue;let b=null,g=oe.fromLine({line:m,taskLocation:new yt(s,p,a.lineStart,u,b),fallbackDate:null});g!==null&&(l.push(g),u++)}let c=new ui({obsidianComponent:n,parentUlElement:e,taskLayoutOptions:new Zr,queryLayoutOptions:new ri});for(let p=0;p<i.length;p++){let m=l[p],b=i[p];if(m===void 0||b===void 0)continue;let g=(d=b.getAttr("data-line"))!=null?d:"0",E=Number.parseInt(g,10),R=yield c.renderTaskLine(m,E),x=b.childNodes;for(let $=0;$<x.length;$=$+1){let ee=x[$];ee.nodeName.toLowerCase()==="div"?R.prepend(ee):ee.nodeName.toLowerCase()==="ul"&&R.append(ee)}let v=b.querySelectorAll("[data-footnote-id]"),V=R.querySelectorAll("[data-footnote-id]");if(v.length===V.length)for(let $=0;$<v.length;$++)V[$].replaceWith(v[$]);b.replaceWith(R)}})}};var nk=require("@codemirror/view"),ik=require("obsidian");var sk=()=>nk.ViewPlugin.fromClass(Ph),Ph=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 p=`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(p),new ik.Notice(p,45e3)}return!1}let{state:i}=this.view,s=this.view.posAtDOM(t),a=i.doc.lineAt(s),o=oe.fromLine({line:a.text,taskLocation:yt.fromUnknownPosition(""),fallbackDate:null});if(o===null)return!1;e.preventDefault();let l=o.toggleWithRecurrenceInUsersOrder().map(p=>p.toFileLineString()).join(i.lineBreak),c=i.update({changes:{from:a.from,to:a.to,insert:l}});this.view.dispatch(c);let d=t.checked;return setTimeout(()=>{t.checked=d},1),!0}};var sa=require("obsidian");function Go(r,e,t){e&&r.push(rF(t))}function rF(r){return`tasks-layout-hide-${r}`}var cc=class{constructor(e){e?this.queryLayoutOptions=e:this.queryLayoutOptions=new ri}getHiddenClasses(){let e=[],t=[[this.queryLayoutOptions.hideUrgency,"urgency"],[this.queryLayoutOptions.hideBacklinks,"backlinks"],[this.queryLayoutOptions.hideEditButton,"edit-button"],[this.queryLayoutOptions.hidePostponeButton,"postpone-button"]];for(let[n,i]of t)Go(e,n,i);return this.queryLayoutOptions.shortMode&&e.push("tasks-layout-short-mode"),e}};function ak(r,e,t,n=void 0){let i="";e.isEmpty()||(i+=`Only tasks containing the global filter '${e.get()}'.
2 years ago
8 months ago
`);let s=new qs(" "),a=new Fn(r,n);if(!a.ignoreGlobalQuery&&t.hasInstructions()){let o=t.query(n);i+=`Explanation of the global query:
2 years ago
8 months ago
${s.explainQuery(o)}
`}return i+=`Explanation of this Tasks code block query:
2 years ago
8 months ago
${s.explainQuery(a)}`,i}function dc(r,e,t){let n=new Fn(r,t);return n.ignoreGlobalQuery?n:e.query(t).append(n)}function ok(r){for(let t of oe.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 fc(r){return r.dueDate?"dueDate":r.scheduledDate?"scheduledDate":r.startDate?"startDate":null}function Nh(r,e,t,n){let i=r[e];return lk(i,r,e,t,n)}function uk(r,e,t,n){let i=window.moment();return lk(i,r,e,t,n)}function lk(r,e,t,n,i){let s=new Ye(r).postpone(n,i),a=wt.removeInferredStatusIfNeeded(e,[new oe(be(X({},e),{[t]:s}))])[0];return{postponedDate:s,postponedTask:a}}function ck(r,e){let t=r==null?void 0:r.format("DD MMM YYYY");return`Task's ${e} changed to ${t}`}function dk(r,e,t){return`\u2139\uFE0F ${Ih(r,e,t)} (right-click for more options)`}function nF(r){return r.charAt(0).toUpperCase()+r.slice(1)}function Ih(r,e,t){let n=fc(r),i=r[n];return pk(n,i,e,t)}function fk(r,e,t){let n=fc(r),i=window.moment().startOf("day");return pk(n,i,e,t)}function pk(r,e,t,n){let s=new Ye(e).postpone(n,t).format("ddd Do MMM"),a=t!=1?t:"a";return e.isSameOrBefore(window.moment(),"day")?`${nF(r.replace("Date",""))} in ${a} ${n}, on ${s}`.replace(" in 0 days"," today").replace("in a day","tomorrow"):`Postpone ${r.replace("Date"," date")} by ${a} ${n}, to ${s}`}var pc=class{constructor(e){e?this.taskLayoutOptions=e:this.taskLayoutOptions=new Zr}generateHiddenClasses(){let e=[];return this.taskLayoutOptions.toggleableComponents.forEach(t=>{Go(e,!this.taskLayoutOptions.isShown(t),t)}),Go(e,!this.taskLayoutOptions.areTagsShown(),"tags"),e}};var Fh=require("obsidian");var li=class extends na{constructor(e,t,n=jo){super(n);let i=(l,c,d,p,m,b)=>{let g=m(t,p,d);c.setTitle(g).onClick(()=>li.postponeOnClickCallback(l,t,p,d,b,n))},s=fk,a=uk;this.addItem(l=>i(e,l,"days",0,s,a)),this.addItem(l=>i(e,l,"day",1,s,a)),this.addSeparator();let o=Ih,u=Nh;this.addItem(l=>i(e,l,"days",2,o,u)),this.addItem(l=>i(e,l,"days",3,o,u)),this.addItem(l=>i(e,l,"days",4,o,u)),this.addItem(l=>i(e,l,"days",5,o,u)),this.addItem(l=>i(e,l,"days",6,o,u)),this.addSeparator(),this.addItem(l=>i(e,l,"week",1,o,u)),this.addItem(l=>i(e,l,"weeks",2,o,u)),this.addItem(l=>i(e,l,"weeks",3,o,u)),this.addItem(l=>i(e,l,"month",1,o,u))}static postponeOnClickCallback(o,u,l,c){return L(this,arguments,function*(e,t,n,i,s=Nh,a=jo){let d=fc(t);if(d===null){let b="\u26A0\uFE0F Postponement requires a date: due, scheduled or start.";return new Fh.Notice(b,1e4)}let{postponedDate:p,postponedTask:m}=s(t,d,i,n);yield a(t,m),li.postponeSuccessCallback(e,d,p)})}static postponeSuccessCallback(e,t,n){e.style.pointerEvents="none";let i=ck(n,t);new Fh.Notice(i,2e3)}};var mc=class{constructor({plugin:e,events:t}){this.addQueryRenderChild=this._addQueryRenderChild.bind(this);this.app=e.app,this.plugin=e,this.events=t,e.registerMarkdownCodeBlockProcessor("tasks",this._addQueryRenderChild.bind(this))}_addQueryRenderChild(e,t,n){return L(this,null,function*(){n.addChild(new Lh({app:this.app,plugin:this.plugin,events:this.events,container:t,source:e,filePath:n.sourcePath}))})}},Lh=class extends sa.MarkdownRenderChild{constructor({app:t,plugin:n,events:i,container:s,source:a,filePath:o}){super(s);switch(this.app=t,this.plugin=n,this.events=i,this.source=a,this.filePath=o,this.containerEl.className){case"block-language-tasks":this.query=dc(this.source,kr.getInstance(),this.filePath),this.queryType="tasks";break;default:this.query=dc(this.source,kr.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=dc(this.source,kr.getInstance(),this.filePath),this.events.triggerR
1 year ago
`,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}
8 months ago
`)}makeRowText(e){let t="|";return e.forEach(n=>{t+=` ${n} |`}),t}};function mk(r,e){return r.findIndex(t=>t.symbol===e)}function Ln(r){return r===""?r:"`"+(r!==" "?r:"space")+"`"}function iF(r,e){let t=ne.getTypeForUnknownSymbol(r.symbol);r.type!==t&&(t==="TODO"&&r.symbol!==" "||e.push(`For information, the conventional type for status symbol ${Ln(r.symbol)} is ${Ln(t)}: you may wish to review this type.`))}function sF(r,e,t){let n=mk(r,e.nextStatusSymbol);if(n===-1){t.push(`Next symbol ${Ln(e.nextStatusSymbol)} is unknown: create a status with symbol ${Ln(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",a=[`This \`DONE\` status is followed by ${Ln(i.type)}, not \`TODO\` or \`IN_PROGRESS\`.`,"If used to complete a recurring task, it will instead be followed by `TODO` or `IN_PROGRESS`, to ensure the next task matches the `not done` filter.",`See [Recurring Tasks and Custom Statuses](${s}).`].join("<br>");t.push(a)}}else t.push("Unexpected failure to find the next status.")}function aF(r,e,t){let n=[];return e.symbol===ne.EMPTY.symbol?(n.push("Empty symbol: this status will be ignored."),n):mk(r,e.symbol)!=t?(n.push(`Duplicate symbol '${Ln(e.symbol)}': this status will be ignored.`),n):(iF(e,n),sF(r,e,n),n)}function hk(r){let e=new hc(["Status Symbol","Next Status Symbol","Status Name","Status Type","Problems (if any)"]),t=Le.allStatuses(r);return t.forEach((n,i)=>{e.addRow([Ln(n.symbol),Ln(n.nextStatusSymbol),n.name,Ln(n.type),aF(t,n,i).join("<br>")])}),e.markdown}function gk(r,e,t,n){let s=hk(r),a=e.mermaidDiagram(!0);return`# ${t}
1 year ago
## About this file
This file was created by the Obsidian Tasks plugin (version ${n}) to help visualise the task statuses in this vault.
If you change the Tasks status settings, you can get an updated report by:
- Going to \`Settings\` -> \`Tasks\`.
- Clicking on \`Review and check your Statuses\`.
You can delete this file any time.
## Status Settings
<!--
Switch to Live Preview or Reading Mode to see the table.
If there are any Markdown formatting characters in status names, such as '*' or '_',
Obsidian may only render the table correctly in Reading Mode.
-->
These are the status values in the Core and Custom statuses sections.
8 months ago
${s}
1 year ago
## Loaded Settings
<!-- Switch to Live Preview or Reading Mode to see the diagram. -->
These are the settings actually used by Tasks.
8 months ago
${a}`}function yk(){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 bk(){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 Tk(){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 vk(){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 wk(){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"]]}f
`)+`
8 months ago
Fix errors before saving.`;new $r.Notice(d);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?ar.removeValidationError(t):ar.setValidationError(t)}};var Gt=class extends ke.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 L(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 ke.Setting(t).setName("Task Format").setDesc(Gt.createFragmentWithHTML('<p>The format that Tasks uses to read and write tasks.</p><p><b>Important:</b> Tasks currently only supports one format at a time. Selecting Dataview will currently <b>stop Tasks reading its own emoji signifiers</b>.</p><p>See the <a href="https://publish.obsidian.md/tasks/Reference/Task+Formats/About+Task+Formats">documentation</a>.</p>')).addDropdown(i=>{for(let s of Object.keys(Dn))i.addOption(s,Dn[s].displayName);i.setValue(J().taskFormat).onChange(s=>L(this,null,function*(){tt({taskFormat:s}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global filter Settings"}),new ke.Setting(t).setName("Global task filter").setDesc(Gt.createFragmentWithHTML('<p><b>Recommended: Leave empty if you want all checklist items in your vault to be tasks managed by this plugin.</b></p><p>Use a global filter if you want Tasks to only act on a subset of your "<code>- [ ]</code>" checklist items, so that a checklist item must include the specified string in its description in order to be considered a task.<p><p>For example, if you set the global filter to <code>#task</code>, the Tasks plugin will only handle checklist items tagged with <code>#task</code>.</br>Other checklist items will remain normal checklist items and not appear in queries or get a done date set.</p><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Global+Filter">documentation</a>.</p>')).addText(i=>{i.setPlaceholder("e.g. #task or TODO").setValue(ye.getInstance().get()).onChange(s=>L(this,null,function*(){tt({globalFilter:s}),ye.getInstance().set(s),yield this.plugin.saveSettings()}))}),new ke.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=J();i.setValue(s.removeGlobalFilter).onChange(a=>L(this,null,function*(){tt({removeGlobalFilter:a}),ye.getInstance().setRemoveGlobalFilter(a),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global Query"}),cF(new ke.Setting(t).setDesc(Gt.createFragmentWithHTML('<p>A query that is automatically included at the start of every Tasks block in the vault. Useful for adding default filters, or layout options.</p><p>See the <a href="https://publish.obsidian.md/tasks/Queries/Global+Query">documentation</a>.</p>')).addTextArea(i=>{let s=J();i.inputEl.rows=4,i.setPlaceholder(`# For example...
2 years ago
path does not include _templates/
limit 300
8 months ago
show urgency`).setValue(s.globalQuery).onChange(a=>L(this,null,function*(){tt({globalQuery:a}),kr.getInstance().set(a),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=J();Ek.forEach(i=>{this.addOneSettingsBlock(t,i,n)}),t.createEl("h4",{text:"Date Settings"}),new ke.Setting(t).setName("Set created date on every added task").setDesc(Gt.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.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Dates#Created+date">documentation</a>.</p>`)).addToggle(i=>{let s=J();i.setValue(s.setCreatedDate).onChange(a=>L(this,null,function*(){tt({setCreatedDate:a}),yield this.plugin.saveSettings()}))}),new ke.Setting(t).setName("Set done date on every completed task").setDesc(Gt.createFragmentWithHTML('Enabling this will add a timestamp \u2705 YYYY-MM-DD at the end when a task is toggled to done.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Dates#Done+date">documentation</a>.</p>')).addToggle(i=>{let s=J();i.setValue(s.setDoneDate).onChange(a=>L(this,null,function*(){tt({setDoneDate:a}),yield this.plugin.saveSettings()}))}),new ke.Setting(t).setName("Set cancelled date on every cancelled task").setDesc(Gt.createFragmentWithHTML('Enabling this will add a timestamp \u274C YYYY-MM-DD at the end when a task is toggled to cancelled.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Dates#Cancelled+date">documentation</a>.</p>')).addToggle(i=>{let s=J();i.setValue(s.setCancelledDate).onChange(a=>L(this,null,function*(){tt({setCancelledDate:a}),yield this.plugin.saveSettings()}))}),new ke.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(Gt.createFragmentWithHTML('Save time entering Scheduled (\u23F3) dates.</br>If this option is enabled, any undated tasks will be given a default Scheduled date extracted from their file name.</br>The date in the file name must be in one of <code>YYYY-MM-DD</code> or <code>YYYYMMDD</code> formats.</br>Undated tasks have none of Due (\u{1F4C5} ), Scheduled (\u23F3) and Start (\u{1F6EB}) dates.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Use+Filename+as+Default+Date">documentation</a>.</p>')).addToggle(i=>{let s=J();i.setValue(s.useFilenameAsScheduledDate).onChange(a=>L(this,null,function*(){tt({useFilenameAsScheduledDate:a}),yield this.plugin.saveSettings()}))}),new ke.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=>L(this,null,function*(){let s=J();yield this.plugin.saveSettings(),i.setValue(Gt.renderFolderArray(s.filenameAsDateFolders)).onChange(a=>L(this,null,function*(){let o=Gt.parseCommaSeparatedFolders(a);tt({filenameAsDateFolders:o}),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Recurring task Settings"}),new ke.Setting(t).setName("Next recurrence appears on the line below").setDesc(Gt.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.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Recurring+Tasks">documentation</a>.</p>')).addToggle(i=>{let{recurrenceOnNextLine:s}=J();i.setValue(s).onChange(a=>L(this,null,function*(){tt({recurrenceOnNextLine:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Auto-suggest Settings"}),new ke.Setting(t).setName("Auto-suggest task content").setDesc(Gt.createFragmentWithHTML('Enabling this will open an intelligent suggest menu while typing inside a recognized task line.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Auto-Suggest">documentation</a>.</p>')).addToggle(i=>{let s=J();i.setValue(s.autoSuggestInEditor).onChange(a=>L(this,null,function*(){tt({au
`);t(o)}).open(),n};var xk=(r,e)=>{let t=El({line:"",path:""});return new ti({app:r,task:t,onSubmit:e,allTasks:[]})};var Rk=r=>({createTaskLineModal:()=>Dk(r,xk)});var yc=class extends Mk.Plugin{get apiV1(){return Rk(app)}onload(){return L(this,null,function*(){Pt.registerConsoleLogger(),qm("info",`loading plugin "${this.manifest.name}" v${this.manifest.version}`),yield this.loadSettings();let{loggingOptions:t}=J();Pt.configure(t),this.addSettingTab(new Yo({plugin:this})),Lv({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let n=new ac({obsidianEvents:this.app.workspace});this.cache=new Pi({metadataCache:this.app.metadataCache,vault:this.app.vault,events:n}),this.inlineRenderer=new lc({plugin:this}),this.queryRenderer=new mc({plugin:this,events:n}),this.registerEditorExtension(sk()),this.registerEditorSuggest(new gc(this.app,J())),new Sl({plugin:this})})}loadTaskStatuses(){return L(this,null,function*(){let{statusSettings:t}=J();Le.applyToStatusRegistry(t,Oe.getInstance())})}onunload(){var t;qm("info",`unloading plugin "${this.manifest.name}" v${this.manifest.version}`),(t=this.cache)==null||t.unload()}loadSettings(){return L(this,null,function*(){let t=yield this.loadData();tt(t),t=J(),ye.getInstance().set(t.globalFilter),ye.getInstance().setRemoveGlobalFilter(t.removeGlobalFilter),kr.getInstance().set(t.globalQuery),yield this.loadTaskStatuses()})}saveSettings(){return L(this,null,function*(){yield this.saveData(J())})}getTasks(){var t;return(t=this.cache)==null?void 0:t.getTasks()}};
2 years ago
/*!
* EventEmitter2
* https://github.com/hij1nx/EventEmitter2
*
* Copyright (c) 2013 hij1nx
* Licensed under the MIT license.
*/
1 year ago
/*!
* mustache.js - Logic-less {{mustache}} templates with JavaScript
* http://github.com/janl/mustache.js
*/