|
|
/*
|
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
|
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
|
|
|
|
|
|
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.
|
|
|
*/
|
|
|
|
|
|
"use strict";var zk=Object.create;var ha=Object.defineProperty,Kk=Object.defineProperties,Qk=Object.getOwnPropertyDescriptor,Xk=Object.getOwnPropertyDescriptors,Zk=Object.getOwnPropertyNames,su=Object.getOwnPropertySymbols,Jk=Object.getPrototypeOf,Ac=Object.prototype.hasOwnProperty,eg=Object.prototype.propertyIsEnumerable;var Jh=(r,e,t)=>e in r?ha(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,X=(r,e)=>{for(var t in e||(e={}))Ac.call(e,t)&&Jh(r,t,e[t]);if(su)for(var t of su(e))eg.call(e,t)&&Jh(r,t,e[t]);return r},be=(r,e)=>Kk(r,Xk(e));var au=(r,e)=>{var t={};for(var n in r)Ac.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&su)for(var n of su(r))e.indexOf(n)<0&&eg.call(r,n)&&(t[n]=r[n]);return t};var k=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),eE=(r,e)=>{for(var t in e)ha(r,t,{get:e[t],enumerable:!0})},tg=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Zk(e))!Ac.call(r,i)&&i!==t&&ha(r,i,{get:()=>e[i],enumerable:!(n=Qk(e,i))||n.enumerable});return r};var ga=(r,e,t)=>(t=r!=null?zk(Jk(r)):{},tg(e||!r||!r.__esModule?ha(t,"default",{value:r,enumerable:!0}):t,r)),tE=r=>tg(ha({},"__esModule",{value:!0}),r);var F=(r,e,t)=>new Promise((n,i)=>{var s=u=>{try{o(t.next(u))}catch(l){i(l)}},a=u=>{try{o(t.throw(u))}catch(l){i(l)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,a);o((t=t.apply(r,e)).next())});var xe=k(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.matchAnyPattern=Hn.extractTerms=Hn.repeatedTimeunitPattern=void 0;function sE(r,e){let t=e.replace(/\((?!\?)/g,"(?:");return`${r}${t}\\s{0,5}(?:,?\\s{0,5}${t}){0,10}`}Hn.repeatedTimeunitPattern=sE;function rg(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}Hn.extractTerms=rg;function aE(r){return`(?:${rg(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}Hn.matchAnyPattern=aE});var _e=k((Nc,Ic)=>{(function(r,e){typeof Nc=="object"&&typeof Ic!="undefined"?Ic.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(Nc,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",m="date",p="Invalid Date",T=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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:m,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 j=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(j(G))return G.clone();var O=typeof N=="object"?N:{};return O.date=G,O.args=arguments,new de(O)},W=x;W.l=ee,W.i=j,W.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(W.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(T);if(f){var h=f[2]-1||0,g=(f[7]||"0").substring(0,3);return Q?new Date(Date.UTC(f[1],h,f[3]||1,f[4]||0,f[5]||0,f[6]||0,g)):new Date(f[1],h,f[3]||1,f[4]||0,f[5]||0,f[6]||0,g)}}return new Date(U)}(O),this.$x=O.x||{},this.init()},N.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},N.$utils=function(){return W},N.isValid=function(){return this.$d.toString()!==p},N.isSame=function(O,B){var U=Y(O);return this.startOf(B)<=U&&U<=this.endOf(B)},N.isAfter=function(O,B){return Y(O)<this.startOf(B)},N.isBefore=function(O,B){return this.endOf(B)<Y(O)},N.$g=function(O,B,U){return W.u(O)?this[B]:this.set(U,O)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function(O,B){var U=this,Q=!!W.u(B)||B,f=W.p(O),h=function(D,I){var me=W.w(U.$u?Date.UTC(U.$y,I,D):new Date(U.$y,I,D),U);return Q?me:me.endOf(o)},g=function(D,I){return W.w(U.toDate()[D].apply(U.toDate("s"),(Q?[0,0,0,0]:[23,59,59,999]).slice(I)),U)},b=this.$W,w=this.$M,S=this.$D,M="set"+(this.$u?"UTC":"");switch(f){case d:return Q?h(1,0):h(31,11);case l:return Q?h(1,w):h(0,w+1);case u:var P=this.$locale().weekStart||0,_=(b<P?b+7:b)-P;return h(Q?S-_:S+(6-_),w);case o:case m:return g(M+"Hours",0);case a:return g(M+"Minutes",1);case s:return g(M+"Seconds",2);case i:return g(M+"Milliseconds",3);default:return this.clone()}},N.endOf=function(O){return this.startOf(O,!1)},N.$set=function(O,B){var U,Q=W.p(O),f="set"+(this.$u?"UTC":""),h=(U={},U[o]=f+"Date",U[m]=f+"Date",U[l]=f+"Month",U[d]=f+"FullYear",U[a]=f+"Hours",U[s]=f+"Minutes",U[i]=f+"Seconds",U[n]=f+"Milliseconds",U)[Q],g=Q===o?this.$D+(B-this.$W):B;if(Q===l||Q===d){var b=this.clone().set(m,1);b.$d[h](g),b.init(),this.$d=b.set(m,Math.min(this.$D,b.daysInMonth())).$d}else h&&this.$d[h](g);return this.init(),this},N.set=function(O,B){return this.clone().$set(O,B)},N.get=function(O){return this[W.p(O)]()},N.add=function(O,B){var U,Q=this;O=Number(O);var f=W.p(B),h=function(w){var S=Y(Q);return W.w(S.date(S.date()+Math.round(w*O)),Q)};if(f===l)return this.set(l,this.$M+O);if(f===d)return this.set(d,this.$y+O);if(f===o)return h(1);if(f===u)return h(7);var g=(U={},U[s]=e,U[a]=t,U[i]=r,U)[f]||1,b=this.$d.getTime()+O*g;return W.w(b,this)},N.subtract=function(O,B){return this.add(-1*O,B)},N.format=function(O){var B=this,U=this.$locale();if(!this.isValid())return U.invalidDate||p;var Q=O||"YYYY-MM-DDTHH:mm:ssZ",f=W.z(this),h=this.$H,g=this.$m,b=this.$M,w=U.weekdays,S=U.months,M=function(I,me,ae,le){return I&&(I[me]||I(B,Q))||ae[me].substr(0,le)},P=function(I){return W.s(h%12||12,I,"0")},_=U.meridiem||function(I,me,ae){var le=I<12?"AM":"PM";return ae?le.toLowerCase():le},D={YY:String(this.$y).slice(-2),YYYY:this.$y,M:b+1,MM:W.s(b+1,2,"0"),MMM:M(U.monthsShort,b,S,3),MMMM:M(S,b),D:this.$D,DD:W.s(this.$D,2,"0"),d:String(this.$W),dd:M(U.weekdaysMin,this.$W,w,2),ddd:M(U.weekdaysShort,this.$W,w,3),dddd:w[this.$W],H:String(h),HH:W.s(h,2,"0"),h:P(1),hh:P(2),a:_(h,g,!0),A:_(h,g,!1),m:String(g),mm:W.s(g,2,"0"),s:String(this.$s),ss:W.s(this.$s,2,"0"),SSS:W.s(this.$ms,3,"0"),Z:f};return Q.replace(y,function(I,me){return me||D[I]||f.replace(":","")})},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function(O,B,U){var Q,f=W.p(B),h=Y(O),g=(h.utcOffset()-this.utcOffset())*e,b=this-h,w=W.m(this,h);return w=(Q={},Q[d]=w/12,Q[l]=w,Q[c]=w/3,Q[u]=(b-g)/6048e5,Q[o]=(b-g)/864e5,Q[a]=b/t,Q[s]=b/e,Q[i]=b/r,Q)[f]||b,U?w:W.a(w)},N.daysInMonth=function(){return this.endOf(l).$D},N.$locale=function(){return V[this.$L]},N.locale=function(O,B){if(!O)return this.$L;var U=this.clone(),Q=ee(O,B,!0);return Q&&(U.$L=Q),U},N.clone=function(){return W.w(this.$d,this)},N.toDate=function(){return new Date(this.valueOf())},N.toJSON=function(){return this.isValid()?this.toISOString():null},N.toISOString=function(){return this.$d.toISOString()},N.toString=function(){return this.$d.toUTCString()},G}(),Te=de.prototype;return Y.prototype=Te,[["$ms",n],["$s",i],["$m",s],["$H",a],["$W",o],["$M",l],["$y",d],["$D",m]].forEach(function(G){Te[G[1]]=function(N){return this.$g(N,G[0],G[1])}}),Y.extend=function(G,N){return G.$i||(G(N,de,Y),G.$i=!0),Y},Y.locale=ee,Y.isDayjs=j,Y.unix=function(G){return Y(1e3*G)},Y.en=V[v],Y.Ls=V,Y.p={},Y})});var pt=k(Vn=>{"use strict";var oE=Vn&&Vn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.findYearClosestToRef=Vn.findMostLikelyADYear=void 0;var uE=oE(_e());function lE(r){return r<100&&(r>50?r=r+1900:r=r+2e3),r}Vn.findMostLikelyADYear=lE;function cE(r,e,t){let n=uE.default(r),i=n;i=i.month(t-1),i=i.date(e),i=i.year(n.year());let s=i.add(1,"y"),a=i.add(-1,"y");return Math.abs(s.diff(n))<Math.abs(i.diff(n))?i=s:Math.abs(a.diff(n))<Math.abs(i.diff(n))&&(i=a),i.year()}Vn.findYearClosestToRef=cE});var mt=k(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.parseTimeUnits=ue.TIME_UNITS_PATTERN=ue.parseYear=ue.YEAR_PATTERN=ue.parseOrdinalNumberPattern=ue.ORDINAL_NUMBER_PATTERN=ue.parseNumberPattern=ue.NUMBER_PATTERN=ue.TIME_UNIT_DICTIONARY=ue.ORDINAL_WORD_DICTIONARY=ue.INTEGER_WORD_DICTIONARY=ue.MONTH_DICTIONARY=ue.FULL_MONTH_NAME_DICTIONARY=ue.WEEKDAY_DICTIONARY=void 0;var uu=xe(),dE=pt();ue.WEEKDAY_DICTIONARY={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6};ue.FULL_MONTH_NAME_DICTIONARY={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12};ue.MONTH_DICTIONARY=Object.assign(Object.assign({},ue.FULL_MONTH_NAME_DICTIONARY),{jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12});ue.INTEGER_WORD_DICTIONARY={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12};ue.ORDINAL_WORD_DICTIONARY={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31};ue.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconds:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",day:"d",days:"d",week:"week",weeks:"week",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year"};ue.NUMBER_PATTERN=`(?:${uu.matchAnyPattern(ue.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function ig(r){let e=r.toLowerCase();return ue.INTEGER_WORD_DICTIONARY[e]!==void 0?ue.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}ue.parseNumberPattern=ig;ue.ORDINAL_NUMBER_PATTERN=`(?:${uu.matchAnyPattern(ue.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function fE(r){let e=r.toLowerCase();return ue.ORDINAL_WORD_DICTIONARY[e]!==void 0?ue.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}ue.parseOrdinalNumberPattern=fE;ue.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9])";function pE(r){if(/BE/i.test(r))return r=r.replace(/BE/i,""),parseInt(r)-543;if(/BCE?/i.test(r))return r=r.replace(/BCE?/i,""),-parseInt(r);if(/(AD|CE)/i.test(r))return r=r.replace(/(AD|CE)/i,""),parseInt(r);let e=parseInt(r);return dE.findMostLikelyADYear(e)}ue.parseYear=pE;var sg=`(${ue.NUMBER_PATTERN})\\s{0,3}(${uu.matchAnyPattern(ue.TIME_UNIT_DICTIONARY)})`,ng=new RegExp(sg,"i");ue.TIME_UNITS_PATTERN=uu.repeatedTimeunitPattern("(?:(?:about|around)\\s{0,3})?",sg);function mE(r){let e={},t=r,n=ng.exec(t);for(;n;)hE(e,n),t=t.substring(n[0].length).trim(),n=ng.exec(t);return e}ue.parseTimeUnits=mE;function hE(r,e){let t=ig(e[1]),n=ue.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var ag=k((Fc,Lc)=>{(function(r,e){typeof Fc=="object"&&typeof Lc!="undefined"?Lc.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs_plugin_quarterOfYear=e()})(Fc,function(){"use strict";var r="month",e="quarter";return function(t,n){var i=n.prototype;i.quarter=function(o){return this.$utils().u(o)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(o-1))};var s=i.add;i.add=function(o,u){return o=Number(o),this.$utils().p(u)===e?this.add(3*o,r):s.bind(this)(o,u)};var a=i.startOf;i.startOf=function(o,u){var l=this.$utils(),c=!!l.u(u)||u;if(l.p(o)===e){var d=this.quarter()-1;return c?this.month(3*d).startOf(r).startOf("day"):this.month(3*d+2).endOf(r).endOf("day")}return a.bind(this)(o,u)}}})});var cr=k(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.implySimilarTime=Hr.assignSimilarTime=Hr.assignSimilarDate=Hr.assignTheNextDay=void 0;var og=et();function gE(r,e){e=e.add(1,"day"),ug(r,e),lg(r,e)}Hr.assignTheNextDay=gE;function ug(r,e){r.assign("day",e.date()),r.assign("month",e.month()+1),r.assign("year",e.year())}Hr.assignSimilarDate=ug;function yE(r,e){r.assign("hour",e.hour()),r.assign("minute",e.minute()),r.assign("second",e.second()),r.assign("millisecond",e.millisecond()),r.get("hour")<12?r.assign("meridiem",og.Meridiem.AM):r.assign("meridiem",og.Meridiem.PM)}Hr.assignSimilarTime=yE;function lg(r,e){r.imply("hour",e.hour()),r.imply("minute",e.minute()),r.imply("second",e.second()),r.imply("millisecond",e.millisecond())}Hr.implySimilarTime=lg});var cg=k(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.toTimezoneOffset=Ti.TIMEZONE_ABBR_MAP=void 0;Ti.TIMEZONE_ABBR_MAP={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function bE(r){var e;return r==null?null:typeof r=="number"?r:(e=Ti.TIMEZONE_ABBR_MAP[r])!==null&&e!==void 0?e:null}Ti.toTimezoneOffset=bE});var We=k(Vr=>{"use strict";var dg=Vr&&Vr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.ParsingResult=Vr.ParsingComponents=Vr.ReferenceWithTimezone=void 0;var TE=dg(ag()),lu=dg(_e()),Uc=cr(),_E=cg();lu.default.extend(TE.default);var qc=class{constructor(e){var t;e=e!=null?e:new Date,e instanceof Date?this.instant=e:(this.instant=(t=e.instant)!==null&&t!==void 0?t:new Date,this.timezoneOffset=_E.toTimezoneOffset(e.timezone))}};Vr.ReferenceWithTimezone=qc;var _i=class{constructor(e,t){if(this.reference=e,this.knownValues={},this.impliedValues={},t)for(let i in t)this.knownValues[i]=t[i];let n=lu.default(e.instant);this.imply("day",n.date()),this.imply("month",n.month()+1),this.imply("year",n.year()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}get(e){return e in this.knownValues?this.knownValues[e]:e in this.impliedValues?this.impliedValues[e]:null}isCertain(e){return e in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(e,t){return e in this.knownValues?this:(this.impliedValues[e]=t,this)}assign(e,t){return this.knownValues[e]=t,delete this.impliedValues[e],this}delete(e){delete this.knownValues[e],delete this.impliedValues[e]}clone(){let e=new _i(this.reference);e.knownValues={},e.impliedValues={};for(let t in this.knownValues)e.knownValues[t]=this.knownValues[t];for(let t in this.impliedValues)e.impliedValues[t]=this.impliedValues[t];return e}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyDayMonthComponent(){return this.isCertain("day")&&this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let e=this.dateWithoutTimezoneAdjustment();return!(e.getFullYear()!==this.get("year")||e.getMonth()!==this.get("month")-1||e.getDate()!==this.get("day")||this.get("hour")!=null&&e.getHours()!=this.get("hour")||this.get("minute")!=null&&e.getMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents {knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}, reference: ${JSON.stringify(this.reference)}]`}dayjs(){return lu.default(this.date())}date(){let e=this.dateWithoutTimezoneAdjustment();return new Date(e.getTime()+this.getSystemTimezoneAdjustmentMinute(e)*6e4)}dateWithoutTimezoneAdjustment(){let e=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return e.setFullYear(this.get("year")),e}getSystemTimezoneAdjustmentMinute(e){var t,n;(!e||e.getTime()<0)&&(e=new Date);let i=-e.getTimezoneOffset(),s=(n=(t=this.get("timezoneOffset"))!==null&&t!==void 0?t:this.reference.timezoneOffset)!==null&&n!==void 0?n:i;return i-s}static createRelativeFromReference(e,t){let n=lu.default(e.instant);for(let s in t)n=n.add(t[s],s);let i=new _i(e);return t.hour||t.minute||t.second?(Uc.assignSimilarTime(i,n),Uc.assignSimilarDate(i,n),e.timezoneOffset!==null&&i.assign("timezoneOffset",-e.instant.getTimezoneOffset())):(Uc.implySimilarTime(i,n),e.timezoneOffset!==null&&i.imply("timezoneOffset",-e.instant.getTimezoneOffset()),t.d?(i.assign("day",n.date()),i.assign("month",n.month()+1),i.assign("year",n.year())):(t.week&&i.imply("weekday",n.day()),i.imply("day",n.date()),t.month?(i.assign("month",n.month()+1),i.assign("year",n.year())):(i.imply("month",n.month()+1),t.year?i.assign("year",n.year()):i.imply("year",n.year())))),i}};Vr.ParsingComponents=_i;var ya=class{constructor(e,t,n,i,s){this.reference=e,this.refDate=e.instant,this.index=t,this.text=n,this.start=i||new _i(e),this.end=s}clone(){let e=new ya(this.reference,this.index,this.text);return e.start=this.start?this.start.clone():null,e.end=this.end?this.end.clone():null,e}date(){return this.start.date()}toString(){return`[ParsingResult {index: ${this.index}, text: '${this.text}', ...}]`}};Vr.ParsingResult=ya});var H=k(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.AbstractParserWithWordBoundaryChecking=void 0;var Wc=class{constructor(){this.cachedInnerPattern=null,this.cachedPattern=null}patternLeftBoundary(){return"(\\W|^)"}pattern(e){let t=this.innerPattern(e);return t==this.cachedInnerPattern?this.cachedPattern:(this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${t.source}`,t.flags),this.cachedInnerPattern=t,this.cachedPattern)}extract(e,t){var n;let i=(n=t[1])!==null&&n!==void 0?n:"";t.index=t.index+i.length,t[0]=t[0].substring(i.length);for(let s=2;s<t.length;s++)t[s-1]=t[s];return this.innerExtract(e,t)}};cu.AbstractParserWithWordBoundaryChecking=Wc});var fg=k(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});var jc=mt(),vE=We(),wE=H(),kE=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${jc.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),EE=new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${jc.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),$c=class extends wE.AbstractParserWithWordBoundaryChecking{innerPattern(e){return e.option.forwardDate?EE:kE}innerExtract(e,t){let n=jc.parseTimeUnits(t[1]);return vE.ParsingComponents.createRelativeFromReference(e.reference,n)}};Gc.default=$c});var bg=k(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});var SE=pt(),gg=mt(),yg=mt(),du=mt(),OE=xe(),DE=H(),xE=new RegExp(`(?:on\\s{0,3})?(${du.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${du.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${OE.matchAnyPattern(gg.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s{0,3})(${yg.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),pg=1,mg=2,RE=3,hg=4,Yc=class extends DE.AbstractParserWithWordBoundaryChecking{innerPattern(){return xE}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=gg.MONTH_DICTIONARY[t[RE].toLowerCase()],s=du.parseOrdinalNumberPattern(t[pg]);if(s>31)return t.index=t.index+t[pg].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[hg]){let a=yg.parseYear(t[hg]);n.start.assign("year",a)}else{let a=SE.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[mg]){let a=du.parseOrdinalNumberPattern(t[mg]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Bc.default=Yc});var kg=k(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});var ME=pt(),vg=mt(),fu=mt(),wg=mt(),CE=xe(),AE=H(),PE=new RegExp(`(${CE.matchAnyPattern(vg.MONTH_DICTIONARY)})(?:-|/|\\s*,?\\s*)(${fu.ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${fu.ORDINAL_NUMBER_PATTERN})\\s*)?(?:(?:-|/|\\s*,?\\s*)(${wg.YEAR_PATTERN}))?(?=\\W|$)(?!\\:\\d)`,"i"),NE=1,IE=2,Tg=3,_g=4,Hc=class extends AE.AbstractParserWithWordBoundaryChecking{innerPattern(){return PE}innerExtract(e,t){let n=vg.MONTH_DICTIONARY[t[NE].toLowerCase()],i=fu.parseOrdinalNumberPattern(t[IE]);if(i>31)return null;let s=e.createParsingComponents({day:i,month:n});if(t[_g]){let u=wg.parseYear(t[_g]);s.assign("year",u)}else{let u=ME.findYearClosestToRef(e.refDate,i,n);s.imply("year",u)}if(!t[Tg])return s;let a=fu.parseOrdinalNumberPattern(t[Tg]),o=e.createParsingResult(t.index,t[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}};Vc.default=Hc});var Og=k(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});var zc=mt(),FE=pt(),LE=xe(),Sg=mt(),UE=H(),qE=new RegExp(`((?:in)\\s*)?(${LE.matchAnyPattern(zc.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${Sg.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),WE=1,$E=2,Eg=3,Kc=class extends UE.AbstractParserWithWordBoundaryChecking{innerPattern(){return qE}innerExtract(e,t){let n=t[$E].toLowerCase();if(t[0].length<=3&&!zc.FULL_MONTH_NAME_DICTIONARY[n])return null;let i=e.createParsingResult(t.index+(t[WE]||"").length,t.index+t[0].length);i.start.imply("day",1);let s=zc.MONTH_DICTIONARY[n];if(i.start.assign("month",s),t[Eg]){let a=Sg.parseYear(t[Eg]);i.start.assign("year",a)}else{let a=FE.findYearClosestToRef(e.refDate,1,s);i.start.imply("year",a)}return i}};Qc.default=Kc});var Rg=k(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});var xg=mt(),jE=xe(),GE=H(),YE=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${jE.matchAnyPattern(xg.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),BE=1,HE=2,Dg=3,VE=4,Xc=class extends GE.AbstractParserWithWordBoundaryChecking{innerPattern(){return YE}innerExtract(e,t){let n=t[Dg]?parseInt(t[Dg]):xg.MONTH_DICTIONARY[t[HE].toLowerCase()];if(n<1||n>12)return null;let i=parseInt(t[BE]);return{day:parseInt(t[VE]),month:n,year:i}}};Zc.default=Xc});var Mg=k(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});var zE=H(),KE=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),QE=1,XE=2,Jc=class extends zE.AbstractParserWithWordBoundaryChecking{innerPattern(){return KE}innerExtract(e,t){let n=parseInt(t[XE]),i=parseInt(t[QE]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}};ed.default=Jc});var vi=k(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.AbstractTimeExpressionParser=void 0;var Ct=et();function ZE(r,e,t,n){return new RegExp(`${r}${e}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,n)}function JE(r,e){return new RegExp(`^(${r})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${e}`,"i")}var Cg=2,as=3,pu=4,mu=5,ba=6,td=class{constructor(e=!1){this.cachedPrimaryPrefix=null,this.cachedPrimarySuffix=null,this.cachedPrimaryTimePattern=null,this.cachedFollowingPhase=null,this.cachedFollowingSuffix=null,this.cachedFollowingTimePatten=null,this.strictMode=e}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?=\\W|$)"}followingSuffix(){return"(?=\\W|$)"}pattern(e){return this.getPrimaryTimePatternThroughCache()}extract(e,t){let n=this.extractPrimaryTimeComponents(e,t);if(!n)return t.index+=t[0].length,null;let i=t.index+t[1].length,s=t[0].substring(t[1].length),a=e.createParsingResult(i,s,n);t.index+=t[0].length;let o=e.text.substring(t.index),l=this.getFollowingTimePatternThroughCache().exec(o);return s.match(/^\d{3,4}/)&&l&&l[0].match(/^\s*([+-])\s*\d{2,4}$/)?null:!l||l[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(a):(a.end=this.extractFollowingTimeComponents(e,l,a),a.end&&(a.text+=l[0]),this.checkAndReturnWithFollowingPattern(a))}extractPrimaryTimeComponents(e,t,n=!1){let i=e.createParsingComponents(),s=0,a=null,o=parseInt(t[Cg]);if(o>100){if(this.strictMode||t[as]!=null)return null;s=o%100,o=Math.floor(o/100)}if(o>24)return null;if(t[as]!=null){if(t[as].length==1&&!t[ba])return null;s=parseInt(t[as])}if(s>=60)return null;if(o>12&&(a=Ct.Meridiem.PM),t[ba]!=null){if(o>12)return null;let u=t[ba][0].toLowerCase();u=="a"&&(a=Ct.Meridiem.AM,o==12&&(o=0)),u=="p"&&(a=Ct.Meridiem.PM,o!=12&&(o+=12))}if(i.assign("hour",o),i.assign("minute",s),a!==null?i.assign("meridiem",a):o<12?i.imply("meridiem",Ct.Meridiem.AM):i.imply("meridiem",Ct.Meridiem.PM),t[mu]!=null){let u=parseInt(t[mu].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(t[pu]!=null){let u=parseInt(t[pu]);if(u>=60)return null;i.assign("second",u)}return i}extractFollowingTimeComponents(e,t,n){let i=e.createParsingComponents();if(t[mu]!=null){let u=parseInt(t[mu].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(t[pu]!=null){let u=parseInt(t[pu]);if(u>=60)return null;i.assign("second",u)}let s=parseInt(t[Cg]),a=0,o=-1;if(t[as]!=null?a=parseInt(t[as]):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=Ct.Meridiem.PM),t[ba]!=null){if(s>12)return null;let u=t[ba][0].toLowerCase();u=="a"&&(o=Ct.Meridiem.AM,s==12&&(s=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),u=="p"&&(o=Ct.Meridiem.PM,s!=12&&(s+=12)),n.start.isCertain("meridiem")||(o==Ct.Meridiem.AM?(n.start.imply("meridiem",Ct.Meridiem.AM),n.start.get("hour")==12&&n.start.assign("hour",0)):(n.start.imply("meridiem",Ct.Meridiem.PM),n.start.get("hour")!=12&&n.start.assign("hour",n.start.get("hour")+12)))}return i.assign("hour",s),i.assign("minute",a),o>=0?i.assign("meridiem",o):n.start.isCertain("meridiem")&&n.start.get("hour")>12?n.start.get("hour")-12>s?i.imply("meridiem",Ct.Meridiem.AM):s<=12&&(i.assign("hour",s+12),i.assign("meridiem",Ct.Meridiem.PM)):s>12?i.imply("meridiem",Ct.Meridiem.PM):s<=12&&i.imply("meridiem",Ct.Meridiem.AM),i.date().getTime()<n.start.date().getTime()&&i.imply("day",i.get("day")+1),i}checkAndReturnWithoutFollowingPattern(e){if(e.text.match(/^\d$/)||e.text.match(/^\d\d\d+$/)||e.text.match(/\d[apAP]$/))return null;let t=e.text.match(/[^\d:.](\d[\d.]+)$/);if(t){let n=t[1];if(this.strictMode||n.includes(".")&&!n.match(/\d(\.\d{2})+$/)||parseInt(n)>24)return null}return e}checkAndReturnWithFollowingPattern(e){if(e.text.match(/^\d+-\d+$/))return null;let t=e.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(t){if(this.strictMode)return null;let n=t[1],i=t[2];if(i.includes(".")&&!i.match(/\d(\.\d{2})+$/))return null;let s=parseInt(i),a=parseInt(n);if(s>24||a>24)return null}return e}getPrimaryTimePatternThroughCache(){let e=this.primaryPrefix(),t=this.primarySuffix();return this.cachedPrimaryPrefix===e&&this.cachedPrimarySuffix===t?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=ZE(this.primaryPatternLeftBoundary(),e,t,this.patternFlags()),this.cachedPrimaryPrefix=e,this.cachedPrimarySuffix=t,this.cachedPrimaryTimePattern)}getFollowingTimePatternThroughCache(){let e=this.followingPhase(),t=this.followingSuffix();return this.cachedFollowingPhase===e&&this.cachedFollowingSuffix===t?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=JE(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}};hu.AbstractTimeExpressionParser=td});var Ag=k(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});var gu=et(),eS=vi(),rd=class extends eS.AbstractTimeExpressionParser{constructor(e){super(e)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("night")){let i=n.get("hour");i>=6&&i<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",gu.Meridiem.PM)):i<6&&n.assign("meridiem",gu.Meridiem.AM)}if(t[0].endsWith("afternoon")){n.assign("meridiem",gu.Meridiem.PM);let i=n.get("hour");i>=0&&i<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("morning")&&(n.assign("meridiem",gu.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};nd.default=rd});var dr=k(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.addImpliedTimeUnits=os.reverseTimeUnits=void 0;function tS(r){let e={};for(let t in r)e[t]=-r[t];return e}os.reverseTimeUnits=tS;function rS(r,e){let t=r.clone(),n=r.dayjs();for(let i in e)n=n.add(e[i],i);return("day"in e||"d"in e||"week"in e||"month"in e||"year"in e)&&(t.imply("day",n.date()),t.imply("month",n.month()+1),t.imply("year",n.year())),("second"in e||"minute"in e||"hour"in e)&&(t.imply("second",n.second()),t.imply("minute",n.minute()),t.imply("hour",n.hour())),t}os.addImpliedTimeUnits=rS});var Pg=k(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});var sd=mt(),nS=We(),iS=H(),sS=dr(),aS=new RegExp(`(${sd.TIME_UNITS_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=(?:\\W|$))`,"i"),oS=new RegExp(`(${sd.TIME_UNITS_PATTERN})\\s{0,5}ago(?=(?:\\W|$))`,"i"),id=class extends iS.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?oS:aS}innerExtract(e,t){let n=sd.parseTimeUnits(t[1]),i=sS.reverseTimeUnits(n);return nS.ParsingComponents.createRelativeFromReference(e.reference,i)}};ad.default=id});var Ng=k(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});var ud=mt(),uS=We(),lS=H(),cS=new RegExp(`(${ud.TIME_UNITS_PATTERN})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),dS=new RegExp("("+ud.TIME_UNITS_PATTERN+")(later|from now)(?=(?:\\W|$))","i"),fS=1,od=class extends lS.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?dS:cS}innerExtract(e,t){let n=ud.parseTimeUnits(t[fS]);return uS.ParsingComponents.createRelativeFromReference(e.reference,n)}};ld.default=od});var ls=k(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.MergingRefiner=us.Filter=void 0;var cd=class{refine(e,t){return t.filter(n=>this.isValid(e,n))}};us.Filter=cd;var dd=class{refine(e,t){if(t.length<2)return t;let n=[],i=t[0],s=null;for(let a=1;a<t.length;a++){s=t[a];let o=e.text.substring(i.index+i.text.length,s.index);if(!this.shouldMergeResults(o,i,s,e))n.push(i),i=s;else{let u=i,l=s,c=this.mergeResults(o,u,l,e);e.debug(()=>{console.log(`${this.constructor.name} merged ${u} and ${l} into ${c}`)}),i=c}}return i!=null&&n.push(i),n}};us.MergingRefiner=dd});var zr=k(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});var pS=ls(),fd=class extends pS.MergingRefiner{shouldMergeResults(e,t,n){return!t.end&&!n.end&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){if(!t.start.isOnlyWeekdayComponent()&&!n.start.isOnlyWeekdayComponent()&&(n.start.getCertainComponents().forEach(s=>{t.start.isCertain(s)||t.start.assign(s,n.start.get(s))}),t.start.getCertainComponents().forEach(s=>{n.start.isCertain(s)||n.start.assign(s,t.start.get(s))})),t.start.date().getTime()>n.start.date().getTime()){let s=t.start.dayjs(),a=n.start.dayjs();t.start.isOnlyWeekdayComponent()&&s.add(-7,"days").isBefore(a)?(s=s.add(-7,"days"),t.start.imply("day",s.date()),t.start.imply("month",s.month()+1),t.start.imply("year",s.year())):n.start.isOnlyWeekdayComponent()&&a.add(7,"days").isAfter(s)?(a=a.add(7,"days"),n.start.imply("day",a.date()),n.start.imply("month",a.month()+1),n.start.imply("year",a.year())):[n,t]=[t,n]}let i=t.clone();return i.start=t.start,i.end=n.start,i.index=Math.min(t.index,n.index),t.index<n.index?i.text=t.text+e+n.text:i.text=n.text+e+t.text,i}};pd.default=fd});var Ig=k(Ta=>{"use strict";var mS=Ta&&Ta.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ta,"__esModule",{value:!0});var hS=mS(zr()),md=class extends hS.default{patternBetween(){return/^\s*(to|-)\s*$/i}};Ta.default=md});var Fg=k(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.mergeDateTimeComponent=cs.mergeDateTimeResult=void 0;var gS=et();function yS(r,e){let t=r.clone(),n=r.start,i=e.start;if(t.start=hd(n,i),r.end!=null||e.end!=null){let s=r.end==null?r.start:r.end,a=e.end==null?e.start:e.end,o=hd(s,a);r.end==null&&o.date().getTime()<t.start.date().getTime()&&(o.isCertain("day")?o.assign("day",o.get("day")+1):o.imply("day",o.get("day")+1)),t.end=o}return t}cs.mergeDateTimeResult=yS;function hd(r,e){let t=r.clone();return e.isCertain("hour")?(t.assign("hour",e.get("hour")),t.assign("minute",e.get("minute")),e.isCertain("second")?(t.assign("second",e.get("second")),e.isCertain("millisecond")?t.assign("millisecond",e.get("millisecond")):t.imply("millisecond",e.get("millisecond"))):(t.imply("second",e.get("second")),t.imply("millisecond",e.get("millisecond")))):(t.imply("hour",e.get("hour")),t.imply("minute",e.get("minute")),t.imply("second",e.get("second")),t.imply("millisecond",e.get("millisecond"))),e.isCertain("timezoneOffset")&&t.assign("timezoneOffset",e.get("timezoneOffset")),e.isCertain("meridiem")?t.assign("meridiem",e.get("meridiem")):e.get("meridiem")!=null&&t.get("meridiem")==null&&t.imply("meridiem",e.get("meridiem")),t.get("meridiem")==gS.Meridiem.PM&&t.get("hour")<12&&(e.isCertain("hour")?t.assign("hour",t.get("hour")+12):t.imply("hour",t.get("hour")+12)),t}cs.mergeDateTimeComponent=hd});var mn=k(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});var bS=ls(),Lg=Fg(),gd=class extends bS.MergingRefiner{shouldMergeResults(e,t,n){return(t.start.isOnlyDate()&&n.start.isOnlyTime()||n.start.isOnlyDate()&&t.start.isOnlyTime())&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){let i=t.start.isOnlyDate()?Lg.mergeDateTimeResult(t,n):Lg.mergeDateTimeResult(n,t);return i.index=t.index,i.text=t.text+e+n.text,i}};yd.default=gd});var Ug=k(_a=>{"use strict";var TS=_a&&_a.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_a,"__esModule",{value:!0});var _S=TS(mn()),bd=class extends _S.default{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$")}};_a.default=bd});var qg=k(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});var vS=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),wS={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:240,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360},Td=class{constructor(e){this.timezone=Object.assign(Object.assign({},wS),e)}refine(e,t){var n;let i=(n=e.option.timezones)!==null&&n!==void 0?n:{};return t.forEach(s=>{var a,o;let u=e.text.substring(s.index+s.text.length),l=vS.exec(u);if(!l)return;let c=l[1].toUpperCase(),d=(o=(a=i[c])!==null&&a!==void 0?a:this.timezone[c])!==null&&o!==void 0?o:null;if(d===null)return;e.debug(()=>{console.log(`Extracting timezone: '${c}' into: ${d} for: ${s.start}`)});let m=s.start.get("timezoneOffset");m!==null&&d!=m&&(s.start.isCertain("timezoneOffset")||c!=l[1])||s.start.isOnlyDate()&&c!=l[1]||(s.text+=l[0],s.start.isCertain("timezoneOffset")||s.start.assign("timezoneOffset",d),s.end!=null&&!s.end.isCertain("timezoneOffset")&&s.end.assign("timezoneOffset",d))}),t}};_d.default=Td});var yu=k(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});var kS=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),ES=1,SS=2,OS=3,vd=class{refine(e,t){return t.forEach(function(n){if(n.start.isCertain("timezoneOffset"))return;let i=e.text.substring(n.index+n.text.length),s=kS.exec(i);if(!s)return;e.debug(()=>{console.log(`Extracting timezone: '${s[0]}' into : ${n}`)});let a=parseInt(s[SS]),o=parseInt(s[OS]||"0"),u=a*60+o;u>14*60||(s[ES]==="-"&&(u=-u),n.end!=null&&n.end.assign("timezoneOffset",u),n.start.assign("timezoneOffset",u),n.text+=s[0])}),t}};wd.default=vd});var Wg=k(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});var kd=class{refine(e,t){if(t.length<2)return t;let n=[],i=t[0];for(let s=1;s<t.length;s++){let a=t[s];a.index<i.index+i.text.length?a.text.length>i.text.length&&(i=a):(n.push(i),i=a)}return i!=null&&n.push(i),n}};Ed.default=kd});var $g=k(va=>{"use strict";var DS=va&&va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(va,"__esModule",{value:!0});var xS=DS(_e()),Sd=class{refine(e,t){return e.option.forwardDate&&t.forEach(function(n){let i=xS.default(e.refDate);if(n.start.isOnlyDayMonthComponent()&&i.isAfter(n.start.dayjs()))for(let s=0;s<3&&i.isAfter(n.start.dayjs());s++)n.start.imply("year",n.start.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.start})`)}),n.end&&!n.end.isCertain("year")&&(n.end.imply("year",n.end.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.end})`)}));n.start.isOnlyWeekdayComponent()&&i.isAfter(n.start.dayjs())&&(i.day()>=n.start.get("weekday")?i=i.day(n.start.get("weekday")+7):i=i.day(n.start.get("weekday")),n.start.imply("day",i.date()),n.start.imply("month",i.month()+1),n.start.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.start})`)}),n.end&&n.end.isOnlyWeekdayComponent()&&(i.day()>n.end.get("weekday")?i=i.day(n.end.get("weekday")+7):i=i.day(n.end.get("weekday")),n.end.imply("day",i.date()),n.end.imply("month",i.month()+1),n.end.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.end})`)})))}),t}};va.default=Sd});var jg=k(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var RS=ls(),Od=class extends RS.Filter{constructor(e){super(),this.strictMode=e}isValid(e,t){return t.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(e.debug(()=>{console.log(`Removing unlikely result '${t.text}'`)}),!1):t.start.isValidDate()?t.end&&!t.end.isValidDate()?(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.end})`)}),!1):this.strictMode?this.isStrictModeValid(e,t):!0:(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.start})`)}),!1)}isStrictModeValid(e,t){return t.start.isOnlyWeekdayComponent()?(e.debug(()=>{console.log(`(Strict) Removing weekday only component: ${t} (${t.end})`)}),!1):t.start.isOnlyTime()&&(!t.start.isCertain("hour")||!t.start.isCertain("minute"))?(e.debug(()=>{console.log(`(Strict) Removing uncertain time component: ${t} (${t.end})`)}),!1):!0}};Dd.default=Od});var Md=k(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});var MS=H(),CS=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(?:Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),AS=1,PS=2,NS=3,Gg=4,IS=5,Yg=6,Bg=7,Hg=8,Vg=9,xd=class extends MS.AbstractParserWithWordBoundaryChecking{innerPattern(){return CS}innerExtract(e,t){let n={};if(n.year=parseInt(t[AS]),n.month=parseInt(t[PS]),n.day=parseInt(t[NS]),t[Gg]!=null)if(n.hour=parseInt(t[Gg]),n.minute=parseInt(t[IS]),t[Yg]!=null&&(n.second=parseInt(t[Yg])),t[Bg]!=null&&(n.millisecond=parseInt(t[Bg])),t[Hg]==null)n.timezoneOffset=0;else{let i=parseInt(t[Hg]),s=0;t[Vg]!=null&&(s=parseInt(t[Vg]));let a=i*60;a<0?a-=s:a+=s,n.timezoneOffset=a}return n}};Rd.default=xd});var zg=k(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});var FS=ls(),Cd=class extends FS.MergingRefiner{mergeResults(e,t,n){let i=n.clone();return i.index=t.index,i.text=t.text+e+i.text,i.start.assign("weekday",t.start.get("weekday")),i.end&&i.end.assign("weekday",t.start.get("weekday")),i}shouldMergeResults(e,t,n){return t.start.isOnlyWeekdayComponent()&&!t.start.isCertain("hour")&&n.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}};Ad.default=Cd});var hn=k(ds=>{"use strict";var wi=ds&&ds.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ds,"__esModule",{value:!0});ds.includeCommonConfiguration=void 0;var LS=wi(qg()),US=wi(yu()),Kg=wi(Wg()),qS=wi($g()),WS=wi(jg()),$S=wi(Md()),jS=wi(zg());function GS(r,e=!1){return r.parsers.unshift(new $S.default),r.refiners.unshift(new jS.default),r.refiners.unshift(new LS.default),r.refiners.unshift(new US.default),r.refiners.unshift(new Kg.default),r.refiners.push(new Kg.default),r.refiners.push(new qS.default),r.refiners.push(new WS.default(e)),r}ds.includeCommonConfiguration=GS});var yn=k(Oe=>{"use strict";var YS=Oe&&Oe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.noon=Oe.morning=Oe.midnight=Oe.yesterdayEvening=Oe.evening=Oe.lastNight=Oe.tonight=Oe.theDayAfter=Oe.tomorrow=Oe.theDayBefore=Oe.yesterday=Oe.today=Oe.now=void 0;var Kr=We(),fs=YS(_e()),gn=cr(),wa=et();function BS(r){let e=fs.default(r.instant),t=new Kr.ParsingComponents(r,{});return gn.assignSimilarDate(t,e),gn.assignSimilarTime(t,e),r.timezoneOffset!==null&&t.assign("timezoneOffset",e.utcOffset()),t}Oe.now=BS;function HS(r){let e=fs.default(r.instant),t=new Kr.ParsingComponents(r,{});return gn.assignSimilarDate(t,e),gn.implySimilarTime(t,e),t}Oe.today=HS;function VS(r){return Qg(r,1)}Oe.yesterday=VS;function Qg(r,e){return Pd(r,-e)}Oe.theDayBefore=Qg;function zS(r){return Pd(r,1)}Oe.tomorrow=zS;function Pd(r,e){let t=fs.default(r.instant),n=new Kr.ParsingComponents(r,{});return t=t.add(e,"day"),gn.assignSimilarDate(n,t),gn.implySimilarTime(n,t),n}Oe.theDayAfter=Pd;function KS(r,e=22){let t=fs.default(r.instant),n=new Kr.ParsingComponents(r,{});return n.imply("hour",e),n.imply("meridiem",wa.Meridiem.PM),gn.assignSimilarDate(n,t),n}Oe.tonight=KS;function QS(r,e=0){let t=fs.default(r.instant),n=new Kr.ParsingComponents(r,{});return t.hour()<6&&(t=t.add(-1,"day")),gn.assignSimilarDate(n,t),n.imply("hour",e),n}Oe.lastNight=QS;function XS(r,e=20){let t=new Kr.ParsingComponents(r,{});return t.imply("meridiem",wa.Meridiem.PM),t.imply("hour",e),t}Oe.evening=XS;function ZS(r,e=20){let t=fs.default(r.instant),n=new Kr.ParsingComponents(r,{});return t=t.add(-1,"day"),gn.assignSimilarDate(n,t),n.imply("hour",e),n.imply("meridiem",wa.Meridiem.PM),n}Oe.yesterdayEvening=ZS;function JS(r){let e=new Kr.ParsingComponents(r,{});return e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e}Oe.midnight=JS;function eO(r,e=6){let t=new Kr.ParsingComponents(r,{});return t.imply("meridiem",wa.Meridiem.AM),t.imply("hour",e),t}Oe.morning=eO;function tO(r){let e=new Kr.ParsingComponents(r,{});return e.imply("meridiem",wa.Meridiem.AM),e.imply("hour",12),e}Oe.noon=tO});var Xg=k(Or=>{"use strict";var rO=Or&&Or.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),nO=Or&&Or.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),iO=Or&&Or.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&rO(e,r,t);return nO(e,r),e},sO=Or&&Or.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Or,"__esModule",{value:!0});var aO=sO(_e()),oO=H(),uO=cr(),ka=iO(yn()),lO=/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,Nd=class extends oO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return lO}innerExtract(e,t){let n=aO.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();switch(i){case"now":return ka.now(e.reference);case"today":return ka.today(e.reference);case"yesterday":return ka.yesterday(e.reference);case"tomorrow":case"tmr":case"tmrw":return ka.tomorrow(e.reference);case"tonight":return ka.tonight(e.reference);default:i.match(/last\s*night/)&&(n.hour()>6&&(n=n.add(-1,"day")),uO.assignSimilarDate(s,n),s.imply("hour",0));break}return s}};Or.default=Nd});var Zg=k(Ea=>{"use strict";var cO=Ea&&Ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ea,"__esModule",{value:!0});var bu=et(),dO=H(),fO=cO(_e()),pO=cr(),mO=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i,Id=class extends dO.AbstractParserWithWordBoundaryChecking{innerPattern(){return mO}innerExtract(e,t){let n=fO.default(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"afternoon":i.imply("meridiem",bu.Meridiem.PM),i.imply("hour",15);break;case"evening":case"night":i.imply("meridiem",bu.Meridiem.PM),i.imply("hour",20);break;case"midnight":pO.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"morning":i.imply("meridiem",bu.Meridiem.AM),i.imply("hour",6);break;case"noon":i.imply("meridiem",bu.Meridiem.AM),i.imply("hour",12);break}return i}};Ea.default=Id});var ki=k(zn=>{"use strict";var hO=zn&&zn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(zn,"__esModule",{value:!0});zn.toDayJSClosestWeekday=zn.toDayJSWeekday=void 0;var Jg=hO(_e());function gO(r,e,t){if(!t)return ey(r,e);let n=Jg.default(r);switch(t){case"this":n=n.day(e);break;case"next":n=n.day(e+7);break;case"last":n=n.day(e-7);break}return n}zn.toDayJSWeekday=gO;function ey(r,e){let t=Jg.default(r),n=t.day();return Math.abs(e-7-n)<Math.abs(e-n)?t=t.day(e-7):Math.abs(e+7-n)<Math.abs(e-n)?t=t.day(e+7):t=t.day(e),t}zn.toDayJSClosestWeekday=ey});var ry=k(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});var ty=mt(),yO=xe(),bO=H(),TO=ki(),_O=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${yO.matchAnyPattern(ty.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),vO=1,wO=2,kO=3,Fd=class extends bO.AbstractParserWithWordBoundaryChecking{innerPattern(){return _O}innerExtract(e,t){let n=t[wO].toLowerCase(),i=ty.WEEKDAY_DICTIONARY[n],s=t[vO],a=t[kO],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="last"||o=="past"?u="last":o=="next"?u="next":o=="this"&&(u="this");let l=TO.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Ld.default=Fd});var sy=k(Sa=>{"use strict";var EO=Sa&&Sa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sa,"__esModule",{value:!0});var iy=mt(),ny=We(),SO=EO(_e()),OO=H(),DO=xe(),xO=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${DO.matchAnyPattern(iy.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),RO=1,MO=2,Ud=class extends OO.AbstractParserWithWordBoundaryChecking{innerPattern(){return xO}innerExtract(e,t){let n=t[RO].toLowerCase(),i=t[MO].toLowerCase(),s=iy.TIME_UNIT_DICTIONARY[i];if(n=="next"||n.startsWith("after")){let u={};return u[s]=1,ny.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="last"||n=="past"){let u={};return u[s]=-1,ny.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=SO.default(e.reference.instant);return i.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):i.match(/month/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):i.match(/year/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};Sa.default=Ud});var Dr=k(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.ParsingContext=hs.Chrono=void 0;var ps=We(),CO=qd(),ms=class{constructor(e){e=e||CO.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new ms({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,t,n){let i=this.parse(e,t,n);return i.length>0?i[0].start.date():null}parse(e,t,n){let i=new Tu(e,t,n),s=[];return this.parsers.forEach(a=>{let o=ms.executeParser(i,a);s=s.concat(o)}),s.sort((a,o)=>a.index-o.index),this.refiners.forEach(function(a){s=a.refine(i,s)}),s}static executeParser(e,t){let n=[],i=t.pattern(e),s=e.text,a=e.text,o=i.exec(a);for(;o;){let u=o.index+s.length-a.length;o.index=u;let l=t.extract(e,o);if(!l){a=s.substring(o.index+1),o=i.exec(a);continue}let c=null;l instanceof ps.ParsingResult?c=l:l instanceof ps.ParsingComponents?(c=e.createParsingResult(o.index,o[0]),c.start=l):c=e.createParsingResult(o.index,o[0],l),e.debug(()=>console.log(`${t.constructor.name} extracted result ${c}`)),n.push(c),a=s.substring(u+c.text.length),o=i.exec(a)}return n}};hs.Chrono=ms;var Tu=class{constructor(e,t,n){this.text=e,this.reference=new ps.ReferenceWithTimezone(t),this.option=n!=null?n:{},this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof ps.ParsingComponents?e:new ps.ParsingComponents(this.reference,e)}createParsingResult(e,t,n,i){let s=typeof t=="string"?t:this.text.substring(e,t),a=n?this.createParsingComponents(n):null,o=i?this.createParsingComponents(i):null;return new ps.ParsingResult(this.reference,e,s,a,o)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}};hs.ParsingContext=Tu});var Ei=k(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});var ay=pt(),AO=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),_u=1,oy=5,uy=2,ly=3,Wd=4,$d=class{constructor(e){this.groupNumberMonth=e?ly:uy,this.groupNumberDay=e?uy:ly}pattern(){return AO}extract(e,t){if(t[_u]=="/"||t[oy]=="/"){t.index+=t[0].length;return}let n=t.index+t[_u].length,i=t[0].substr(t[_u].length,t[0].length-t[_u].length-t[oy].length);if(i.match(/^\d\.\d$/)||i.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!t[Wd]&&t[0].indexOf("/")<0)return;let s=e.createParsingResult(n,i),a=parseInt(t[this.groupNumberMonth]),o=parseInt(t[this.groupNumberDay]);if((a<1||a>12)&&a>12)if(o>=1&&o<=12&&a<=31)[o,a]=[a,o];else return null;if(o<1||o>31)return null;if(s.start.assign("day",o),s.start.assign("month",a),t[Wd]){let u=parseInt(t[Wd]),l=ay.findMostLikelyADYear(u);s.start.assign("year",l)}else{let u=ay.findYearClosestToRef(e.refDate,o,a);s.start.imply("year",u)}return s}};jd.default=$d});var dy=k(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});var cy=mt(),PO=We(),NO=H(),IO=dr(),FO=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${cy.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Gd=class extends NO.AbstractParserWithWordBoundaryChecking{innerPattern(){return FO}innerExtract(e,t){let n=t[1].toLowerCase(),i=cy.parseTimeUnits(t[2]);switch(n){case"last":case"past":case"-":i=IO.reverseTimeUnits(i);break}return PO.ParsingComponents.createRelativeFromReference(e.reference,i)}};Yd.default=Gd});var py=k(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});var LO=ls(),Bd=We(),UO=mt(),qO=dr();function fy(r){return r.text.match(/\s+(before|from)$/i)!=null}function WO(r){return r.text.match(/\s+(after|since)$/i)!=null}var Hd=class extends LO.MergingRefiner{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,n){return!e.match(this.patternBetween())||!fy(t)&&!WO(t)?!1:!!n.start.get("day")&&!!n.start.get("month")&&!!n.start.get("year")}mergeResults(e,t,n){let i=UO.parseTimeUnits(t.text);fy(t)&&(i=qO.reverseTimeUnits(i));let s=Bd.ParsingComponents.createRelativeFromReference(new Bd.ReferenceWithTimezone(n.start.date()),i);return new Bd.ParsingResult(n.reference,t.index,`${t.text}${e}${n.text}`,s)}};Vd.default=Hd});var qd=k(He=>{"use strict";var it=He&&He.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(He,"__esModule",{value:!0});He.createConfiguration=He.createCasualConfiguration=He.parseDate=He.parse=He.GB=He.strict=He.casual=void 0;var $O=it(fg()),jO=it(bg()),GO=it(kg()),YO=it(Og()),BO=it(Rg()),HO=it(Mg()),VO=it(Ag()),zO=it(Pg()),KO=it(Ng()),QO=it(Ig()),XO=it(Ug()),ZO=hn(),JO=it(Xg()),e1=it(Zg()),t1=it(ry()),r1=it(sy()),zd=Dr(),n1=it(Ei()),i1=it(dy()),s1=it(py());He.casual=new zd.Chrono(my(!1));He.strict=new zd.Chrono(vu(!0,!1));He.GB=new zd.Chrono(vu(!1,!0));function a1(r,e,t){return He.casual.parse(r,e,t)}He.parse=a1;function o1(r,e,t){return He.casual.parseDate(r,e,t)}He.parseDate=o1;function my(r=!1){let e=vu(!1,r);return e.parsers.unshift(new JO.default),e.parsers.unshift(new e1.default),e.parsers.unshift(new YO.default),e.parsers.unshift(new r1.default),e.parsers.unshift(new i1.default),e}He.createCasualConfiguration=my;function vu(r=!0,e=!1){return ZO.includeCommonConfiguration({parsers:[new n1.default(e),new $O.default,new jO.default,new GO.default,new t1.default,new BO.default,new HO.default,new VO.default(r),new zO.default(r),new KO.default(r)],refiners:[new s1.default,new XO.default,new QO.default]},r)}He.createConfiguration=vu});var hy=k(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});var u1=vi(),Kd=class extends u1.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:um|von)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|bis)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};Qd.default=Kd});var Oa=k(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.parseTimeUnits=Me.TIME_UNITS_PATTERN=Me.parseYear=Me.YEAR_PATTERN=Me.parseNumberPattern=Me.NUMBER_PATTERN=Me.TIME_UNIT_DICTIONARY=Me.INTEGER_WORD_DICTIONARY=Me.MONTH_DICTIONARY=Me.WEEKDAY_DICTIONARY=void 0;var Xd=xe(),l1=pt();Me.WEEKDAY_DICTIONARY={sonntag:0,so:0,montag:1,mo:1,dienstag:2,di:2,mittwoch:3,mi:3,donnerstag:4,do:4,freitag:5,fr:5,samstag:6,sa:6};Me.MONTH_DICTIONARY={januar:1,j\u00E4nner:1,janner:1,jan:1,"jan.":1,februar:2,feber:2,feb:2,"feb.":2,m\u00E4rz:3,maerz:3,m\u00E4r:3,"m\xE4r.":3,mrz:3,"mrz.":3,april:4,apr:4,"apr.":4,mai:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,august:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,dezember:12,dez:12,"dez.":12};Me.INTEGER_WORD_DICTIONARY={eins:1,eine:1,einem:1,einen:1,einer:1,zwei:2,drei:3,vier:4,f\u00FCnf:5,fuenf:5,sechs:6,sieben:7,acht:8,neun:9,zehn:10,elf:11,zw\u00F6lf:12,zwoelf:12};Me.TIME_UNIT_DICTIONARY={sek:"second",sekunde:"second",sekunden:"second",min:"minute",minute:"minute",minuten:"minute",h:"hour",std:"hour",stunde:"hour",stunden:"hour",tag:"d",tage:"d",tagen:"d",woche:"week",wochen:"week",monat:"month",monate:"month",monaten:"month",monats:"month",quartal:"quarter",quartals:"quarter",quartale:"quarter",quartalen:"quarter",a:"year",j:"year",jr:"year",jahr:"year",jahre:"year",jahren:"year",jahres:"year"};Me.NUMBER_PATTERN=`(?:${Xd.matchAnyPattern(Me.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s*an?)?|an?\\b(?:\\s*few)?|few|several|a?\\s*couple\\s*(?:of)?)`;function yy(r){let e=r.toLowerCase();return Me.INTEGER_WORD_DICTIONARY[e]!==void 0?Me.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}Me.parseNumberPattern=yy;Me.YEAR_PATTERN="(?:[0-9]{1,4}(?:\\s*[vn]\\.?\\s*(?:C(?:hr)?|(?:u\\.?|d\\.?(?:\\s*g\\.?)?)?\\s*Z)\\.?|\\s*(?:u\\.?|d\\.?(?:\\s*g\\.)?)\\s*Z\\.?)?)";function c1(r){if(/v/i.test(r))return-parseInt(r.replace(/[^0-9]+/gi,""));if(/n/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));if(/z/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));let e=parseInt(r);return l1.findMostLikelyADYear(e)}Me.parseYear=c1;var by=`(${Me.NUMBER_PATTERN})\\s{0,5}(${Xd.matchAnyPattern(Me.TIME_UNIT_DICTIONARY)})\\s{0,5}`,gy=new RegExp(by,"i");Me.TIME_UNITS_PATTERN=Xd.repeatedTimeunitPattern("",by);function d1(r){let e={},t=r,n=gy.exec(t);for(;n;)f1(e,n),t=t.substring(n[0].length),n=gy.exec(t);return e}Me.parseTimeUnits=d1;function f1(r,e){let t=yy(e[1]),n=Me.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var _y=k(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});var Ty=Oa(),p1=xe(),m1=H(),h1=ki(),g1=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:a[mn]\\s*?)?(?:(diese[mn]|letzte[mn]|n(?:\xE4|ae)chste[mn])\\s*)?(${p1.matchAnyPattern(Ty.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(diese|letzte|n(?:\xE4|ae)chste)\\s*woche)?(?=\\W|$)`,"i"),y1=1,b1=3,T1=2,Zd=class extends m1.AbstractParserWithWordBoundaryChecking{innerPattern(){return g1}innerExtract(e,t){let n=t[T1].toLowerCase(),i=Ty.WEEKDAY_DICTIONARY[n],s=t[y1],a=t[b1],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o.match(/letzte/)?u="last":o.match(/chste/)?u="next":o.match(/diese/)&&(u="this");let l=h1.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Jd.default=Zd});var Ey=k(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});var Kn=et(),_1=new RegExp("(^|\\s|T)(?:(?:um|von)\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),v1=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|bis(?:\\s+um)?|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),w1=2,vy=3,wy=4,ky=5,gs=class{pattern(e){return _1}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=gs.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let i=e.text.substring(t.index+t[0].length),s=v1.exec(i);return s&&(n.end=gs.extractTimeComponent(n.start.clone(),s),n.end&&(n.text+=s[0])),n}static extractTimeComponent(e,t){let n=0,i=0,s=null;if(n=parseInt(t[w1]),t[vy]!=null&&(i=parseInt(t[vy])),i>=60||n>24)return null;if(n>=12&&(s=Kn.Meridiem.PM),t[ky]!=null){if(n>12)return null;let a=t[ky].toLowerCase();a.match(/morgen|vormittag/)&&(s=Kn.Meridiem.AM,n==12&&(n=0)),a.match(/nachmittag|abend/)&&(s=Kn.Meridiem.PM,n!=12&&(n+=12)),a.match(/nacht/)&&(n==12?(s=Kn.Meridiem.AM,n=0):n<6?s=Kn.Meridiem.AM:(s=Kn.Meridiem.PM,n+=12))}if(e.assign("hour",n),e.assign("minute",i),s!==null?e.assign("meridiem",s):n<12?e.imply("meridiem",Kn.Meridiem.AM):e.imply("meridiem",Kn.Meridiem.PM),t[wy]!=null){let a=parseInt(t[wy]);if(a>=60)return null;e.assign("second",a)}return e}};ef.default=gs});var Sy=k(Da=>{"use strict";var k1=Da&&Da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Da,"__esModule",{value:!0});var E1=k1(zr()),tf=class extends E1.default{patternBetween(){return/^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i}};Da.default=tf});var Oy=k(xa=>{"use strict";var S1=xa&&xa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xa,"__esModule",{value:!0});var O1=S1(mn()),rf=class extends O1.default{patternBetween(){return new RegExp("^\\s*(T|um|am|,|-)?\\s*$")}};xa.default=rf});var nf=k(Ma=>{"use strict";var D1=Ma&&Ma.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ma,"__esModule",{value:!0});var x1=D1(_e()),Si=et(),R1=H(),M1=cr(),C1=dr(),Ra=class extends R1.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i}innerExtract(e,t){let n=x1.default(e.refDate),i=t[2].toLowerCase(),s=e.createParsingComponents();return M1.implySimilarTime(s,n),Ra.extractTimeComponents(s,i)}static extractTimeComponents(e,t){switch(t){case"morgen":e.imply("hour",6),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Si.Meridiem.AM);break;case"vormittag":e.imply("hour",9),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Si.Meridiem.AM);break;case"mittag":case"mittags":e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Si.Meridiem.AM);break;case"nachmittag":e.imply("hour",15),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Si.Meridiem.PM);break;case"abend":e.imply("hour",18),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Si.Meridiem.PM);break;case"nacht":e.imply("hour",22),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Si.Meridiem.PM);break;case"mitternacht":e.get("hour")>1&&(e=C1.addImpliedTimeUnits(e,{day:1})),e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Si.Meridiem.AM);break}return e}};Ma.default=Ra});var Ry=k(xr=>{"use strict";var A1=xr&&xr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),P1=xr&&xr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),N1=xr&&xr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&A1(e,r,t);return P1(e,r),e},xy=xr&&xr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xr,"__esModule",{value:!0});var I1=xy(_e()),F1=H(),Oi=cr(),L1=xy(nf()),Dy=N1(yn()),U1=new RegExp("(jetzt|heute|morgen|\xFCbermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?(?=\\W|$)","i"),q1=1,W1=2,sf=class extends F1.AbstractParserWithWordBoundaryChecking{innerPattern(e){return U1}innerExtract(e,t){let n=I1.default(e.refDate),i=(t[q1]||"").toLowerCase(),s=(t[W1]||"").toLowerCase(),a=e.createParsingComponents();switch(i){case"jetzt":a=Dy.now(e.reference);break;case"heute":a=Dy.today(e.reference);break;case"morgen":Oi.assignTheNextDay(a,n);break;case"\xFCbermorgen":case"uebermorgen":n=n.add(1,"day"),Oi.assignTheNextDay(a,n);break;case"gestern":n=n.add(-1,"day"),Oi.assignSimilarDate(a,n),Oi.implySimilarTime(a,n);break;case"vorgestern":n=n.add(-2,"day"),Oi.assignSimilarDate(a,n),Oi.implySimilarTime(a,n);break;default:i.match(/letzte\s*nacht/)&&(n.hour()>6&&(n=n.add(-1,"day")),Oi.assignSimilarDate(a,n),a.imply("hour",0));break}return s&&(a=L1.default.extractTimeComponents(a,s)),a}};xr.default=sf});var Iy=k(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});var $1=pt(),Py=Oa(),Ny=Oa(),j1=xe(),G1=H(),Y1=new RegExp(`(?:am\\s*?)?(?:den\\s*?)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\\u2013|\\s)\\s*([0-9]{1,2})\\.?)?\\s*(${j1.matchAnyPattern(Py.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${Ny.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),My=1,Cy=2,B1=3,Ay=4,af=class extends G1.AbstractParserWithWordBoundaryChecking{innerPattern(){return Y1}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Py.MONTH_DICTIONARY[t[B1].toLowerCase()],s=parseInt(t[My]);if(s>31)return t.index=t.index+t[My].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[Ay]){let a=Ny.parseYear(t[Ay]);n.start.assign("year",a)}else{let a=$1.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[Cy]){let a=parseInt(t[Cy]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};of.default=af});var Fy=k(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});var wu=Oa(),H1=We(),V1=H(),z1=dr(),K1=xe(),uf=class extends V1.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:\\s*((?:n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?|vor|in)\\s*)?(${wu.NUMBER_PATTERN})?(?:\\s*(n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?\\s*(${K1.matchAnyPattern(wu.TIME_UNIT_DICTIONARY)})`,"i")}innerExtract(e,t){let n=t[2]?wu.parseNumberPattern(t[2]):1,i=wu.TIME_UNIT_DICTIONARY[t[4].toLowerCase()],s={};s[i]=n;let a=t[1]||t[3]||"";if(a=a.toLowerCase(),!!a)return(/vor/.test(a)||/letzte/.test(a)||/vergangen/.test(a))&&(s=z1.reverseTimeUnits(s)),H1.ParsingComponents.createRelativeFromReference(e.reference,s)}};lf.default=uf});var qy=k(st=>{"use strict";var Rr=st&&st.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(st,"__esModule",{value:!0});st.createConfiguration=st.createCasualConfiguration=st.parseDate=st.parse=st.strict=st.casual=void 0;var Q1=hn(),Ly=Dr(),X1=Rr(Ei()),Z1=Rr(Md()),J1=Rr(hy()),e0=Rr(_y()),t0=Rr(Ey()),r0=Rr(Sy()),n0=Rr(Oy()),i0=Rr(Ry()),s0=Rr(nf()),a0=Rr(Iy()),o0=Rr(Fy());st.casual=new Ly.Chrono(Uy());st.strict=new Ly.Chrono(cf(!0));function u0(r,e,t){return st.casual.parse(r,e,t)}st.parse=u0;function l0(r,e,t){return st.casual.parseDate(r,e,t)}st.parseDate=l0;function Uy(r=!0){let e=cf(!1,r);return e.parsers.unshift(new s0.default),e.parsers.unshift(new i0.default),e.parsers.unshift(new o0.default),e}st.createCasualConfiguration=Uy;function cf(r=!0,e=!0){return Q1.includeCommonConfiguration({parsers:[new Z1.default,new X1.default(e),new J1.default,new t0.default,new a0.default,new e0.default],refiners:[new r0.default,new n0.default]},r)}st.createConfiguration=cf});var $y=k(Mr=>{"use strict";var c0=Mr&&Mr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),d0=Mr&&Mr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),f0=Mr&&Mr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&c0(e,r,t);return d0(e,r),e},p0=Mr&&Mr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Mr,"__esModule",{value:!0});var m0=p0(_e()),h0=et(),g0=H(),Wy=cr(),ku=f0(yn()),df=class extends g0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i}innerExtract(e,t){let n=m0.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();switch(i){case"maintenant":return ku.now(e.reference);case"aujourd'hui":return ku.today(e.reference);case"hier":return ku.yesterday(e.reference);case"demain":return ku.tomorrow(e.reference);default:i.match(/cette\s*nuit/)?(Wy.assignSimilarDate(s,n),s.imply("hour",22),s.imply("meridiem",h0.Meridiem.PM)):i.match(/la\s*veille/)&&(n=n.add(-1,"day"),Wy.assignSimilarDate(s,n),s.imply("hour",0))}return s}};Mr.default=df});var jy=k(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});var Ca=et(),y0=H(),ff=class extends y0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(cet?)?\s*(matin|soir|après-midi|aprem|a midi|à minuit)(?=\W|$)/i}innerExtract(e,t){let n=t[2].toLowerCase(),i=e.createParsingComponents();switch(n){case"apr\xE8s-midi":case"aprem":i.imply("hour",14),i.imply("minute",0),i.imply("meridiem",Ca.Meridiem.PM);break;case"soir":i.imply("hour",18),i.imply("minute",0),i.imply("meridiem",Ca.Meridiem.PM);break;case"matin":i.imply("hour",8),i.imply("minute",0),i.imply("meridiem",Ca.Meridiem.AM);break;case"a midi":i.imply("hour",12),i.imply("minute",0),i.imply("meridiem",Ca.Meridiem.AM);break;case"\xE0 minuit":i.imply("hour",0),i.imply("meridiem",Ca.Meridiem.AM);break}return i}};pf.default=ff});var Gy=k(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});var b0=vi(),mf=class extends b0.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:[\xE0a])\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};hf.default=mf});var Yy=k(Aa=>{"use strict";var T0=Aa&&Aa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Aa,"__esModule",{value:!0});var _0=T0(mn()),gf=class extends _0.default{patternBetween(){return new RegExp("^\\s*(T|\xE0|a|vers|de|,|-)?\\s*$")}};Aa.default=gf});var By=k(Pa=>{"use strict";var v0=Pa&&Pa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pa,"__esModule",{value:!0});var w0=v0(zr()),yf=class extends w0.default{patternBetween(){return/^\s*(à|a|-)\s*$/i}};Pa.default=yf});var Qn=k(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.parseTimeUnits=ve.TIME_UNITS_PATTERN=ve.parseYear=ve.YEAR_PATTERN=ve.parseOrdinalNumberPattern=ve.ORDINAL_NUMBER_PATTERN=ve.parseNumberPattern=ve.NUMBER_PATTERN=ve.TIME_UNIT_DICTIONARY=ve.INTEGER_WORD_DICTIONARY=ve.MONTH_DICTIONARY=ve.WEEKDAY_DICTIONARY=void 0;var bf=xe();ve.WEEKDAY_DICTIONARY={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6};ve.MONTH_DICTIONARY={janvier:1,jan:1,"jan.":1,f\u00E9vrier:2,f\u00E9v:2,"f\xE9v.":2,fevrier:2,fev:2,"fev.":2,mars:3,mar:3,"mar.":3,avril:4,avr:4,"avr.":4,mai:5,juin:6,jun:6,juillet:7,juil:7,jul:7,"jul.":7,ao\u00FBt:8,aout:8,septembre:9,sep:9,"sep.":9,sept:9,"sept.":9,octobre:10,oct:10,"oct.":10,novembre:11,nov:11,"nov.":11,d\u00E9cembre:12,decembre:12,dec:12,"dec.":12};ve.INTEGER_WORD_DICTIONARY={un:1,deux:2,trois:3,quatre:4,cinq:5,six:6,sept:7,huit:8,neuf:9,dix:10,onze:11,douze:12,treize:13};ve.TIME_UNIT_DICTIONARY={sec:"second",seconde:"second",secondes:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",heure:"hour",heures:"hour",jour:"d",jours:"d",semaine:"week",semaines:"week",mois:"month",trimestre:"quarter",trimestres:"quarter",ans:"year",ann\u00E9e:"year",ann\u00E9es:"year"};ve.NUMBER_PATTERN=`(?:${bf.matchAnyPattern(ve.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`;function Vy(r){let e=r.toLowerCase();return ve.INTEGER_WORD_DICTIONARY[e]!==void 0?ve.INTEGER_WORD_DICTIONARY[e]:e==="une"||e==="un"?1:e.match(/quelques?/)?3:e.match(/demi-?/)?.5:parseFloat(e)}ve.parseNumberPattern=Vy;ve.ORDINAL_NUMBER_PATTERN="(?:[0-9]{1,2}(?:er)?)";function k0(r){let e=r.toLowerCase();return e=e.replace(/(?:er)$/i,""),parseInt(e)}ve.parseOrdinalNumberPattern=k0;ve.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:AC|AD|p\\.\\s*C(?:hr?)?\\.\\s*n\\.)|[1-2][0-9]{3}|[5-9][0-9])";function E0(r){if(/AC/i.test(r))return r=r.replace(/BC/i,""),-parseInt(r);if(/AD/i.test(r)||/C/i.test(r))return r=r.replace(/[^\d]+/i,""),parseInt(r);let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}ve.parseYear=E0;var zy=`(${ve.NUMBER_PATTERN})\\s{0,5}(${bf.matchAnyPattern(ve.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Hy=new RegExp(zy,"i");ve.TIME_UNITS_PATTERN=bf.repeatedTimeunitPattern("",zy);function S0(r){let e={},t=r,n=Hy.exec(t);for(;n;)O0(e,n),t=t.substring(n[0].length),n=Hy.exec(t);return e}ve.parseTimeUnits=S0;function O0(r,e){let t=Vy(e[1]),n=ve.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Qy=k(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});var Ky=Qn(),D0=xe(),x0=H(),R0=ki(),M0=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(?:ce)\\s*)?(${D0.matchAnyPattern(Ky.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(dernier|prochain)\\s*)?(?=\\W|\\d|$)`,"i"),C0=1,A0=2,Tf=class extends x0.AbstractParserWithWordBoundaryChecking{innerPattern(){return M0}innerExtract(e,t){let n=t[C0].toLowerCase(),i=Ky.WEEKDAY_DICTIONARY[n];if(i===void 0)return null;let s=t[A0];s=s||"",s=s.toLowerCase();let a=null;s=="dernier"?a="last":s=="prochain"&&(a="next");let o=R0.toDayJSWeekday(e.refDate,i,a);return e.createParsingComponents().assign("weekday",i).imply("day",o.date()).imply("month",o.month()+1).imply("year",o.year())}};_f.default=Tf});var eb=k(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});var Na=et(),P0=new RegExp("(^|\\s|T)(?:(?:[\xE0a])\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),N0=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),I0=2,Xy=3,Zy=4,Jy=5,ys=class{pattern(e){return P0}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=ys.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let i=e.text.substring(t.index+t[0].length),s=N0.exec(i);return s&&(n.end=ys.extractTimeComponent(n.start.clone(),s),n.end&&(n.text+=s[0])),n}static extractTimeComponent(e,t){let n=0,i=0,s=null;if(n=parseInt(t[I0]),t[Xy]!=null&&(i=parseInt(t[Xy])),i>=60||n>24)return null;if(n>=12&&(s=Na.Meridiem.PM),t[Jy]!=null){if(n>12)return null;let a=t[Jy][0].toLowerCase();a=="a"&&(s=Na.Meridiem.AM,n==12&&(n=0)),a=="p"&&(s=Na.Meridiem.PM,n!=12&&(n+=12))}if(e.assign("hour",n),e.assign("minute",i),s!==null?e.assign("meridiem",s):n<12?e.imply("meridiem",Na.Meridiem.AM):e.imply("meridiem",Na.Meridiem.PM),t[Zy]!=null){let a=parseInt(t[Zy]);if(a>=60)return null;e.assign("second",a)}return e}};vf.default=ys});var ab=k(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});var F0=pt(),ib=Qn(),sb=Qn(),Eu=Qn(),L0=xe(),U0=H(),q0=new RegExp(`(?:on\\s*?)?(${Eu.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:au|\\-|\\\u2013|jusqu'au?|\\s)\\s*(${Eu.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:de)?\\s*)(${L0.matchAnyPattern(ib.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${sb.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),tb=1,rb=2,W0=3,nb=4,wf=class extends U0.AbstractParserWithWordBoundaryChecking{innerPattern(){return q0}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=ib.MONTH_DICTIONARY[t[W0].toLowerCase()],s=Eu.parseOrdinalNumberPattern(t[tb]);if(s>31)return t.index=t.index+t[tb].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[nb]){let a=sb.parseYear(t[nb]);n.start.assign("year",a)}else{let a=F0.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[rb]){let a=Eu.parseOrdinalNumberPattern(t[rb]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};kf.default=wf});var ub=k(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});var ob=Qn(),$0=We(),j0=H(),G0=dr(),Ef=class extends j0.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`il y a\\s*(${ob.TIME_UNITS_PATTERN})(?=(?:\\W|$))`,"i")}innerExtract(e,t){let n=ob.parseTimeUnits(t[1]),i=G0.reverseTimeUnits(n);return $0.ParsingComponents.createRelativeFromReference(e.reference,i)}};Sf.default=Ef});var cb=k(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});var lb=Qn(),Y0=We(),B0=H(),Of=class extends B0.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${lb.TIME_UNITS_PATTERN})(?=\\W|$)`,"i")}innerExtract(e,t){let n=lb.parseTimeUnits(t[1]);return Y0.ParsingComponents.createRelativeFromReference(e.reference,n)}};Df.default=Of});var db=k(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});var Su=Qn(),H0=We(),V0=H(),z0=dr(),K0=xe(),xf=class extends V0.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:les?|la|l'|du|des?)\\s*(${Su.NUMBER_PATTERN})?(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?\\s*(${K0.matchAnyPattern(Su.TIME_UNIT_DICTIONARY)})(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?`,"i")}innerExtract(e,t){let n=t[1]?Su.parseNumberPattern(t[1]):1,i=Su.TIME_UNIT_DICTIONARY[t[3].toLowerCase()],s={};s[i]=n;let a=t[2]||t[4]||"";if(a=a.toLowerCase(),!!a)return(/derni[eè]re?s?/.test(a)||/pass[ée]e?s?/.test(a)||/pr[ée]c[ée]dents?/.test(a))&&(s=z0.reverseTimeUnits(s)),H0.ParsingComponents.createRelativeFromReference(e.reference,s)}};Rf.default=xf});var mb=k(at=>{"use strict";var fr=at&&at.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(at,"__esModule",{value:!0});at.createConfiguration=at.createCasualConfiguration=at.parseDate=at.parse=at.strict=at.casual=void 0;var Q0=hn(),fb=Dr(),X0=fr($y()),Z0=fr(jy()),J0=fr(Ei()),eD=fr(Gy()),tD=fr(Yy()),rD=fr(By()),nD=fr(Qy()),iD=fr(eb()),sD=fr(ab()),aD=fr(ub()),oD=fr(cb()),uD=fr(db());at.casual=new fb.Chrono(pb());at.strict=new fb.Chrono(Mf(!0));function lD(r,e,t){return at.casual.parse(r,e,t)}at.parse=lD;function cD(r,e,t){return at.casual.parseDate(r,e,t)}at.parseDate=cD;function pb(r=!0){let e=Mf(!1,r);return e.parsers.unshift(new X0.default),e.parsers.unshift(new Z0.default),e.parsers.unshift(new uD.default),e}at.createCasualConfiguration=pb;function Mf(r=!0,e=!0){return Q0.includeCommonConfiguration({parsers:[new J0.default(e),new sD.default,new eD.default,new iD.default,new aD.default,new oD.default,new nD.default],refiners:[new tD.default,new rD.default]},r)}at.createConfiguration=Mf});var hb=k(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.toHankaku=void 0;function dD(r){return String(r).replace(/\u2019/g,"'").replace(/\u201D/g,'"').replace(/\u3000/g," ").replace(/\uFFE5/g,"\xA5").replace(/[\uFF01\uFF03-\uFF06\uFF08\uFF09\uFF0C-\uFF19\uFF1C-\uFF1F\uFF21-\uFF3B\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5E]/g,fD)}Ou.toHankaku=dD;function fD(r){return String.fromCharCode(r.charCodeAt(0)-65248)}});var yb=k(Ia=>{"use strict";var pD=Ia&&Ia.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ia,"__esModule",{value:!0});var Cf=hb(),mD=pt(),hD=pD(_e()),gD=/(?:(?:([同今本])|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i,gb=1,yD=2,Af=3,bD=4,TD=5,_D=6,Pf=class{pattern(){return gD}extract(e,t){let n=parseInt(Cf.toHankaku(t[TD])),i=parseInt(Cf.toHankaku(t[_D])),s=e.createParsingComponents({day:i,month:n});if(t[gb]&&t[gb].match("\u540C|\u4ECA|\u672C")){let a=hD.default(e.refDate);s.assign("year",a.year())}if(t[yD]){let a=t[bD],o=a=="\u5143"?1:parseInt(Cf.toHankaku(a));t[Af]=="\u4EE4\u548C"?o+=2018:t[Af]=="\u5E73\u6210"?o+=1988:t[Af]=="\u662D\u548C"&&(o+=1925),s.assign("year",o)}else{let a=mD.findYearClosestToRef(e.refDate,i,n);s.imply("year",a)}return s}};Ia.default=Pf});var bb=k(Fa=>{"use strict";var vD=Fa&&Fa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fa,"__esModule",{value:!0});var wD=vD(zr()),Nf=class extends wD.default{patternBetween(){return/^\s*(から|ー|-)\s*$/i}};Fa.default=Nf});var _b=k(Cr=>{"use strict";var kD=Cr&&Cr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ED=Cr&&Cr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),SD=Cr&&Cr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&kD(e,r,t);return ED(e,r),e},OD=Cr&&Cr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cr,"__esModule",{value:!0});var DD=OD(_e()),Tb=et(),If=SD(yn()),xD=/今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i,Ff=class{pattern(){return xD}extract(e,t){let n=t[0],i=DD.default(e.refDate),s=e.createParsingComponents();switch(n){case"\u6628\u65E5":return If.yesterday(e.reference);case"\u660E\u65E5":return If.tomorrow(e.reference);case"\u4ECA\u65E5":case"\u5F53\u65E5":return If.today(e.reference)}return n=="\u4ECA\u591C"||n=="\u4ECA\u5915"||n=="\u4ECA\u6669"?(s.imply("hour",22),s.assign("meridiem",Tb.Meridiem.PM)):n.match("\u4ECA\u671D")&&(s.imply("hour",6),s.assign("meridiem",Tb.Meridiem.AM)),s.assign("day",i.date()),s.assign("month",i.month()+1),s.assign("year",i.year()),s}};Cr.default=Ff});var kb=k(ot=>{"use strict";var Lf=ot&&ot.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ot,"__esModule",{value:!0});ot.createConfiguration=ot.createCasualConfiguration=ot.parseDate=ot.parse=ot.strict=ot.casual=void 0;var RD=Lf(yb()),MD=Lf(bb()),CD=Lf(_b()),vb=Dr();ot.casual=new vb.Chrono(wb());ot.strict=new vb.Chrono(Uf());function AD(r,e,t){return ot.casual.parse(r,e,t)}ot.parse=AD;function PD(r,e,t){return ot.casual.parseDate(r,e,t)}ot.parseDate=PD;function wb(){let r=Uf();return r.parsers.unshift(new CD.default),r}ot.createCasualConfiguration=wb;function Uf(){return{parsers:[new RD.default],refiners:[new MD.default]}}ot.createConfiguration=Uf});var Du=k(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.parseYear=Qr.YEAR_PATTERN=Qr.MONTH_DICTIONARY=Qr.WEEKDAY_DICTIONARY=void 0;Qr.WEEKDAY_DICTIONARY={domingo:0,dom:0,segunda:1,"segunda-feira":1,seg:1,ter\u00E7a:2,"ter\xE7a-feira":2,ter:2,quarta:3,"quarta-feira":3,qua:3,quinta:4,"quinta-feira":4,qui:4,sexta:5,"sexta-feira":5,sex:5,s\u00E1bado:6,sabado:6,sab:6};Qr.MONTH_DICTIONARY={janeiro:1,jan:1,"jan.":1,fevereiro:2,fev:2,"fev.":2,mar\u00E7o:3,mar:3,"mar.":3,abril:4,abr:4,"abr.":4,maio:5,mai:5,"mai.":5,junho:6,jun:6,"jun.":6,julho:7,jul:7,"jul.":7,agosto:8,ago:8,"ago.":8,setembro:9,set:9,"set.":9,outubro:10,out:10,"out.":10,novembro:11,nov:11,"nov.":11,dezembro:12,dez:12,"dez.":12};Qr.YEAR_PATTERN="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";function ND(r){if(r.match(/^[0-9]{1,4}$/)){let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}return r.match(/a\.?\s*c\.?/i)?(r=r.replace(/a\.?\s*c\.?/i,""),-parseInt(r)):parseInt(r)}Qr.parseYear=ND});var Sb=k(Wf=>{"use strict";Object.defineProperty(Wf,"__esModule",{value:!0});var Eb=Du(),ID=xe(),FD=H(),LD=ki(),UD=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|passado|pr[o\xF3]ximo)\\s*)?(${ID.matchAnyPattern(Eb.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|passado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),qD=1,WD=2,$D=3,qf=class extends FD.AbstractParserWithWordBoundaryChecking{innerPattern(){return UD}innerExtract(e,t){let n=t[WD].toLowerCase(),i=Eb.WEEKDAY_DICTIONARY[n];if(i===void 0)return null;let s=t[qD],a=t[$D],o=s||a||"";o=o.toLowerCase();let u=null;o=="passado"?u="this":o=="pr\xF3ximo"||o=="proximo"?u="next":o=="este"&&(u="this");let l=LD.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Wf.default=qf});var Ob=k(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});var jD=vi(),$f=class extends jD.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:ao?|\xE0s?|das|da|de|do)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:o)?|\\?)\\s*"}};jf.default=$f});var Db=k(La=>{"use strict";var GD=La&&La.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(La,"__esModule",{value:!0});var YD=GD(mn()),Gf=class extends YD.default{patternBetween(){return new RegExp("^\\s*(?:,|\xE0)?\\s*$")}};La.default=Gf});var xb=k(Ua=>{"use strict";var BD=Ua&&Ua.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ua,"__esModule",{value:!0});var HD=BD(zr()),Yf=class extends HD.default{patternBetween(){return/^\s*(?:-)\s*$/i}};Ua.default=Yf});var Nb=k(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});var VD=pt(),Ab=Du(),Pb=Du(),zD=xe(),KD=H(),QD=new RegExp(`([0-9]{1,2})(?:\xBA|\xAA|\xB0)?(?:\\s*(?:desde|de|\\-|\\\u2013|ao?|\\s)\\s*([0-9]{1,2})(?:\xBA|\xAA|\xB0)?)?\\s*(?:de)?\\s*(?:-|/|\\s*(?:de|,)?\\s*)(${zD.matchAnyPattern(Ab.MONTH_DICTIONARY)})(?:\\s*(?:de|,)?\\s*(${Pb.YEAR_PATTERN}))?(?=\\W|$)`,"i"),Rb=1,Mb=2,XD=3,Cb=4,Bf=class extends KD.AbstractParserWithWordBoundaryChecking{innerPattern(){return QD}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Ab.MONTH_DICTIONARY[t[XD].toLowerCase()],s=parseInt(t[Rb]);if(s>31)return t.index=t.index+t[Rb].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[Cb]){let a=Pb.parseYear(t[Cb]);n.start.assign("year",a)}else{let a=VD.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[Mb]){let a=parseInt(t[Mb]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Hf.default=Bf});var Ib=k(bn=>{"use strict";var ZD=bn&&bn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),JD=bn&&bn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),ex=bn&&bn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&ZD(e,r,t);return JD(e,r),e};Object.defineProperty(bn,"__esModule",{value:!0});var tx=H(),xu=ex(yn()),Vf=class extends tx.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),i=e.createParsingComponents();switch(n){case"agora":return xu.now(e.reference);case"hoje":return xu.today(e.reference);case"amanha":case"amanh\xE3":return xu.tomorrow(e.reference);case"ontem":return xu.yesterday(e.reference)}return i}};bn.default=Vf});var Fb=k(qa=>{"use strict";var rx=qa&&qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qa,"__esModule",{value:!0});var Ru=et(),nx=H(),ix=cr(),sx=rx(_e()),zf=class extends nx.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i}innerExtract(e,t){let n=sx.default(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":i.imply("meridiem",Ru.Meridiem.PM),i.imply("hour",15);break;case"noite":i.imply("meridiem",Ru.Meridiem.PM),i.imply("hour",22);break;case"manha":case"manh\xE3":i.imply("meridiem",Ru.Meridiem.AM),i.imply("hour",6);break;case"meia-noite":ix.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"meio-dia":i.imply("meridiem",Ru.Meridiem.AM),i.imply("hour",12);break}return i}};qa.default=zf});var qb=k(ut=>{"use strict";var Xn=ut&&ut.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ut,"__esModule",{value:!0});ut.createConfiguration=ut.createCasualConfiguration=ut.parseDate=ut.parse=ut.strict=ut.casual=void 0;var ax=hn(),Lb=Dr(),ox=Xn(Ei()),ux=Xn(Sb()),lx=Xn(Ob()),cx=Xn(Db()),dx=Xn(xb()),fx=Xn(Nb()),px=Xn(Ib()),mx=Xn(Fb());ut.casual=new Lb.Chrono(Ub());ut.strict=new Lb.Chrono(Kf(!0));function hx(r,e,t){return ut.casual.parse(r,e,t)}ut.parse=hx;function gx(r,e,t){return ut.casual.parseDate(r,e,t)}ut.parseDate=gx;function Ub(r=!0){let e=Kf(!1,r);return e.parsers.push(new px.default),e.parsers.push(new mx.default),e}ut.createCasualConfiguration=Ub;function Kf(r=!0,e=!0){return ax.includeCommonConfiguration({parsers:[new ox.default(e),new ux.default,new lx.default,new fx.default],refiners:[new cx.default,new dx.default]},r)}ut.createConfiguration=Kf});var Wb=k(Wa=>{"use strict";var yx=Wa&&Wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wa,"__esModule",{value:!0});var bx=yx(zr()),Qf=class extends bx.default{patternBetween(){return/^\s*(tot|-)\s*$/i}};Wa.default=Qf});var $b=k($a=>{"use strict";var Tx=$a&&$a.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($a,"__esModule",{value:!0});var _x=Tx(mn()),Xf=class extends _x.default{patternBetween(){return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$")}};$a.default=Xf});var jb=k(Tn=>{"use strict";var vx=Tn&&Tn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),wx=Tn&&Tn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),kx=Tn&&Tn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&vx(e,r,t);return wx(e,r),e};Object.defineProperty(Tn,"__esModule",{value:!0});var Ex=H(),Mu=kx(yn()),Zf=class extends Ex.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(nu|vandaag|morgen|morgend|gisteren)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),i=e.createParsingComponents();switch(n){case"nu":return Mu.now(e.reference);case"vandaag":return Mu.today(e.reference);case"morgen":case"morgend":return Mu.tomorrow(e.reference);case"gisteren":return Mu.yesterday(e.reference)}return i}};Tn.default=Zf});var Gb=k(ja=>{"use strict";var Sx=ja&&ja.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ja,"__esModule",{value:!0});var Cu=et(),Ox=H(),Dx=Sx(_e()),xx=cr(),Rx=1,Mx=2,Jf=class extends Ox.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i}innerExtract(e,t){let n=Dx.default(e.refDate),i=e.createParsingComponents();switch(t[Rx]==="deze"&&(i.assign("day",e.refDate.getDate()),i.assign("month",e.refDate.getMonth()+1),i.assign("year",e.refDate.getFullYear())),t[Mx].toLowerCase()){case"namiddag":case"'s namiddags":i.imply("meridiem",Cu.Meridiem.PM),i.imply("hour",15);break;case"avond":case"'s avonds'":i.imply("meridiem",Cu.Meridiem.PM),i.imply("hour",20);break;case"middernacht":xx.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"ochtend":case"'s ochtends":i.imply("meridiem",Cu.Meridiem.AM),i.imply("hour",6);break;case"middag":case"'s middags":i.imply("meridiem",Cu.Meridiem.AM),i.imply("hour",12);break}return i}};ja.default=Jf});var Vt=k(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.parseTimeUnits=pe.TIME_UNITS_PATTERN=pe.parseYear=pe.YEAR_PATTERN=pe.parseOrdinalNumberPattern=pe.ORDINAL_NUMBER_PATTERN=pe.parseNumberPattern=pe.NUMBER_PATTERN=pe.TIME_UNIT_DICTIONARY=pe.ORDINAL_WORD_DICTIONARY=pe.INTEGER_WORD_DICTIONARY=pe.MONTH_DICTIONARY=pe.WEEKDAY_DICTIONARY=void 0;var Au=xe(),Cx=pt();pe.WEEKDAY_DICTIONARY={zondag:0,zon:0,"zon.":0,zo:0,"zo.":0,maandag:1,ma:1,"ma.":1,dinsdag:2,din:2,"din.":2,di:2,"di.":2,woensdag:3,woe:3,"woe.":3,wo:3,"wo.":3,donderdag:4,dond:4,"dond.":4,do:4,"do.":4,vrijdag:5,vrij:5,"vrij.":5,vr:5,"vr.":5,zaterdag:6,zat:6,"zat.":6,za:6,"za.":6};pe.MONTH_DICTIONARY={januari:1,jan:1,"jan.":1,februari:2,feb:2,"feb.":2,maart:3,mar:3,"mar.":3,april:4,apr:4,"apr.":4,mei:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,augustus:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,december:12,dec:12,"dec.":12};pe.INTEGER_WORD_DICTIONARY={een:1,twee:2,drie:3,vier:4,vijf:5,zes:6,zeven:7,acht:8,negen:9,tien:10,elf:11,twaalf:12};pe.ORDINAL_WORD_DICTIONARY={eerste:1,tweede:2,derde:3,vierde:4,vijfde:5,zesde:6,zevende:7,achtste:8,negende:9,tiende:10,elfde:11,twaalfde:12,dertiende:13,veertiende:14,vijftiende:15,zestiende:16,zeventiende:17,achttiende:18,negentiende:19,twintigste:20,eenentwintigste:21,twee\u00EBntwintigste:22,drieentwintigste:23,vierentwintigste:24,vijfentwintigste:25,zesentwintigste:26,zevenentwintigste:27,achtentwintig:28,negenentwintig:29,dertigste:30,eenendertigste:31};pe.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconden:"second",min:"minute",mins:"minute",minute:"minute",minuut:"minute",minuten:"minute",minuutje:"minute",h:"hour",hr:"hour",hrs:"hour",uur:"hour",u:"hour",uren:"hour",dag:"d",dagen:"d",week:"week",weken:"week",maand:"month",maanden:"month",jaar:"year",jr:"year",jaren:"year"};pe.NUMBER_PATTERN=`(?:${Au.matchAnyPattern(pe.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`;function Bb(r){let e=r.toLowerCase();return pe.INTEGER_WORD_DICTIONARY[e]!==void 0?pe.INTEGER_WORD_DICTIONARY[e]:e==="paar"?2:e==="half"||e.match(/halve?/)?.5:parseFloat(e.replace(",","."))}pe.parseNumberPattern=Bb;pe.ORDINAL_NUMBER_PATTERN=`(?:${Au.matchAnyPattern(pe.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`;function Ax(r){let e=r.toLowerCase();return pe.ORDINAL_WORD_DICTIONARY[e]!==void 0?pe.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:ste|de)$/i,""),parseInt(e))}pe.parseOrdinalNumberPattern=Ax;pe.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])";function Px(r){if(/voor Christus/i.test(r))return r=r.replace(/voor Christus/i,""),-parseInt(r);if(/na Christus/i.test(r))return r=r.replace(/na Christus/i,""),parseInt(r);let e=parseInt(r);return Cx.findMostLikelyADYear(e)}pe.parseYear=Px;var Hb=`(${pe.NUMBER_PATTERN})\\s{0,5}(${Au.matchAnyPattern(pe.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Yb=new RegExp(Hb,"i");pe.TIME_UNITS_PATTERN=Au.repeatedTimeunitPattern("(?:(?:binnen|in)\\s*)?",Hb);function Nx(r){let e={},t=r,n=Yb.exec(t);for(;n;)Ix(e,n),t=t.substring(n[0].length),n=Yb.exec(t);return e}pe.parseTimeUnits=Nx;function Ix(r,e){let t=Bb(e[1]),n=pe.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var zb=k(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});var Vb=Vt(),Fx=We(),Lx=H(),ep=class extends Lx.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(?:binnen|in|binnen de|voor)\\s*("+Vb.TIME_UNITS_PATTERN+")(?=\\W|$)","i")}innerExtract(e,t){let n=Vb.parseTimeUnits(t[1]);return Fx.ParsingComponents.createRelativeFromReference(e.reference,n)}};tp.default=ep});var Qb=k(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});var Kb=Vt(),Ux=xe(),qx=H(),Wx=ki(),$x=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:op\\s*?)?(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?(${Ux.matchAnyPattern(Kb.WEEKDAY_DICTIONARY)})(?=\\W|$)`,"i"),jx=1,Gx=2,Yx=3,rp=class extends qx.AbstractParserWithWordBoundaryChecking{innerPattern(){return $x}innerExtract(e,t){let n=t[Gx].toLowerCase(),i=Kb.WEEKDAY_DICTIONARY[n],s=t[jx],a=t[Yx],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="vorige"?u="last":o=="volgende"?u="next":o=="deze"&&(u="this");let l=Wx.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};np.default=rp});var rT=k(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0});var Bx=pt(),eT=Vt(),Pu=Vt(),tT=Vt(),Hx=xe(),Vx=H(),zx=new RegExp(`(?:on\\s*?)?(${Pu.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:tot|\\-|\\\u2013|until|through|till|\\s)\\s*(${Pu.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:of)?\\s*)(`+Hx.matchAnyPattern(eT.MONTH_DICTIONARY)+`)(?:(?:-|/|,?\\s*)(${tT.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Kx=3,Xb=1,Zb=2,Jb=4,ip=class extends Vx.AbstractParserWithWordBoundaryChecking{innerPattern(){return zx}innerExtract(e,t){let n=eT.MONTH_DICTIONARY[t[Kx].toLowerCase()],i=Pu.parseOrdinalNumberPattern(t[Xb]);if(i>31)return t.index=t.index+t[Xb].length,null;let s=e.createParsingComponents({day:i,month:n});if(t[Jb]){let u=tT.parseYear(t[Jb]);s.assign("year",u)}else{let u=Bx.findYearClosestToRef(e.refDate,i,n);s.imply("year",u)}if(!t[Zb])return s;let a=Pu.parseOrdinalNumberPattern(t[Zb]),o=e.createParsingResult(t.index,t[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}};sp.default=ip});var aT=k(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});var iT=Vt(),Qx=pt(),Xx=xe(),sT=Vt(),Zx=H(),Jx=new RegExp(`(${Xx.matchAnyPattern(iT.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${sT.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),eR=1,nT=2,ap=class extends Zx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Jx}innerExtract(e,t){let n=e.createParsingComponents();n.imply("day",1);let i=t[eR],s=iT.MONTH_DICTIONARY[i.toLowerCase()];if(n.assign("month",s),t[nT]){let a=sT.parseYear(t[nT]);n.assign("year",a)}else{let a=Qx.findYearClosestToRef(e.refDate,1,s);n.imply("year",a)}return n}};op.default=ap});var oT=k(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});var tR=H(),rR=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),nR=1,iR=2,up=class extends tR.AbstractParserWithWordBoundaryChecking{innerPattern(){return rR}innerExtract(e,t){let n=parseInt(t[iR]),i=parseInt(t[nR]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}};lp.default=up});var uT=k(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});var sR=vi(),cp=class extends sR.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:om)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|om|\\?)\\s*"}primarySuffix(){return"(?:\\s*(?:uur))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};dp.default=cp});var dT=k(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});var cT=Vt(),aR=xe(),oR=H(),uR=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${aR.matchAnyPattern(cT.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),lR=1,cR=2,lT=3,dR=4,fp=class extends oR.AbstractParserWithWordBoundaryChecking{innerPattern(){return uR}innerExtract(e,t){let n=t[lT]?parseInt(t[lT]):cT.MONTH_DICTIONARY[t[cR].toLowerCase()];if(n<1||n>12)return null;let i=parseInt(t[lR]);return{day:parseInt(t[dR]),month:n,year:i}}};pp.default=fp});var fT=k(Ga=>{"use strict";var fR=Ga&&Ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ga,"__esModule",{value:!0});var pR=H(),Nu=et(),mp=cr(),mR=fR(_e()),hR=1,gR=2,hp=class extends pR.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i}innerExtract(e,t){let n=t[hR].toLowerCase(),i=t[gR].toLowerCase(),s=e.createParsingComponents(),a=mR.default(e.refDate);switch(n){case"gisteren":mp.assignSimilarDate(s,a.add(-1,"day"));break;case"van":mp.assignSimilarDate(s,a);break;case"morgen":mp.assignTheNextDay(s,a);break}switch(i){case"ochtend":s.imply("meridiem",Nu.Meridiem.AM),s.imply("hour",6);break;case"middag":s.imply("meridiem",Nu.Meridiem.AM),s.imply("hour",12);break;case"namiddag":s.imply("meridiem",Nu.Meridiem.PM),s.imply("hour",15);break;case"avond":s.imply("meridiem",Nu.Meridiem.PM),s.imply("hour",20);break}return s}};Ga.default=hp});var mT=k(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});var pT=Vt(),yR=We(),bR=H(),TR=dr(),_R=new RegExp(`(deze|vorige|afgelopen|komende|over|\\+|-)\\s*(${pT.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),gp=class extends bR.AbstractParserWithWordBoundaryChecking{innerPattern(){return _R}innerExtract(e,t){let n=t[1].toLowerCase(),i=pT.parseTimeUnits(t[2]);switch(n){case"vorige":case"afgelopen":case"-":i=TR.reverseTimeUnits(i);break}return yR.ParsingComponents.createRelativeFromReference(e.reference,i)}};yp.default=gp});var yT=k(Ya=>{"use strict";var vR=Ya&&Ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ya,"__esModule",{value:!0});var gT=Vt(),hT=We(),wR=vR(_e()),kR=H(),ER=xe(),SR=new RegExp(`(dit|deze|komende|volgend|volgende|afgelopen|vorige)\\s*(${ER.matchAnyPattern(gT.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),OR=1,DR=2,bp=class extends kR.AbstractParserWithWordBoundaryChecking{innerPattern(){return SR}innerExtract(e,t){let n=t[OR].toLowerCase(),i=t[DR].toLowerCase(),s=gT.TIME_UNIT_DICTIONARY[i];if(n=="volgend"||n=="volgende"||n=="komende"){let u={};return u[s]=1,hT.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="afgelopen"||n=="vorige"){let u={};return u[s]=-1,hT.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=wR.default(e.reference.instant);return i.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):i.match(/maand/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):i.match(/jaar/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};Ya.default=bp});var bT=k(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});var _p=Vt(),xR=We(),RR=H(),MR=dr(),CR=new RegExp("("+_p.TIME_UNITS_PATTERN+")(?:geleden|voor|eerder)(?=(?:\\W|$))","i"),AR=new RegExp("("+_p.TIME_UNITS_PATTERN+")geleden(?=(?:\\W|$))","i"),Tp=class extends RR.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?AR:CR}innerExtract(e,t){let n=_p.parseTimeUnits(t[1]),i=MR.reverseTimeUnits(n);return xR.ParsingComponents.createRelativeFromReference(e.reference,i)}};vp.default=Tp});var TT=k(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});var kp=Vt(),PR=We(),NR=H(),IR=new RegExp("("+kp.TIME_UNITS_PATTERN+")(later|na|vanaf nu|voortaan|vooruit|uit)(?=(?:\\W|$))","i"),FR=new RegExp("("+kp.TIME_UNITS_PATTERN+")(later|vanaf nu)(?=(?:\\W|$))","i"),LR=1,wp=class extends NR.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?FR:IR}innerExtract(e,t){let n=kp.parseTimeUnits(t[LR]);return PR.ParsingComponents.createRelativeFromReference(e.reference,n)}};Ep.default=wp});var kT=k(lt=>{"use strict";var ht=lt&<.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(lt,"__esModule",{value:!0});lt.createConfiguration=lt.createCasualConfiguration=lt.parseDate=lt.parse=lt.strict=lt.casual=void 0;var UR=hn(),_T=Dr(),qR=ht(Wb()),WR=ht($b()),$R=ht(jb()),jR=ht(Gb()),GR=ht(Ei()),YR=ht(zb()),BR=ht(Qb()),HR=ht(rT()),vT=ht(aT()),VR=ht(oT()),zR=ht(uT()),KR=ht(dT()),QR=ht(fT()),XR=ht(mT()),ZR=ht(yT()),JR=ht(bT()),eM=ht(TT());lt.casual=new _T.Chrono(wT());lt.strict=new _T.Chrono(Sp(!0));function tM(r,e,t){return lt.casual.parse(r,e,t)}lt.parse=tM;function rM(r,e,t){return lt.casual.parseDate(r,e,t)}lt.parseDate=rM;function wT(r=!0){let e=Sp(!1,r);return e.parsers.unshift(new $R.default),e.parsers.unshift(new jR.default),e.parsers.unshift(new QR.default),e.parsers.unshift(new vT.default),e.parsers.unshift(new ZR.default),e.parsers.unshift(new XR.default),e}lt.createCasualConfiguration=wT;function Sp(r=!0,e=!0){return UR.includeCommonConfiguration({parsers:[new GR.default(e),new YR.default,new HR.default,new vT.default,new BR.default,new KR.default,new VR.default,new zR.default(r),new JR.default(r),new eM.default(r)],refiners:[new WR.default,new qR.default]},r)}lt.createConfiguration=Sp});var DT=k(Ba=>{"use strict";var nM=Ba&&Ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ba,"__esModule",{value:!0});var iM=nM(_e()),sM=H(),aM=1,ET=2,oM=3,ST=4,OT=5,uM=6,Op=class extends sM.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u800C\u5BB6|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,i=e.createParsingResult(n,t[0]),s=iM.default(e.refDate),a=s;if(t[aM])i.start.imply("hour",s.hour()),i.start.imply("minute",s.minute()),i.start.imply("second",s.second()),i.start.imply("millisecond",s.millisecond());else if(t[ET]){let o=t[ET],u=t[oM];o=="\u660E"||o=="\u807D"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u5F8C"?a=a.add(2,"day"):o=="\u5927\u5F8C"&&(a=a.add(3,"day")),u=="\u65E9"||u=="\u671D"?i.start.imply("hour",6):u=="\u665A"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(t[ST]){let u=t[ST][0];u=="\u65E9"||u=="\u671D"||u=="\u4E0A"?i.start.imply("hour",6):u=="\u4E0B"||u=="\u664F"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):u=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):u=="\u51CC"&&i.start.imply("hour",0)}else if(t[OT]){let o=t[OT];o=="\u660E"||o=="\u807D"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u5F8C"?a=a.add(2,"day"):o=="\u5927\u5F8C"&&(a=a.add(3,"day"));let u=t[uM];if(u){let l=u[0];l=="\u65E9"||l=="\u671D"||l=="\u4E0A"?i.start.imply("hour",6):l=="\u4E0B"||l=="\u664F"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):l=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):l=="\u51CC"&&i.start.imply("hour",0)}}return i.start.assign("day",a.date()),i.start.assign("month",a.month()+1),i.start.assign("year",a.year()),i}};Ba.default=Op});var bs=k(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.zhStringToYear=Ut.zhStringToNumber=Ut.WEEKDAY_OFFSET=Ut.NUMBER=void 0;Ut.NUMBER={\u96F6:0,\u4E00:1,\u4E8C:2,\u5169:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10,\u5EFF:20,\u5345:30};Ut.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function lM(r){let e=0;for(let t=0;t<r.length;t++){let n=r[t];n==="\u5341"?e=e===0?Ut.NUMBER[n]:e*Ut.NUMBER[n]:e+=Ut.NUMBER[n]}return e}Ut.zhStringToNumber=lM;function cM(r){let e="";for(let t=0;t<r.length;t++){let n=r[t];e=e+Ut.NUMBER[n]}return parseInt(e)}Ut.zhStringToYear=cM});var RT=k(Ha=>{"use strict";var dM=Ha&&Ha.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ha,"__esModule",{value:!0});var fM=dM(_e()),pM=H(),Di=bs(),Dp=1,xT=2,xp=3,Rp=class extends pM.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(Di.NUMBER).join("")+"]{4}|["+Object.keys(Di.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(Di.NUMBER).join("")+"]{1,2})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(Di.NUMBER).join("")+"]{1,2})?(?:\\s*)(?:\u65E5|\u865F)?")}innerExtract(e,t){let n=fM.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[xT]);if(isNaN(s)&&(s=Di.zhStringToNumber(t[xT])),i.start.assign("month",s),t[xp]){let a=parseInt(t[xp]);isNaN(a)&&(a=Di.zhStringToNumber(t[xp])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[Dp]){let a=parseInt(t[Dp]);isNaN(a)&&(a=Di.zhStringToYear(t[Dp])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}};Ha.default=Rp});var CT=k(Va=>{"use strict";var mM=Va&&Va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Va,"__esModule",{value:!0});var hM=mM(_e()),gM=H(),MT=bs(),yM=new RegExp("(\\d+|["+Object.keys(MT.NUMBER).join("")+"]+|\u534A|\u5E7E)(?:\\s*)(?:\u500B)?(\u79D2(?:\u9418)?|\u5206\u9418|\u5C0F\u6642|\u9418|\u65E5|\u5929|\u661F\u671F|\u79AE\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u904E)?\u5F8C|(?:\u4E4B)?\u5167)","i"),Mp=1,bM=2,Cp=class extends gM.AbstractParserWithWordBoundaryChecking{innerPattern(){return yM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[Mp]);if(isNaN(i)&&(i=MT.zhStringToNumber(t[Mp])),isNaN(i)){let u=t[Mp];if(u==="\u5E7E")i=3;else if(u==="\u534A")i=.5;else return null}let s=hM.default(e.refDate),o=t[bM][0];return o.match(/[日天星禮月年]/)?(o=="\u65E5"||o=="\u5929"?s=s.add(i,"d"):o=="\u661F"||o=="\u79AE"?s=s.add(i*7,"d"):o=="\u6708"?s=s.add(i,"month"):o=="\u5E74"&&(s=s.add(i,"year")),n.start.assign("year",s.year()),n.start.assign("month",s.month()+1),n.start.assign("day",s.date()),n):(o=="\u79D2"?s=s.add(i,"second"):o=="\u5206"?s=s.add(i,"minute"):(o=="\u5C0F"||o=="\u9418")&&(s=s.add(i,"hour")),n.start.imply("year",s.year()),n.start.imply("month",s.month()+1),n.start.imply("day",s.date()),n.start.assign("hour",s.hour()),n.start.assign("minute",s.minute()),n.start.assign("second",s.second()),n)}};Va.default=Cp});var PT=k(za=>{"use strict";var TM=za&&za.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(za,"__esModule",{value:!0});var _M=TM(_e()),vM=H(),AT=bs(),wM=new RegExp("(?<prefix>\u4E0A|\u4ECA|\u4E0B|\u9019|\u5462)(?:\u500B)?(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?<weekday>"+Object.keys(AT.WEEKDAY_OFFSET).join("|")+")"),Ap=class extends vM.AbstractParserWithWordBoundaryChecking{innerPattern(){return wM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=AT.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=null,o=t.groups.prefix;o=="\u4E0A"?a="last":o=="\u4E0B"?a="next":(o=="\u4ECA"||o=="\u9019"||o=="\u5462")&&(a="this");let u=_M.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(s-7),l=!0):a=="next"?(u=u.day(s+7),l=!0):a=="this"?u=u.day(s):Math.abs(s-7-c)<Math.abs(s-c)?u=u.day(s-7):Math.abs(s+7-c)<Math.abs(s-c)?u=u.day(s+7):u=u.day(s),n.start.assign("weekday",s),l?(n.start.assign("day",u.date()),n.start.assign("month",u.month()+1),n.start.assign("year",u.year())):(n.start.imply("day",u.date()),n.start.imply("month",u.month()+1),n.start.imply("year",u.year())),n}};za.default=Ap});var NT=k(Ka=>{"use strict";var kM=Ka&&Ka.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ka,"__esModule",{value:!0});var EM=kM(_e()),SM=H(),mr=bs(),OM=new RegExp("(?:\u7531|\u5F9E|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(mr.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(mr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(mr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),DM=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(mr.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(mr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(mr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Iu=1,Fu=2,Lu=3,Uu=4,qu=5,Wu=6,pr=7,Ts=8,$u=9,Pp=class extends SM.AbstractParserWithWordBoundaryChecking{innerPattern(){return OM}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=EM.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[Iu]){var a=t[Iu];a=="\u660E"||a=="\u807D"?n.hour()>1&&s.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?s.add(-1,"day"):a=="\u524D"?s.add(-2,"day"):a=="\u5927\u524D"?s.add(-3,"day"):a=="\u5F8C"?s.add(2,"day"):a=="\u5927\u5F8C"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else if(t[Uu]){var o=t[Uu];o=="\u660E"||o=="\u807D"?s.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?s.add(-1,"day"):o=="\u524D"?s.add(-2,"day"):o=="\u5927\u524D"?s.add(-3,"day"):o=="\u5F8C"?s.add(2,"day"):o=="\u5927\u5F8C"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else i.start.imply("day",s.date()),i.start.imply("month",s.month()+1),i.start.imply("year",s.year());let u=0,l=0,c=-1;if(t[Ts]){var d=parseInt(t[Ts]);if(isNaN(d)&&(d=mr.zhStringToNumber(t[Ts])),d>=60)return null;i.start.assign("second",d)}if(u=parseInt(t[Wu]),isNaN(u)&&(u=mr.zhStringToNumber(t[Wu])),t[pr]?t[pr]=="\u534A"?l=30:t[pr]=="\u6B63"||t[pr]=="\u6574"?l=0:(l=parseInt(t[pr]),isNaN(l)&&(l=mr.zhStringToNumber(t[pr]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[$u]){if(u>12)return null;var m=t[$u][0].toLowerCase();m=="a"&&(c=0,u==12&&(u=0)),m=="p"&&(c=1,u!=12&&(u+=12))}else if(t[Fu]){var p=t[Fu],T=p[0];T=="\u671D"||T=="\u65E9"?(c=0,u==12&&(u=0)):T=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[Lu]){var y=t[Lu],E=y[0];E=="\u4E0A"||E=="\u671D"||E=="\u65E9"||E=="\u51CC"?(c=0,u==12&&(u=0)):(E=="\u4E0B"||E=="\u664F"||E=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[qu]){var R=t[qu],x=R[0];x=="\u4E0A"||x=="\u671D"||x=="\u65E9"||x=="\u51CC"?(c=0,u==12&&(u=0)):(x=="\u4E0B"||x=="\u664F"||x=="\u665A")&&(c=1,u!=12&&(u+=12))}if(i.start.assign("hour",u),i.start.assign("minute",l),c>=0?i.start.assign("meridiem",c):u<12?i.start.imply("meridiem",0):i.start.imply("meridiem",1),t=DM.exec(e.text.substring(i.index+i.text.length)),!t)return i.text.match(/^\d+$/)?null:i;let v=s.clone();if(i.end=e.createParsingComponents(),t[Iu]){var a=t[Iu];a=="\u660E"||a=="\u807D"?n.hour()>1&&v.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?v.add(-1,"day"):a=="\u524D"?v.add(-2,"day"):a=="\u5927\u524D"?v.add(-3,"day"):a=="\u5F8C"?v.add(2,"day"):a=="\u5927\u5F8C"&&v.add(3,"day"),i.end.assign("day",v.date()),i.end.assign("month",v.month()+1),i.end.assign("year",v.year())}else if(t[Uu]){var o=t[Uu];o=="\u660E"||o=="\u807D"?v.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?v.add(-1,"day"):o=="\u524D"?v.add(-2,"day"):o=="\u5927\u524D"?v.add(-3,"day"):o=="\u5F8C"?v.add(2,"day"):o=="\u5927\u5F8C"&&v.add(3,"day"),i.end.assign("day",v.date()),i.end.assign("month",v.month()+1),i.end.assign("year",v.year())}else i.end.imply("day",v.date()),i.end.imply("month",v.month()+1),i.end.imply("year",v.year());if(u=0,l=0,c=-1,t[Ts]){var d=parseInt(t[Ts]);if(isNaN(d)&&(d=mr.zhStringToNumber(t[Ts])),d>=60)return null;i.end.assign("second",d)}if(u=parseInt(t[Wu]),isNaN(u)&&(u=mr.zhStringToNumber(t[Wu])),t[pr]?t[pr]=="\u534A"?l=30:t[pr]=="\u6B63"||t[pr]=="\u6574"?l=0:(l=parseInt(t[pr]),isNaN(l)&&(l=mr.zhStringToNumber(t[pr]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[$u]){if(u>12)return null;var m=t[$u][0].toLowerCase();m=="a"&&(c=0,u==12&&(u=0)),m=="p"&&(c=1,u!=12&&(u+=12)),i.start.isCertain("meridiem")||(c==0?(i.start.imply("meridiem",0),i.start.get("hour")==12&&i.start.assign("hour",0)):(i.start.imply("meridiem",1),i.start.get("hour")!=12&&i.start.assign("hour",i.start.get("hour")+12)))}else if(t[Fu]){var p=t[Fu],T=p[0];T=="\u671D"||T=="\u65E9"?(c=0,u==12&&(u=0)):T=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[Lu]){var y=t[Lu],E=y[0];E=="\u4E0A"||E=="\u671D"||E=="\u65E9"||E=="\u51CC"?(c=0,u==12&&(u=0)):(E=="\u4E0B"||E=="\u664F"||E=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[qu]){var R=t[qu],x=R[0];x=="\u4E0A"||x=="\u671D"||x=="\u65E9"||x=="\u51CC"?(c=0,u==12&&(u=0)):(x=="\u4E0B"||x=="\u664F"||x=="\u665A")&&(c=1,u!=12&&(u+=12))}return i.text=i.text+t[0],i.end.assign("hour",u),i.end.assign("minute",l),c>=0?i.end.assign("meridiem",c):i.start.isCertain("meridiem")&&i.start.get("meridiem")==1&&i.start.get("hour")>u?i.end.imply("meridiem",0):u>12&&i.end.imply("meridiem",1),i.end.date().getTime()<i.start.date().getTime()&&i.end.imply("day",i.end.get("day")+1),i}};Ka.default=Pp});var FT=k(Qa=>{"use strict";var xM=Qa&&Qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qa,"__esModule",{value:!0});var RM=xM(_e()),MM=H(),IT=bs(),CM=new RegExp("(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?<weekday>"+Object.keys(IT.WEEKDAY_OFFSET).join("|")+")"),Np=class extends MM.AbstractParserWithWordBoundaryChecking{innerPattern(){return CM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=IT.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=RM.default(e.refDate),o=!1,u=a.day();return Math.abs(s-7-u)<Math.abs(s-u)?a=a.day(s-7):Math.abs(s+7-u)<Math.abs(s-u)?a=a.day(s+7):a=a.day(s),n.start.assign("weekday",s),o?(n.start.assign("day",a.date()),n.start.assign("month",a.month()+1),n.start.assign("year",a.year())):(n.start.imply("day",a.date()),n.start.imply("month",a.month()+1),n.start.imply("year",a.year())),n}};Qa.default=Np});var LT=k(Xa=>{"use strict";var AM=Xa&&Xa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xa,"__esModule",{value:!0});var PM=AM(zr()),Ip=class extends PM.default{patternBetween(){return/^\s*(至|到|\-|\~|~|-|ー)\s*$/i}};Xa.default=Ip});var UT=k(Za=>{"use strict";var NM=Za&&Za.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Za,"__esModule",{value:!0});var IM=NM(mn()),Fp=class extends IM.default{patternBetween(){return/^\s*$/i}};Za.default=Fp});var qT=k(Ve=>{"use strict";var _n=Ve&&Ve.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.createConfiguration=Ve.createCasualConfiguration=Ve.parseDate=Ve.parse=Ve.strict=Ve.casual=Ve.hant=void 0;var Lp=Dr(),FM=_n(yu()),LM=hn(),UM=_n(DT()),qM=_n(RT()),WM=_n(CT()),$M=_n(PT()),jM=_n(NT()),GM=_n(FT()),YM=_n(LT()),BM=_n(UT());Ve.hant=new Lp.Chrono(Up());Ve.casual=new Lp.Chrono(Up());Ve.strict=new Lp.Chrono(qp());function HM(r,e,t){return Ve.casual.parse(r,e,t)}Ve.parse=HM;function VM(r,e,t){return Ve.casual.parseDate(r,e,t)}Ve.parseDate=VM;function Up(){let r=qp();return r.parsers.unshift(new UM.default),r}Ve.createCasualConfiguration=Up;function qp(){let r=LM.includeCommonConfiguration({parsers:[new qM.default,new $M.default,new GM.default,new jM.default,new WM.default],refiners:[new YM.default,new BM.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof FM.default)),r}Ve.createConfiguration=qp});var GT=k(Ja=>{"use strict";var zM=Ja&&Ja.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ja,"__esModule",{value:!0});var KM=zM(_e()),QM=H(),XM=1,WT=2,ZM=3,$T=4,jT=5,JM=6,Wp=class extends QM.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u73B0\u5728|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,i=e.createParsingResult(n,t[0]),s=KM.default(e.refDate),a=s;if(t[XM])i.start.imply("hour",s.hour()),i.start.imply("minute",s.minute()),i.start.imply("second",s.second()),i.start.imply("millisecond",s.millisecond());else if(t[WT]){let o=t[WT],u=t[ZM];o=="\u660E"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u540E"?a=a.add(2,"day"):o=="\u5927\u540E"&&(a=a.add(3,"day")),u=="\u65E9"?i.start.imply("hour",6):u=="\u665A"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(t[$T]){let u=t[$T][0];u=="\u65E9"||u=="\u4E0A"?i.start.imply("hour",6):u=="\u4E0B"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):u=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):u=="\u51CC"&&i.start.imply("hour",0)}else if(t[jT]){let o=t[jT];o=="\u660E"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u540E"?a=a.add(2,"day"):o=="\u5927\u540E"&&(a=a.add(3,"day"));let u=t[JM];if(u){let l=u[0];l=="\u65E9"||l=="\u4E0A"?i.start.imply("hour",6):l=="\u4E0B"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):l=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):l=="\u51CC"&&i.start.imply("hour",0)}}return i.start.assign("day",a.date()),i.start.assign("month",a.month()+1),i.start.assign("year",a.year()),i}};Ja.default=Wp});var _s=k(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.zhStringToYear=qt.zhStringToNumber=qt.WEEKDAY_OFFSET=qt.NUMBER=void 0;qt.NUMBER={\u96F6:0,"\u3007":0,\u4E00:1,\u4E8C:2,\u4E24:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10};qt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function eC(r){let e=0;for(let t=0;t<r.length;t++){let n=r[t];n==="\u5341"?e=e===0?qt.NUMBER[n]:e*qt.NUMBER[n]:e+=qt.NUMBER[n]}return e}qt.zhStringToNumber=eC;function tC(r){let e="";for(let t=0;t<r.length;t++){let n=r[t];e=e+qt.NUMBER[n]}return parseInt(e)}qt.zhStringToYear=tC});var BT=k(eo=>{"use strict";var rC=eo&&eo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(eo,"__esModule",{value:!0});var nC=rC(_e()),iC=H(),xi=_s(),$p=1,YT=2,jp=3,Gp=class extends iC.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(xi.NUMBER).join("")+"]{4}|["+Object.keys(xi.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(xi.NUMBER).join("")+"]{1,3})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(xi.NUMBER).join("")+"]{1,3})?(?:\\s*)(?:\u65E5|\u53F7)?")}innerExtract(e,t){let n=nC.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[YT]);if(isNaN(s)&&(s=xi.zhStringToNumber(t[YT])),i.start.assign("month",s),t[jp]){let a=parseInt(t[jp]);isNaN(a)&&(a=xi.zhStringToNumber(t[jp])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[$p]){let a=parseInt(t[$p]);isNaN(a)&&(a=xi.zhStringToYear(t[$p])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}};eo.default=Gp});var VT=k(to=>{"use strict";var sC=to&&to.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(to,"__esModule",{value:!0});var aC=sC(_e()),oC=H(),HT=_s(),uC=new RegExp("(\\d+|["+Object.keys(HT.NUMBER).join("")+"]+|\u534A|\u51E0)(?:\\s*)(?:\u4E2A)?(\u79D2(?:\u949F)?|\u5206\u949F|\u5C0F\u65F6|\u949F|\u65E5|\u5929|\u661F\u671F|\u793C\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u8FC7)?\u540E|(?:\u4E4B)?\u5185)","i"),Yp=1,lC=2,Bp=class extends oC.AbstractParserWithWordBoundaryChecking{innerPattern(){return uC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[Yp]);if(isNaN(i)&&(i=HT.zhStringToNumber(t[Yp])),isNaN(i)){let u=t[Yp];if(u==="\u51E0")i=3;else if(u==="\u534A")i=.5;else return null}let s=aC.default(e.refDate),o=t[lC][0];return o.match(/[日天星礼月年]/)?(o=="\u65E5"||o=="\u5929"?s=s.add(i,"d"):o=="\u661F"||o=="\u793C"?s=s.add(i*7,"d"):o=="\u6708"?s=s.add(i,"month"):o=="\u5E74"&&(s=s.add(i,"year")),n.start.assign("year",s.year()),n.start.assign("month",s.month()+1),n.start.assign("day",s.date()),n):(o=="\u79D2"?s=s.add(i,"second"):o=="\u5206"?s=s.add(i,"minute"):(o=="\u5C0F"||o=="\u949F")&&(s=s.add(i,"hour")),n.start.imply("year",s.year()),n.start.imply("month",s.month()+1),n.start.imply("day",s.date()),n.start.assign("hour",s.hour()),n.start.assign("minute",s.minute()),n.start.assign("second",s.second()),n)}};to.default=Bp});var KT=k(ro=>{"use strict";var cC=ro&&ro.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ro,"__esModule",{value:!0});var dC=cC(_e()),fC=H(),zT=_s(),pC=new RegExp("(?<prefix>\u4E0A|\u4E0B|\u8FD9)(?:\u4E2A)?(?:\u661F\u671F|\u793C\u62DC|\u5468)(?<weekday>"+Object.keys(zT.WEEKDAY_OFFSET).join("|")+")"),Hp=class extends fC.AbstractParserWithWordBoundaryChecking{innerPattern(){return pC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=zT.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=null,o=t.groups.prefix;o=="\u4E0A"?a="last":o=="\u4E0B"?a="next":o=="\u8FD9"&&(a="this");let u=dC.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(s-7),l=!0):a=="next"?(u=u.day(s+7),l=!0):a=="this"?u=u.day(s):Math.abs(s-7-c)<Math.abs(s-c)?u=u.day(s-7):Math.abs(s+7-c)<Math.abs(s-c)?u=u.day(s+7):u=u.day(s),n.start.assign("weekday",s),l?(n.start.assign("day",u.date()),n.start.assign("month",u.month()+1),n.start.assign("year",u.year())):(n.start.imply("day",u.date()),n.start.imply("month",u.month()+1),n.start.imply("year",u.year())),n}};ro.default=Hp});var QT=k(no=>{"use strict";var mC=no&&no.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(no,"__esModule",{value:!0});var hC=mC(_e()),gC=H(),gr=_s(),yC=new RegExp("(?:\u4ECE|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(gr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(gr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(gr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),bC=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(gr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(gr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(gr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),ju=1,Gu=2,Yu=3,Bu=4,Hu=5,Vu=6,hr=7,vs=8,zu=9,Vp=class extends gC.AbstractParserWithWordBoundaryChecking{innerPattern(){return yC}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=hC.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[ju]){let c=t[ju];c=="\u660E"?n.hour()>1&&s.add(1,"day"):c=="\u6628"?s.add(-1,"day"):c=="\u524D"?s.add(-2,"day"):c=="\u5927\u524D"?s.add(-3,"day"):c=="\u540E"?s.add(2,"day"):c=="\u5927\u540E"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else if(t[Bu]){let c=t[Bu];c=="\u660E"?s.add(1,"day"):c=="\u6628"?s.add(-1,"day"):c=="\u524D"?s.add(-2,"day"):c=="\u5927\u524D"?s.add(-3,"day"):c=="\u540E"?s.add(2,"day"):c=="\u5927\u540E"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else i.start.imply("day",s.date()),i.start.imply("month",s.month()+1),i.start.imply("year",s.year());let a=0,o=0,u=-1;if(t[vs]){let c=parseInt(t[vs]);if(isNaN(c)&&(c=gr.zhStringToNumber(t[vs])),c>=60)return null;i.start.assign("second",c)}if(a=parseInt(t[Vu]),isNaN(a)&&(a=gr.zhStringToNumber(t[Vu])),t[hr]?t[hr]=="\u534A"?o=30:t[hr]=="\u6B63"||t[hr]=="\u6574"?o=0:(o=parseInt(t[hr]),isNaN(o)&&(o=gr.zhStringToNumber(t[hr]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[zu]){if(a>12)return null;let c=t[zu][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12))}else if(t[Gu]){let d=t[Gu][0];d=="\u65E9"?(u=0,a==12&&(a=0)):d=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Yu]){let d=t[Yu][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[Hu]){let d=t[Hu][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}if(i.start.assign("hour",a),i.start.assign("minute",o),u>=0?i.start.assign("meridiem",u):a<12?i.start.imply("meridiem",0):i.start.imply("meridiem",1),t=bC.exec(e.text.substring(i.index+i.text.length)),!t)return i.text.match(/^\d+$/)?null:i;let l=s.clone();if(i.end=e.createParsingComponents(),t[ju]){let c=t[ju];c=="\u660E"?n.hour()>1&&l.add(1,"day"):c=="\u6628"?l.add(-1,"day"):c=="\u524D"?l.add(-2,"day"):c=="\u5927\u524D"?l.add(-3,"day"):c=="\u540E"?l.add(2,"day"):c=="\u5927\u540E"&&l.add(3,"day"),i.end.assign("day",l.date()),i.end.assign("month",l.month()+1),i.end.assign("year",l.year())}else if(t[Bu]){let c=t[Bu];c=="\u660E"?l.add(1,"day"):c=="\u6628"?l.add(-1,"day"):c=="\u524D"?l.add(-2,"day"):c=="\u5927\u524D"?l.add(-3,"day"):c=="\u540E"?l.add(2,"day"):c=="\u5927\u540E"&&l.add(3,"day"),i.end.assign("day",l.date()),i.end.assign("month",l.month()+1),i.end.assign("year",l.year())}else i.end.imply("day",l.date()),i.end.imply("month",l.month()+1),i.end.imply("year",l.year());if(a=0,o=0,u=-1,t[vs]){let c=parseInt(t[vs]);if(isNaN(c)&&(c=gr.zhStringToNumber(t[vs])),c>=60)return null;i.end.assign("second",c)}if(a=parseInt(t[Vu]),isNaN(a)&&(a=gr.zhStringToNumber(t[Vu])),t[hr]?t[hr]=="\u534A"?o=30:t[hr]=="\u6B63"||t[hr]=="\u6574"?o=0:(o=parseInt(t[hr]),isNaN(o)&&(o=gr.zhStringToNumber(t[hr]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[zu]){if(a>12)return null;let c=t[zu][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12)),i.start.isCertain("meridiem")||(u==0?(i.start.imply("meridiem",0),i.start.get("hour")==12&&i.start.assign("hour",0)):(i.start.imply("meridiem",1),i.start.get("hour")!=12&&i.start.assign("hour",i.start.get("hour")+12)))}else if(t[Gu]){let d=t[Gu][0];d=="\u65E9"?(u=0,a==12&&(a=0)):d=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Yu]){let d=t[Yu][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[Hu]){let d=t[Hu][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}return i.text=i.text+t[0],i.end.assign("hour",a),i.end.assign("minute",o),u>=0?i.end.assign("meridiem",u):i.start.isCertain("meridiem")&&i.start.get("meridiem")==1&&i.start.get("hour")>a?i.end.imply("meridiem",0):a>12&&i.end.imply("meridiem",1),i.end.date().getTime()<i.start.date().getTime()&&i.end.imply("day",i.end.get("day")+1),i}};no.default=Vp});var ZT=k(io=>{"use strict";var TC=io&&io.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(io,"__esModule",{value:!0});var _C=TC(_e()),vC=H(),XT=_s(),wC=new RegExp("(?:\u661F\u671F|\u793C\u62DC|\u5468)(?<weekday>"+Object.keys(XT.WEEKDAY_OFFSET).join("|")+")"),zp=class extends vC.AbstractParserWithWordBoundaryChecking{innerPattern(){return wC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=XT.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=_C.default(e.refDate),o=!1,u=a.day();return Math.abs(s-7-u)<Math.abs(s-u)?a=a.day(s-7):Math.abs(s+7-u)<Math.abs(s-u)?a=a.day(s+7):a=a.day(s),n.start.assign("weekday",s),o?(n.start.assign("day",a.date()),n.start.assign("month",a.month()+1),n.start.assign("year",a.year())):(n.start.imply("day",a.date()),n.start.imply("month",a.month()+1),n.start.imply("year",a.year())),n}};io.default=zp});var JT=k(so=>{"use strict";var kC=so&&so.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(so,"__esModule",{value:!0});var EC=kC(zr()),Kp=class extends EC.default{patternBetween(){return/^\s*(至|到|-|~|~|-|ー)\s*$/i}};so.default=Kp});var e_=k(ao=>{"use strict";var SC=ao&&ao.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ao,"__esModule",{value:!0});var OC=SC(mn()),Qp=class extends OC.default{patternBetween(){return/^\s*$/i}};ao.default=Qp});var t_=k(ze=>{"use strict";var vn=ze&&ze.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ze,"__esModule",{value:!0});ze.createConfiguration=ze.createCasualConfiguration=ze.parseDate=ze.parse=ze.strict=ze.casual=ze.hans=void 0;var Xp=Dr(),DC=vn(yu()),xC=hn(),RC=vn(GT()),MC=vn(BT()),CC=vn(VT()),AC=vn(KT()),PC=vn(QT()),NC=vn(ZT()),IC=vn(JT()),FC=vn(e_());ze.hans=new Xp.Chrono(Zp());ze.casual=new Xp.Chrono(Zp());ze.strict=new Xp.Chrono(Jp());function LC(r,e,t){return ze.casual.parse(r,e,t)}ze.parse=LC;function UC(r,e,t){return ze.casual.parseDate(r,e,t)}ze.parseDate=UC;function Zp(){let r=Jp();return r.parsers.unshift(new RC.default),r}ze.createCasualConfiguration=Zp;function Jp(){let r=xC.includeCommonConfiguration({parsers:[new MC.default,new AC.default,new NC.default,new PC.default,new CC.default],refiners:[new IC.default,new FC.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof DC.default)),r}ze.createConfiguration=Jp});var n_=k(zt=>{"use strict";var r_=zt&&zt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),qC=zt&&zt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),WC=zt&&zt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&r_(e,r,t)},$C=zt&&zt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&r_(e,r,t);return qC(e,r),e};Object.defineProperty(zt,"__esModule",{value:!0});zt.hans=void 0;WC(qT(),zt);zt.hans=$C(t_())});var Wt=k(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.parseTimeUnits=se.TIME_UNITS_PATTERN=se.parseYear=se.YEAR_PATTERN=se.parseOrdinalNumberPattern=se.ORDINAL_NUMBER_PATTERN=se.parseNumberPattern=se.NUMBER_PATTERN=se.TIME_UNIT_DICTIONARY=se.ORDINAL_WORD_DICTIONARY=se.INTEGER_WORD_DICTIONARY=se.MONTH_DICTIONARY=se.FULL_MONTH_NAME_DICTIONARY=se.WEEKDAY_DICTIONARY=se.REGEX_PARTS=void 0;var Ku=xe(),jC=pt();se.REGEX_PARTS={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"};se.WEEKDAY_DICTIONARY={\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435:0,\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u044F:0,\u0432\u0441\u043A:0,"\u0432\u0441\u043A.":0,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A:1,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A\u0430:1,\u043F\u043D:1,"\u043F\u043D.":1,\u0432\u0442\u043E\u0440\u043D\u0438\u043A:2,\u0432\u0442\u043E\u0440\u043D\u0438\u043A\u0430:2,\u0432\u0442:2,"\u0432\u0442.":2,\u0441\u0440\u0435\u0434\u0430:3,\u0441\u0440\u0435\u0434\u044B:3,\u0441\u0440\u0435\u0434\u0443:3,\u0441\u0440:3,"\u0441\u0440.":3,\u0447\u0435\u0442\u0432\u0435\u0440\u0433:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430:4,\u0447\u0442:4,"\u0447\u0442.":4,\u043F\u044F\u0442\u043D\u0438\u0446\u0430:5,\u043F\u044F\u0442\u043D\u0438\u0446\u0443:5,\u043F\u044F\u0442\u043D\u0438\u0446\u044B:5,\u043F\u0442:5,"\u043F\u0442.":5,\u0441\u0443\u0431\u0431\u043E\u0442\u0430:6,\u0441\u0443\u0431\u0431\u043E\u0442\u0443:6,\u0441\u0443\u0431\u0431\u043E\u0442\u044B:6,\u0441\u0431:6,"\u0441\u0431.":6};se.FULL_MONTH_NAME_DICTIONARY={\u044F\u043D\u0432\u0430\u0440\u044C:1,\u044F\u043D\u0432\u0430\u0440\u044F:1,\u044F\u043D\u0432\u0430\u0440\u0435:1,\u0444\u0435\u0432\u0440\u044F\u043B\u044C:2,\u0444\u0435\u0432\u0440\u044F\u043B\u044F:2,\u0444\u0435\u0432\u0440\u044F\u043B\u0435:2,\u043C\u0430\u0440\u0442:3,\u043C\u0430\u0440\u0442\u0430:3,\u043C\u0430\u0440\u0442\u0435:3,\u0430\u043F\u0440\u0435\u043B\u044C:4,\u0430\u043F\u0440\u0435\u043B\u044F:4,\u0430\u043F\u0440\u0435\u043B\u0435:4,\u043C\u0430\u0439:5,\u043C\u0430\u044F:5,\u043C\u0430\u0435:5,\u0438\u044E\u043D\u044C:6,\u0438\u044E\u043D\u044F:6,\u0438\u044E\u043D\u0435:6,\u0438\u044E\u043B\u044C:7,\u0438\u044E\u043B\u044F:7,\u0438\u044E\u043B\u0435:7,\u0430\u0432\u0433\u0443\u0441\u0442:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0430:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0435:8,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044C:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044F:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u0435:9,\u043E\u043A\u0442\u044F\u0431\u0440\u044C:10,\u043E\u043A\u0442\u044F\u0431\u0440\u044F:10,\u043E\u043A\u0442\u044F\u0431\u0440\u0435:10,\u043D\u043E\u044F\u0431\u0440\u044C:11,\u043D\u043E\u044F\u0431\u0440\u044F:11,\u043D\u043E\u044F\u0431\u0440\u0435:11,\u0434\u0435\u043A\u0430\u0431\u0440\u044C:12,\u0434\u0435\u043A\u0430\u0431\u0440\u044F:12,\u0434\u0435\u043A\u0430\u0431\u0440\u0435:12};se.MONTH_DICTIONARY=Object.assign(Object.assign({},se.FULL_MONTH_NAME_DICTIONARY),{\u044F\u043D\u0432:1,"\u044F\u043D\u0432.":1,\u0444\u0435\u0432:2,"\u0444\u0435\u0432.":2,\u043C\u0430\u0440:3,"\u043C\u0430\u0440.":3,\u0430\u043F\u0440:4,"\u0430\u043F\u0440.":4,\u0430\u0432\u0433:8,"\u0430\u0432\u0433.":8,\u0441\u0435\u043D:9,"\u0441\u0435\u043D.":9,\u043E\u043A\u0442:10,"\u043E\u043A\u0442.":10,\u043D\u043E\u044F:11,"\u043D\u043E\u044F.":11,\u0434\u0435\u043A:12,"\u0434\u0435\u043A.":12});se.INTEGER_WORD_DICTIONARY={\u043E\u0434\u0438\u043D:1,\u043E\u0434\u043D\u0430:1,\u043E\u0434\u043D\u043E\u0439:1,\u043E\u0434\u043D\u0443:1,\u0434\u0432\u0435:2,\u0434\u0432\u0430:2,\u0434\u0432\u0443\u0445:2,\u0442\u0440\u0438:3,\u0442\u0440\u0435\u0445:3,\u0442\u0440\u0451\u0445:3,\u0447\u0435\u0442\u044B\u0440\u0435:4,\u0447\u0435\u0442\u044B\u0440\u0435\u0445:4,\u0447\u0435\u0442\u044B\u0440\u0451\u0445:4,\u043F\u044F\u0442\u044C:5,\u043F\u044F\u0442\u0438:5,\u0448\u0435\u0441\u0442\u044C:6,\u0448\u0435\u0441\u0442\u0438:6,\u0441\u0435\u043C\u044C:7,\u0441\u0435\u043C\u0438:7,\u0432\u043E\u0441\u0435\u043C\u044C:8,\u0432\u043E\u0441\u0435\u043C\u044C\u043C\u0438:8,\u0434\u0435\u0432\u044F\u0442\u044C:9,\u0434\u0435\u0432\u044F\u0442\u0438:9,\u0434\u0435\u0441\u044F\u0442\u044C:10,\u0434\u0435\u0441\u044F\u0442\u0438:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u044C:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u0438:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u044C:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u0438:12};se.ORDINAL_WORD_DICTIONARY={\u043F\u0435\u0440\u0432\u043E\u0435:1,\u043F\u0435\u0440\u0432\u043E\u0433\u043E:1,\u0432\u0442\u043E\u0440\u043E\u0435:2,\u0432\u0442\u043E\u0440\u043E\u0433\u043E:2,\u0442\u0440\u0435\u0442\u044C\u0435:3,\u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E:3,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E:4,\u043F\u044F\u0442\u043E\u0435:5,\u043F\u044F\u0442\u043E\u0433\u043E:5,\u0448\u0435\u0441\u0442\u043E\u0435:6,\u0448\u0435\u0441\u0442\u043E\u0433\u043E:6,\u0441\u0435\u0434\u044C\u043C\u043E\u0435:7,\u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E:7,\u0432\u043E\u0441\u044C\u043C\u043E\u0435:8,\u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E:8,\u0434\u0435\u0432\u044F\u0442\u043E\u0435:9,\u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E:9,\u0434\u0435\u0441\u044F\u0442\u043E\u0435:10,\u0434\u0435\u0441\u044F\u0442\u043E\u0433\u043E:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:12,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:13,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:13,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:14,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:14,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:15,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:15,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:16,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:16,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:17,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:17,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:18,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:18,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:19,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:19,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0435:20,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:20,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0435":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0433\u043E":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0435":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0433\u043E":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0435":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0433\u043E":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0435":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0435":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0435":29,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E":29,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0435:30,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0433\u043E:30,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":31,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":31};se.TIME_UNIT_DICTIONARY={\u0441\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u044B:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0443:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0443:"second",\u043C\u0438\u043D:"minute",\u043C\u0438\u043D\u0443\u0442\u0430:"minute",\u043C\u0438\u043D\u0443\u0442:"minute",\u043C\u0438\u043D\u0443\u0442\u044B:"minute",\u043C\u0438\u043D\u0443\u0442\u0443:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u043A:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0438:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0443:"minute",\u0447\u0430\u0441:"hour",\u0447\u0430\u0441\u043E\u0432:"hour",\u0447\u0430\u0441\u0430:"hour",\u0447\u0430\u0441\u0443:"hour",\u0447\u0430\u0441\u0438\u043A\u043E\u0432:"hour",\u0447\u0430\u0441\u0438\u043A\u0430:"hour",\u0447\u0430\u0441\u0438\u043A\u0435:"hour",\u0447\u0430\u0441\u0438\u043A:"hour",\u0434\u0435\u043D\u044C:"d",\u0434\u043D\u044F:"d",\u0434\u043D\u0435\u0439:"d",\u0441\u0443\u0442\u043E\u043A:"d",\u0441\u0443\u0442\u043A\u0438:"d",\u043D\u0435\u0434\u0435\u043B\u044F:"week",\u043D\u0435\u0434\u0435\u043B\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u044E:"week",\u043D\u0435\u0434\u0435\u043B\u044C:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u0435\u043A:"week",\u043C\u0435\u0441\u044F\u0446:"month",\u043C\u0435\u0441\u044F\u0446\u0435:"month",\u043C\u0435\u0441\u044F\u0446\u0435\u0432:"month",\u043C\u0435\u0441\u044F\u0446\u0430:"month",\u043A\u0432\u0430\u0440\u0442\u0430\u043B:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0435:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u043E\u0432:"quarter",\u0433\u043E\u0434:"year",\u0433\u043E\u0434\u0430:"year",\u0433\u043E\u0434\u0443:"year",\u0433\u043E\u0434\u043E\u0432:"year",\u043B\u0435\u0442:"year",\u0433\u043E\u0434\u0438\u043A:"year",\u0433\u043E\u0434\u0438\u043A\u0430:"year",\u0433\u043E\u0434\u0438\u043A\u043E\u0432:"year"};se.NUMBER_PATTERN=`(?:${Ku.matchAnyPattern(se.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|\u043F\u043E\u043B|\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E|\u043F\u0430\u0440(?:\u044B|\u0443)|\\s{0,3})`;function s_(r){let e=r.toLowerCase();return se.INTEGER_WORD_DICTIONARY[e]!==void 0?se.INTEGER_WORD_DICTIONARY[e]:e.match(/несколько/)?3:e.match(/пол/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}se.parseNumberPattern=s_;se.ORDINAL_NUMBER_PATTERN=`(?:${Ku.matchAnyPattern(se.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435|\u043E\u0435)?)`;function GC(r){let e=r.toLowerCase();return se.ORDINAL_WORD_DICTIONARY[e]!==void 0?se.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}se.parseOrdinalNumberPattern=GC;var em="(?:\\s+(?:\u0433\u043E\u0434\u0443|\u0433\u043E\u0434\u0430|\u0433\u043E\u0434|\u0433|\u0433.))?";se.YEAR_PATTERN=`(?:[1-9][0-9]{0,3}${em}\\s*(?:\u043D.\u044D.|\u0434\u043E \u043D.\u044D.|\u043D. \u044D.|\u0434\u043E \u043D. \u044D.)|[1-2][0-9]{3}${em}|[5-9][0-9]${em})`;function YC(r){if(/(год|года|г|г.)/i.test(r)&&(r=r.replace(/(год|года|г|г.)/i,"")),/(до н.э.|до н. э.)/i.test(r))return r=r.replace(/(до н.э.|до н. э.)/i,""),-parseInt(r);if(/(н. э.|н.э.)/i.test(r))return r=r.replace(/(н. э.|н.э.)/i,""),parseInt(r);let e=parseInt(r);return jC.findMostLikelyADYear(e)}se.parseYear=YC;var a_=`(${se.NUMBER_PATTERN})\\s{0,3}(${Ku.matchAnyPattern(se.TIME_UNIT_DICTIONARY)})`,i_=new RegExp(a_,"i");se.TIME_UNITS_PATTERN=Ku.repeatedTimeunitPattern("(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s{0,3})?",a_);function BC(r){let e={},t=r,n=i_.exec(t);for(;n;)HC(e,n),t=t.substring(n[0].length).trim(),n=i_.exec(t);return e}se.parseTimeUnits=BC;function HC(r,e){let t=s_(e[1]),n=se.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var u_=k(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});var oo=Wt(),VC=We(),zC=H(),o_=`(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s*(?:~\\s*)?)?(${oo.TIME_UNITS_PATTERN})${oo.REGEX_PARTS.rightBoundary}`,KC=new RegExp(`(?:\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435|\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0438)\\s*${o_}`,oo.REGEX_PARTS.flags),QC=new RegExp(o_,"i"),tm=class extends zC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return oo.REGEX_PARTS.leftBoundary}innerPattern(e){return e.option.forwardDate?QC:KC}innerExtract(e,t){let n=oo.parseTimeUnits(t[1]);return VC.ParsingComponents.createRelativeFromReference(e.reference,n)}};rm.default=tm});var p_=k(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});var XC=pt(),uo=Wt(),f_=Wt(),Qu=Wt(),ZC=xe(),JC=H(),eA=new RegExp(`(?:\u0441)?\\s*(${Qu.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${Qu.ORDINAL_NUMBER_PATTERN}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${ZC.matchAnyPattern(uo.MONTH_DICTIONARY)})(?:(?:-|\\/|,?\\s{0,3})(${f_.YEAR_PATTERN}(?![^\\s]\\d)))?${uo.REGEX_PARTS.rightBoundary}`,uo.REGEX_PARTS.flags),l_=1,c_=2,tA=3,d_=4,nm=class extends JC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return uo.REGEX_PARTS.leftBoundary}innerPattern(){return eA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=uo.MONTH_DICTIONARY[t[tA].toLowerCase()],s=Qu.parseOrdinalNumberPattern(t[l_]);if(s>31)return t.index=t.index+t[l_].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[d_]){let a=f_.parseYear(t[d_]);n.start.assign("year",a)}else{let a=XC.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[c_]){let a=Qu.parseOrdinalNumberPattern(t[c_]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};im.default=nm});var g_=k(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});var lo=Wt(),rA=pt(),nA=xe(),h_=Wt(),iA=H(),sA=new RegExp(`((?:\u0432)\\s*)?(${nA.matchAnyPattern(lo.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${h_.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,lo.REGEX_PARTS.flags),aA=2,m_=3,sm=class extends iA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return lo.REGEX_PARTS.leftBoundary}innerPattern(){return sA}innerExtract(e,t){let n=t[aA].toLowerCase();if(t[0].length<=3&&!lo.FULL_MONTH_NAME_DICTIONARY[n])return null;let i=e.createParsingResult(t.index,t.index+t[0].length);i.start.imply("day",1);let s=lo.MONTH_DICTIONARY[n];if(i.start.assign("month",s),t[m_]){let a=h_.parseYear(t[m_]);i.start.assign("year",a)}else{let a=rA.findYearClosestToRef(e.refDate,1,s);i.start.imply("year",a)}return i}};am.default=sm});var b_=k(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var Xu=et(),oA=vi(),y_=Wt(),om=class extends oA.AbstractTimeExpressionParser{constructor(e){super(e)}patternFlags(){return y_.REGEX_PARTS.flags}primaryPatternLeftBoundary(){return"(^|\\s|T|(?:[^\\p{L}\\p{N}_]))"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|\u0434\u043E|\u0438|\u043F\u043E|\\?)\\s*"}primaryPrefix(){return"(?:(?:\u0432|\u0441)\\s*)??"}primarySuffix(){return`(?:\\s*(?:\u0443\u0442\u0440\u0430|\u0432\u0435\u0447\u0435\u0440\u0430|\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F))?(?!\\/)${y_.REGEX_PARTS.rightBoundary}`}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("\u0432\u0435\u0447\u0435\u0440\u0430")){let i=n.get("hour");i>=6&&i<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",Xu.Meridiem.PM)):i<6&&n.assign("meridiem",Xu.Meridiem.AM)}if(t[0].endsWith("\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F")){n.assign("meridiem",Xu.Meridiem.PM);let i=n.get("hour");i>=0&&i<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("\u0443\u0442\u0440\u0430")&&(n.assign("meridiem",Xu.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};um.default=om});var T_=k(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});var Zu=Wt(),uA=We(),lA=H(),cA=dr(),dA=new RegExp(`(${Zu.TIME_UNITS_PATTERN})\\s{0,5}\u043D\u0430\u0437\u0430\u0434(?=(?:\\W|$))`,Zu.REGEX_PARTS.flags),lm=class extends lA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Zu.REGEX_PARTS.leftBoundary}innerPattern(){return dA}innerExtract(e,t){let n=Zu.parseTimeUnits(t[1]),i=cA.reverseTimeUnits(n);return uA.ParsingComponents.createRelativeFromReference(e.reference,i)}};cm.default=lm});var __=k(co=>{"use strict";var fA=co&&co.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(co,"__esModule",{value:!0});var pA=fA(zr()),dm=class extends pA.default{patternBetween(){return/^\s*(и до|и по|до|по|-)\s*$/i}};co.default=dm});var v_=k(fo=>{"use strict";var mA=fo&&fo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fo,"__esModule",{value:!0});var hA=mA(mn()),fm=class extends hA.default{patternBetween(){return new RegExp("^\\s*(T|\u0432|,|-)?\\s*$")}};fo.default=fm});var w_=k(wn=>{"use strict";var gA=wn&&wn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),yA=wn&&wn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),bA=wn&&wn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&gA(e,r,t);return yA(e,r),e};Object.defineProperty(wn,"__esModule",{value:!0});var TA=H(),po=bA(yn()),pm=Wt(),_A=new RegExp(`(?:\u0441|\u0441\u043E)?\\s*(\u0441\u0435\u0433\u043E\u0434\u043D\u044F|\u0432\u0447\u0435\u0440\u0430|\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430)${pm.REGEX_PARTS.rightBoundary}`,pm.REGEX_PARTS.flags),mm=class extends TA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return pm.REGEX_PARTS.leftBoundary}innerPattern(e){return _A}innerExtract(e,t){let n=t[1].toLowerCase(),i=e.createParsingComponents();switch(n){case"\u0441\u0435\u0433\u043E\u0434\u043D\u044F":return po.today(e.reference);case"\u0432\u0447\u0435\u0440\u0430":return po.yesterday(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return po.tomorrow(e.reference);case"\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return po.theDayAfter(e.reference,2);case"\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return po.theDayBefore(e.reference,2)}return i}};wn.default=mm});var k_=k(Ar=>{"use strict";var vA=Ar&&Ar.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),wA=Ar&&Ar.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),kA=Ar&&Ar.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&vA(e,r,t);return wA(e,r),e},EA=Ar&&Ar.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ar,"__esModule",{value:!0});var SA=H(),Ri=kA(yn()),OA=cr(),DA=EA(_e()),hm=Wt(),xA=new RegExp(`(\u0441\u0435\u0439\u0447\u0430\u0441|\u043F\u0440\u043E\u0448\u043B\u044B\u043C\\s*\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u043F\u0440\u043E\u0448\u043B\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u0435\u0433\u043E\u0434\u043D\u044F\\s*\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u0438\u043C \u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u0434\u0435\u043D\u044C|\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u0432\u0435\u0447\u0435\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u043D\u043E\u0447\u044C)${hm.REGEX_PARTS.rightBoundary}`,hm.REGEX_PARTS.flags),gm=class extends SA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return hm.REGEX_PARTS.leftBoundary}innerPattern(){return xA}innerExtract(e,t){let n=DA.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();if(i==="\u0441\u0435\u0439\u0447\u0430\u0441")return Ri.now(e.reference);if(i==="\u0432\u0435\u0447\u0435\u0440\u043E\u043C"||i==="\u0432\u0435\u0447\u0435\u0440\u0430")return Ri.evening(e.reference);if(i.endsWith("\u0443\u0442\u0440\u043E\u043C")||i.endsWith("\u0443\u0442\u0440\u0430"))return Ri.morning(e.reference);if(i.match(/в\s*полдень/))return Ri.noon(e.reference);if(i.match(/прошлой\s*ночью/))return Ri.lastNight(e.reference);if(i.match(/прошлым\s*вечером/))return Ri.yesterdayEvening(e.reference);if(i.match(/следующей\s*ночью/)){let a=n.hour()<22?1:2;n=n.add(a,"day"),OA.assignSimilarDate(s,n),s.imply("hour",0)}return i.match(/в\s*полночь/)||i.endsWith("\u043D\u043E\u0447\u044C\u044E")?Ri.midnight(e.reference):s}};Ar.default=gm});var E_=k(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});var mo=Wt(),RA=xe(),MA=H(),CA=ki(),AA=new RegExp(`(?:(?:,|\\(|\uFF08)\\s*)?(?:\u0432\\s*?)?(?:(\u044D\u0442\u0443|\u044D\u0442\u043E\u0442|\u043F\u0440\u043E\u0448\u043B\u044B\u0439|\u043F\u0440\u043E\u0448\u043B\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E)\\s*)?(${RA.matchAnyPattern(mo.WEEKDAY_DICTIONARY)})(?:\\s*(?:,|\\)|\uFF09))?(?:\\s*\u043D\u0430\\s*(\u044D\u0442\u043E\u0439|\u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439)\\s*\u043D\u0435\u0434\u0435\u043B\u0435)?${mo.REGEX_PARTS.rightBoundary}`,mo.REGEX_PARTS.flags),PA=1,NA=2,IA=3,ym=class extends MA.AbstractParserWithWordBoundaryChecking{innerPattern(){return AA}patternLeftBoundary(){return mo.REGEX_PARTS.leftBoundary}innerExtract(e,t){let n=t[NA].toLowerCase(),i=mo.WEEKDAY_DICTIONARY[n],s=t[PA],a=t[IA],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="\u043F\u0440\u043E\u0448\u043B\u044B\u0439"||o=="\u043F\u0440\u043E\u0448\u043B\u0443\u044E"||o=="\u043F\u0440\u043E\u0448\u043B\u043E\u0439"?u="last":o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E"?u="next":(o=="\u044D\u0442\u043E\u0442"||o=="\u044D\u0442\u0443"||o=="\u044D\u0442\u043E\u0439")&&(u="this");let l=CA.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};bm.default=ym});var O_=k(go=>{"use strict";var FA=go&&go.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(go,"__esModule",{value:!0});var ho=Wt(),S_=We(),LA=FA(_e()),UA=H(),qA=xe(),WA=new RegExp(`(\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C|\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439|\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C|\u043D\u0430 \u044D\u0442\u043E\u0439|\u0432 \u044D\u0442\u043E\u043C)\\s*(${qA.matchAnyPattern(ho.TIME_UNIT_DICTIONARY)})(?=\\s*)${ho.REGEX_PARTS.rightBoundary}`,ho.REGEX_PARTS.flags),$A=1,jA=2,Tm=class extends UA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return ho.REGEX_PARTS.leftBoundary}innerPattern(){return WA}innerExtract(e,t){let n=t[$A].toLowerCase(),i=t[jA].toLowerCase(),s=ho.TIME_UNIT_DICTIONARY[i];if(n=="\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||n=="\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C"){let u={};return u[s]=1,S_.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C"||n=="\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439"){let u={};return u[s]=-1,S_.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=LA.default(e.reference.instant);return s.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):s.match(/month/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):s.match(/year/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};go.default=Tm});var D_=k(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});var yo=Wt(),GA=We(),YA=H(),BA=dr(),HA=new RegExp(`(\u044D\u0442\u0438|\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435|\u043F\u0440\u043E\u0448\u043B\u044B\u0435|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0435|\u043F\u043E\u0441\u043B\u0435|\u0447\u0435\u0440\u0435\u0437|\\+|-)\\s*(${yo.TIME_UNITS_PATTERN})${yo.REGEX_PARTS.rightBoundary}`,yo.REGEX_PARTS.flags),_m=class extends YA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return yo.REGEX_PARTS.leftBoundary}innerPattern(){return HA}innerExtract(e,t){let n=t[1].toLowerCase(),i=yo.parseTimeUnits(t[2]);switch(n){case"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435":case"\u043F\u0440\u043E\u0448\u043B\u044B\u0435":case"-":i=BA.reverseTimeUnits(i);break}return GA.ParsingComponents.createRelativeFromReference(e.reference,i)}};vm.default=_m});var M_=k(ct=>{"use strict";var Kt=ct&&ct.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ct,"__esModule",{value:!0});ct.createConfiguration=ct.createCasualConfiguration=ct.parseDate=ct.parse=ct.strict=ct.casual=void 0;var VA=Kt(u_()),zA=Kt(p_()),KA=Kt(g_()),QA=Kt(b_()),XA=Kt(T_()),ZA=Kt(__()),JA=Kt(v_()),eP=hn(),tP=Kt(w_()),rP=Kt(k_()),nP=Kt(E_()),iP=Kt(O_()),x_=Dr(),sP=Kt(Ei()),aP=Kt(D_());ct.casual=new x_.Chrono(R_());ct.strict=new x_.Chrono(wm(!0));function oP(r,e,t){return ct.casual.parse(r,e,t)}ct.parse=oP;function uP(r,e,t){return ct.casual.parseDate(r,e,t)}ct.parseDate=uP;function R_(){let r=wm(!1);return r.parsers.unshift(new tP.default),r.parsers.unshift(new rP.default),r.parsers.unshift(new KA.default),r.parsers.unshift(new iP.default),r.parsers.unshift(new aP.default),r}ct.createCasualConfiguration=R_;function wm(r=!0){return eP.includeCommonConfiguration({parsers:[new sP.default(!0),new VA.default,new zA.default,new nP.default,new QA.default(r),new XA.default],refiners:[new JA.default,new ZA.default]},r)}ct.createConfiguration=wm});var et=k(ce=>{"use strict";var lP=ce&&ce.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),cP=ce&&ce.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Zn=ce&&ce.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&lP(e,r,t);return cP(e,r),e};Object.defineProperty(ce,"__esModule",{value:!0});ce.parseDate=ce.parse=ce.casual=ce.strict=ce.ru=ce.zh=ce.nl=ce.pt=ce.ja=ce.fr=ce.de=ce.Meridiem=ce.Chrono=ce.en=void 0;var km=Zn(qd());ce.en=km;var dP=Dr();Object.defineProperty(ce,"Chrono",{enumerable:!0,get:function(){return dP.Chrono}});var fP;(function(r){r[r.AM=0]="AM",r[r.PM=1]="PM"})(fP=ce.Meridiem||(ce.Meridiem={}));var pP=Zn(qy());ce.de=pP;var mP=Zn(mb());ce.fr=mP;var hP=Zn(kb());ce.ja=hP;var gP=Zn(qb());ce.pt=gP;var yP=Zn(kT());ce.nl=yP;var bP=Zn(n_());ce.zh=bP;var TP=Zn(M_());ce.ru=TP;ce.strict=km.strict;ce.casual=km.casual;function _P(r,e,t){return ce.casual.parse(r,e,t)}ce.parse=_P;function vP(r,e,t){return ce.casual.parseDate(r,e,t)}ce.parseDate=vP});var Ov=k((Ev,Sv)=>{(function(r){var e=Object.hasOwnProperty,t=Array.isArray?Array.isArray:function(h){return Object.prototype.toString.call(h)==="[object Array]"},n=10,i=typeof process=="object"&&typeof process.nextTick=="function",s=typeof Symbol=="function",a=typeof Reflect=="object",o=typeof setImmediate=="function",u=o?setImmediate:setTimeout,l=s?a&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(f){var h=Object.getOwnPropertyNames(f);return h.push.apply(h,Object.getOwnPropertySymbols(f)),h}:Object.keys;function c(){this._events={},this._conf&&d.call(this,this._conf)}function d(f){f&&(this._conf=f,f.delimiter&&(this.delimiter=f.delimiter),f.maxListeners!==r&&(this._maxListeners=f.maxListeners),f.wildcard&&(this.wildcard=f.wildcard),f.newListener&&(this._newListener=f.newListener),f.removeListener&&(this._removeListener=f.removeListener),f.verboseMemoryLeak&&(this.verboseMemoryLeak=f.verboseMemoryLeak),f.ignoreErrors&&(this.ignoreErrors=f.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function m(f,h){var g="(node) warning: possible EventEmitter memory leak detected. "+f+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(g+=" Event name: "+h+"."),typeof process!="undefined"&&process.emitWarning){var b=new Error(g);b.name="MaxListenersExceededWarning",b.emitter=this,b.count=f,process.emitWarning(b)}else console.error(g),console.trace&&console.trace()}var p=function(f,h,g){var b=arguments.length;switch(b){case 0:return[];case 1:return[f];case 2:return[f,h];case 3:return[f,h,g];default:for(var w=new Array(b);b--;)w[b]=arguments[b];return w}};function T(f,h){for(var g={},b,w=f.length,S=h?h.length:0,M=0;M<w;M++)b=f[M],g[b]=M<S?h[M]:r;return g}function y(f,h,g){this._emitter=f,this._target=h,this._listeners={},this._listenersCount=0;var b,w;if((g.on||g.off)&&(b=g.on,w=g.off),h.addEventListener?(b=h.addEventListener,w=h.removeEventListener):h.addListener?(b=h.addListener,w=h.removeListener):h.on&&(b=h.on,w=h.off),!b&&!w)throw Error("target does not implement any known event API");if(typeof b!="function")throw TypeError("on method must be a function");if(typeof w!="function")throw TypeError("off method must be a function");this._on=b,this._off=w;var S=f._observers;S?S.push(this):f._observers=[this]}Object.assign(y.prototype,{subscribe:function(f,h,g){var b=this,w=this._target,S=this._emitter,M=this._listeners,P=function(){var _=p.apply(null,arguments),D={data:_,name:h,original:f};if(g){var I=g.call(w,D);I!==!1&&S.emit.apply(S,[D.name].concat(_));return}S.emit.apply(S,[h].concat(_))};if(M[f])throw Error("Event '"+f+"' is already listening");this._listenersCount++,S._newListener&&S._removeListener&&!b._onNewListener?(this._onNewListener=function(_){_===h&&M[f]===null&&(M[f]=P,b._on.call(w,f,P))},S.on("newListener",this._onNewListener),this._onRemoveListener=function(_){_===h&&!S.hasListeners(_)&&M[f]&&(M[f]=null,b._off.call(w,f,P))},M[f]=null,S.on("removeListener",this._onRemoveListener)):(M[f]=P,b._on.call(w,f,P))},unsubscribe:function(f){var h=this,g=this._listeners,b=this._emitter,w,S,M=this._off,P=this._target,_;if(f&&typeof f!="string")throw TypeError("event must be a string");function D(){h._onNewListener&&(b.off("newListener",h._onNewListener),b.off("removeListener",h._onRemoveListener),h._onNewListener=null,h._onRemoveListener=null);var I=ee.call(b,h);b._observers.splice(I,1)}if(f){if(w=g[f],!w)return;M.call(P,f,w),delete g[f],--this._listenersCount||D()}else{for(S=l(g),_=S.length;_-- >0;)f=S[_],M.call(P,f,g[f]);this._listeners={},this._listenersCount=0,D()}}});function E(f,h,g,b){var w=Object.assign({},h);if(!f)return w;if(typeof f!="object")throw TypeError("options must be an object");var S=Object.keys(f),M=S.length,P,_,D;function I(ae){throw Error('Invalid "'+P+'" option value'+(ae?". Reason: "+ae:""))}for(var me=0;me<M;me++){if(P=S[me],!b&&!e.call(h,P))throw Error('Unknown "'+P+'" option');_=f[P],_!==r&&(D=g[P],w[P]=D?D(_,I):_)}return w}function R(f,h){return(typeof f!="function"||!f.hasOwnProperty("prototype"))&&h("value must be a constructor"),f}function x(f){var h="value must be type of "+f.join("|"),g=f.length,b=f[0],w=f[1];return g===1?function(S,M){if(typeof S===b)return S;M(h)}:g===2?function(S,M){var P=typeof S;if(P===b||P===w)return S;M(h)}:function(S,M){for(var P=typeof S,_=g;_-- >0;)if(P===f[_])return S;M(h)}}var v=x(["function"]),V=x(["object","function"]);function j(f,h,g){var b,w,S=0,M,P=new f(function(_,D,I){g=E(g,{timeout:0,overload:!1},{timeout:function(Se,qe){return Se*=1,(typeof Se!="number"||Se<0||!Number.isFinite(Se))&&qe("timeout must be a positive number"),Se}}),b=!g.overload&&typeof f.prototype.cancel=="function"&&typeof I=="function";function me(){w&&(w=null),S&&(clearTimeout(S),S=0)}var ae=function(Se){me(),_(Se)},le=function(Se){me(),D(Se)};b?h(ae,le,I):(w=[function(Se){le(Se||Error("canceled"))}],h(ae,le,function(Se){if(M)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof Se!="function")throw TypeError("onCancel callback must be a function");w.push(Se)}),M=!0),g.timeout>0&&(S=setTimeout(function(){var Se=Error("timeout");Se.code="ETIMEDOUT",S=0,P.cancel(Se),D(Se)},g.timeout))});return b||(P.cancel=function(_){if(!!w){for(var D=w.length,I=1;I<D;I++)w[I](_);w[0](_),w=null}}),P}function ee(f){var h=this._observers;if(!h)return-1;for(var g=h.length,b=0;b<g;b++)if(h[b]._target===f)return b;return-1}function Y(f,h,g,b,w){if(!g)return null;if(b===0){var S=typeof h;if(S==="string"){var M,P,_=0,D=0,I=this.delimiter,me=I.length;if((P=h.indexOf(I))!==-1){M=new Array(5);do M[_++]=h.slice(D,P),D=P+me;while((P=h.indexOf(I,D))!==-1);M[_++]=h.slice(D),h=M,w=_}else h=[h],w=1}else S==="object"?w=h.length:(h=[h],w=1)}var ae=null,le,Se,qe,jn,Tt,ur=h[b],Gn=h[b+1],Ft,Qe;if(b===w)g._listeners&&(typeof g._listeners=="function"?(f&&f.push(g._listeners),ae=[g]):(f&&f.push.apply(f,g._listeners),ae=[g]));else if(ur==="*"){for(Ft=l(g),P=Ft.length;P-- >0;)le=Ft[P],le!=="_listeners"&&(Qe=Y(f,h,g[le],b+1,w),Qe&&(ae?ae.push.apply(ae,Qe):ae=Qe));return ae}else if(ur==="**"){for(Tt=b+1===w||b+2===w&&Gn==="*",Tt&&g._listeners&&(ae=Y(f,h,g,w,w)),Ft=l(g),P=Ft.length;P-- >0;)le=Ft[P],le!=="_listeners"&&(le==="*"||le==="**"?(g[le]._listeners&&!Tt&&(Qe=Y(f,h,g[le],w,w),Qe&&(ae?ae.push.apply(ae,Qe):ae=Qe)),Qe=Y(f,h,g[le],b,w)):le===Gn?Qe=Y(f,h,g[le],b+2,w):Qe=Y(f,h,g[le],b,w),Qe&&(ae?ae.push.apply(ae,Qe):ae=Qe));return ae}else g[ur]&&(ae=Y(f,h,g[ur],b+1,w));if(Se=g["*"],Se&&Y(f,h,Se,b+1,w),qe=g["**"],qe)if(b<w)for(qe._listeners&&Y(f,h,qe,w,w),Ft=l(qe),P=Ft.length;P-- >0;)le=Ft[P],le!=="_listeners"&&(le===Gn?Y(f,h,qe[le],b+2,w):le===ur?Y(f,h,qe[le],b+1,w):(jn={},jn[le]=qe[le],Y(f,h,{"**":jn},b+1,w)));else qe._listeners?Y(f,h,qe,w,w):qe["*"]&&qe["*"]._listeners&&Y(f,h,qe["*"],w,w);return ae}function W(f,h,g){var b=0,w=0,S,M=this.delimiter,P=M.length,_;if(typeof f=="string")if((S=f.indexOf(M))!==-1){_=new Array(5);do _[b++]=f.slice(w,S),w=S+P;while((S=f.indexOf(M,w))!==-1);_[b++]=f.slice(w)}else _=[f],b=1;else _=f,b=f.length;if(b>1){for(S=0;S+1<b;S++)if(_[S]==="**"&&_[S+1]==="**")return}var D=this.listenerTree,I;for(S=0;S<b;S++)if(I=_[S],D=D[I]||(D[I]={}),S===b-1)return D._listeners?(typeof D._listeners=="function"&&(D._listeners=[D._listeners]),g?D._listeners.unshift(h):D._listeners.push(h),!D._listeners.warned&&this._maxListeners>0&&D._listeners.length>this._maxListeners&&(D._listeners.warned=!0,m.call(this,D._listeners.length,I))):D._listeners=h,!0;return!0}function de(f,h,g,b){for(var w=l(f),S=w.length,M,P,_,D=f._listeners,I;S-- >0;)P=w[S],M=f[P],P==="_listeners"?_=g:_=g?g.concat(P):[P],I=b||typeof P=="symbol",D&&h.push(I?_:_.join(this.delimiter)),typeof M=="object"&&de.call(this,M,h,_,I);return h}function Te(f){for(var h=l(f),g=h.length,b,w,S;g-- >0;)w=h[g],b=f[w],b&&(S=!0,w!=="_listeners"&&!Te(b)&&delete f[w]);return S}function G(f,h,g){this.emitter=f,this.event=h,this.listener=g}G.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function N(f,h,g){if(g===!0)w=!0;else if(g===!1)b=!0;else{if(!g||typeof g!="object")throw TypeError("options should be an object or true");var b=g.async,w=g.promisify,S=g.nextTick,M=g.objectify}if(b||S||w){var P=h,_=h._origin||h;if(S&&!i)throw Error("process.nextTick is not supported");w===r&&(w=h.constructor.name==="AsyncFunction"),h=function(){var D=arguments,I=this,me=this.event;return w?S?Promise.resolve():new Promise(function(ae){u(ae)}).then(function(){return I.event=me,P.apply(I,D)}):(S?process.nextTick:u)(function(){I.event=me,P.apply(I,D)})},h._async=!0,h._origin=_}return[h,M?new G(this,f,h):this]}function O(f){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,d.call(this,f)}O.EventEmitter2=O,O.prototype.listenTo=function(f,h,g){if(typeof f!="object")throw TypeError("target musts be an object");var b=this;g=E(g,{on:r,off:r,reducers:r},{on:v,off:v,reducers:V});function w(S){if(typeof S!="object")throw TypeError("events must be an object");var M=g.reducers,P=ee.call(b,f),_;P===-1?_=new y(b,f,g):_=b._observers[P];for(var D=l(S),I=D.length,me,ae=typeof M=="function",le=0;le<I;le++)me=D[le],_.subscribe(me,S[me]||me,ae?M:M&&M[me])}return t(h)?w(T(h)):w(typeof h=="string"?T(h.split(/\s+/)):h),this},O.prototype.stopListeningTo=function(f,h){var g=this._observers;if(!g)return!1;var b=g.length,w,S=!1;if(f&&typeof f!="object")throw TypeError("target should be an object");for(;b-- >0;)w=g[b],(!f||w._target===f)&&(w.unsubscribe(h),S=!0);return S},O.prototype.delimiter=".",O.prototype.setMaxListeners=function(f){f!==r&&(this._maxListeners=f,this._conf||(this._conf={}),this._conf.maxListeners=f)},O.prototype.getMaxListeners=function(){return this._maxListeners},O.prototype.event="",O.prototype.once=function(f,h,g){return this._once(f,h,!1,g)},O.prototype.prependOnceListener=function(f,h,g){return this._once(f,h,!0,g)},O.prototype._once=function(f,h,g,b){return this._many(f,1,h,g,b)},O.prototype.many=function(f,h,g,b){return this._many(f,h,g,!1,b)},O.prototype.prependMany=function(f,h,g,b){return this._many(f,h,g,!0,b)},O.prototype._many=function(f,h,g,b,w){var S=this;if(typeof g!="function")throw new Error("many only accepts instances of Function");function M(){return--h===0&&S.off(f,M),g.apply(this,arguments)}return M._origin=g,this._on(f,M,b,w)},O.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||c.call(this);var f=arguments[0],h,g=this.wildcard,b,w,S,M,P;if(f==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(g&&(h=f,f!=="newListener"&&f!=="removeListener"&&typeof f=="object")){if(w=f.length,s){for(S=0;S<w;S++)if(typeof f[S]=="symbol"){P=!0;break}}P||(f=f.join(this.delimiter))}var _=arguments.length,D;if(this._all&&this._all.length)for(D=this._all.slice(),S=0,w=D.length;S<w;S++)switch(this.event=f,_){case 1:D[S].call(this,f);break;case 2:D[S].call(this,f,arguments[1]);break;case 3:D[S].call(this,f,arguments[1],arguments[2]);break;default:D[S].apply(this,arguments)}if(g)D=[],Y.call(this,D,h,this.listenerTree,0,w);else if(D=this._events[f],typeof D=="function"){switch(this.event=f,_){case 1:D.call(this);break;case 2:D.call(this,arguments[1]);break;case 3:D.call(this,arguments[1],arguments[2]);break;default:for(b=new Array(_-1),M=1;M<_;M++)b[M-1]=arguments[M];D.apply(this,b)}return!0}else D&&(D=D.slice());if(D&&D.length){if(_>3)for(b=new Array(_-1),M=1;M<_;M++)b[M-1]=arguments[M];for(S=0,w=D.length;S<w;S++)switch(this.event=f,_){case 1:D[S].call(this);break;case 2:D[S].call(this,arguments[1]);break;case 3:D[S].call(this,arguments[1],arguments[2]);break;default:D[S].apply(this,b)}return!0}else if(!this.ignoreErrors&&!this._all&&f==="error")throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");return!!this._all},O.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||c.call(this);var f=arguments[0],h=this.wildcard,g,b,w,S,M,P;if(f==="newListener"&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(h&&(g=f,f!=="newListener"&&f!=="removeListener"&&typeof f=="object")){if(S=f.length,s){for(M=0;M<S;M++)if(typeof f[M]=="symbol"){b=!0;break}}b||(f=f.join(this.delimiter))}var _=[],D=arguments.length,I;if(this._all)for(M=0,S=this._all.length;M<S;M++)switch(this.event=f,D){case 1:_.push(this._all[M].call(this,f));break;case 2:_.push(this._all[M].call(this,f,arguments[1]));break;case 3:_.push(this._all[M].call(this,f,arguments[1],arguments[2]));break;default:_.push(this._all[M].apply(this,arguments))}if(h?(I=[],Y.call(this,I,g,this.listenerTree,0)):I=this._events[f],typeof I=="function")switch(this.event=f,D){case 1:_.push(I.call(this));break;case 2:_.push(I.call(this,arguments[1]));break;case 3:_.push(I.call(this,arguments[1],arguments[2]));break;default:for(w=new Array(D-1),P=1;P<D;P++)w[P-1]=arguments[P];_.push(I.apply(this,w))}else if(I&&I.length){if(I=I.slice(),D>3)for(w=new Array(D-1),P=1;P<D;P++)w[P-1]=arguments[P];for(M=0,S=I.length;M<S;M++)switch(this.event=f,D){case 1:_.push(I[M].call(this));break;case 2:_.push(I[M].call(this,arguments[1]));break;case 3:_.push(I[M].call(this,arguments[1],arguments[2]));break;default:_.push(I[M].apply(this,w))}}else if(!this.ignoreErrors&&!this._all&&f==="error")return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");return Promise.all(_)},O.prototype.on=function(f,h,g){return this._on(f,h,!1,g)},O.prototype.prependListener=function(f,h,g){return this._on(f,h,!0,g)},O.prototype.onAny=function(f){return this._onAny(f,!1)},O.prototype.prependAny=function(f){return this._onAny(f,!0)},O.prototype.addListener=O.prototype.on,O.prototype._onAny=function(f,h){if(typeof f!="function")throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),h?this._all.unshift(f):this._all.push(f),this},O.prototype._on=function(f,h,g,b){if(typeof f=="function")return this._onAny(f,h),this;if(typeof h!="function")throw new Error("on only accepts instances of Function");this._events||c.call(this);var w=this,S;return b!==r&&(S=N.call(this,f,h,b),h=S[0],w=S[1]),this._newListener&&this.emit("newListener",f,h),this.wildcard?(W.call(this,f,h,g),w):(this._events[f]?(typeof this._events[f]=="function"&&(this._events[f]=[this._events[f]]),g?this._events[f].unshift(h):this._events[f].push(h),!this._events[f].warned&&this._maxListeners>0&&this._events[f].length>this._maxListeners&&(this._events[f].warned=!0,m.call(this,this._events[f].length,f))):this._events[f]=h,w)},O.prototype.off=function(f,h){if(typeof h!="function")throw new Error("removeListener only takes instances of Function");var g,b=[];if(this.wildcard){var w=typeof f=="string"?f.split(this.delimiter):f.slice();if(b=Y.call(this,null,w,this.listenerTree,0),!b)return this}else{if(!this._events[f])return this;g=this._events[f],b.push({_listeners:g})}for(var S=0;S<b.length;S++){var M=b[S];if(g=M._listeners,t(g)){for(var P=-1,_=0,D=g.length;_<D;_++)if(g[_]===h||g[_].listener&&g[_].listener===h||g[_]._origin&&g[_]._origin===h){P=_;break}if(P<0)continue;return this.wildcard?M._listeners.splice(P,1):this._events[f].splice(P,1),g.length===0&&(this.wildcard?delete M._listeners:delete this._events[f]),this._removeListener&&this.emit("removeListener",f,h),this}else(g===h||g.listener&&g.listener===h||g._origin&&g._origin===h)&&(this.wildcard?delete M._listeners:delete this._events[f],this._removeListener&&this.emit("removeListener",f,h))}return this.listenerTree&&Te(this.listenerTree),this},O.prototype.offAny=function(f){var h=0,g=0,b;if(f&&this._all&&this._all.length>0){for(b=this._all,h=0,g=b.length;h<g;h++)if(f===b[h])return b.splice(h,1),this._removeListener&&this.emit("removeListenerAny",f),this}else{if(b=this._all,this._removeListener)for(h=0,g=b.length;h<g;h++)this.emit("removeListenerAny",b[h]);this._all=[]}return this},O.prototype.removeListener=O.prototype.off,O.prototype.removeAllListeners=function(f){if(f===r)return!this._events||c.call(this),this;if(this.wildcard){var h=Y.call(this,null,f,this.listenerTree,0),g,b;if(!h)return this;for(b=0;b<h.length;b++)g=h[b],g._listeners=null;this.listenerTree&&Te(this.listenerTree)}else this._events&&(this._events[f]=null);return this},O.prototype.listeners=function(f){var h=this._events,g,b,w,S,M;if(f===r){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!h)return[];for(g=l(h),S=g.length,w=[];S-- >0;)b=h[g[S]],typeof b=="function"?w.push(b):w.push.apply(w,b);return w}else{if(this.wildcard){if(M=this.listenerTree,!M)return[];var P=[],_=typeof f=="string"?f.split(this.delimiter):f.slice();return Y.call(this,P,_,M,0),P}return h?(b=h[f],b?typeof b=="function"?[b]:b:[]):[]}},O.prototype.eventNames=function(f){var h=this._events;return this.wildcard?de.call(this,this.listenerTree,[],null,f):h?l(h):[]},O.prototype.listenerCount=function(f){return this.listeners(f).length},O.prototype.hasListeners=function(f){if(this.wildcard){var h=[],g=typeof f=="string"?f.split(this.delimiter):f.slice();return Y.call(this,h,g,this.listenerTree,0),h.length>0}var b=this._events,w=this._all;return!!(w&&w.length||b&&(f===r?l(b).length:b[f]))},O.prototype.listenersAny=function(){return this._all?this._all:[]},O.prototype.waitFor=function(f,h){var g=this,b=typeof h;return b==="number"?h={timeout:h}:b==="function"&&(h={filter:h}),h=E(h,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:v,Promise:R}),j(h.Promise,function(w,S,M){function P(){var _=h.filter;if(!(_&&!_.apply(g,arguments)))if(g.off(f,P),h.handleError){var D=arguments[0];D?S(D):w(p.apply(null,arguments).slice(1))}else w(p.apply(null,arguments))}M(function(){g.off(f,P)}),g._on(f,P,!1)},{timeout:h.timeout,overload:h.overload})};function B(f,h,g){g=E(g,{Promise,timeout:0,overload:!1},{Promise:R});var b=g.Promise;return j(b,function(w,S,M){var P;if(typeof f.addEventListener=="function"){P=function(){w(p.apply(null,arguments))},M(function(){f.removeEventListener(h,P)}),f.addEventListener(h,P,{once:!0});return}var _=function(){D&&f.removeListener("error",D),w(p.apply(null,arguments))},D;h!=="error"&&(D=function(I){f.removeListener(h,_),S(I)},f.once("error",D)),M(function(){D&&f.removeListener("error",D),f.removeListener(h,_)}),f.once(h,_)},{timeout:g.timeout,overload:g.overload})}var U=O.prototype;if(Object.defineProperties(O,{defaultMaxListeners:{get:function(){return U._maxListeners},set:function(f){if(typeof f!="number"||f<0||Number.isNaN(f))throw TypeError("n must be a non-negative number");U._maxListeners=f},enumerable:!0},once:{value:B,writable:!0,configurable:!0}}),Object.defineProperties(U,{_maxListeners:{value:n,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define=="function"&&define.amd)define(function(){return O});else if(typeof Ev=="object")Sv.exports=O;else{var Q=new Function("","return this")();Q.EventEmitter2=O}})()});var Pw=k(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});var Cw=Symbol("MustacheDataPath");function Mw({target:r,propertyName:e}){return[...r[Cw]||[],e]}function Aw(r,e){return typeof r!="object"?r:new Proxy(r,{get(t,n){let i=t[n];if(i===void 0&&!(n in t)){let s=Mw({target:t,propertyName:n});if(e!=null&&e.handleError)return e.handleError(s),i;throw Error(`Missing Mustache data property: ${s.join(" > ")}`)}return i&&typeof i=="object"?(i[Cw]=Mw({target:t,propertyName:n}),Aw(i,e)):i}})}_h.default=Aw});var un=k($r=>{"use strict";$r.__esModule=!0;$r.Tokens=$r.StructuralCharacters=$r.Operators=void 0;var CI;(function(r){r.AND="AND",r.OR="OR",r.XOR="XOR",r.NOT="NOT"})(CI=$r.Operators||($r.Operators={}));var AI;(function(r){r.OPEN_PARENTHESIS="(",r.CLOSE_PARENTHESIS=")"})(AI=$r.StructuralCharacters||($r.StructuralCharacters={}));var PI;(function(r){r.IDENTIFIER="IDENTIFIER",r.OPERATOR="OPERATOR",r.STRUCTURAL_CHARACTER="STRUCTURAL_CHARACTER",r.EOF="EOF",r.COMMENT="COMMENT"})(PI=$r.Tokens||($r.Tokens={}))});var Dh=k(Qs=>{"use strict";Qs.__esModule=!0;Qs.VALID_TOKENS=Qs.OPERATOR_PRECEDENCE=void 0;var $e=un();Qs.OPERATOR_PRECEDENCE={NOT:0,XOR:1,AND:2,OR:3};Qs.VALID_TOKENS={identifierOnly:[{name:$e.Tokens.IDENTIFIER},{name:$e.Tokens.STRUCTURAL_CHARACTER,value:$e.StructuralCharacters.OPEN_PARENTHESIS}],identifierOrNot:[{name:$e.Tokens.IDENTIFIER},{name:$e.Tokens.STRUCTURAL_CHARACTER,value:$e.StructuralCharacters.OPEN_PARENTHESIS},{name:$e.Tokens.OPERATOR,value:$e.Operators.NOT}],binaryOperator:[{name:$e.Tokens.OPERATOR,value:$e.Operators.AND},{name:$e.Tokens.OPERATOR,value:$e.Operators.OR},{name:$e.Tokens.OPERATOR,value:$e.Operators.XOR}],binaryOperatorOrClose:[{name:$e.Tokens.OPERATOR,value:$e.Operators.AND},{name:$e.Tokens.OPERATOR,value:$e.Operators.OR},{name:$e.Tokens.OPERATOR,value:$e.Operators.XOR},{name:$e.Tokens.STRUCTURAL_CHARACTER,value:$e.StructuralCharacters.CLOSE_PARENTHESIS}]}});var xh=k(Ot=>{"use strict";Ot.__esModule=!0;Ot.ESCAPE_CHARACTER=Ot.EOL=Ot.COMMENT_DELIMITER=Ot.QUOTED_IDENTIFIER_DELIMITER=Ot.SEPARATORS=Ot.OPERATORS=Ot.STRUCTURAL_CHARACTERS=void 0;var Xs=un();Ot.STRUCTURAL_CHARACTERS={"(":Xs.StructuralCharacters.OPEN_PARENTHESIS,")":Xs.StructuralCharacters.CLOSE_PARENTHESIS};Ot.OPERATORS={AND:Xs.Operators.AND,OR:Xs.Operators.OR,XOR:Xs.Operators.XOR,NOT:Xs.Operators.NOT};Ot.SEPARATORS=new Set([32,9,10,13].map(function(r){return String.fromCodePoint(r)}));Ot.QUOTED_IDENTIFIER_DELIMITER=String.fromCodePoint(34);Ot.COMMENT_DELIMITER=String.fromCodePoint(35);Ot.EOL=String.fromCodePoint(10);Ot.ESCAPE_CHARACTER=String.fromCodePoint(92)});var qw=k(kr=>{"use strict";var Rh=kr&&kr.__assign||function(){return Rh=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Rh.apply(this,arguments)};kr.__esModule=!0;kr.getQuotedIdentifier=kr.getComment=kr.createResult=void 0;var Uw=un(),Qi=xh(),NI=function(r,e,t){return{token:Rh({name:r},e!==null?{value:e}:{}),remainingString:t}};kr.createResult=NI;var II=function(r){for(var e=r.length,t=0;t<r.length;t+=1){var n=r[t];if(n===Qi.EOL){e=t;break}}return(0,kr.createResult)(Uw.Tokens.COMMENT,r.slice(0,e),r.slice(e+1))};kr.getComment=II;var FI=function(r){for(var e=!1,t="",n=null,i=0;i<r.length;i+=1){var s=r[i];if(n===null)s===Qi.QUOTED_IDENTIFIER_DELIMITER?e?t=t.slice(-1)+Qi.QUOTED_IDENTIFIER_DELIMITER:n=i:(s===Qi.ESCAPE_CHARACTER?e=!0:e=!1,t=t+=s);else{if(!Qi.SEPARATORS.has(s)&&!Qi.STRUCTURAL_CHARACTERS[s])throw new Error("Unexpected character: ".concat(s," Expected ) character or separator"));break}}if(n===null)throw new Error("Unexpected end of expression: expected ".concat(Qi.QUOTED_IDENTIFIER_DELIMITER," character"));return(0,kr.createResult)(Uw.Tokens.IDENTIFIER,t,r.slice(n+1))};kr.getQuotedIdentifier=FI});var Ww=k(Gl=>{"use strict";Gl.__esModule=!0;Gl.lex=void 0;var Zs=un(),ir=xh(),Js=qw(),LI=function(r){for(var e=null,t=null,n=null,i=0;i<r.length;i+=1){var s=r[i];if(e===null){if(!ir.SEPARATORS.has(s)){var a=ir.STRUCTURAL_CHARACTERS[s];if(a){var o=r[i+1];if(a===Zs.StructuralCharacters.CLOSE_PARENTHESIS&&o&&!ir.SEPARATORS.has(o)&&o!==Zs.StructuralCharacters.CLOSE_PARENTHESIS)throw new Error("Unexpected character: ".concat(o,". A closing parenthesis should be followed by another closing parenthesis or whitespace"));return(0,Js.createResult)(Zs.Tokens.STRUCTURAL_CHARACTER,ir.STRUCTURAL_CHARACTERS[s],r.slice(i+1))}if(s===ir.QUOTED_IDENTIFIER_DELIMITER)return(0,Js.getQuotedIdentifier)(r.slice(i+1));if(s===ir.COMMENT_DELIMITER)return(0,Js.getComment)(r.slice(i+1));e=i}}else if(ir.SEPARATORS.has(s)||ir.STRUCTURAL_CHARACTERS[s]){t=i,n=s;break}else if(s===ir.QUOTED_IDENTIFIER_DELIMITER||s===ir.COMMENT_DELIMITER)throw new Error("Unexpected character: ".concat(s))}if(e!==null){t=t!=null?t:r.length;var u=r.slice(e,t),l=r.slice(t);if(ir.OPERATORS[u]){if(n&&!ir.SEPARATORS.has(n))throw new Error("Unexpected character: ".concat(n,". Operators should be separated using whitespace"));return(0,Js.createResult)(Zs.Tokens.OPERATOR,ir.OPERATORS[u],l)}else return(0,Js.createResult)(Zs.Tokens.IDENTIFIER,u,l)}return(0,Js.createResult)(Zs.Tokens.EOF,null,"")};Gl.lex=LI});var jw=k(sr=>{"use strict";var $w=sr&&sr.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))};sr.__esModule=!0;sr.validateToken=sr.previousOperatorTakesPrecedent=sr.getValue=sr.newTokenGenerator=void 0;var UI=Ww(),ea=un(),Yl=Dh(),qI=function(r){var e=r;return function(t,n){for(n===void 0&&(n=!1);;){var i=(0,UI.lex)(e),s=i.token,a=i.remainingString;if(e=a,s.name!==ea.Tokens.COMMENT)return(0,sr.validateToken)(s,t,n),s}}};sr.newTokenGenerator=qI;var WI=function(r,e){var t=r(Yl.VALID_TOKENS.identifierOrNot),n=t.value===ea.Operators.NOT;n&&(t=r(Yl.VALID_TOKENS.identifierOnly));var i=t.name===ea.Tokens.STRUCTURAL_CHARACTER?e(r,!0):[t];return n?$w($w([],i,!0),[{name:ea.Tokens.OPERATOR,value:ea.Operators.NOT}],!1):i};sr.getValue=WI;var $I=function(r,e){return Yl.OPERATOR_PRECEDENCE[r]<=Yl.OPERATOR_PRECEDENCE[e]};sr.previousOperatorTakesPrecedent=$I;var jI=function(r,e,t){if(t===void 0&&(t=!1),r.name===ea.Tokens.EOF){if(t)return;throw new Error("Unexpected end of expression")}for(var n=0,i=e;n<i.length;n++){var s=i[n];if(s.name===r.name&&(!s.value||s.value===r.value))return}throw new TypeError("Invalid token")};sr.validateToken=jI});var Ch=k(ta=>{"use strict";var ln=ta&&ta.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))};ta.__esModule=!0;ta.parse=void 0;var Gw=un(),Yw=Dh(),Bl=jw(),GI=function(r){if(typeof r!="string")throw new Error("Expected string but received ".concat(typeof r));var e=(0,Bl.newTokenGenerator)(r);return Mh(e)};ta.parse=GI;var Mh=function(r,e){e===void 0&&(e=!1);for(var t=ln([],(0,Bl.getValue)(r,Mh),!0),n=[];;){var i=e?Yw.VALID_TOKENS.binaryOperatorOrClose:Yw.VALID_TOKENS.binaryOperator,s=r(i,!e);if(s.name===Gw.Tokens.EOF||s.name===Gw.Tokens.STRUCTURAL_CHARACTER)return ln(ln([],t,!0),ln([],n,!0).reverse(),!0);for(;n.length;){var a=n[n.length-1]||null;if(a&&(0,Bl.previousOperatorTakesPrecedent)(a.value,s.value))t=ln(ln([],t,!0),[a],!1),n=n.slice(0,-1);else break}n=ln(ln([],n,!0),[s],!1),t=ln(ln([],t,!0),(0,Bl.getValue)(r,Mh),!0)}}});var Ah=k(Dt=>{"use strict";Dt.__esModule=!0;Dt.throwInvalidExpression=Dt.isOperator=Dt.isIdentifier=Dt.notUtil=Dt.xorUtil=Dt.orUtil=Dt.andUtil=void 0;var Bw=un(),YI=function(r,e){return r&&e};Dt.andUtil=YI;var BI=function(r,e){return r||e};Dt.orUtil=BI;var HI=function(r,e){return r!==e};Dt.xorUtil=HI;var VI=function(r){return!r};Dt.notUtil=VI;var zI=function(r){var e=r.name,t=r.value;return e===Bw.Tokens.IDENTIFIER&&typeof t=="string"};Dt.isIdentifier=zI;var KI=function(r){var e=r.name,t=r.value;return e===Bw.Tokens.OPERATOR&&typeof t=="string"};Dt.isOperator=KI;var QI=function(r){throw new TypeError("Invalid postfix expression: ".concat(r))};Dt.throwInvalidExpression=QI});var Hw=k(Hl=>{"use strict";var Go;Hl.__esModule=!0;Hl.OPERATOR_MAP=void 0;var Ph=un(),Nh=Ah();Hl.OPERATOR_MAP=(Go={},Go[Ph.Operators.AND]=Nh.andUtil,Go[Ph.Operators.OR]=Nh.orUtil,Go[Ph.Operators.XOR]=Nh.xorUtil,Go)});var zw=k(Un=>{"use strict";var ra=Un&&Un.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))};Un.__esModule=!0;Un.evaluate=Un.getEvaluator=void 0;var XI=Ch(),Vw=un(),ZI=Hw(),Xi=Ah(),JI=function(r){var e=(0,XI.parse)(r);return function(t){return(0,Un.evaluate)(e,t)}};Un.getEvaluator=JI;var eF=function(r,e){if(!Array.isArray(r))throw new Error("".concat(r," should be an array. evaluate takes in a parsed expression. Use in combination with parse or use getEvaluator"));var t=r.reduce(function(n,i,s){if(!(i&&((0,Xi.isIdentifier)(i)||(0,Xi.isOperator)(i))))throw new Error("Invalid token: ".concat(i,". Found in parsed expression at index ").concat(s));if(i.name===Vw.Tokens.IDENTIFIER)return ra(ra([],n,!0),[Boolean(e[i.value])],!1);var a=n[n.length-2],o=n[n.length-1];if(i.value===Vw.Operators.NOT)return o===void 0&&(0,Xi.throwInvalidExpression)("missing identifier"),ra(ra([],n.slice(0,-1),!0),[(0,Xi.notUtil)(o)],!1);(o===void 0||a===void 0)&&(0,Xi.throwInvalidExpression)("missing identifier");var u=ZI.OPERATOR_MAP[i.value];return u||(0,Xi.throwInvalidExpression)("unknown operator"),ra(ra([],n.slice(0,-2),!0),[u(a,o)],!1)},[]);return t.length!==1&&(0,Xi.throwInvalidExpression)("too many identifiers after evaluation"),t[0]};Un.evaluate=eF});var Qw=k(cn=>{"use strict";var Ih=cn&&cn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]});cn.__esModule=!0;cn.parse=cn.evaluate=cn.getEvaluator=void 0;var Kw=zw();Ih(cn,Kw,"getEvaluator");Ih(cn,Kw,"evaluate");var tF=Ch();Ih(cn,tF,"parse")});var gF={};eE(gF,{default:()=>vc});module.exports=tE(gF);var Ik=require("obsidian");var Ms=require("obsidian");var bF=new Error("timeout while waiting for mutex to become available"),TF=new Error("mutex already locked"),rE=new Error("request for lock canceled"),nE=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},Pc=class{constructor(e,t=rE){this._value=e,this._cancelError=t,this._weightedQueues=[],this._weightedWaiters=[]}acquire(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((t,n)=>{this._weightedQueues[e-1]||(this._weightedQueues[e-1]=[]),this._weightedQueues[e-1].push({resolve:t,reject:n}),this._dispatch()})}runExclusive(e,t=1){return nE(this,void 0,void 0,function*(){let[n,i]=yield this.acquire(t);try{return yield e(n)}finally{i()}})}waitForUnlock(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(t=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),this._weightedWaiters[e-1].push(t),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatch()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatch()}cancel(){this._weightedQueues.forEach(e=>e.forEach(t=>t.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var e;for(let t=this._value;t>0;t--){let n=(e=this._weightedQueues[t-1])===null||e===void 0?void 0:e.shift();if(!n)continue;let i=this._value,s=t;this._value-=t,t=this._value+1,n.resolve([i,this._newReleaser(s)])}this._drainUnlockWaiters()}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){for(let e=this._value;e>0;e--)!this._weightedWaiters[e-1]||(this._weightedWaiters[e-1].forEach(t=>t()),this._weightedWaiters[e-1]=[])}},iE=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},ou=class{constructor(e){this._semaphore=new Pc(1,e)}acquire(){return iE(this,void 0,void 0,function*(){let[,e]=yield this._semaphore.acquire();return e})}runExclusive(e){return this._semaphore.runExclusive(()=>e())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var Je=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 Ju=ga(et());var At=class{constructor(e,t){this.start=e,this.end=t,t.isBefore(e)&&(this.start=t,this.end=e),this.start=this.start.startOf("day"),this.end=this.end.startOf("day")}static buildRelative(e){let t=e==="week"?"isoWeek":e;return new At(window.moment().startOf(t).startOf("day"),window.moment().endOf(t).startOf("day"))}static buildInvalid(){return new At(window.moment.invalid(),window.moment.invalid())}isValid(){return this.start.isValid()&&this.end.isValid()}moveToPrevious(e){let t=window.moment.duration(1,e);this.start.subtract(t),this.end.subtract(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}moveToNext(e){let t=window.moment.duration(1,e);this.start.add(t),this.end.add(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}};var Qt=class{static parseDate(e,t=!1){return window.moment(Ju.parseDate(e,void 0,{forwardDate:t})).startOf("day")}static parseDateRange(e,t=!1){let n=[Qt.parseRelativeDateRange,Qt.parseNumberedDateRange,Qt.parseAbsoluteDateRange];for(let i of n){let s=i(e,t);if(s.isValid())return s}return At.buildInvalid()}static parseAbsoluteDateRange(e,t){let n=Ju.parse(e,void 0,{forwardDate:t});if(n.length===0)return At.buildInvalid();let i=n[0].start,s=n[1]&&n[1].start?n[1].start:i,a=window.moment(i.date()),o=window.moment(s.date());return new At(a,o)}static parseRelativeDateRange(e,t){let n=/(last|this|next) (week|month|quarter|year)/,i=e.match(n);if(i&&i.length===3){let s=i[1],a=i[2],o=At.buildRelative(a);switch(s){case"last":o.moveToPrevious(a);break;case"next":o.moveToNext(a);break}return o}return At.buildInvalid()}static parseNumberedDateRange(e,t){let n=[[/^\s*[0-9]{4}\s*$/,"YYYY","year"],[/^\s*[0-9]{4}-Q[1-4]\s*$/,"YYYY-Q","quarter"],[/^\s*[0-9]{4}-[0-9]{2}\s*$/,"YYYY-MM","month"],[/^\s*[0-9]{4}-W[0-9]{2}\s*$/,"YYYY-WW","isoWeek"]];for(let[i,s,a]of n){let o=e.match(i);if(o){let u=o[0].trim();return new At(window.moment(u,s).startOf(a),window.moment(u,s).endOf(a))}}return At.buildInvalid()}};var wP={td:"today",tm:"tomorrow",yd:"yesterday",tw:"this week",nw:"next week",weekend:"sat",we:"sat"};function el(r){for(let[e,t]of Object.entries(wP))r=r.replace(RegExp(`\\b${e}\\s`,"i"),t);return r}var tl=["MO","TU","WE","TH","FR","SA","SU"],Ke=function(){function r(e,t){if(t===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=t}return r.fromStr=function(e){return new r(tl.indexOf(e))},r.prototype.nth=function(e){return this.n===e?this:new r(this.weekday,e)},r.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},r.prototype.toString=function(){var e=tl[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},r.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},r}();var Pe=function(r){return r!=null},Xt=function(r){return typeof r=="number"},Em=function(r){return typeof r=="string"&&tl.includes(r)},gt=Array.isArray,yr=function(r,e){e===void 0&&(e=r),arguments.length===1&&(e=r,r=0);for(var t=[],n=r;n<e;n++)t.push(n);return t};var he=function(r,e){var t=0,n=[];if(gt(r))for(;t<e;t++)n[t]=[].concat(r);else for(;t<e;t++)n[t]=r;return n},C_=function(r){return gt(r)?r:[r]};function Mi(r,e,t){t===void 0&&(t=" ");var n=String(r);return e=e>>0,n.length>e?String(n):(e=e-n.length,e>t.length&&(t+=he(t,e/t.length)),t.slice(0,e)+String(n))}var A_=function(r,e,t){var n=r.split(e);return t?n.slice(0,t).concat([n.slice(t).join(e)]):n},_t=function(r,e){var t=r%e;return t*e<0?t+e:t},rl=function(r,e){return{div:Math.floor(r/e),mod:_t(r,e)}},Zt=function(r){return!Pe(r)||r.length===0},Ge=function(r){return!Zt(r)},ge=function(r,e){return Ge(r)&&r.indexOf(e)!==-1};var Xr=function(r,e,t,n,i,s){return n===void 0&&(n=0),i===void 0&&(i=0),s===void 0&&(s=0),new Date(Date.UTC(r,e-1,t,n,i,s))},kP=[31,28,31,30,31,30,31,31,30,31,30,31],I_=1e3*60*60*24,nl=9999,F_=Xr(1970,1,1),EP=[6,0,1,2,3,4,5];var ws=function(r){return r%4===0&&r%100!==0||r%400===0},Sm=function(r){return r instanceof Date},Ci=function(r){return Sm(r)&&!isNaN(r.getTime())},P_=function(r){return r.getTimezoneOffset()*60*1e3},SP=function(r,e){var t=r.getTime()-P_(r),n=e.getTime()-P_(e),i=t-n;return Math.round(i/I_)},bo=function(r){return SP(r,F_)},il=function(r){return new Date(F_.getTime()+r*I_)},OP=function(r){var e=r.getUTCMonth();return e===1&&ws(r.getUTCFullYear())?29:kP[e]},kn=function(r){return EP[r.getUTCDay()]},Om=function(r,e){var t=Xr(r,e+1,1);return[kn(t),OP(t)]},sl=function(r,e){return e=e||r,new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},al=function(r){var e=new Date(r.getTime());return e},Dm=function(r){for(var e=[],t=0;t<r.length;t++)e.push(al(r[t]));return e},En=function(r){r.sort(function(e,t){return e.getTime()-t.getTime()})},ks=function(r,e){e===void 0&&(e=!0);var t=new Date(r);return[Mi(t.getUTCFullYear().toString(),4,"0"),Mi(t.getUTCMonth()+1,2,"0"),Mi(t.getUTCDate(),2,"0"),"T",Mi(t.getUTCHours(),2,"0"),Mi(t.getUTCMinutes(),2,"0"),Mi(t.getUTCSeconds(),2,"0"),e?"Z":""].join("")},To=function(r){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/,t=e.exec(r);if(!t)throw new Error("Invalid UNTIL value: ".concat(r));return new Date(Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[5],10)||0,parseInt(t[6],10)||0,parseInt(t[7],10)||0))},N_=function(r,e){var t=r.toLocaleString("sv-SE",{timeZone:e});return t.replace(" ","T")+"Z"},L_=function(r,e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date(N_(r,t)),i=new Date(N_(r,e!=null?e:"UTC")),s=i.getTime()-n.getTime();return new Date(r.getTime()-s)};var DP=function(){function r(e,t){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=e,this.args=t,e==="between"?(this.maxDate=t.inc?t.before:new Date(t.before.getTime()-1),this.minDate=t.inc?t.after:new Date(t.after.getTime()+1)):e==="before"?this.maxDate=t.inc?t.dt:new Date(t.dt.getTime()-1):e==="after"&&(this.minDate=t.inc?t.dt:new Date(t.dt.getTime()+1))}return r.prototype.accept=function(e){++this.total;var t=this.minDate&&e<this.minDate,n=this.maxDate&&e>this.maxDate;if(this.method==="between"){if(t)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return t?!0:(this.add(e),!1);return this.add(e)},r.prototype.add=function(e){return this._result.push(e),!0},r.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":default:return e.length?e[e.length-1]:null}},r.prototype.clone=function(){return new r(this.method,this.args)},r}(),Sn=DP;var xm=function(r,e){return xm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},xm(r,e)};function Es(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");xm(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var yt=function(){return yt=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},yt.apply(this,arguments)};function q(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))}var xP=function(r){Es(e,r);function e(t,n,i){var s=r.call(this,t,n)||this;return s.iterator=i,s}return e.prototype.add=function(t){return this.iterator(t,this._result.length)?(this._result.push(t),!0):!1},e}(Sn),Rm=xP;var RP={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},Ai=RP;var U_=function(r,e){return r.indexOf(e)!==-1},MP=function(r){return r.toString()},CP=function(r,e,t){return"".concat(e," ").concat(t,", ").concat(r)},AP=function(){function r(e,t,n,i){if(t===void 0&&(t=MP),n===void 0&&(n=Ai),i===void 0&&(i=CP),this.text=[],this.language=n||Ai,this.gettext=t,this.dateFormatter=i,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var s=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);s.sort(function(c,d){return c-d}),a.sort(function(c,d){return d-c}),this.bymonthday=s.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(Pe(this.origOptions.byweekday)){var o=gt(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],u=String(o);this.byweekday={allWeeks:o.filter(function(c){return!c.n}),someWeeks:o.filter(function(c){return Boolean(c.n)}),isWeekdays:u.indexOf("MO")!==-1&&u.indexOf("TU")!==-1&&u.indexOf("WE")!==-1&&u.indexOf("TH")!==-1&&u.indexOf("FR")!==-1&&u.indexOf("SA")===-1&&u.indexOf("SU")===-1,isEveryDay:u.indexOf("MO")!==-1&&u.indexOf("TU")!==-1&&u.indexOf("WE")!==-1&&u.indexOf("TH")!==-1&&u.indexOf("FR")!==-1&&u.indexOf("SA")!==-1&&u.indexOf("SU")!==-1};var l=function(c,d){return c.weekday-d.weekday};this.byweekday.allWeeks.sort(l),this.byweekday.someWeeks.sort(l),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return r.isFullyConvertible=function(e){var t=!0;if(!(e.options.freq in r.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(U_(["dtstart","wkst","freq"],n))return!0;if(!U_(r.IMPLEMENTED[e.options.freq],n))return!1}return t},r.prototype.isFullyConvertible=function(){return r.isFullyConvertible(this.rrule)},r.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in r.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[z.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var t=this.options.until;this.add(this.dateFormatter(t.getUTCFullYear(),this.language.monthNames[t.getUTCMonth()],t.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},r.prototype.HOURLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))},r.prototype.MINUTELY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("minutes"):e("minute"))},r.prototype.DAILY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},r.prototype.WEEKLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e("days"):e("day")):(this.options.interval===1&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())},r.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()},r.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))},r.prototype._bymonthday=function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))},r.prototype._byweekday=function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))},r.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},r.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},r.prototype.nth=function(e){e=parseInt(e.toString(),10);var t,n=this.gettext;if(e===-1)return n("last");var i=Math.abs(e);switch(i){case 1:case 21:case 31:t=i+n("st");break;case 2:case 22:t=i+n("nd");break;case 3:case 23:t=i+n("rd");break;default:t=i+n("th")}return e<0?t+" "+n("last"):t},r.prototype.monthtext=function(e){return this.language.monthNames[e-1]},r.prototype.weekdaytext=function(e){var t=Xt(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]},r.prototype.plural=function(e){return e%100!==1},r.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},r.prototype.list=function(e,t,n,i){var s=this;i===void 0&&(i=","),gt(e)||(e=[e]);var a=function(u,l,c){for(var d="",m=0;m<u.length;m++)m!==0&&(m===u.length-1?d+=" "+c+" ":d+=l+" "),d+=u[m];return d};t=t||function(u){return u.toString()};var o=function(u){return t&&t.call(s,u)};return n?a(e.map(o),i,n):e.map(o).join(i+" ")},r}(),Zr=AP;var PP=function(){function r(e){this.done=!0,this.rules=e}return r.prototype.start=function(e){return this.text=e,this.done=!1,this.nextSymbol()},r.prototype.isDone=function(){return this.done&&this.symbol===null},r.prototype.nextSymbol=function(){var e,t;this.symbol=null,this.value=null;do{if(this.done)return!1;var n=void 0;e=null;for(var i in this.rules){n=this.rules[i];var s=n.exec(this.text);s&&(e===null||s[0].length>e[0].length)&&(e=s,t=i)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(t==="SKIP");return this.symbol=t,this.value=e,!0},r.prototype.accept=function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},r.prototype.acceptNumber=function(){return this.accept("number")},r.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},r}();function _o(r,e){e===void 0&&(e=Ai);var t={},n=new PP(e.tokens);if(!n.start(r))return null;return i(),t;function i(){n.expect("every");var m=n.acceptNumber();if(m&&(t.interval=parseInt(m[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":t.freq=z.DAILY,n.nextSymbol()&&(a(),d());break;case"weekday(s)":t.freq=z.WEEKLY,t.byweekday=[z.MO,z.TU,z.WE,z.TH,z.FR],n.nextSymbol(),d();break;case"week(s)":t.freq=z.WEEKLY,n.nextSymbol()&&(s(),d());break;case"hour(s)":t.freq=z.HOURLY,n.nextSymbol()&&(s(),d());break;case"minute(s)":t.freq=z.MINUTELY,n.nextSymbol()&&(s(),d());break;case"month(s)":t.freq=z.MONTHLY,n.nextSymbol()&&(s(),d());break;case"year(s)":t.freq=z.YEARLY,n.nextSymbol()&&(s(),d());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=z.WEEKLY;var p=n.symbol.substr(0,2).toUpperCase();if(t.byweekday=[z[p]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var T=u();if(!T)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push(z[T]),n.nextSymbol()}c(),d();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(t.freq=z.YEARLY,t.bymonth=[o()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var y=o();if(!y)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(y),n.nextSymbol()}s(),d();break;default:throw new Error("Unknown symbol")}}function s(){var m=n.accept("on"),p=n.accept("the");if(!!(m||p))do{var T=l(),y=u(),E=o();if(T)y?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(z[y].nth(T))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(T),n.accept("day(s)"));else if(y)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(z[y]);else if(n.symbol==="weekday(s)")n.nextSymbol(),t.byweekday||(t.byweekday=[z.MO,z.TU,z.WE,z.TH,z.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var R=n.acceptNumber();if(!R)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt(R[0],10)];n.accept("comma");){if(R=n.acceptNumber(),!R)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt(R[0],10))}}else if(E)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(E);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function a(){var m=n.accept("at");if(!!m)do{var p=n.acceptNumber();if(!p)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(t.byhour=[parseInt(p[0],10)];n.accept("comma");){if(p=n.acceptNumber(),!p)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");t.byhour.push(parseInt(p[0],10))}}while(n.accept("comma")||n.accept("at"))}function o(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function u(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function l(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var m=parseInt(n.value[1],10);if(m<-366||m>366)throw new Error("Nth out of range: "+m);return n.nextSymbol(),n.accept("last")?-m:m;default:return!1}}function c(){n.accept("on"),n.accept("the");var m=l();if(!!m)for(t.bymonthday=[m],n.nextSymbol();n.accept("comma");){if(m=l(),!m)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(m),n.nextSymbol()}}function d(){if(n.symbol==="until"){var m=Date.parse(n.text);if(!m)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(m)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}var fe;(function(r){r[r.YEARLY=0]="YEARLY",r[r.MONTHLY=1]="MONTHLY",r[r.WEEKLY=2]="WEEKLY",r[r.DAILY=3]="DAILY",r[r.HOURLY=4]="HOURLY",r[r.MINUTELY=5]="MINUTELY",r[r.SECONDLY=6]="SECONDLY"})(fe||(fe={}));function vo(r){return r<fe.HOURLY}var q_=function(r,e){return e===void 0&&(e=Ai),new z(_o(r,e)||void 0)},Ss=["count","until","interval","byweekday","bymonthday","bymonth"];Zr.IMPLEMENTED=[];Zr.IMPLEMENTED[fe.HOURLY]=Ss;Zr.IMPLEMENTED[fe.MINUTELY]=Ss;Zr.IMPLEMENTED[fe.DAILY]=["byhour"].concat(Ss);Zr.IMPLEMENTED[fe.WEEKLY]=Ss;Zr.IMPLEMENTED[fe.MONTHLY]=Ss;Zr.IMPLEMENTED[fe.YEARLY]=["byweekno","byyearday"].concat(Ss);var W_=function(r,e,t,n){return new Zr(r,e,t,n).toString()},$_=Zr.isFullyConvertible;var Os=function(){function r(e,t,n,i){this.hour=e,this.minute=t,this.second=n,this.millisecond=i||0}return r.prototype.getHours=function(){return this.hour},r.prototype.getMinutes=function(){return this.minute},r.prototype.getSeconds=function(){return this.second},r.prototype.getMilliseconds=function(){return this.millisecond},r.prototype.getTime=function(){return(this.hour*60*60+this.minute*60+this.second)*1e3+this.millisecond},r}();var j_=function(r){Es(e,r);function e(t,n,i,s,a,o,u){var l=r.call(this,s,a,o,u)||this;return l.year=t,l.month=n,l.day=i,l}return e.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},e.prototype.getWeekday=function(){return kn(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(t){this.year+=t},e.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var n=Math.floor(this.month/12),i=_t(this.month,12);this.month=i,this.year+=n,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+t*7:this.day+=-(this.getWeekday()-n)+t*7,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,n,i){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var s=rl(this.hour,24),a=s.div,o=s.mod;if(a&&(this.hour=o,this.addDaily(a)),Zt(i)||ge(i,this.hour))break}},e.prototype.addMinutes=function(t,n,i,s){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/t)*t);;){this.minute+=t;var a=rl(this.minute,60),o=a.div,u=a.mod;if(o&&(this.minute=u,this.addHours(o,!1,i)),(Zt(i)||ge(i,this.hour))&&(Zt(s)||ge(s,this.minute)))break}},e.prototype.addSeconds=function(t,n,i,s,a){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var o=rl(this.second,60),u=o.div,l=o.mod;if(u&&(this.second=l,this.addMinutes(u,!1,i,s)),(Zt(i)||ge(i,this.hour))&&(Zt(s)||ge(s,this.minute))&&(Zt(a)||ge(a,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=Om(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,this.month===13&&(this.month=1,++this.year,this.year>nl))return;t=Om(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var i=t.freq,s=t.interval,a=t.wkst,o=t.byhour,u=t.byminute,l=t.bysecond;switch(i){case fe.YEARLY:return this.addYears(s);case fe.MONTHLY:return this.addMonths(s);case fe.WEEKLY:return this.addWeekly(s,a);case fe.DAILY:return this.addDaily(s);case fe.HOURLY:return this.addHours(s,n,o);case fe.MINUTELY:return this.addMinutes(s,n,o,u);case fe.SECONDLY:return this.addSeconds(s,n,o,u,l)}},e}(Os);function Mm(r){for(var e=[],t=Object.keys(r),n=0,i=t;n<i.length;n++){var s=i[n];ge(B_,s)||e.push(s),Sm(r[s])&&!Ci(r[s])&&e.push(s)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return yt({},r)}function G_(r){var e=yt(yt({},wo),Mm(r));if(Pe(e.byeaster)&&(e.freq=z.YEARLY),!(Pe(e.freq)&&z.FREQUENCIES[e.freq]))throw new Error("Invalid frequency: ".concat(e.freq," ").concat(r.freq));if(e.dtstart||(e.dtstart=new Date(new Date().setMilliseconds(0))),Pe(e.wkst)?Xt(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=z.MO.weekday,Pe(e.bysetpos)){Xt(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var t=0;t<e.bysetpos.length;t++){var n=e.bysetpos[t];if(n===0||!(n>=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||Ge(e.byweekno)||Ge(e.byyearday)||Boolean(e.bymonthday)||Ge(e.bymonthday)||Pe(e.byweekday)||Pe(e.byeaster)))switch(e.freq){case z.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case z.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case z.WEEKLY:e.byweekday=[kn(e.dtstart)];break}if(Pe(e.bymonth)&&!gt(e.bymonth)&&(e.bymonth=[e.bymonth]),Pe(e.byyearday)&&!gt(e.byyearday)&&Xt(e.byyearday)&&(e.byyearday=[e.byyearday]),!Pe(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(gt(e.bymonthday)){for(var i=[],s=[],t=0;t<e.bymonthday.length;t++){var n=e.bymonthday[t];n>0?i.push(n):n<0&&s.push(n)}e.bymonthday=i,e.bynmonthday=s}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(Pe(e.byweekno)&&!gt(e.byweekno)&&(e.byweekno=[e.byweekno]),!Pe(e.byweekday))e.bynweekday=null;else if(Xt(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(Em(e.byweekday))e.byweekday=[Ke.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof Ke)!e.byweekday.n||e.freq>z.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var a=[],o=[],t=0;t<e.byweekday.length;t++){var u=e.byweekday[t];if(Xt(u)){a.push(u);continue}else if(Em(u)){a.push(Ke.fromStr(u).weekday);continue}!u.n||e.freq>z.MONTHLY?a.push(u.weekday):o.push([u.weekday,u.n])}e.byweekday=Ge(a)?a:null,e.bynweekday=Ge(o)?o:null}return Pe(e.byhour)?Xt(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<z.HOURLY?[e.dtstart.getUTCHours()]:null,Pe(e.byminute)?Xt(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<z.MINUTELY?[e.dtstart.getUTCMinutes()]:null,Pe(e.bysecond)?Xt(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<z.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function Y_(r){var e=r.dtstart.getTime()%1e3;if(!vo(r.freq))return[];var t=[];return r.byhour.forEach(function(n){r.byminute.forEach(function(i){r.bysecond.forEach(function(s){t.push(new Os(n,i,s,e))})})}),t}function Eo(r){var e=r.split(`
|
|
|
`).map(NP).filter(function(t){return t!==null});return yt(yt({},e[0]),e[1])}function ko(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=To(i),e}function NP(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return H_(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return H_(r);case"DTSTART":return ko(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function H_(r){var e=r.replace(/^RRULE:/i,""),t=ko(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=br[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=IP(o),l=a.toLowerCase();t[l]=u;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=FP(o);break;case"DTSTART":case"TZID":var c=ko(r);t.tzid=c.tzid,t.dtstart=c.dtstart;break;case"UNTIL":t.until=To(o);break;case"BYEASTER":t.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),t}function IP(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(V_)}return V_(r)}function V_(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function FP(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return br[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=br[s].weekday;return new Ke(a,i)})}var Pi=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=ks(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:L_(this.date,this.tzid)},r}();function So(r){for(var e=[],t="",n=Object.keys(r),i=Object.keys(wo),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)||gt(o)&&!o.length)){switch(a){case"FREQ":u=z.FREQUENCIES[r.freq];break;case"WKST":Xt(o)?u=new Ke(o).toString():u=o.toString();break;case"BYWEEKDAY":a="BYDAY",u=C_(o).map(function(p){return p instanceof Ke?p:gt(p)?new Ke(p[0],p[1]):new Ke(p)}).toString();break;case"DTSTART":t=LP(o,r.tzid);break;case"UNTIL":u=ks(o,!r.tzid);break;default:if(gt(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(p){var T=p[0],y=p[1];return"".concat(T,"=").concat(y.toString())}).join(";"),m="";return d!==""&&(m="RRULE:".concat(d)),[t,m].filter(function(p){return!!p}).join(`
|
|
|
`)}function LP(r,e){return r?"DTSTART"+new Pi(new Date(r),e).toString():""}function UP(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 z_=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?al(t):Dm(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 m=i[d];if(!UP(t[m],c[m]))return!0}return!1},a=this[e];if(e==="all")n=this.all;else if(gt(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 Sn(e,t),o=0;o<this.all.length&&l.accept(this.all[o]);o++);n=l.getValue(),this._cacheAdd(e,n,t)}return gt(n)?Dm(n):n instanceof Date?al(n):n},r}();var K_=q(q(q(q(q(q(q(q(q(q(q(q(q([],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),Q_=q(q(q(q(q(q(q(q(q(q(q(q(q([],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),qP=yr(1,29),WP=yr(1,30),Jn=yr(1,31),vt=yr(1,32),X_=q(q(q(q(q(q(q(q(q(q(q(q(q([],vt,!0),WP,!0),vt,!0),Jn,!0),vt,!0),Jn,!0),vt,!0),vt,!0),Jn,!0),vt,!0),Jn,!0),vt,!0),vt.slice(0,7),!0),Z_=q(q(q(q(q(q(q(q(q(q(q(q(q([],vt,!0),qP,!0),vt,!0),Jn,!0),vt,!0),Jn,!0),vt,!0),vt,!0),Jn,!0),vt,!0),Jn,!0),vt,!0),vt.slice(0,7),!0),$P=yr(-28,0),jP=yr(-29,0),ei=yr(-30,0),wt=yr(-31,0),J_=q(q(q(q(q(q(q(q(q(q(q(q(q([],wt,!0),jP,!0),wt,!0),ei,!0),wt,!0),ei,!0),wt,!0),wt,!0),ei,!0),wt,!0),ei,!0),wt,!0),wt.slice(0,7),!0),ev=q(q(q(q(q(q(q(q(q(q(q(q(q([],wt,!0),$P,!0),wt,!0),ei,!0),wt,!0),ei,!0),wt,!0),wt,!0),ei,!0),wt,!0),ei,!0),wt,!0),wt.slice(0,7),!0),tv=[0,31,60,91,121,152,182,213,244,274,305,335,366],rv=[0,31,59,90,120,151,181,212,243,273,304,334,365],Cm=function(){for(var r=[],e=0;e<55;e++)r=r.concat(yr(7));return r}();function nv(r,e){var t=Xr(r,1,1),n=ws(r)?366:365,i=ws(r+1)?366:365,s=bo(t),a=kn(t),o=yt(yt({yearlen:n,nextyearlen:i,yearordinal:s,yearweekday:a},GP(r)),{wnomask:null});if(Zt(e.byweekno))return o;o.wnomask=he(0,n+7);var u,l,c=u=_t(7-a+e.wkst,7);c>=4?(c=0,l=o.yearlen+_t(a-e.wkst,7)):l=n-c;for(var d=Math.floor(l/7),m=_t(l,7),p=Math.floor(d+m/4),T=0;T<e.byweekno.length;T++){var y=e.byweekno[T];if(y<0&&(y+=p+1),y>0&&y<=p){var E=void 0;y>1?(E=c+(y-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+p*7;if(c!==u&&(E-=7-u),E<n)for(var T=0;T<7&&(o.wnomask[E]=1,E+=1,o.wdaymask[E]!==e.wkst);T++);}if(c){var x=void 0;if(ge(e.byweekno,-1))x=-1;else{var v=kn(Xr(r-1,1,1)),V=_t(7-v.valueOf()+e.wkst,7),j=ws(r-1)?366:365,ee=void 0;V>=4?(V=0,ee=j+_t(v-e.wkst,7)):ee=n-c,x=Math.floor(52+_t(ee,7)/4)}if(ge(e.byweekno,x))for(var E=0;E<c;E++)o.wnomask[E]=1}return o}function GP(r){var e=ws(r)?366:365,t=Xr(r,1,1),n=kn(t);return e===365?{mmask:K_,mdaymask:Z_,nmdaymask:ev,wdaymask:Cm.slice(n),mrange:rv}:{mmask:Q_,mdaymask:X_,nmdaymask:J_,wdaymask:Cm.slice(n),mrange:tv}}function iv(r,e,t,n,i,s){var a={lastyear:r,lastmonth:e,nwdaymask:[]},o=[];if(s.freq===z.YEARLY)if(Zt(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(Zt(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,m=0;m<s.bynweekday.length;m++){var p=void 0,T=s.bynweekday[m],y=T[0],E=T[1];E<0?(p=d+(E+1)*7,p-=_t(i[p]-y,7)):(p=c+(E-1)*7,p+=_t(7-i[p]+y,7)),c<=p&&p<=d&&(a.nwdaymask[p]=1)}return a}function sv(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,m=Math.floor(32+2*a+2*c-l-d)%7,p=Math.floor((t+11*l+22*m)/451),T=Math.floor((l+m-7*p+114)/31),y=(l+m-7*p+114)%31+1,E=Date.UTC(r,T-1,y+e),R=Date.UTC(r,0,1);return[Math.ceil((E-R)/(1e3*60*60*24))]}var YP=function(){function r(e){this.options=e}return r.prototype.rebuild=function(e,t){var n=this.options;if(e!==this.lastyear&&(this.yearinfo=nv(e,n)),Ge(n.bynweekday)&&(t!==this.lastmonth||e!==this.lastyear)){var i=this.yearinfo,s=i.yearlen,a=i.mrange,o=i.wdaymask;this.monthinfo=iv(e,t,s,a,o,n)}Pe(n.byeaster)&&(this.eastermask=sv(e,n.byeaster))},Object.defineProperty(r.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),r.prototype.ydayset=function(){return[yr(this.yearlen),0,this.yearlen]},r.prototype.mdayset=function(e,t){for(var n=this.mrange[t-1],i=this.mrange[t],s=he(null,this.yearlen),a=n;a<i;a++)s[a]=a;return[s,n,i]},r.prototype.wdayset=function(e,t,n){for(var i=he(null,this.yearlen+7),s=bo(Xr(e,t,n))-this.yearordinal,a=s,o=0;o<7&&(i[s]=s,++s,this.wdaymask[s]!==this.options.wkst);o++);return[i,a,s]},r.prototype.ddayset=function(e,t,n){var i=he(null,this.yearlen),s=bo(Xr(e,t,n))-this.yearordinal;return i[s]=s,[i,s,s+1]},r.prototype.htimeset=function(e,t,n,i){var s=this,a=[];return this.options.byminute.forEach(function(o){a=a.concat(s.mtimeset(e,o,n,i))}),En(a),a},r.prototype.mtimeset=function(e,t,n,i){var s=this.options.bysecond.map(function(a){return new Os(e,t,a,i)});return En(s),s},r.prototype.stimeset=function(e,t,n,i){return[new Os(e,t,n,i)]},r.prototype.getdayset=function(e){switch(e){case fe.YEARLY:return this.ydayset.bind(this);case fe.MONTHLY:return this.mdayset.bind(this);case fe.WEEKLY:return this.wdayset.bind(this);case fe.DAILY:return this.ddayset.bind(this);default:return this.ddayset.bind(this)}},r.prototype.gettimeset=function(e){switch(e){case fe.HOURLY:return this.htimeset.bind(this);case fe.MINUTELY:return this.mtimeset.bind(this);case fe.SECONDLY:return this.stimeset.bind(this)}},r}(),av=YP;function ov(r,e,t,n,i,s){for(var a=[],o=0;o<r.length;o++){var u=void 0,l=void 0,c=r[o];c<0?(u=Math.floor(c/e.length),l=_t(c,e.length)):(u=Math.floor((c-1)/e.length),l=_t(c-1,e.length));for(var d=[],m=t;m<n;m++){var p=s[m];!Pe(p)||d.push(p)}var T=void 0;u<0?T=d.slice(u)[0]:T=d[u];var y=e[l],E=il(i.yearordinal+T),R=sl(E,y);ge(a,R)||a.push(R)}return En(a),a}function ol(r,e){var t=e.dtstart,n=e.freq,i=e.interval,s=e.until,a=e.bysetpos,o=e.count;if(o===0||i===0)return On(r);var u=j_.fromDate(t),l=new av(e);l.rebuild(u.year,u.month);for(var c=VP(l,u,e);;){var d=l.getdayset(n)(u.year,u.month,u.day),m=d[0],p=d[1],T=d[2],y=HP(m,p,T,l,e);if(Ge(a))for(var E=ov(a,c,p,T,l,m),R=0;R<E.length;R++){var x=E[R];if(s&&x>s)return On(r);if(x>=t){var v=uv(x,e);if(!r.accept(v)||o&&(--o,!o))return On(r)}}else for(var R=p;R<T;R++){var V=m[R];if(!!Pe(V))for(var j=il(l.yearordinal+V),ee=0;ee<c.length;ee++){var Y=c[ee],x=sl(j,Y);if(s&&x>s)return On(r);if(x>=t){var v=uv(x,e);if(!r.accept(v)||o&&(--o,!o))return On(r)}}}if(e.interval===0||(u.add(e,y),u.year>nl))return On(r);vo(n)||(c=l.gettimeset(n)(u.hour,u.minute,u.second,0)),l.rebuild(u.year,u.month)}}function BP(r,e,t){var n=t.bymonth,i=t.byweekno,s=t.byweekday,a=t.byeaster,o=t.bymonthday,u=t.bynmonthday,l=t.byyearday;return Ge(n)&&!ge(n,r.mmask[e])||Ge(i)&&!r.wnomask[e]||Ge(s)&&!ge(s,r.wdaymask[e])||Ge(r.nwdaymask)&&!r.nwdaymask[e]||a!==null&&!ge(r.eastermask,e)||(Ge(o)||Ge(u))&&!ge(o,r.mdaymask[e])&&!ge(u,r.nmdaymask[e])||Ge(l)&&(e<r.yearlen&&!ge(l,e+1)&&!ge(l,-r.yearlen+e)||e>=r.yearlen&&!ge(l,e+1-r.yearlen)&&!ge(l,-r.nextyearlen+e-r.yearlen))}function uv(r,e){return new Pi(r,e.tzid).rezonedDate()}function On(r){return r.getValue()}function HP(r,e,t,n,i){for(var s=!1,a=e;a<t;a++){var o=r[a];s=BP(n,o,i),s&&(r[o]=null)}return s}function VP(r,e,t){var n=t.freq,i=t.byhour,s=t.byminute,a=t.bysecond;return vo(n)?Y_(t):n>=z.HOURLY&&Ge(i)&&!ge(i,e.hour)||n>=z.MINUTELY&&Ge(s)&&!ge(s,e.minute)||n>=z.SECONDLY&&Ge(a)&&!ge(a,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var br={MO:new Ke(0),TU:new Ke(1),WE:new Ke(2),TH:new Ke(3),FR:new Ke(4),SA:new Ke(5),SU:new Ke(6)},wo={freq:fe.YEARLY,dtstart:null,interval:1,wkst:br.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},B_=Object.keys(wo),z=function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new z_,this.origOptions=Mm(e);var n=G_(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return _o(e,t)},r.fromText=function(e,t){return q_(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return ol(e,this.options)},r.prototype._cacheGet=function(e,t){return this._cache?this._cache._cacheGet(e,t):!1},r.prototype._cacheAdd=function(e,t,n){if(!!this._cache)return this._cache._cacheAdd(e,t,n)},r.prototype.all=function(e){if(e)return this._iter(new Rm("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new Sn("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,i){if(n===void 0&&(n=!1),!Ci(e)||!Ci(t))throw new Error("Invalid date passed in to RRule.between");var s={before:t,after:e,inc:n};if(i)return this._iter(new Rm("between",s,i));var a=this._cacheGet("between",s);return a===!1&&(a=this._iter(new Sn("between",s)),this._cacheAdd("between",a,s)),a},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!Ci(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},i=this._cacheGet("before",n);return i===!1&&(i=this._iter(new Sn("before",n)),this._cacheAdd("before",i,n)),i},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!Ci(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},i=this._cacheGet("after",n);return i===!1&&(i=this._iter(new Sn("after",n)),this._cacheAdd("after",i,n)),i},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return So(this.origOptions)},r.prototype.toText=function(e,t,n){return W_(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return $_(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=fe.YEARLY,r.MONTHLY=fe.MONTHLY,r.WEEKLY=fe.WEEKLY,r.DAILY=fe.DAILY,r.HOURLY=fe.HOURLY,r.MINUTELY=fe.MINUTELY,r.SECONDLY=fe.SECONDLY,r.MO=br.MO,r.TU=br.TU,r.WE=br.WE,r.TH=br.TH,r.FR=br.FR,r.SA=br.SA,r.SU=br.SU,r.parseString=Eo,r.optionsToString=So,r}();function lv(r,e,t,n,i,s){var a={},o=r.accept;function u(m,p){t.forEach(function(T){T.between(m,p,!0).forEach(function(y){a[Number(y)]=!0})})}i.forEach(function(m){var p=new Pi(m,s).rezonedDate();a[Number(p)]=!0}),r.accept=function(m){var p=Number(m);return isNaN(p)?o.call(this,m):!a[p]&&(u(new Date(p-1),new Date(p+1)),!a[p])?(a[p]=!0,o.call(this,m)):!0},r.method==="between"&&(u(r.args.after,r.args.before),r.accept=function(m){var p=Number(m);return a[p]?!0:(a[p]=!0,o.call(this,m))});for(var l=0;l<n.length;l++){var c=new Pi(n[l],s).rezonedDate();if(!r.accept(new Date(c.getTime())))break}e.forEach(function(m){ol(r,m.options)});var d=r._result;switch(En(d),r.method){case"all":case"between":return d;case"before":return d.length&&d[d.length-1]||null;case"after":default:return d.length&&d[0]||null}}var cv={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function zP(r,e){var t=[],n=[],i=[],s=[],a=ko(r),o=a.dtstart,u=a.tzid,l=JP(r,e.unfold);return l.forEach(function(c){var d;if(!!c){var m=ZP(c),p=m.name,T=m.parms,y=m.value;switch(p.toUpperCase()){case"RRULE":if(T.length)throw new Error("unsupported RRULE parm: ".concat(T.join(",")));t.push(Eo(c));break;case"RDATE":var E=(d=/RDATE(?:;TZID=([^:=]+))?/i.exec(c))!==null&&d!==void 0?d:[],R=E[1];R&&!u&&(u=R),n=n.concat(dv(y,T));break;case"EXRULE":if(T.length)throw new Error("unsupported EXRULE parm: ".concat(T.join(",")));i.push(Eo(y));break;case"EXDATE":s=s.concat(dv(y,T));break;case"DTSTART":break;default:throw new Error("unsupported property: "+p)}}}),{dtstart:o,tzid:u,rrulevals:t,rdatevals:n,exrulevals:i,exdatevals:s}}function KP(r,e){var t=zP(r,e),n=t.rrulevals,i=t.rdatevals,s=t.exrulevals,a=t.exdatevals,o=t.dtstart,u=t.tzid,l=e.cache===!1;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||n.length>1||i.length||s.length||a.length){var c=new Pm(l);return c.dtstart(o),c.tzid(u||void 0),n.forEach(function(m){c.rrule(new z(Am(m,o,u),l))}),i.forEach(function(m){c.rdate(m)}),s.forEach(function(m){c.exrule(new z(Am(m,o,u),l))}),a.forEach(function(m){c.exdate(m)}),e.compatible&&e.dtstart&&c.rdate(o),c}var d=n[0]||{};return new z(Am(d,d.dtstart||e.dtstart||o,d.tzid||e.tzid||u),l)}function ul(r,e){return e===void 0&&(e={}),KP(r,QP(e))}function Am(r,e,t){return yt(yt({},r),{dtstart:e,tzid:t})}function QP(r){var e=[],t=Object.keys(r),n=Object.keys(cv);if(t.forEach(function(i){ge(n,i)||e.push(i)}),e.length)throw new Error("Invalid options: "+e.join(", "));return yt(yt({},cv),r)}function XP(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=A_(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function ZP(r){var e=XP(r),t=e.name,n=e.value,i=t.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:n}}function JP(r,e){if(e===void 0&&(e=!1),r=r&&r.trim(),!r)throw new Error("Invalid empty string");if(!e)return r.split(/\s/);for(var t=r.split(`
|
|
|
`),n=0;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 eN(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function dv(r,e){return eN(e),r.split(",").map(function(t){return To(t)})}function fv(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 Pm=function(r){Es(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=fv.apply(n,["dtstart"]),n.tzid=fv.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return lv(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){pv(t,this._rrule)},e.prototype.exrule=function(t){pv(t,this._exrule)},e.prototype.rdate=function(t){mv(t,this._rdate)},e.prototype.exdate=function(t){mv(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return ul(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return ul(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(So({dtstart:this._dtstart}))),this._rrule.forEach(function(n){t=t.concat(n.toString().split(`
|
|
|
`))}),this._exrule.forEach(function(n){t=t.concat(n.toString().split(`
|
|
|
`).map(function(i){return i.replace(/^RRULE:/,"EXRULE:")}).filter(function(i){return!/^DTSTART/.test(i)}))}),this._rdate.length&&t.push(hv("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(hv("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 pv(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 mv(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");ge(e.map(Number),Number(r))||(e.push(r),En(e))}function hv(r,e,t){var n=!t||t.toUpperCase()==="UTC",i=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),s=e.map(function(a){return ks(a.valueOf(),n)}).join(",");return"".concat(i).concat(s)}var Nm=ga(et());function Tr(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 tN(r,e,t=void 0){if(!e)return`<i>no ${r} date</i>`;let n=Nm.parseDate(e,t,{forwardDate:t!=null});return n!==null?window.moment(n).format("YYYY-MM-DD"):`<i>invalid ${r} date</i>`}function gv(r,e,t){return tN(r,e,t?new Date:void 0)}function Ni(r,e){let t=null,n=Nm.parseDate(r,new Date,{forwardDate:e});return n!==null&&(t=window.moment(n)),t}var dt=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 dt({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||Tr(this.startDate,e.startDate)!==0||Tr(this.scheduledDate,e.scheduledDate)!==0||Tr(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=dt.nextAfterMonths(e,n,t,s[1])));let a=i.match(/every( \d+)? year(s)?(.*)?/);return a!==null&&(n=dt.nextAfterYears(e,n,t,a[1])),dt.addTimezone(n)}static nextAfterMonths(e,t,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));dt.isSkippingTooManyMonths(e,t,s);)t=dt.fromOneDayEarlier(e,n);return t}static isSkippingTooManyMonths(e,t,n){let i=t.month()-e.month();return i+=(t.year()-e.year())*12,i>n}static nextAfterYears(e,t,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));dt.isSkippingTooManyYears(e,t,s);)t=dt.fromOneDayEarlier(e,n);return t}static isSkippingTooManyYears(e,t,n){return t.year()-e.year()>n}static fromOneDayEarlier(e,t){e.subtract(1,"days").endOf("day");let n=t.origOptions;return n.dtstart=e.startOf("day").toDate(),t=new z(n),window.moment(t.after(e.toDate()))}static addTimezone(e){return window.moment.utc(e).local(!0).startOf("day")}};function Ds(r){return r.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")}var ti=class{constructor(){this._globalFilter="";this._removeGlobalFilter=!1}static getInstance(){return ti.instance||(ti.instance=new ti),ti.instance}get(){return this._globalFilter}set(e){this._globalFilter=e}reset(){this.set(ti.empty)}isEmpty(){return this.get()===ti.empty}equals(e){return this.get()===e}includedIn(e){let t=this.get();return e.includes(t)}prependTo(e){return this.get()+" "+e}removeAsWordFromDependingOnSettings(e){return this.getRemoveGlobalFilter()?this.removeAsWordFrom(e):e}getRemoveGlobalFilter(){return this._removeGlobalFilter}setRemoveGlobalFilter(e){this._removeGlobalFilter=e}removeAsWordFrom(e){if(this.isEmpty())return e;let t=RegExp("(^|\\s)"+Ds(this.get())+"($|\\s)","ug");return e.search(t)>-1&&(e=e.replace(t,"$1$2").replace(" "," ").trim()),e}removeAsSubstringFrom(e){let t=this.get();return e.replace(t,"").trim()}},ye=ti;ye.empty="";var Jt=class{},J=Jt;J.dateFormat="YYYY-MM-DD",J.dateTimeFormat="YYYY-MM-DD HH:mm",J.indentationRegex=/^([\s\t>]*)/,J.listMarkerRegex=/([-*+]|[0-9]+\.)/,J.checkboxRegex=/\[(.)\]/u,J.afterCheckboxRegex=/ *(.*)/u,J.taskRegex=new RegExp(Jt.indentationRegex.source+Jt.listMarkerRegex.source+" +"+Jt.checkboxRegex.source+Jt.afterCheckboxRegex.source,"u"),J.nonTaskRegex=new RegExp(Jt.indentationRegex.source+Jt.listMarkerRegex.source+"? *("+Jt.checkboxRegex.source+")?"+Jt.afterCheckboxRegex.source,"u"),J.listItemRegex=new RegExp(Jt.indentationRegex.source+Jt.listMarkerRegex.source),J.blockLinkRegex=/ \^[a-zA-Z0-9-]+$/u,J.hashTags=/(^|\s)#[^ !@#$%^&*(),.?":{}|<>]+/g,J.hashTagsFromEnd=new RegExp(Jt.hashTags.source+"$");var Im=5;function Fm(r,e,t){let n=[r.startDateSymbol,r.scheduledDateSymbol,r.dueDateSymbol].join("|");return(i,s,a)=>{let o=[];return o=o.concat(nN(i,s,a,n,e,t)),o=o.concat(iN(i,s,a,r.recurrenceSymbol,t)),o=o.concat(rN(i,s,a,r,t)),o.length>0&&!o.some(u=>u.suggestionType==="match")&&(t||o.unshift({suggestionType:"empty",displayText:"\u23CE",appendText:`
|
|
|
`})),o=o.slice(0,a.autoSuggestMaxItems),o}}function Lm(r,e,t){let n=aN(e.substring(0,t),[["(",")"],["[","]"]])=="("?")":"]",i=r?n+" ":" ",s=r&&e.length>t&&e.charAt(t)===n?1:0;return{postfix:i,insertSkip:s}}function rN(r,e,t,n,i){let s=d=>Object.values(n.prioritySymbols).some(m=>m.length>0&&d.includes(m)),a=[],{postfix:o,insertSkip:u}=Lm(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,m=["High","Medium","Low","Highest","Lowest"];for(let p=0;p<m.length;p++){let T=m[p],y=d[T];a.push({displayText:i?`${y} priority`:`${y} ${T.toLowerCase()} priority`,appendText:`${y}${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 m=Qt.parseDate("today",!0).format(J.dateFormat);a.push({textToMatch:`${n.createdDateSymbol} created`,displayText:`${n.createdDateSymbol} created today (${m})`,appendText:`${n.createdDateSymbol} ${m}`+o,insertSkip:i?u:void 0})}let l=Um(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 m=a.filter(p=>(p.textToMatch||p.displayText).toLowerCase().includes(d.toLowerCase()));for(let p of m){let T=i&&(p.displayText.includes("priority")||p.displayText.includes("created"))?d.length+u:d.length;c.push({suggestionType:"match",displayText:p.displayText,appendText:p.appendText,insertAt:l.index,insertSkip:T})}}}return c.length===0&&t.autoSuggestMinMatch===0?a:c}function nN(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}=Lm(s,r,e),l=[],c=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),d=Um(r,c,e);if(d&&d.length>=2){let m=d[1],p=d[2];if(p.length<t.autoSuggestMinMatch)return[];let T=p&&p.length>1?Qt.parseDate(el(p),!0):null;T&&T.isValid()&&l.push({displayText:`${T.format(J.dateFormat)}`,appendText:`${m} ${T.format(J.dateFormat)} `,insertAt:d.index,insertSkip:d[0].length});let y=1,E=a.filter(R=>p&&p.length>=y&&R.toLowerCase().includes(p.toLowerCase())).slice(0,i);E.length===0&&(E=a.slice(0,i));for(let R of E){let v=`${Qt.parseDate(R,!0).format(J.dateFormat)}`,V=s?d[0].length+u:d[0].length;l.push({suggestionType:"match",displayText:`${R} (${v})`,appendText:`${m} ${v}`+o,insertAt:d.index,insertSkip:V})}}return l}function iN(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}=Lm(i,r,e),u=[],l=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),c=Um(r,l,e);if(c&&c.length>=2){let m=c[1],p=c[2];if(p.length<t.autoSuggestMinMatch)return[];if(p.length>0){let R=(d=dt.fromText({recurrenceRuleText:p,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:d.toText();if(R){let x=`${m} ${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 T=1,y=t.autoSuggestMaxItems/2,E=s.filter(R=>p&&p.length>=T&&R.toLowerCase().includes(p.toLowerCase())).slice(0,y);E.length===0&&p.trim().length===0&&(E=s.slice(0,y));for(let R of E)u.push({suggestionType:"match",displayText:`${R}`,appendText:`${m} ${R} `,insertAt:c.index,insertSkip:c[0].length})}return u}function Um(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 sN(r,e){if(e.length===0)return!1;let t=Object.fromEntries(e.map(([i,s])=>[i,0])),n=Object.fromEntries(e.map(([i,s])=>[s,i]));for(let i of r)i in t?t[i]++:i in n&&(t[n[i]]=Math.max(0,t[n[i]]-1));return Object.values(t).some(i=>i>0)}function aN(r,e){if(e.length===0)return null;let t=Object.fromEntries(e.map(([s,a])=>[s,0])),n=Object.fromEntries(e.map(([s,a])=>[a,s])),i=[];for(let s=0;s<r.length;s++){let a=r[s];if(a in t)t[a]++,i.push({bracket:a,idx:s});else if(a in n){if(t[n[a]]>=1){for(let o=i.length-1;o>=0;o--)if(i[o].bracket==n[a]){i.splice(o,1);break}}t[n[a]]=Math.max(0,t[n[a]]-1)}}return i.length>0?i[i.length-1].bracket:null}function bv(r,e){return(t,n,i)=>sN(t.slice(0,n),e)?r(t,n,i):[]}function Tv(r,e){return ye.getInstance().includedIn(r)&&oN(r,e)}function oN(r,e){if(r.length===0)return!1;let t=oe.extractTaskComponents(r);if(!t)return!1;let n=t.indentation+t.listMarker+" ["+t.status.symbol+"] ";return e>=n.length}var xs=(m=>(m.Description="description",m.Id="id",m.DependsOn="dependsOn",m.Priority="priority",m.RecurrenceRule="recurrenceRule",m.CreatedDate="createdDate",m.StartDate="startDate",m.ScheduledDate="scheduledDate",m.DueDate="dueDate",m.CancelledDate="cancelledDate",m.DoneDate="doneDate",m.BlockLink="blockLink",m))(xs||{}),ll=Object.values(xs),Jr=class{constructor(){this.visible={};this.tagsVisible=!0;ll.forEach(e=>{this.visible[e]=!0})}isShown(e){return this.visible[e]}areTagsShown(){return this.tagsVisible}hide(e){this.visible[e]=!1}setVisibility(e,t){this.visible[e]=t}setTagsVisibility(e){this.tagsVisible=e}get shownComponents(){return ll.filter(e=>this.visible[e])}get hiddenComponents(){return ll.filter(e=>!this.visible[e])}get toggleableComponents(){return ll.filter(e=>e!=="description"&&e!=="blockLink")}toggleVisibilityExceptDescriptionAndBlockLink(){this.toggleableComponents.forEach(e=>{this.visible[e]=!this.visible[e]}),this.setTagsVisibility(!this.areTagsShown())}};var Ii=/[a-zA-Z0-9-_]+/,Wm={prioritySymbols:{Highest:"\u{1F53A}",High:"\u23EB",Medium:"\u{1F53C}",Low:"\u{1F53D}",Lowest:"\u23EC",None:""},startDateSymbol:"\u{1F6EB}",createdDateSymbol:"\u2795",scheduledDateSymbol:"\u23F3",dueDateSymbol:"\u{1F4C5}",doneDateSymbol:"\u2705",cancelledDateSymbol:"\u274C",recurrenceSymbol:"\u{1F501}",dependsOnSymbol:"\u26D4",idSymbol:"\u{1F194}",TaskFormatRegularExpressions:{priorityRegex:/([🔺⏫🔼🔽⏬])\uFE0F?$/u,startDateRegex:/🛫 *(\d{4}-\d{2}-\d{2})$/u,createdDateRegex:/➕ *(\d{4}-\d{2}-\d{2})$/u,scheduledDateRegex:/[⏳⌛] *(\d{4}-\d{2}-\d{2})$/u,dueDateRegex:/[📅📆🗓] *(\d{4}-\d{2}-\d{2})$/u,doneDateRegex:/✅ *(\d{4}-\d{2}-\d{2})$/u,cancelledDateRegex:/❌ *(\d{4}-\d{2}-\d{2})$/u,recurrenceRegex:/🔁 ?([a-zA-Z0-9, !]+)$/iu,dependsOnRegex:new RegExp("\u26D4\uFE0F? *("+Ii.source+"( *, *"+Ii.source+" *)*)$","iu"),idRegex:new RegExp("\u{1F194} *("+Ii.source+")$","iu")}};function qm(r,e,t){return t?r?" "+e:` ${e} ${t}`:""}function Rs(r,e,t){return t?r?" "+e:` ${e} ${t.format(J.dateFormat)}`:""}var Fi=class{constructor(e){this.symbols=e}serialize(e){let t=new Jr,n="",i=!1;for(let s of t.shownComponents)n+=this.componentToString(e,i,s);return n}componentToString(e,t,n){var T;let{prioritySymbols:i,startDateSymbol:s,createdDateSymbol:a,scheduledDateSymbol:o,doneDateSymbol:u,cancelledDateSymbol:l,recurrenceSymbol:c,dueDateSymbol:d,dependsOnSymbol:m,idSymbol:p}=this.symbols;switch(n){case"description":return e.description;case"priority":{let y="";return e.priority==="0"?y=" "+i.Highest:e.priority==="1"?y=" "+i.High:e.priority==="2"?y=" "+i.Medium:e.priority==="4"?y=" "+i.Low:e.priority==="5"&&(y=" "+i.Lowest),y}case"startDate":return Rs(t,s,e.startDate);case"createdDate":return Rs(t,a,e.createdDate);case"scheduledDate":return e.scheduledDateIsInferred?"":Rs(t,o,e.scheduledDate);case"doneDate":return Rs(t,u,e.doneDate);case"cancelledDate":return Rs(t,l,e.cancelledDate);case"dueDate":return Rs(t,d,e.dueDate);case"recurrenceRule":return e.recurrence?qm(t,c,e.recurrence.toText()):"";case"dependsOn":return e.dependsOn.length===0?"":qm(t,m,e.dependsOn.join(","));case"id":return qm(t,p,e.id);case"blockLink":return(T=e.blockLink)!=null?T:"";default:throw new Error(`Don't know how to render task component of type '${n}'`)}}parsePriority(e){let{prioritySymbols:t}=this.symbols;switch(e){case t.Lowest:return"5";case t.Low:return"4";case t.Medium:return"2";case t.High:return"1";case t.Highest:return"0";default:return"3"}}deserialize(e){let{TaskFormatRegularExpressions:t}=this.symbols,n,i="3",s=null,a=null,o=null,u=null,l=null,c=null,d="",m=null,p="",T=[],y="",E=20,R=0;do{n=!1;let x=e.match(t.priorityRegex);x!==null&&(i=this.parsePriority(x[1]),e=e.replace(t.priorityRegex,"").trim(),n=!0);let v=e.match(t.doneDateRegex);v!==null&&(u=window.moment(v[1],J.dateFormat),e=e.replace(t.doneDateRegex,"").trim(),n=!0);let V=e.match(t.cancelledDateRegex);V!==null&&(l=window.moment(V[1],J.dateFormat),e=e.replace(t.cancelledDateRegex,"").trim(),n=!0);let j=e.match(t.dueDateRegex);j!==null&&(o=window.moment(j[1],J.dateFormat),e=e.replace(t.dueDateRegex,"").trim(),n=!0);let ee=e.match(t.scheduledDateRegex);ee!==null&&(a=window.moment(ee[1],J.dateFormat),e=e.replace(t.scheduledDateRegex,"").trim(),n=!0);let Y=e.match(t.startDateRegex);Y!==null&&(s=window.moment(Y[1],J.dateFormat),e=e.replace(t.startDateRegex,"").trim(),n=!0);let W=e.match(t.createdDateRegex);W!==null&&(c=window.moment(W[1],J.dateFormat),e=e.replace(t.createdDateRegex,"").trim(),n=!0);let de=e.match(t.recurrenceRegex);de!==null&&(d=de[1].trim(),e=e.replace(t.recurrenceRegex,"").trim(),n=!0);let Te=e.match(J.hashTagsFromEnd);if(Te!=null){e=e.replace(J.hashTagsFromEnd,"").trim(),n=!0;let O=Te[0].trim();y=y.length>0?[O,y].join(" "):O}let G=e.match(t.idRegex);G!=null&&(e=e.replace(t.idRegex,"").trim(),p=G[1].trim(),n=!0);let N=e.match(t.dependsOnRegex);N!=null&&(e=e.replace(t.dependsOnRegex,"").trim(),T=N[1].replace(/ /g,"").split(",").filter(O=>O!==""),n=!0),R++}while(n&&R<=E);return d.length>0&&(m=dt.fromText({recurrenceRuleText:d,startDate:s,scheduledDate:a,dueDate:o})),y.length>0&&(e+=" "+y),{description:e,priority:i,startDate:s,createdDate:c,scheduledDate:a,dueDate:o,doneDate:u,cancelledDate:l,recurrence:m,id:p,dependsOn:T,tags:oe.extractHashtags(e)}}};function en(r){let e=["(?:",/(?=[^\]]+\])\[/,"|",/(?=[^)]+\))\(/,")",/ */,r,/ */,/[)\]]/,/(?: *,)?/,/$/].map(t=>t instanceof RegExp?t.source:t).join("");return new RegExp(e,r.flags)}var $m={prioritySymbols:{Highest:"priority:: highest",High:"priority:: high",Medium:"priority:: medium",Low:"priority:: low",Lowest:"priority:: lowest",None:""},startDateSymbol:"start::",createdDateSymbol:"created::",scheduledDateSymbol:"scheduled::",dueDateSymbol:"due::",doneDateSymbol:"completion::",cancelledDateSymbol:"cancelled::",recurrenceSymbol:"repeat::",idSymbol:"id::",dependsOnSymbol:"dependsOn::",TaskFormatRegularExpressions:{priorityRegex:en(/priority:: *(highest|high|medium|low|lowest)/),startDateRegex:en(/start:: *(\d{4}-\d{2}-\d{2})/),createdDateRegex:en(/created:: *(\d{4}-\d{2}-\d{2})/),scheduledDateRegex:en(/scheduled:: *(\d{4}-\d{2}-\d{2})/),dueDateRegex:en(/due:: *(\d{4}-\d{2}-\d{2})/),doneDateRegex:en(/completion:: *(\d{4}-\d{2}-\d{2})/),cancelledDateRegex:en(/cancelled:: *(\d{4}-\d{2}-\d{2})/),recurrenceRegex:en(/repeat:: *([a-zA-Z0-9, !]+)/),dependsOnRegex:en(new RegExp("dependsOn:: *("+Ii.source+"( *, *"+Ii.source+" *)*)")),idRegex:en(new RegExp("id:: *("+Ii.source+")"))}},cl=class extends Fi{constructor(){super($m)}parsePriority(e){switch(e){case"highest":return"0";case"high":return"1";case"medium":return"2";case"low":return"4";case"lowest":return"5";default:return"3"}}componentToString(e,t,n){let i=super.componentToString(e,t,n),s=["blockLink","description"];return i!==""&&!s.includes(n)?` [${i.trim()}]`:i}};var er=(a=>(a.TODO="TODO",a.DONE="DONE",a.IN_PROGRESS="IN_PROGRESS",a.CANCELLED="CANCELLED",a.NON_TASK="NON_TASK",a.EMPTY="EMPTY",a))(er||{}),tt=class{constructor(e,t,n,i,s="TODO"){this.symbol=e,this.name=t,this.nextStatusSymbol=n,this.availableAsCommand=i,this.type=s}};var Pt=class{get symbol(){return this.configuration.symbol}get name(){return this.configuration.name}get nextStatusSymbol(){return this.configuration.nextStatusSymbol}get nextSymbol(){return this.configuration.nextStatusSymbol}get availableAsCommand(){return this.configuration.availableAsCommand}get type(){return this.configuration.type}get typeGroupText(){let e=this.type,t;switch(e){case"IN_PROGRESS":t="1";break;case"TODO":t="2";break;case"DONE":t="3";break;case"CANCELLED":t="4";break;case"NON_TASK":t="5";break;case"EMPTY":t="6";break}return`%%${t}%%${e}`}constructor(e){this.configuration=e}static makeDone(){return new Pt(new tt("x","Done"," ",!0,"DONE"))}static makeEmpty(){return new Pt(new tt("","EMPTY","",!0,"EMPTY"))}static makeTodo(){return new Pt(new tt(" ","Todo","x",!0,"TODO"))}static makeCancelled(){return new Pt(new tt("-","Cancelled"," ",!0,"CANCELLED"))}static makeInProgress(){return new Pt(new tt("/","In Progress","x",!0,"IN_PROGRESS"))}static makeNonTask(){return new Pt(new tt("Q","Non-Task","A",!0,"NON_TASK"))}static getTypeForUnknownSymbol(e){switch(e){case"x":case"X":return"DONE";case"/":return"IN_PROGRESS";case"-":return"CANCELLED";case"":return"EMPTY";case" ":default:return"TODO"}}static getTypeFromStatusTypeString(e){return er[e]||"TODO"}static createUnknownStatus(e){return new Pt(new tt(e,"Unknown","x",!1,"TODO"))}static createFromImportedValue(e){let t=e[0],n=Pt.getTypeFromStatusTypeString(e[3]);return new Pt(new tt(t,e[1],e[2],!1,n))}isCompleted(){return this.type==="DONE"}isCancelled(){return this.type==="CANCELLED"}identicalTo(e){let t=["symbol","name","nextStatusSymbol","availableAsCommand","type"];for(let n of t)if(this[n]!==e[n])return!1;return!0}previewText(){let e="";return Pt.tasksPluginCanCreateCommandsForStatuses()&&this.availableAsCommand&&(e=" Available as a command."),`- [${this.symbol}] => [${this.nextStatusSymbol}], name: '${this.name}', type: '${this.configuration.type}'.${e}`}static tasksPluginCanCreateCommandsForStatuses(){return!1}},re=Pt;re.DONE=Pt.makeDone(),re.EMPTY=Pt.makeEmpty(),re.TODO=Pt.makeTodo();var dl=class{constructor(e=!1,t=!1,n=!1){this.ignoreSortInstructions=e,this.showTaskHiddenData=t,this.recordTimings=n}};var Le=class{constructor(){this.coreStatuses=[re.makeTodo().configuration,re.makeDone().configuration],this.customStatuses=[re.makeInProgress().configuration,re.makeCancelled().configuration]}static addStatus(e,t){e.push(t)}static replaceStatus(e,t,n){let i=this.findStatusIndex(t,e);return i<=-1?!1:(e.splice(i,1,n),!0)}static findStatusIndex(e,t){let n=new re(e);return t.findIndex(i=>new re(i).previewText()==n.previewText())}static deleteStatus(e,t){let n=this.findStatusIndex(t,e);return n<=-1?!1:(e.splice(n,1),!0)}static deleteAllCustomStatuses(e){e.customStatuses.splice(0)}static resetAllCustomStatuses(e){Le.deleteAllCustomStatuses(e),new Le().customStatuses.forEach(n=>{Le.addStatus(e.customStatuses,n)})}static bulkAddStatusCollection(e,t){let n=[];return t.forEach(i=>{e.customStatuses.find(a=>a.symbol==i[0]&&a.name==i[1]&&a.nextStatusSymbol==i[2])?n.push(`The status ${i[1]} (${i[0]}) is already added.`):Le.addStatus(e.customStatuses,re.createFromImportedValue(i))}),n}static allStatuses(e){return e.coreStatuses.concat(e.customStatuses)}static applyToStatusRegistry(e,t){t.clearStatuses(),Le.allStatuses(e).forEach(n=>{t.add(n)})}};var _v=[{index:9999,internalName:"INTERNAL_TESTING_ENABLED_BY_DEFAULT",displayName:"Test Item. Used to validate the Feature Framework.",description:"Description",enabledByDefault:!0,stable:!1}];var Dn=class{constructor(e,t,n,i,s,a){this.internalName=e;this.index=t;this.description=n;this.displayName=i;this.enabledByDefault=s;this.stable=a}static get values(){let e=[];return _v.forEach(t=>{e=[...e,new Dn(t.internalName,t.index,t.description,t.displayName,t.enabledByDefault,t.stable)]}),e}static get settingsFlags(){let e={};return Dn.values.forEach(t=>{e[t.internalName]=t.enabledByDefault}),e}static fromString(e){for(let t of Dn.values)if(e===t.internalName)return t;throw new RangeError(`Illegal argument passed to fromString(): ${e} does not correspond to any available Feature ${this.prototype.constructor.name}`)}};var Rn={tasksPluginEmoji:{displayName:"Tasks Emoji Format",taskSerializer:new Fi(Wm),buildSuggestions:Fm(Wm,Im,!1)},dataview:{displayName:"Dataview",taskSerializer:new cl,buildSuggestions:bv(Fm($m,Im,!0),[["(",")"],["[","]"]])}},Gm={globalQuery:"",globalFilter:"",removeGlobalFilter:!1,taskFormat:"tasksPluginEmoji",setCreatedDate:!1,setDoneDate:!0,setCancelledDate:!0,autoSuggestInEditor:!0,autoSuggestMinMatch:0,autoSuggestMaxItems:6,provideAccessKeys:!0,useFilenameAsScheduledDate:!1,filenameAsDateFolders:[],recurrenceOnNextLine:!1,statusSettings:new Le,features:Dn.settingsFlags,generalSettings:{},headingOpened:{},debugSettings:new dl,loggingOptions:{minLevels:{"":"info",tasks:"info","tasks.Cache":"info","tasks.Events":"info","tasks.File":"info","tasks.Query":"info","tasks.Task":"info"}}},xn=X({},Gm);function jm(r,e){for(let t in r)e[t]===void 0&&(e[t]=r[t])}var Z=()=>(jm(Dn.settingsFlags,xn.features),jm(Gm.loggingOptions.minLevels,xn.loggingOptions.minLevels),jm(Gm.debugSettings,xn.debugSettings),xn.statusSettings.customStatuses.forEach((r,e,t)=>{var i,s;let n=re.getTypeFromStatusTypeString(r.type);t[e]=new tt((i=r.symbol)!=null?i:" ",r.name,(s=r.nextStatusSymbol)!=null?s:"x",r.availableAsCommand,n)}),X({},xn)),rt=r=>(xn=X(X({},xn),r),Z());var Li=(r,e)=>(xn.generalSettings[r]=e,Z()),vv=r=>{var e;return(e=xn.features[r])!=null?e:!1};function Do(){return Rn[Z().taskFormat]}function fl(r){let t={"<":"<",">":">","&":"&",'"':"""}[r];return t!==void 0?t:r}function wv(r){let e=[...r],t="";return e.forEach(n=>{t+=fl(n)}),t}var De=class{constructor(){this._registeredStatuses=[];this.addDefaultStatusTypes()}set(e){this.clearStatuses(),e.forEach(t=>{this.add(t)})}get registeredStatuses(){return this._registeredStatuses.filter(({symbol:e})=>e!==re.EMPTY.symbol)}static getInstance(){return De.instance||(De.instance=new De),De.instance}add(e){this.hasSymbol(e.symbol)||(e instanceof re?this._registeredStatuses.push(e):this._registeredStatuses.push(new re(e)))}bySymbol(e){return this.hasSymbol(e)?this.getSymbol(e):re.EMPTY}bySymbolOrCreate(e){return this.hasSymbol(e)?this.getSymbol(e):re.createUnknownStatus(e)}byName(e){return this._registeredStatuses.filter(({name:t})=>t===e).length>0?this._registeredStatuses.filter(({name:t})=>t===e)[0]:re.EMPTY}resetToDefaultStatuses(){this.clearStatuses(),this.addDefaultStatusTypes()}clearStatuses(){this._registeredStatuses=[]}getNextStatus(e){if(e.nextStatusSymbol!==""){let t=this.bySymbol(e.nextStatusSymbol);if(t!==null)return t}return re.EMPTY}getNextStatusOrCreate(e){let t=this.getNextStatus(e);return t.type!=="EMPTY"?t:re.createUnknownStatus(e.nextStatusSymbol)}getNextRecurrenceStatusOrCreate(e){let t=this.getNextStatusOrCreate(e),n=this.getNextRecurrenceStatusOfType(t,"TODO");if(n)return n;let i=this.getNextRecurrenceStatusOfType(t,"IN_PROGRESS");return i||this.bySymbolOrCreate(" ")}getNextRecurrenceStatusOfType(e,t){if(e.type===t)return e;let n=e;for(let i=0;i<this.registeredStatuses.length-1;i++)if(n=this.getNextStatusOrCreate(n),n.type===t)return n}findUnknownStatuses(e){let t=e.filter(s=>!this.hasSymbol(s.symbol)),n=new De,i=[];return t.forEach(s=>{if(n.hasSymbol(s.symbol))return;let a=De.copyStatusWithNewName(s,`Unknown (${s.symbol})`);i.push(a),n.add(a)}),i.sort((s,a)=>s.symbol.localeCompare(a.symbol,void 0,{numeric:!0}))}static copyStatusWithNewName(e,t){let n=new tt(e.symbol,t,e.nextStatusSymbol,e.availableAsCommand,e.type);return new re(n)}getSymbol(e){return this._registeredStatuses.filter(({symbol:t})=>t===e)[0]}hasSymbol(e){return this._registeredStatuses.find(t=>t.symbol===e)!==void 0}addDefaultStatusTypes(){[re.makeTodo(),re.makeInProgress(),re.makeDone(),re.makeCancelled()].forEach(t=>{this.add(t)})}mermaidDiagram(e=!1){let t=this.registeredStatuses,n="mermaid",i=[],s=[];return t.forEach((a,o)=>{let u=this.getMermaidNodeLabel(a,e);i.push(`${o+1}${u}`);let l=this.getNextStatus(a);if(this.addEdgeIfNotToInternal(t,l,s,o,!1),a.type==="DONE"){let c=this.getNextRecurrenceStatusOrCreate(a);c.symbol!==l.symbol&&this.addEdgeIfNotToInternal(t,c,s,o,!0)}}),`
|
|
|
\`\`\`${n}
|
|
|
flowchart LR
|
|
|
|
|
|
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;
|
|
|
|
|
|
${i.join(`
|
|
|
`)}
|
|
|
${s.join(`
|
|
|
`)}
|
|
|
|
|
|
linkStyle default stroke:gray
|
|
|
\`\`\`
|
|
|
`}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=wv(e.name),i=e.type;if(t){let s=fl(e.symbol),a=fl(e.nextStatusSymbol),o=`[${s}] -> [${a}]`,u=`'${n}'`,l=`(${i})`;return`["${u}<br>${o}<br>${l}"]:::${i}`}else return`["${n}"]:::${i}`}};var kv=require("obsidian");var tn=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(J.dateFormat,e)}formatAsDateAndTime(e=""){return this.format(J.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 tn("Overdue",1):t.isSame(e,"day")?new tn("Today",2):t.isValid()?new tn("Future",3):new tn("Invalid date",0):new tn("Undated",4)}get fromNow(){let e=this.moment;if(!e)return new tn("",0);let t=this.fromNowOrder(e);return new tn(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 kv.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 Mn=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 Mn.priorityNameUsingNone(e).replace("None","Normal")}};var lN=require("obsidian"),Dv=ga(Ov());var Ym=class extends Dv.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 Bm(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)}},Nt=new Ym,Bm=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:n,traceId:void 0};this.logManager.emit("log",s)}trace(e,t){this.log("trace",e,t)}debug(e,t){this.log("debug",e,t)}info(e,t){this.log("info",e,t)}warn(e,t){this.log("warn",e,t)}error(e,t){this.log("error",e,t)}logWithId(e,t,n,i){if(this.levelToInt(e)<this.minLevel)return;let a={level:e,module:this.module,message:n,objects:i,traceId:t};this.logManager.emit("log",a)}traceWithId(e,t,n){this.logWithId("trace",e,t,n)}debugWithId(e,t,n){this.logWithId("debug",e,t,n)}infoWithId(e,t,n){this.logWithId("info",e,t,n)}warnWithId(e,t,n){this.logWithId("warn",e,t,n)}errorWithId(e,t,n){this.logWithId("error",e,t,n)}};function Hm(r,e){let t=Nt.getLogger("tasks");switch(r){case"trace":t.trace(e);break;case"debug":t.debug(e);break;case"info":t.info(e);break;case"warn":t.warn(e);break;case"error":t.error(e);break;default:break}}function pl(r,e,t){r.debug(`${e}: task line number: ${t.taskLocation.lineNumber}. file path: "${t.path}"`),r.debug(`${e} original: ${t.originalMarkdown}`)}function ml(r,e,t){t.map((n,i)=>{r.debug(`${e} ==> ${i+1} : ${n.toFileLineString()}`)})}var kt=class{static fromPath(e){let{useFilenameAsScheduledDate:t,filenameAsDateFolders:n}=Z();return!t||!this.matchesAnyFolder(n,e)?null:this.extractDateFromPath(e)}static matchesAnyFolder(e,t){return e.length===0?!0:e.some(n=>t.startsWith(n+"/"))}static extractDateFromPath(e){let t=Math.max(0,e.lastIndexOf("/")+1),n=e.lastIndexOf("."),i=e.substring(t,n),s=/(\d{4})-(\d{2})-(\d{2})/.exec(i);if(s||(s=/(\d{4})(\d{2})(\d{2})/.exec(i)),s){let a=window.moment([parseInt(s[1]),parseInt(s[2])-1,parseInt(s[3])]);if(a.isValid())return a}return null}static canApplyFallback({startDate:e,scheduledDate:t,dueDate:n}){return e===null&&n===null&&t===null}static updateTaskPath(e,t,n){let i=e.scheduledDate,s=e.scheduledDateIsInferred;return n===null?s&&(s=!1,i=null):s?i=n:this.canApplyFallback(e)&&(i=n,s=!0),new oe(be(X({},e),{taskLocation:e.taskLocation.fromRenamedFile(new Je(t)),scheduledDate:i,scheduledDateIsInferred:s}))}static removeInferredStatusIfNeeded(e,t){let n=e.scheduledDateIsInferred?e.scheduledDate:null;return t.map(i=>(n!==null&&!n.isSame(i.scheduledDate,"day")&&(i=new oe(be(X({},i),{scheduledDateIsInferred:!1}))),i))}};var Pr=class{static calculate(e){var n,i,s;let t=0;if((n=e.dueDate)!=null&&n.isValid()){let a=window.moment().startOf("day"),o=Math.round(a.diff(e.dueDate)/Pr.milliSecondsPerDay),u;o>=7?u=1:o>=-14?u=(o+14)*.8/21+.2:u=.2,t+=u*Pr.dueCoefficient}switch((i=e.scheduledDate)!=null&&i.isValid()&&window.moment().isSameOrAfter(e.scheduledDate)&&(t+=1*Pr.scheduledCoefficient),(s=e.startDate)!=null&&s.isValid()&&window.moment().isBefore(e.startDate)&&(t+=1*Pr.startedCoefficient),e.priority){case"0":t+=1.5*Pr.priorityCoefficient;break;case"1":t+=1*Pr.priorityCoefficient;break;case"2":t+=.65*Pr.priorityCoefficient;break;case"3":t+=.325*Pr.priorityCoefficient;break;case"5":t-=.3*Pr.priorityCoefficient;break}return t}},Cn=Pr;Cn.dueCoefficient=12,Cn.scheduledCoefficient=5,Cn.startedCoefficient=-3,Cn.priorityCoefficient=6,Cn.milliSecondsPerDay=1e3*60*60*24;var oe=class{constructor({status:e,description:t,taskLocation:n,indentation:i,listMarker:s,priority:a,createdDate:o,startDate:u,scheduledDate:l,dueDate:c,doneDate:d,cancelledDate:m,recurrence:p,dependsOn:T,id:y,blockLink:E,tags:R,originalMarkdown:x,scheduledDateIsInferred:v}){this._urgency=null;this.status=e,this.description=t,this.indentation=i,this.listMarker=s,this.taskLocation=n,this.tags=R,this.priority=a,this.createdDate=o,this.startDate=u,this.scheduledDate=l,this.dueDate=c,this.doneDate=d,this.cancelledDate=m,this.recurrence=p,this.dependsOn=T,this.id=y,this.blockLink=E,this.originalMarkdown=x,this.scheduledDateIsInferred=v}static fromLine({line:e,taskLocation:t,fallbackDate:n}){let i=oe.extractTaskComponents(e);return i===null||!ye.getInstance().includedIn(i.body)?null:oe.parseTaskSignifiers(e,t,n)}static parseTaskSignifiers(e,t,n){let i=oe.extractTaskComponents(e);if(i===null)return null;let{taskSerializer:s}=Do(),a=s.deserialize(i.body),o=!1;return kt.canApplyFallback(a)&&n!==null&&(a.scheduledDate=n,o=!0),a.tags=a.tags.map(u=>u.trim()),a.tags=a.tags.filter(u=>!ye.getInstance().equals(u)),new oe(be(X(X({},i),a),{taskLocation:t,originalMarkdown:e,scheduledDateIsInferred:o}))}static extractTaskComponents(e){let t=e.match(J.taskRegex);if(t===null)return null;let n=t[1],i=t[2],s=t[3],a=De.getInstance().bySymbolOrCreate(s),o=t[4].trim(),u=o.match(J.blockLinkRegex),l=u!==null?u[0]:"";return l!==""&&(o=o.replace(J.blockLinkRegex,"").trim()),{indentation:n,listMarker:i,status:a,body:o,blockLink:l}}toString(){return Do().taskSerializer.serialize(this)}toFileLineString(){return`${this.indentation}${this.listMarker} [${this.status.symbol}] ${this.toString()}`}toggle(){let e=Nt.getLogger("tasks.Task"),t="toggle()";pl(e,t,this);let n=De.getInstance().getNextStatusOrCreate(this.status),i=this.handleNewStatus(n);return ml(e,t,i),i}handleNewStatus(e,t=window.moment()){if(e.identicalTo(this.status))return[this];let{setDoneDate:n}=Z(),i=this.newDate(e,"DONE",this.doneDate,n,t),{setCancelledDate:s}=Z(),a=this.newDate(e,"CANCELLED",this.cancelledDate,s,t),o=null;e.isCompleted()&&!this.status.isCompleted()&&this.recurrence!==null&&(o=this.recurrence.next(t));let u=new oe(be(X({},this),{status:e,doneDate:i,cancelledDate:a})),l=[];if(o!==null){let c=this.createNextOccurrence(e,o);l.push(c)}return l.push(u),l}newDate(e,t,n,i,s){let a=null;return e.type===t&&(this.status.type!==t?i&&(a=s):a=n),a}createNextOccurrence(e,t){let{setCreatedDate:n}=Z(),i=null;n&&(i=window.moment());let s=null,a=null,u=De.getInstance().getNextRecurrenceStatusOrCreate(e);return new oe(be(X(X({},this),t),{status:u,blockLink:"",id:"",dependsOn:[],createdDate:i,cancelledDate:s,doneDate:a}))}toggleWithRecurrenceInUsersOrder(){let e=this.toggle();return this.putRecurrenceInUsersOrder(e)}handleNewStatusWithRecurrenceInUsersOrder(e,t=window.moment()){Nt.getLogger("tasks.Task").debug(`changed task ${this.taskLocation.path} ${this.taskLocation.lineNumber} ${this.originalMarkdown} status to '${e.symbol}'`);let i=this.handleNewStatus(e,t);return this.putRecurrenceInUsersOrder(i)}putRecurrenceInUsersOrder(e){let{recurrenceOnNextLine:t}=Z();return t?e.reverse():e}get isDone(){return this.status.type==="DONE"||this.status.type==="CANCELLED"||this.status.type==="NON_TASK"}isBlocked(e){if(this.dependsOn.length===0||this.isDone)return!1;for(let t of this.dependsOn)if(!!e.find(i=>i.id===t&&!i.isDone))return!0;return!1}isBlocking(e){return this.id===""||this.isDone?!1:e.some(t=>t.isDone?!1:t.dependsOn.includes(this.id))}get priorityNumber(){return Number.parseInt(this.priority)}get priorityNameGroupText(){let e=Mn.priorityNameUsingNormal(this.priority);return`%%${this.priority}%%${e} priority`}get descriptionWithoutTags(){return this.description.replace(J.hashTags,"").trim()}get priorityName(){return Mn.priorityNameUsingNormal(this.priority)}get urgency(){return this._urgency===null&&(this._urgency=Cn.calculate(this)),this._urgency}get path(){return this.taskLocation.path}get cancelled(){return new Ye(this.cancelledDate)}get created(){return new Ye(this.createdDate)}get done(){return new Ye(this.doneDate)}get due(){return new Ye(this.dueDate)}get scheduled(){return new Ye(this.scheduledDate)}get start(){return new Ye(this.startDate)}get happensDates(){return Array.of(this.startDate,this.scheduledDate,this.dueDate)}get happens(){let e=this.happensDates,t=Array.from(e).sort(Tr);for(let n of t)if(n!=null&&n.isValid())return new Ye(n);return new Ye(null)}get isRecurring(){return this.recurrence!==null}get recurrenceRule(){return this.recurrence?this.recurrence.toText():""}get heading(){return this.precedingHeader}get hasHeading(){return this.precedingHeader!==null}get file(){return this.taskLocation.tasksFile}get filename(){let e=this.path.match(/([^/]+)\.md$/);return e!==null?e[1]:null}get lineNumber(){return this.taskLocation.lineNumber}get sectionStart(){return this.taskLocation.sectionStart}get sectionIndex(){return this.taskLocation.sectionIndex}get precedingHeader(){return this.taskLocation.precedingHeader}getLinkText({isFilenameUnique:e}){let t;return e?t=this.filename:t="/"+this.path,t===null?null:(this.precedingHeader!==null&&this.precedingHeader!==t&&(t=t+" > "+this.precedingHeader),t)}static tasksListsIdentical(e,t){return e.length!==t.length?!1:e.every((n,i)=>n.identicalTo(t[i]))}identicalTo(e){var s,a;let t=["description","path","indentation","listMarker","lineNumber","sectionStart","sectionIndex","precedingHeader","priority","blockLink","scheduledDateIsInferred","id","dependsOn"];for(let o of t)if(((s=this[o])==null?void 0:s.toString())!==((a=e[o])==null?void 0:a.toString()))return!1;if(!this.status.identicalTo(e.status)||this.tags.length!==e.tags.length||!this.tags.every(function(o,u){return o===e.tags[u]}))return!1;t=oe.allDateFields();for(let o of t){let u=this[o],l=e[o];if(Tr(u,l)!==0)return!1}let n=this.recurrence,i=e.recurrence;return n===null&&i!==null||n!==null&&i===null?!1:!(n&&i&&!n.identicalTo(i))}static allDateFields(){return["createdDate","startDate","scheduledDate","dueDate","doneDate","cancelledDate"]}static extractHashtags(e){var t,n;return(n=(t=e.match(J.hashTags))==null?void 0:t.map(i=>i.trim()))!=null?n:[]}};var xo=class{constructor(e){this.fetch=e;this._value=void 0}get value(){return this._value===void 0&&(this._value=this.fetch()),this._value}};var bt=class{constructor(e,t,n,i,s){this._tasksFile=e,this._lineNumber=t,this._sectionStart=n,this._sectionIndex=i,this._precedingHeader=s}static fromUnknownPosition(e){return new bt(e,0,0,0,null)}fromRenamedFile(e){return new bt(e,this.lineNumber,this.sectionStart,this.sectionIndex,this.precedingHeader)}get tasksFile(){return this._tasksFile}get path(){return this._tasksFile.path}get lineNumber(){return this._lineNumber}get sectionStart(){return this._sectionStart}get sectionIndex(){return this._sectionIndex}get precedingHeader(){return this._precedingHeader}get hasKnownPath(){return this.path!==""}};var Ui=class{constructor({metadataCache:e,vault:t,events:n}){this.logger=Nt.getLogger("tasks.Cache");this.logger.debug("Creating Cache object"),this.metadataCache=e,this.metadataCacheEventReferences=[],this.vault=t,this.vaultEventReferences=[],this.events=n,this.eventsEventReferences=[],this.tasksMutex=new ou,this.state="Cold",this.logger.debug("Cache.constructor(): state = Cold"),this.tasks=[],this.loadedAfterFirstResolve=!1,this.subscribeToCache(),this.subscribeToVault(),this.subscribeToEvents(),this.loadVault()}unload(){this.logger.info("Unloading Cache");for(let e of this.metadataCacheEventReferences)this.metadataCache.offref(e);for(let e of this.vaultEventReferences)this.vault.offref(e);for(let e of this.eventsEventReferences)this.events.off(e)}getTasks(){return this.tasks}getState(){return this.state}notifySubscribers(){this.logger.debug("Cache.notifySubscribers()"),this.events.triggerCacheUpdate({tasks:this.tasks,state:this.state})}subscribeToCache(){this.logger.debug("Cache.subscribeToCache()");let e=this.metadataCache.on("resolved",()=>F(this,null,function*(){this.loadedAfterFirstResolve||(this.loadedAfterFirstResolve=!0,this.loadVault())}));this.metadataCacheEventReferences.push(e);let t=this.metadataCache.on("changed",n=>{this.tasksMutex.runExclusive(()=>{this.indexFile(n)})});this.metadataCacheEventReferences.push(t)}subscribeToVault(){this.logger.debug("Cache.subscribeToVault()");let{useFilenameAsScheduledDate:e}=Z(),t=this.vault.on("create",s=>{s instanceof Ms.TFile&&(this.logger.debug(`Cache.subscribeToVault.createdEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.indexFile(s)}))});this.vaultEventReferences.push(t);let n=this.vault.on("delete",s=>{s instanceof Ms.TFile&&(this.logger.debug(`Cache.subscribeToVault.deletedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.tasks=this.tasks.filter(a=>a.path!==s.path),this.notifySubscribers()}))});this.vaultEventReferences.push(n);let i=this.vault.on("rename",(s,a)=>{s instanceof Ms.TFile&&(this.logger.debug(`Cache.subscribeToVault.renamedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{let o=new Je(s.path),u=new xo(()=>kt.fromPath(s.path));this.tasks=this.tasks.map(l=>l.path===a?e?kt.updateTaskPath(l,s.path,u.value):new oe(be(X({},l),{taskLocation:l.taskLocation.fromRenamedFile(o)})):l),this.notifySubscribers()}))});this.vaultEventReferences.push(i)}subscribeToEvents(){this.logger.debug("Cache.subscribeToEvents()");let e=this.events.onRequestCacheUpdate(t=>{t({tasks:this.tasks,state:this.state})});this.eventsEventReferences.push(e)}loadVault(){return this.logger.debug("Cache.loadVault()"),this.tasksMutex.runExclusive(()=>F(this,null,function*(){this.state="Initializing",this.logger.debug("Cache.loadVault(): state = Initializing"),yield Promise.all(this.vault.getMarkdownFiles().map(e=>this.indexFile(e))),this.state="Warm",this.logger.debug("Cache.loadVault(): state = Warm"),this.notifySubscribers()}))}indexFile(e){return F(this,null,function*(){let t=this.metadataCache.getFileCache(e);if(t==null)return;if(!e.path.endsWith(".md")){this.logger.debug("indexFile: skipping non-markdown file: "+e.path);return}this.logger.debug("Cache.indexFile: "+e.path);let n=this.tasks.filter(a=>a.path===e.path),i=t.listItems,s=[];if(i!==void 0){let a=yield this.vault.cachedRead(e);s=this.getTasksFromFileContent(a,i,t,e)}oe.tasksListsIdentical(n,s)||(this.tasks=this.tasks.filter(a=>a.path!==e.path),this.tasks.push(...s),this.logger.debug("Cache.indexFile: "+e.path+`: read ${s.length} task(s)`),this.notifySubscribers())})}getTasksFromFileContent(e,t,n,i){let s=new Je(i.path),a=[],o=e.split(`
|
|
|
`),u=o.length,l=new xo(()=>kt.fromPath(i.path)),c=null,d=0;for(let m of t)if(m.task!==void 0){let p=m.position.start.line;if(p>=u)return this.logger.debug(`${i.path} Obsidian gave us a line number ${p} past the end of the file. ${u}.`),a;if((c===null||c.position.end.line<p)&&(c=Ui.getSection(p,n.sections),d=0),c===null)continue;let T=o[p];if(T===void 0){this.logger.debug(`${i.path}: line ${p} - ignoring 'undefined' line.`);continue}let y;try{y=oe.fromLine({line:T,taskLocation:new bt(s,p,c.position.start.line,d,Ui.getPrecedingHeader(p,n.headings)),fallbackDate:l.value})}catch(E){this.reportTaskParsingErrorToUser(E,i,m,T);continue}y!==null&&(d++,a.push(y))}return a}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}
|
|
|
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.
|
|
|
`;this.logger.error(s),e instanceof Error&&this.logger.error(e.stack?e.stack:"Cannot determine stack"),this.state==="Initializing"&&new Ms.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 hh=require("obsidian");var Sw=require("obsidian");function Et(){}function Qm(r){return r()}function xv(){return Object.create(null)}function _r(r){r.forEach(Qm)}function yl(r){return typeof r=="function"}function Is(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function Rv(r){return Object.keys(r).length===0}var Mv=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global,Mo=class{constructor(e){this.options=e,this._listeners="WeakMap"in Mv?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)Mo.entries.set(i.target,i),(n=this._listeners.get(i.target))===null||n===void 0||n(i)})}};Mo.entries="WeakMap"in Mv?new WeakMap:void 0;var Cv=!1;function cN(){Cv=!0}function dN(){Cv=!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 Fs(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 fN(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Fe(r){return document.createTextNode(r)}function te(){return Fe(" ")}function Re(r,e,t,n){return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function Av(r){return function(e){return e.preventDefault(),r.call(this,e)}}function L(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function Pv(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 pN(r){return Array.from(r.childNodes)}function Nr(r,e){e=""+e,r.data!==e&&(r.data=e)}function Ir(r,e){r.value=e==null?"":e}function Xm(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 Nv(r){let e=r.querySelector(":checked");return e&&e.__value}var hl;function mN(){if(hl===void 0){hl=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(r){hl=!0}}return hl}function Iv(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=mN(),s;return i?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=Re(window,"message",a=>{a.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{s=Re(n.contentWindow,"resize",e),e()}),A(r,n),()=>{(i||s&&n.contentWindow)&&s(),Ce(n)}}function Fr(r,e,t){r.classList[t?"add":"remove"](e)}var Ns=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=fN(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 Co;function Ro(r){Co=r}function hN(){if(!Co)throw new Error("Function called outside component initialization");return Co}function Zm(r){hN().$$.on_mount.push(r)}var As=[];var nt=[],Ps=[],zm=[],gN=Promise.resolve(),Km=!1;function yN(){Km||(Km=!0,gN.then(Fv))}function Wi(r){Ps.push(r)}function tr(r){zm.push(r)}var Vm=new Set,Cs=0;function Fv(){if(Cs!==0)return;let r=Co;do{try{for(;Cs<As.length;){let e=As[Cs];Cs++,Ro(e),bN(e.$$)}}catch(e){throw As.length=0,Cs=0,e}for(Ro(null),As.length=0,Cs=0;nt.length;)nt.pop()();for(let e=0;e<Ps.length;e+=1){let t=Ps[e];Vm.has(t)||(Vm.add(t),t())}Ps.length=0}while(As.length);for(;zm.length;)zm.pop()();Km=!1,Vm.clear(),Ro(r)}function bN(r){if(r.fragment!==null){r.update(),_r(r.before_update);let e=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,e),r.after_update.forEach(Wi)}}function TN(r){let e=[],t=[];Ps.forEach(n=>r.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),Ps=e}var gl=new Set,qi;function Lv(){qi={r:0,c:[],p:qi}}function Uv(){qi.r||_r(qi.c),qi=qi.p}function vr(r,e){r&&r.i&&(gl.delete(r),r.i(e))}function Lr(r,e,t,n){if(r&&r.o){if(gl.has(r))return;gl.add(r),qi.c.push(()=>{gl.delete(r),n&&(t&&r.d(1),n())}),r.o(e)}else n&&n()}var _N=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],nj=new Set([..._N]);function rr(r,e,t){let n=r.$$.props[e];n!==void 0&&(r.$$.bound[n]=t,t(r.$$.ctx[n]))}function An(r){r&&r.c()}function rn(r,e,t,n){let{fragment:i,after_update:s}=r.$$;i&&i.m(e,t),n||Wi(()=>{let a=r.$$.on_mount.map(Qm).filter(yl);r.$$.on_destroy?r.$$.on_destroy.push(...a):_r(a),r.$$.on_mount=[]}),s.forEach(Wi)}function Ur(r,e){let t=r.$$;t.fragment!==null&&(TN(t.after_update),_r(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function vN(r,e){r.$$.dirty[0]===-1&&(As.push(r),yN(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<<e%31}function Ls(r,e,t,n,i,s,a,o=[-1]){let u=Co;Ro(r);let l=r.$$={fragment:null,ctx:[],props:s,update:Et,not_equal:i,bound:xv(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:xv(),dirty:o,skip_bound:!1,root:e.target||u.$$.root};a&&a(l.root);let c=!1;if(l.ctx=t?t(r,e.props||{},(d,m,...p)=>{let T=p.length?p[0]:m;return l.ctx&&i(l.ctx[d],l.ctx[d]=T)&&(!l.skip_bound&&l.bound[d]&&l.bound[d](T),c&&vN(r,d)),m}):[],l.update(),c=!0,_r(l.before_update),l.fragment=n?n(l.ctx):!1,e.target){if(e.hydrate){cN();let d=pN(e.target);l.fragment&&l.fragment.l(d),d.forEach(Ce)}else l.fragment&&l.fragment.c();e.intro&&vr(r.$$.fragment),rn(r,e.target,e.anchor,e.customElement),dN(),Fv()}Ro(u)}var wN;typeof HTMLElement=="function"&&(wN=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:r}=this.$$;this.$$.on_disconnect=r.map(Qm).filter(yl);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(r,e,t){this[r]=t}disconnectedCallback(){_r(this.$$.on_disconnect)}$destroy(){Ur(this,1),this.$destroy=Et}$on(r,e){if(!yl(e))return Et;let t=this.$$.callbacks[r]||(this.$$.callbacks[r]=[]);return t.push(e),()=>{let n=t.indexOf(e);n!==-1&&t.splice(n,1)}}$set(r){this.$$set&&!Rv(r)&&(this.$$.skip_bound=!0,this.$$set(r),this.$$.skip_bound=!1)}});var ri=class{$destroy(){Ur(this,1),this.$destroy=Et}$on(e,t){if(!yl(t))return Et;let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!Rv(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};function Jm(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})}function eh(r){let e="",t=!0;for(;t;)e=Math.random().toString(36).substring(2,6+2),r.includes(e)||(t=!1);return e}function qv(r,e){return r.id!==""?r:new oe(be(X({},r),{id:eh(e)}))}function Wv(r,e){let t=r;if(!r.dependsOn.includes(e.id)){let n=[...r.dependsOn,e.id];t=new oe(be(X({},r),{dependsOn:n}))}return t}function $v(r,e){let t=r;if(r.dependsOn.includes(e.id)){let n=r.dependsOn.filter(i=>i!==e.id);t=new oe(be(X({},r),{dependsOn:n}))}return t}var Po=require("obsidian");var Ao,th,rh,kN=["md"];function _l(){return Nt.getLogger("tasks.File")}var jv=({metadataCache:r,vault:e,workspace:t})=>{Ao=r,th=e,rh=t},nn=t=>F(void 0,[t],function*({originalTask:r,newTasks:e}){if(th===void 0||Ao===void 0||rh===void 0){bl("Tasks: cannot use File before initializing it.");return}Array.isArray(e)||(e=[e]);let n=_l(),i="replaceTaskWithTasks()";pl(n,i,r),ml(n,i,e),yield Yv({originalTask:r,newTasks:e,vault:th,metadataCache:Ao,workspace:rh,previousTries:0})});function bl(r){console.error(r),new Po.Notice(r,15e3)}function Gv(r){console.warn(r),new Po.Notice(r,1e4)}function EN(r){_l().debug(r)}var ni=class extends Error{},Tl=class extends Error{},Yv=a=>F(void 0,[a],function*({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s}){let o=_l();o.debug(`tryRepetitive after ${s} previous tries`);let u=()=>F(void 0,null,function*(){if(s>10){let c=`Tasks: Could not find the correct task line to update.
|
|
|
|
|
|
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.
|
|
|
`;bl(c);return}let l=Math.min(Math.pow(10,s),100);o.debug(`timeout = ${l}`),setTimeout(()=>F(void 0,null,function*(){yield Yv({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s+1})}),l)});try{let[l,c,d]=yield Bv(r,t),m=[...d.slice(0,l),...e.map(p=>p.toFileLineString()),...d.slice(l+1)];yield t.modify(c,m.join(`
|
|
|
`))}catch(l){if(l instanceof ni){l.message&&Gv(l.message),yield u();return}else if(l instanceof Tl){yield u();return}else l instanceof Error&&bl(l.message)}});function Bv(r,e){return F(this,null,function*(){if(Ao===void 0)throw new ni;let t=e.getAbstractFileByPath(r.path);if(!(t instanceof Po.TFile))throw new ni(`Tasks: No file found for task ${r.description}. Retrying ...`);if(!kN.includes(t.extension))throw new Error(`Tasks: Does not support files with the ${t.extension} file extension.`);let n=Ao.getFileCache(t);if(n==null||n===null)throw new ni(`Tasks: No file cache found for file ${t.path}. Retrying ...`);let i=n.listItems;if(i===void 0||i.length===0)throw new ni(`Tasks: No list items found in file cache of ${t.path}. Retrying ...`);let a=(yield e.read(t)).split(`
|
|
|
`),o=SN(r,a,i,EN);if(o===void 0)throw new Tl;return[o,t,a]})}function nh(r,e){return F(this,null,function*(){try{let[t,n,i]=yield Bv(r,e);return[t,n]}catch(t){t instanceof ni?t.message&&Gv(t.message):t instanceof Error&&bl(t.message)}})}function Hv(r,e){return r<e.length}function SN(r,e,t,n){let i=ON(r,e);return i!==void 0||(i=DN(r,e),i!==void 0)?i:xN(r,e,t,n)}function ON(r,e){let t=r.taskLocation.lineNumber;if(Hv(t,e)&&e[t]===r.originalMarkdown)return _l().debug(`Found original markdown at original line number ${t}`),t}function DN(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 xN(r,e,t,n){let i,s=0;for(let a of t){let o=a.position.start.line;if(!Hv(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}.
|
|
|
Expected task:
|
|
|
${r.originalMarkdown}
|
|
|
Found task:
|
|
|
${u}`);return}break}s++}}return i}function RN(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 Ns(!1),L(e,"id",r[2]),L(e,"type","text"),L(e,"class","input"),L(e,"placeholder",MN),L(e,"accesskey",r[4]),Fr(e,"tasks-modal-error",!r[1]),a.a=null,L(n,"class","results")},m(l,c){Ie(l,e,c),Ir(e,r[0]),Ie(l,t,c),Ie(l,n,c),A(n,i),A(n,s),a.m(r[5],n),o||(u=Re(e,"input",r[7]),o=!0)},p(l,[c]){c&4&&L(e,"id",l[2]),c&16&&L(e,"accesskey",l[4]),c&1&&e.value!==l[0]&&Ir(e,l[0]),c&2&&Fr(e,"tasks-modal-error",!l[1]),c&8&&Nr(i,l[3]),c&32&&a.p(l[5])},i:Et,o:Et,d(l){l&&Ce(e),l&&Ce(t),l&&Ce(n),o=!1,u()}}}var MN="Try 'Monday' or 'tomorrow', or [td|tm|yd|tw|nw|we] then space.";function CN(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=el(s)),t(5,l=gv(n,s,o)),t(1,a=!l.includes("invalid"))}},[s,a,n,i,u,l,o,c]}var ih=class extends ri{constructor(e){super(),Ls(this,e,CN,RN,Is,{id:2,dateSymbol:3,date:0,isDateValid:1,forwardOnly:6,accesskey:4})}},$i=ih;var ji=Math.min,$t=Math.max,Io=Math.round;var Pn=r=>({x:r,y:r}),AN={left:"right",right:"left",bottom:"top",top:"bottom"},PN={start:"end",end:"start"};function sh(r,e,t){return $t(r,ji(e,t))}function Us(r,e){return typeof r=="function"?r(e):r}function Nn(r){return r.split("-")[0]}function qs(r){return r.split("-")[1]}function ah(r){return r==="x"?"y":"x"}function oh(r){return r==="y"?"height":"width"}function Ws(r){return["top","bottom"].includes(Nn(r))?"y":"x"}function uh(r){return ah(Ws(r))}function Vv(r,e,t){t===void 0&&(t=!1);let n=qs(r),i=uh(r),s=oh(i),a=i==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=No(a)),[a,No(a)]}function zv(r){let e=No(r);return[vl(r),e,vl(e)]}function vl(r){return r.replace(/start|end/g,e=>PN[e])}function NN(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 Kv(r,e,t,n){let i=qs(r),s=NN(Nn(r),t==="start",n);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(vl)))),s}function No(r){return r.replace(/left|right|bottom|top/g,e=>AN[e])}function IN(r){return X({top:0,right:0,bottom:0,left:0},r)}function Qv(r){return typeof r!="number"?IN(r):{top:r,right:r,bottom:r,left:r}}function Gi(r){return be(X({},r),{top:r.y,left:r.x,right:r.x+r.width,bottom:r.y+r.height})}function Xv(r,e,t){let{reference:n,floating:i}=r,s=Ws(e),a=uh(e),o=oh(a),u=Nn(e),l=s==="y",c=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,m=n[o]/2-i[o]/2,p;switch(u){case"top":p={x:c,y:n.y-i.height};break;case"bottom":p={x:c,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-i.width,y:d};break;default:p={x:n.x,y:n.y}}switch(qs(e)){case"start":p[a]-=m*(t&&l?-1:1);break;case"end":p[a]+=m*(t&&l?-1:1);break}return p}var Zv=(r,e,t)=>F(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}=Xv(l,n,u),m=n,p={},T=0;for(let y=0;y<o.length;y++){let{name:E,fn:R}=o[y],{x,y:v,data:V,reset:j}=yield R({x:c,y:d,initialPlacement:n,placement:m,strategy:i,middlewareData:p,rects:l,platform:a,elements:{reference:r,floating:e}});if(c=x!=null?x:c,d=v!=null?v:d,p=be(X({},p),{[E]:X(X({},p[E]),V)}),j&&T<=50){T++,typeof j=="object"&&(j.placement&&(m=j.placement),j.rects&&(l=j.rects===!0?yield a.getElementRects({reference:r,floating:e,strategy:i}):j.rects),{x:c,y:d}=Xv(l,m,u)),y=-1;continue}}return{x:c,y:d,placement:m,strategy:i,middlewareData:p}});function wl(r,e){return F(this,null,function*(){var t;e===void 0&&(e={});let{x:n,y:i,platform:s,rects:a,elements:o,strategy:u}=r,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=Us(e,r),T=Qv(p),E=o[m?d==="floating"?"reference":"floating":d],R=Gi(yield s.getClippingRect({element:(t=yield s.isElement==null?void 0:s.isElement(E))==null||t?E:E.contextElement||(yield s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:l,rootBoundary:c,strategy:u})),x=d==="floating"?be(X({},a.floating),{x:n,y:i}):a.reference,v=yield s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating),V=(yield s.isElement==null?void 0:s.isElement(v))?(yield s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},j=Gi(s.convertOffsetParentRelativeRectToViewportRelativeRect?yield s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:v,strategy:u}):x);return{top:(R.top-j.top+T.top)/V.y,bottom:(j.bottom-R.bottom+T.bottom)/V.y,left:(R.left-j.left+T.left)/V.x,right:(j.right-R.right+T.right)/V.x}})}var lh=function(r){return r===void 0&&(r={}),{name:"flip",options:r,fn(t){return F(this,null,function*(){var n,i;let{placement:s,middlewareData:a,rects:o,initialPlacement:u,platform:l,elements:c}=t,O=Us(r,t),{mainAxis:d=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:T="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:E=!0}=O,R=au(O,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let x=Nn(s),v=Nn(u)===u,V=yield l.isRTL==null?void 0:l.isRTL(c.floating),j=p||(v||!E?[No(u)]:zv(u));!p&&y!=="none"&&j.push(...Kv(u,E,y,V));let ee=[u,...j],Y=yield wl(t,R),W=[],de=((i=a.flip)==null?void 0:i.overflows)||[];if(d&&W.push(Y[x]),m){let B=Vv(s,o,V);W.push(Y[B[0]],Y[B[1]])}if(de=[...de,{placement:s,overflows:W}],!W.every(B=>B<=0)){var Te,G;let B=(((Te=a.flip)==null?void 0:Te.index)||0)+1,U=ee[B];if(U)return{data:{index:B,overflows:de},reset:{placement:U}};let Q=(G=de.filter(f=>f.overflows[0]<=0).sort((f,h)=>f.overflows[1]-h.overflows[1])[0])==null?void 0:G.placement;if(!Q)switch(T){case"bestFit":{var N;let f=(N=de.map(h=>[h.placement,h.overflows.filter(g=>g>0).reduce((g,b)=>g+b,0)]).sort((h,g)=>h[1]-g[1])[0])==null?void 0:N[0];f&&(Q=f);break}case"initialPlacement":Q=u;break}if(s!==Q)return{reset:{placement:Q}}}return{}})}}};function FN(r,e){return F(this,null,function*(){let{placement:t,platform:n,elements:i}=r,s=yield n.isRTL==null?void 0:n.isRTL(i.floating),a=Nn(t),o=qs(t),u=Ws(t)==="y",l=["left","top"].includes(a)?-1:1,c=s&&u?-1:1,d=Us(e,r),{mainAxis:m,crossAxis:p,alignmentAxis:T}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:X({mainAxis:0,crossAxis:0,alignmentAxis:null},d);return o&&typeof T=="number"&&(p=o==="end"?T*-1:T),u?{x:p*c,y:m*l}:{x:m*l,y:p*c}})}var kl=function(r){return r===void 0&&(r=0),{name:"offset",options:r,fn(t){return F(this,null,function*(){var n,i;let{x:s,y:a,placement:o,middlewareData:u}=t,l=yield FN(t,r);return o===((n=u.offset)==null?void 0:n.placement)&&(i=u.arrow)!=null&&i.alignmentOffset?{}:{x:s+l.x,y:a+l.y,data:be(X({},l),{placement:o})}})}}},El=function(r){return r===void 0&&(r={}),{name:"shift",options:r,fn(t){return F(this,null,function*(){let{x:n,y:i,placement:s}=t,R=Us(r,t),{mainAxis:a=!0,crossAxis:o=!1,limiter:u={fn:x=>{let{x:v,y:V}=x;return{x:v,y:V}}}}=R,l=au(R,["mainAxis","crossAxis","limiter"]),c={x:n,y:i},d=yield wl(t,l),m=Ws(Nn(s)),p=ah(m),T=c[p],y=c[m];if(a){let x=p==="y"?"top":"left",v=p==="y"?"bottom":"right",V=T+d[x],j=T-d[v];T=sh(V,T,j)}if(o){let x=m==="y"?"top":"left",v=m==="y"?"bottom":"right",V=y+d[x],j=y-d[v];y=sh(V,y,j)}let E=u.fn(be(X({},t),{[p]:T,[m]:y}));return be(X({},E),{data:{x:E.x-n,y:E.y-i}})})}}};var ch=function(r){return r===void 0&&(r={}),{name:"size",options:r,fn(t){return F(this,null,function*(){let{placement:n,rects:i,platform:s,elements:a}=t,Y=Us(r,t),{apply:o=()=>{}}=Y,u=au(Y,["apply"]),l=yield wl(t,u),c=Nn(n),d=qs(n),m=Ws(n)==="y",{width:p,height:T}=i.floating,y,E;c==="top"||c==="bottom"?(y=c,E=d===((yield s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(E=c,y=d==="end"?"top":"bottom");let R=T-l[y],x=p-l[E],v=!t.middlewareData.shift,V=R,j=x;if(m){let W=p-l.left-l.right;j=d||v?ji(x,W):W}else{let W=T-l.top-l.bottom;V=d||v?ji(R,W):W}if(v&&!d){let W=$t(l.left,0),de=$t(l.right,0),Te=$t(l.top,0),G=$t(l.bottom,0);m?j=p-2*(W!==0||de!==0?W+de:$t(l.left,l.right)):V=T-2*(Te!==0||G!==0?Te+G:$t(l.top,l.bottom))}yield o(be(X({},t),{availableWidth:j,availableHeight:V}));let ee=yield s.getDimensions(a.floating);return p!==ee.width||T!==ee.height?{reset:{rects:!0}}:{}})}}};function In(r){return ew(r)?(r.nodeName||"").toLowerCase():"#document"}function jt(r){var e;return(r==null||(e=r.ownerDocument)==null?void 0:e.defaultView)||window}function Fn(r){var e;return(e=(ew(r)?r.ownerDocument:r.document)||window.document)==null?void 0:e.documentElement}function ew(r){return r instanceof Node||r instanceof jt(r).Node}function sn(r){return r instanceof Element||r instanceof jt(r).Element}function qr(r){return r instanceof HTMLElement||r instanceof jt(r).HTMLElement}function Jv(r){return typeof ShadowRoot=="undefined"?!1:r instanceof ShadowRoot||r instanceof jt(r).ShadowRoot}function $s(r){let{overflow:e,overflowX:t,overflowY:n,display:i}=nr(r);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!["inline","contents"].includes(i)}function tw(r){return["table","td","th"].includes(In(r))}function Ol(r){let e=Dl(),t=nr(r);return t.transform!=="none"||t.perspective!=="none"||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(t.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(t.contain||"").includes(n))}function rw(r){let e=Yi(r);for(;qr(e)&&!Fo(e);){if(Ol(e))return e;e=Yi(e)}return null}function Dl(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fo(r){return["html","body","#document"].includes(In(r))}function nr(r){return jt(r).getComputedStyle(r)}function Lo(r){return sn(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function Yi(r){if(In(r)==="html")return r;let e=r.assignedSlot||r.parentNode||Jv(r)&&r.host||Fn(r);return Jv(e)?e.host:e}function nw(r){let e=Yi(r);return Fo(e)?r.ownerDocument?r.ownerDocument.body:r.body:qr(e)&&$s(e)?e:nw(e)}function Sl(r,e,t){var n;e===void 0&&(e=[]),t===void 0&&(t=!0);let i=nw(r),s=i===((n=r.ownerDocument)==null?void 0:n.body),a=jt(i);return s?e.concat(a,a.visualViewport||[],$s(i)?i:[],a.frameElement&&t?Sl(a.frameElement):[]):e.concat(i,Sl(i,[],t))}function aw(r){let e=nr(r),t=parseFloat(e.width)||0,n=parseFloat(e.height)||0,i=qr(r),s=i?r.offsetWidth:t,a=i?r.offsetHeight:n,o=Io(t)!==s||Io(n)!==a;return o&&(t=s,n=a),{width:t,height:n,$:o}}function ow(r){return sn(r)?r:r.contextElement}function js(r){let e=ow(r);if(!qr(e))return Pn(1);let t=e.getBoundingClientRect(),{width:n,height:i,$:s}=aw(e),a=(s?Io(t.width):t.width)/n,o=(s?Io(t.height):t.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}var LN=Pn(0);function uw(r){let e=jt(r);return!Dl()||!e.visualViewport?LN:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function UN(r,e,t){return e===void 0&&(e=!1),!t||e&&t!==jt(r)?!1:e}function Uo(r,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);let i=r.getBoundingClientRect(),s=ow(r),a=Pn(1);e&&(n?sn(n)&&(a=js(n)):a=js(r));let o=UN(s,t,n)?uw(s):Pn(0),u=(i.left+o.x)/a.x,l=(i.top+o.y)/a.y,c=i.width/a.x,d=i.height/a.y;if(s){let m=jt(s),p=n&&sn(n)?jt(n):n,T=m.frameElement;for(;T&&n&&p!==m;){let y=js(T),E=T.getBoundingClientRect(),R=nr(T),x=E.left+(T.clientLeft+parseFloat(R.paddingLeft))*y.x,v=E.top+(T.clientTop+parseFloat(R.paddingTop))*y.y;u*=y.x,l*=y.y,c*=y.x,d*=y.y,u+=x,l+=v,T=jt(T).frameElement}}return Gi({width:c,height:d,x:u,y:l})}function qN(r){let{rect:e,offsetParent:t,strategy:n}=r,i=qr(t),s=Fn(t);if(t===s)return e;let a={scrollLeft:0,scrollTop:0},o=Pn(1),u=Pn(0);if((i||!i&&n!=="fixed")&&((In(t)!=="body"||$s(s))&&(a=Lo(t)),qr(t))){let l=Uo(t);o=js(t),u.x=l.x+t.clientLeft,u.y=l.y+t.clientTop}return{width:e.width*o.x,height:e.height*o.y,x:e.x*o.x-a.scrollLeft*o.x+u.x,y:e.y*o.y-a.scrollTop*o.y+u.y}}function WN(r){return Array.from(r.getClientRects())}function lw(r){return Uo(Fn(r)).left+Lo(r).scrollLeft}function $N(r){let e=Fn(r),t=Lo(r),n=r.ownerDocument.body,i=$t(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=$t(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+lw(r),o=-t.scrollTop;return nr(n).direction==="rtl"&&(a+=$t(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:a,y:o}}function jN(r,e){let t=jt(r),n=Fn(r),i=t.visualViewport,s=n.clientWidth,a=n.clientHeight,o=0,u=0;if(i){s=i.width,a=i.height;let l=Dl();(!l||l&&e==="fixed")&&(o=i.offsetLeft,u=i.offsetTop)}return{width:s,height:a,x:o,y:u}}function GN(r,e){let t=Uo(r,!0,e==="fixed"),n=t.top+r.clientTop,i=t.left+r.clientLeft,s=qr(r)?js(r):Pn(1),a=r.clientWidth*s.x,o=r.clientHeight*s.y,u=i*s.x,l=n*s.y;return{width:a,height:o,x:u,y:l}}function iw(r,e,t){let n;if(e==="viewport")n=jN(r,t);else if(e==="document")n=$N(Fn(r));else if(sn(e))n=GN(e,t);else{let i=uw(r);n=be(X({},e),{x:e.x-i.x,y:e.y-i.y})}return Gi(n)}function cw(r,e){let t=Yi(r);return t===e||!sn(t)||Fo(t)?!1:nr(t).position==="fixed"||cw(t,e)}function YN(r,e){let t=e.get(r);if(t)return t;let n=Sl(r,[],!1).filter(o=>sn(o)&&In(o)!=="body"),i=null,s=nr(r).position==="fixed",a=s?Yi(r):r;for(;sn(a)&&!Fo(a);){let o=nr(a),u=Ol(a);!u&&o.position==="fixed"&&(i=null),(s?!u&&!i:!u&&o.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||$s(a)&&!u&&cw(r,a))?n=n.filter(c=>c!==a):i=o,a=Yi(a)}return e.set(r,n),n}function BN(r){let{element:e,boundary:t,rootBoundary:n,strategy:i}=r,a=[...t==="clippingAncestors"?YN(e,this._c):[].concat(t),n],o=a[0],u=a.reduce((l,c)=>{let d=iw(e,c,i);return l.top=$t(d.top,l.top),l.right=ji(d.right,l.right),l.bottom=ji(d.bottom,l.bottom),l.left=$t(d.left,l.left),l},iw(e,o,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function HN(r){return aw(r)}function VN(r,e,t){let n=qr(e),i=Fn(e),s=t==="fixed",a=Uo(r,!0,s,e),o={scrollLeft:0,scrollTop:0},u=Pn(0);if(n||!n&&!s)if((In(e)!=="body"||$s(i))&&(o=Lo(e)),n){let l=Uo(e,!0,s,e);u.x=l.x+e.clientLeft,u.y=l.y+e.clientTop}else i&&(u.x=lw(i));return{x:a.left+o.scrollLeft-u.x,y:a.top+o.scrollTop-u.y,width:a.width,height:a.height}}function sw(r,e){return!qr(r)||nr(r).position==="fixed"?null:e?e(r):r.offsetParent}function dw(r,e){let t=jt(r);if(!qr(r))return t;let n=sw(r,e);for(;n&&tw(n)&&nr(n).position==="static";)n=sw(n,e);return n&&(In(n)==="html"||In(n)==="body"&&nr(n).position==="static"&&!Ol(n))?t:n||rw(r)||t}var zN=function(r){return F(this,null,function*(){let{reference:e,floating:t,strategy:n}=r,i=this.getOffsetParent||dw,s=this.getDimensions;return{reference:VN(e,yield i(t),n),floating:X({x:0,y:0},yield s(t))}})};function KN(r){return nr(r).direction==="rtl"}var QN={convertOffsetParentRelativeRectToViewportRelativeRect:qN,getDocumentElement:Fn,getClippingRect:BN,getOffsetParent:dw,getElementRects:zN,getClientRects:WN,getDimensions:HN,getScale:js,isElement:sn,isRTL:KN};var dh=(r,e,t)=>{let n=new Map,i=X({platform:QN},t),s=be(X({},i.platform),{_c:n});return Zv(r,e,be(X({},i),{platform:s}))};var fw=require("obsidian");var XN=20;function Bi(r){return ye.getInstance().removeAsWordFrom(r.description)}function ZN(r,e){if(r==="")return e;let t=(0,fw.prepareSimpleSearch)(r),n=-4;return e.map(a=>{let o=t(Bi(a));return o&&o.score>n?{item:a,match:o}:null}).filter(Boolean).sort((a,o)=>o.match.score-a.match.score).map(a=>a.item)}function pw(r,e,t,n,i){let s=ZN(r,e);return s=s.filter(a=>{if(a.isDone||a.description.includes("<%")&&a.description.includes("%>"))return!1;let o=a.description===t.description&&a.taskLocation.path===t.taskLocation.path&&a.originalMarkdown===t.originalMarkdown;return![...n,...i].includes(a)&&!o}),s.sort((a,o)=>{let u=a.taskLocation.path===t.taskLocation.path,l=o.taskLocation.path===t.taskLocation.path;return u&&l?Math.abs(a.taskLocation.lineNumber-t.taskLocation.lineNumber)-Math.abs(o.taskLocation.lineNumber-t.taskLocation.lineNumber):u?-1:l?1:0}),s.slice(0,XN)}function mw(r,e,t){let n=r.slice();return n[5]=e[t],n}function hw(r,e,t){let n=r.slice();n[40]=e[t],n[43]=t;let i=n[17](n[40].taskLocation.path);return n[41]=i,n}function gw(r){let e,t,n,i=r[10],s=[];for(let a=0;a<i.length;a+=1)s[a]=bw(hw(r,i,a));return{c(){e=K("ul");for(let a=0;a<s.length;a+=1)s[a].c();L(e,"class","task-dependency-dropdown")},m(a,o){Ie(a,e,o);for(let u=0;u<s.length;u+=1)s[u]&&s[u].m(e,null);r[31](e),t||(n=Re(e,"mouseleave",r[32]),t=!0)},p(a,o){if(o[0]&928832){i=a[10];let u;for(u=0;u<i.length;u+=1){let l=hw(a,i,u);s[u]?s[u].p(l,o):(s[u]=bw(l),s[u].c(),s[u].m(e,null))}for(;u<s.length;u+=1)s[u].d(1);s.length=i.length}},d(a){a&&Ce(e),Fs(s,a),r[31](null),t=!1,n()}}}function yw(r){let e,t=r[41]+"",n,i,s;function a(...o){return r[28](r[41],...o)}return{c(){e=K("div"),n=Fe(t),L(e,"class","dependency-path")},m(o,u){Ie(o,e,u),A(e,n),i||(s=Re(e,"mouseenter",a),i=!0)},p(o,u){r=o,u[0]&1024&&t!==(t=r[41]+"")&&Nr(n,t)},d(o){o&&Ce(e),i=!1,s()}}}function bw(r){let e,t,n,i=r[40].status.symbol+"",s,a,o=Bi(r[40])+"",u,l,c,d,m,p;function T(...x){return r[27](r[40],...x)}let y=r[41]&&yw(r);function E(){return r[29](r[40])}function R(){return r[30](r[43])}return{c(){e=K("li"),t=K("div"),n=Fe("["),s=Fe(i),a=Fe("] "),u=Fe(o),c=te(),y&&y.c(),d=te(),L(t,"class",l=r[41]?"dependency-name-shared":"dependency-name"),Fr(e,"selected",r[6]!==null&&r[43]===r[11])},m(x,v){Ie(x,e,v),A(e,t),A(t,n),A(t,s),A(t,a),A(t,u),A(e,c),y&&y.m(e,null),A(e,d),m||(p=[Re(t,"mouseenter",T),Re(e,"mousedown",E),Re(e,"mouseenter",R)],m=!0)},p(x,v){r=x,v[0]&1024&&i!==(i=r[40].status.symbol+"")&&Nr(s,i),v[0]&1024&&o!==(o=Bi(r[40])+"")&&Nr(u,o),v[0]&1024&&l!==(l=r[41]?"dependency-name-shared":"dependency-name")&&L(t,"class",l),r[41]?y?y.p(r,v):(y=yw(r),y.c(),y.m(e,d)):y&&(y.d(1),y=null),v[0]&2112&&Fr(e,"selected",r[6]!==null&&r[43]===r[11])},d(x){x&&Ce(e),y&&y.d(),m=!1,_r(p)}}}function Tw(r){let e,t,n,i=r[5].status.symbol+"",s,a,o=Bi(r[5])+"",u,l,c,d,m,p;function T(){return r[33](r[5])}function y(...E){return r[34](r[5],...E)}return{c(){e=K("div"),t=K("span"),n=Fe("["),s=Fe(i),a=Fe("] "),u=Fe(o),l=te(),c=K("button"),c.innerHTML='<svg style="display: block; margin: auto;" xmlns="http://www.w3.org/2000/svg" width="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-x"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg>',d=te(),L(t,"class","task-dependency-name"),L(c,"type","button"),L(c,"class","task-dependency-delete"),L(e,"class","task-dependency")},m(E,R){Ie(E,e,R),A(e,t),A(t,n),A(t,s),A(t,a),A(t,u),A(e,l),A(e,c),A(e,d),m||(p=[Re(c,"click",T),Re(e,"mouseenter",y)],m=!0)},p(E,R){r=E,R[0]&3&&i!==(i=r[5].status.symbol+"")&&Nr(s,i),R[0]&3&&o!==(o=Bi(r[5])+"")&&Nr(u,o)},d(E){E&&Ce(e),m=!1,_r(p)}}}function JN(r){let e,t,n,i,s,a,o,u,l,c=r[10]&&r[10].length!==0&&gw(r),d=r[0][r[1]],m=[];for(let p=0;p<d.length;p+=1)m[p]=Tw(mw(r,d,p));return{c(){e=K("span"),t=K("input"),s=te(),c&&c.c(),a=te(),o=K("div");for(let p=0;p<m.length;p+=1)m[p].c();L(t,"accesskey",n=r[2](r[3])),L(t,"id",r[1]),L(t,"class","input"),L(t,"type","text"),L(t,"placeholder",r[4]),L(e,"class","input"),Wi(()=>r[26].call(e)),L(o,"class","task-dependencies-container results")},m(p,T){Ie(p,e,T),A(e,t),r[22](t),Ir(t,r[6]),i=Iv(e,r[26].bind(e)),Ie(p,s,T),c&&c.m(p,T),Ie(p,a,T),Ie(p,o,T);for(let y=0;y<m.length;y+=1)m[y]&&m[y].m(o,null);u||(l=[Re(t,"input",r[23]),Re(t,"keydown",r[24]),Re(t,"focus",r[16]),Re(t,"blur",r[25])],u=!0)},p(p,T){if(T[0]&12&&n!==(n=p[2](p[3]))&&L(t,"accesskey",n),T[0]&2&&L(t,"id",p[1]),T[0]&16&&L(t,"placeholder",p[4]),T[0]&64&&t.value!==p[6]&&Ir(t,p[6]),p[10]&&p[10].length!==0?c?c.p(p,T):(c=gw(p),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null),T[0]&802819){d=p[0][p[1]];let y;for(y=0;y<d.length;y+=1){let E=mw(p,d,y);m[y]?m[y].p(E,T):(m[y]=Tw(E),m[y].c(),m[y].m(o,null))}for(;y<m.length;y+=1)m[y].d(1);m.length=d.length}},i:Et,o:Et,d(p){p&&Ce(e),r[22](null),i(),p&&Ce(s),c&&c.d(p),p&&Ce(a),p&&Ce(o),Fs(m,p),u=!1,_r(l)}}}function eI(r,e,t){let{task:n}=e,{editableTask:i}=e,{allTasks:s}=e,{_onDescriptionKeyDown:a}=e,{type:o}=e,{accesskey:u}=e,{accesskeyLetter:l=""}=e,{placeholder:c="Type to search..."}=e,d="",m=null,p=0,T,y=!1,E=!1,R,x;function v(_){t(0,i[o]=[...i[o],_],i),t(6,d=""),t(7,y=!1)}function V(_){t(0,i[o]=i[o].filter(D=>D!==_),i)}function j(_){var D;if(m!==null){switch(_.key){case"ArrowUp":_.preventDefault(),!!p&&p>0?t(11,p-=1):t(11,p=m.length-1);break;case"ArrowDown":_.preventDefault(),!!p&&p<m.length-1?t(11,p+=1):t(11,p=0);break;case"Enter":p!==null?(_.preventDefault(),v(m[p]),t(11,p=null),t(7,y=!1)):a(_);break;default:t(11,p=0);break}p&&((D=x==null?void 0:x.getElementsByTagName("li")[p])===null||D===void 0||D.scrollIntoView({block:"nearest"}))}}function ee(_){return!_&&!E?[]:(E=!1,pw(_,s,n,i.blockedBy,i.blocking))}function Y(){t(7,y=!0),E=!0}function W(_,D){!_||!D||dh(_,D,{middleware:[kl(6),El(),lh(),ch({apply(){D&&Object.assign(D.style,{width:`${T}px`})}})]}).then(({x:I,y:me})=>{D.style.left=`${I}px`,D.style.top=`${me}px`})}function de(_){return _===n.taskLocation.path?"":_}function Te(_){return Bi(_)}function G(_,D){let I=_.createDiv();I.addClasses(["tooltip","pop-up"]),I.innerText=D,dh(_,I,{placement:"top",middleware:[kl(-18),El()]}).then(({x:me,y:ae})=>{I.style.left=`${me}px`,I.style.top=`${ae}px`}),_.addEventListener("mouseleave",()=>I.remove())}function N(_){nt[_?"unshift":"push"](()=>{R=_,t(8,R)})}function O(){d=this.value,t(6,d)}let B=_=>j(_),U=()=>t(7,y=!1);function Q(){T=this.clientWidth,t(12,T)}let f=(_,D)=>G(D.currentTarget,Te(_)),h=(_,D)=>G(D.currentTarget,_),g=_=>v(_),b=_=>t(11,p=_);function w(_){nt[_?"unshift":"push"](()=>{x=_,t(9,x)})}let S=()=>t(11,p=null),M=_=>V(_),P=(_,D)=>G(D.currentTarget,Te(_));return r.$$set=_=>{"task"in _&&t(5,n=_.task),"editableTask"in _&&t(0,i=_.editableTask),"allTasks"in _&&t(20,s=_.allTasks),"_onDescriptionKeyDown"in _&&t(21,a=_._onDescriptionKeyDown),"type"in _&&t(1,o=_.type),"accesskey"in _&&t(2,u=_.accesskey),"accesskeyLetter"in _&&t(3,l=_.accesskeyLetter),"placeholder"in _&&t(4,c=_.placeholder)},r.$$.update=()=>{if(r.$$.dirty[0]&768){e:W(R,x)}if(r.$$.dirty[0]&192){e:t(10,m=y?ee(d):null)}},[i,o,u,l,c,n,d,y,R,x,m,p,T,v,V,j,Y,de,Te,G,s,a,N,O,B,U,Q,f,h,g,b,w,S,M,P]}var fh=class extends ri{constructor(e){super(),Ls(this,e,eI,JN,Is,{task:5,editableTask:0,allTasks:20,_onDescriptionKeyDown:21,type:1,accesskey:2,accesskeyLetter:3,placeholder:4},null,[-1,-1])}},ph=fh;function _w(r,e,t){let n=r.slice();return n[58]=e[t],n}function vw(r,e,t){let n=r.slice();return n[61]=e[t].value,n[62]=e[t].label,n[63]=e[t].symbol,n[64]=e[t].accessKey,n[65]=e[t].accessKeyIndex,n}function tI(r){let e,t=r[63]+"",n;return{c(){e=K("span"),n=Fe(t)},m(i,s){Ie(i,e,s),A(e,n)},p:Et,d(i){i&&Ce(e)}}}function ww(r){let e,t,n,i,s,a,o,u,l=r[62].substring(0,r[65])+"",c,d,m=r[62].substring(r[65],r[65]+1)+"",p,T,y=r[62].substring(r[65]+1)+"",E,R,x=r[63]&&r[63].charCodeAt(0)>=256,v,V,j,ee,Y,W=x&&tI(r);return j=Pv(r[38][0]),{c(){e=K("span"),t=K("input"),a=te(),o=K("label"),u=K("span"),c=Fe(l),d=K("span"),p=Fe(m),T=K("span"),E=Fe(y),R=te(),W&&W.c(),V=te(),L(t,"type","radio"),L(t,"id",n="priority-"+r[61]),t.__value=i=r[61],t.value=t.__value,L(t,"accesskey",s=r[17](r[64])),L(d,"class","accesskey"),L(o,"for",v="priority-"+r[61]),j.p(t)},m(de,Te){Ie(de,e,Te),A(e,t),t.checked=t.__value===r[3].priority,A(e,a),A(e,o),A(o,u),A(u,c),A(o,d),A(d,p),A(o,T),A(T,E),A(o,R),W&&W.m(o,null),A(e,V),ee||(Y=Re(t,"change",r[37]),ee=!0)},p(de,Te){Te[0]&131072&&s!==(s=de[17](de[64]))&&L(t,"accesskey",s),Te[0]&8&&(t.checked=t.__value===de[3].priority),x&&W.p(de,Te)},d(de){de&&Ce(e),W&&W.d(),j.r(),ee=!1,Y()}}}function rI(r){let e;return{c(){e=K("div"),e.innerHTML="<i>Blocking and blocked by fields are disabled when vault tasks is empty</i>"},m(t,n){Ie(t,e,n)},p:Et,i:Et,o:Et,d(t){t&&Ce(e)}}}function nI(r){let e,t,n,i,s,a,o,u;return n=new ph({props:{type:"blockedBy",task:r[0],editableTask:r[3],allTasks:r[2],_onDescriptionKeyDown:r[29],accesskey:r[17],accesskeyLetter:"b",placeholder:"Search for tasks that the task being edited depends on..."}}),o=new ph({props:{type:"blocking",task:r[0],editableTask:r[3],allTasks:r[2],_onDescriptionKeyDown:r[29],accesskey:r[17],accesskeyLetter:"e",placeholder:"Search for tasks that depend on this task being done..."}}),{c(){e=K("label"),e.textContent="Before this",t=te(),An(n.$$.fragment),i=te(),s=K("label"),s.innerHTML='Aft<span class="accesskey">e</span>r this',a=te(),An(o.$$.fragment),L(e,"for","blockedBy"),L(e,"class","accesskey-first"),L(s,"for","blocking")},m(l,c){Ie(l,e,c),Ie(l,t,c),rn(n,l,c),Ie(l,i,c),Ie(l,s,c),Ie(l,a,c),rn(o,l,c),u=!0},p(l,c){let d={};c[0]&1&&(d.task=l[0]),c[0]&8&&(d.editableTask=l[3]),c[0]&4&&(d.allTasks=l[2]),c[0]&131072&&(d.accesskey=l[17]),n.$set(d);let m={};c[0]&1&&(m.task=l[0]),c[0]&8&&(m.editableTask=l[3]),c[0]&4&&(m.allTasks=l[2]),c[0]&131072&&(m.accesskey=l[17]),o.$set(m)},i(l){u||(vr(n.$$.fragment,l),vr(o.$$.fragment,l),u=!0)},o(l){Lr(n.$$.fragment,l),Lr(o.$$.fragment,l),u=!1},d(l){l&&Ce(e),l&&Ce(t),Ur(n,l),l&&Ce(i),l&&Ce(s),l&&Ce(a),Ur(o,l)}}}function kw(r){let e,t=r[58].name+"",n,i,s=r[58].symbol+"",a,o,u;return{c(){e=K("option"),n=Fe(t),i=Fe(" ["),a=Fe(s),o=Fe("]"),e.__value=u=r[58].symbol,e.value=e.__value},m(l,c){Ie(l,e,c),A(e,n),A(e,i),A(e,a),A(e,o)},p(l,c){c[0]&2&&t!==(t=l[58].name+"")&&Nr(n,t),c[0]&2&&s!==(s=l[58].symbol+"")&&Nr(a,s),c[0]&2&&u!==(u=l[58].symbol)&&(e.__value=u,e.value=e.__value)},d(l){l&&Ce(e)}}}function iI(r){let e,t,n,i,s,a,o,u,l,c,d,m,p,T,y,E,R,x,v,V,j,ee,Y,W,de,Te,G,N,O,B,U,Q,f,h,g,b,w,S,M,P,_,D,I,me,ae,le,Se,qe,jn,Tt,ur,Gn,Ft,Qe,hi,Lt,Bt,Qo,Xo,Zo,$,Xe,Ze,Ue,Yr,gi,Be,yi,Br,lr,ts,rs,ca,Yn,Jo,Sr,je,fn,Bh,eu,Hh,pn,wc,kc,Vh,ns,bi,zh,tu,Kh,da,Ht,Ec,Qh,is=r[25],xt=[];for(let C=0;C<is.length;C+=1)xt[C]=ww(vw(r,is,C));function Fk(C){r[40](C)}function Lk(C){r[41](C)}let Sc={id:"due",dateSymbol:r[21],forwardOnly:r[3].forwardOnly,accesskey:r[17]("d")};r[3].dueDate!==void 0&&(Sc.date=r[3].dueDate),r[7]!==void 0&&(Sc.isDateValid=r[7]),U=new $i({props:Sc}),nt.push(()=>rr(U,"date",Fk)),nt.push(()=>rr(U,"isDateValid",Lk));function Uk(C){r[42](C)}function qk(C){r[43](C)}let Oc={id:"scheduled",dateSymbol:r[20],forwardOnly:r[3].forwardOnly,accesskey:r[17]("s")};r[3].scheduledDate!==void 0&&(Oc.date=r[3].scheduledDate),r[8]!==void 0&&(Oc.isDateValid=r[8]),w=new $i({props:Oc}),nt.push(()=>rr(w,"date",Uk)),nt.push(()=>rr(w,"isDateValid",qk));function Wk(C){r[44](C)}function $k(C){r[45](C)}let Dc={id:"start",dateSymbol:r[19],forwardOnly:r[3].forwardOnly,accesskey:r[17]("a")};r[3].startDate!==void 0&&(Dc.date=r[3].startDate),r[9]!==void 0&&(Dc.isDateValid=r[9]),I=new $i({props:Dc}),nt.push(()=>rr(I,"date",Wk)),nt.push(()=>rr(I,"isDateValid",$k));let Xh=[nI,rI],Bn=[];function Zh(C,ne){return C[2].length>0&&C[16]?0:1}Lt=Zh(r,[-1,-1,-1]),Bt=Bn[Lt]=Xh[Lt](r);let ss=r[1],Rt=[];for(let C=0;C<ss.length;C+=1)Rt[C]=kw(_w(r,ss,C));function jk(C){r[48](C)}function Gk(C){r[49](C)}let xc={id:"created",dateSymbol:r[23],forwardOnly:r[3].forwardOnly,accesskey:null};r[3].createdDate!==void 0&&(xc.date=r[3].createdDate),r[5]!==void 0&&(xc.isDateValid=r[5]),lr=new $i({props:xc}),nt.push(()=>rr(lr,"date",jk)),nt.push(()=>rr(lr,"isDateValid",Gk));function Yk(C){r[50](C)}function Bk(C){r[51](C)}let Rc={id:"done",dateSymbol:r[24],forwardOnly:r[3].forwardOnly,accesskey:null};r[3].doneDate!==void 0&&(Rc.date=r[3].doneDate),r[6]!==void 0&&(Rc.isDateValid=r[6]),Sr=new $i({props:Rc}),nt.push(()=>rr(Sr,"date",Yk)),nt.push(()=>rr(Sr,"isDateValid",Bk));function Hk(C){r[52](C)}function Vk(C){r[53](C)}let Mc={id:"cancelled",dateSymbol:r[22],forwardOnly:r[3].forwardOnly,accesskey:null};return r[3].cancelledDate!==void 0&&(Mc.date=r[3].cancelledDate),r[4]!==void 0&&(Mc.isDateValid=r[4]),pn=new $i({props:Mc}),nt.push(()=>rr(pn,"date",Hk)),nt.push(()=>rr(pn,"isDateValid",Vk)),{c(){e=K("div"),t=K("form"),n=K("div"),i=K("label"),i.innerHTML='Descrip<span class="accesskey">t</span>ion',s=te(),a=K("textarea"),u=te(),l=K("div"),c=K("label"),d=Fe("Priority"),p=te();for(let C=0;C<xt.length;C+=1)xt[C].c();T=te(),y=K("div"),E=K("label"),E.textContent="Recurs",R=te(),x=K("input"),V=te(),j=K("code"),ee=Fe(r[18]),Y=te(),W=new Ns(!1),de=te(),Te=K("hr"),G=te(),N=K("div"),O=K("label"),O.textContent="Due",B=te(),An(U.$$.fragment),h=te(),g=K("label"),g.textContent="Scheduled",b=te(),An(w.$$.fragment),P=te(),_=K("label"),_.innerHTML='St<span class="accesskey">a</span>rt',D=te(),An(I.$$.fragment),le=te(),Se=K("div"),qe=K("label"),qe.innerHTML=`Only
|
|
|
<span class="accesskey-first">future</span> dates:`,jn=te(),Tt=K("input"),Gn=te(),Ft=K("hr"),Qe=te(),hi=K("div"),Bt.c(),Qo=te(),Xo=K("hr"),Zo=te(),$=K("div"),Xe=K("label"),Xe.innerHTML='Stat<span class="accesskey">u</span>s',Ze=te(),Ue=K("select");for(let C=0;C<Rt.length;C+=1)Rt[C].c();gi=te(),Be=K("div"),yi=K("label"),yi.textContent="Created",Br=te(),An(lr.$$.fragment),ca=te(),Yn=K("label"),Yn.textContent="Done",Jo=te(),An(Sr.$$.fragment),Bh=te(),eu=K("label"),eu.textContent="Cancelled",Hh=te(),An(pn.$$.fragment),Vh=te(),ns=K("div"),bi=K("button"),zh=Fe("Apply"),Kh=te(),da=K("button"),da.textContent="Cancel",L(i,"for","description"),L(a,"id","description"),L(a,"class","tasks-modal-description"),L(a,"placeholder","Take out the trash"),L(a,"accesskey",o=r[17]("t")),L(n,"class","tasks-modal-section"),L(c,"for",m="priority-"+r[3].priority),L(l,"class","tasks-modal-section tasks-modal-priorities"),L(E,"for","recurrence"),L(E,"class","accesskey-first"),L(x,"id","recurrence"),L(x,"type","text"),L(x,"class","input"),L(x,"placeholder","Try 'every 2 weeks on Thursday'."),L(x,"accesskey",v=r[17]("r")),Fr(x,"tasks-modal-error",!r[10]),W.a=null,L(j,"class","results"),L(y,"class","tasks-modal-section tasks-modal-dates"),L(O,"for","due"),L(O,"class","accesskey-first"),L(g,"for","scheduled"),L(g,"class","accesskey-first"),L(_,"for","start"),L(qe,"for","forwardOnly"),L(Tt,"id","forwardOnly"),L(Tt,"type","checkbox"),L(Tt,"class","input task-list-item-checkbox tasks-modal-checkbox"),L(Tt,"accesskey",ur=r[17]("f")),L(N,"class","tasks-modal-section tasks-modal-dates"),L(hi,"class","tasks-modal-section tasks-modal-dates"),L(Xe,"for","status"),L(Ue,"id","status-type"),L(Ue,"class","dropdown"),L(Ue,"accesskey",Yr=r[17]("u")),r[12]===void 0&&Wi(()=>r[47].call(Ue)),L($,"class","tasks-modal-section"),L(yi,"for","created"),L(Yn,"for","done"),L(eu,"for","cancelled"),L(Be,"class","tasks-modal-section tasks-modal-dates"),bi.disabled=tu=!r[15],L(bi,"type","submit"),L(bi,"class","mod-cta"),L(da,"type","button"),L(ns,"class","tasks-modal-section tasks-modal-buttons"),Fr(t,"with-accesskeys",r[11]),L(e,"class","tasks-modal")},m(C,ne){Ie(C,e,ne),A(e,t),A(t,n),A(n,i),A(n,s),A(n,a),Ir(a,r[3].description),r[36](a),A(t,u),A(t,l),A(l,c),A(c,d),A(l,p);for(let Mt=0;Mt<xt.length;Mt+=1)xt[Mt]&&xt[Mt].m(l,null);A(t,T),A(t,y),A(y,E),A(y,R),A(y,x),Ir(x,r[3].recurrenceRule),A(y,V),A(y,j),A(j,ee),A(j,Y),W.m(r[14],j),A(t,de),A(t,Te),A(t,G),A(t,N),A(N,O),A(N,B),rn(U,N,null),A(N,h),A(N,g),A(N,b),rn(w,N,null),A(N,P),A(N,_),A(N,D),rn(I,N,null),A(N,le),A(N,Se),A(Se,qe),A(Se,jn),A(Se,Tt),Tt.checked=r[3].forwardOnly,A(t,Gn),A(t,Ft),A(t,Qe),A(t,hi),Bn[Lt].m(hi,null),A(t,Qo),A(t,Xo),A(t,Zo),A(t,$),A($,Xe),A($,Ze),A($,Ue);for(let Mt=0;Mt<Rt.length;Mt+=1)Rt[Mt]&&Rt[Mt].m(Ue,null);Xm(Ue,r[12],!0),A(t,gi),A(t,Be),A(Be,yi),A(Be,Br),rn(lr,Be,null),A(Be,ca),A(Be,Yn),A(Be,Jo),rn(Sr,Be,null),A(Be,Bh),A(Be,eu),A(Be,Hh),rn(pn,Be,null),A(t,Vh),A(t,ns),A(ns,bi),A(bi,zh),A(ns,Kh),A(ns,da),Ht=!0,Ec||(Qh=[Re(a,"input",r[35]),Re(a,"keydown",r[29]),Re(a,"paste",r[30]),Re(a,"drop",r[30]),Re(l,"keyup",r[27]),Re(x,"input",r[39]),Re(Tt,"change",r[46]),Re(Ue,"change",r[47]),Re(Ue,"change",r[26]),Re(da,"click",r[28]),Re(t,"submit",Av(r[31]))],Ec=!0)},p(C,ne){if((!Ht||ne[0]&131072&&o!==(o=C[17]("t")))&&L(a,"accesskey",o),ne[0]&8&&Ir(a,C[3].description),(!Ht||ne[0]&8&&m!==(m="priority-"+C[3].priority))&&L(c,"for",m),ne[0]&33685512){is=C[25];let Ne;for(Ne=0;Ne<is.length;Ne+=1){let ma=vw(C,is,Ne);xt[Ne]?xt[Ne].p(ma,ne):(xt[Ne]=ww(ma),xt[Ne].c(),xt[Ne].m(l,null))}for(;Ne<xt.length;Ne+=1)xt[Ne].d(1);xt.length=is.length}(!Ht||ne[0]&131072&&v!==(v=C[17]("r")))&&L(x,"accesskey",v),ne[0]&8&&x.value!==C[3].recurrenceRule&&Ir(x,C[3].recurrenceRule),(!Ht||ne[0]&1024)&&Fr(x,"tasks-modal-error",!C[10]),(!Ht||ne[0]&16384)&&W.p(C[14]);let Mt={};ne[0]&8&&(Mt.forwardOnly=C[3].forwardOnly),ne[0]&131072&&(Mt.accesskey=C[17]("d")),!Q&&ne[0]&8&&(Q=!0,Mt.date=C[3].dueDate,tr(()=>Q=!1)),!f&&ne[0]&128&&(f=!0,Mt.isDateValid=C[7],tr(()=>f=!1)),U.$set(Mt);let fa={};ne[0]&8&&(fa.forwardOnly=C[3].forwardOnly),ne[0]&131072&&(fa.accesskey=C[17]("s")),!S&&ne[0]&8&&(S=!0,fa.date=C[3].scheduledDate,tr(()=>S=!1)),!M&&ne[0]&256&&(M=!0,fa.isDateValid=C[8],tr(()=>M=!1)),w.$set(fa);let pa={};ne[0]&8&&(pa.forwardOnly=C[3].forwardOnly),ne[0]&131072&&(pa.accesskey=C[17]("a")),!me&&ne[0]&8&&(me=!0,pa.date=C[3].startDate,tr(()=>me=!1)),!ae&&ne[0]&512&&(ae=!0,pa.isDateValid=C[9],tr(()=>ae=!1)),I.$set(pa),(!Ht||ne[0]&131072&&ur!==(ur=C[17]("f")))&&L(Tt,"accesskey",ur),ne[0]&8&&(Tt.checked=C[3].forwardOnly);let Cc=Lt;if(Lt=Zh(C,ne),Lt===Cc?Bn[Lt].p(C,ne):(Lv(),Lr(Bn[Cc],1,1,()=>{Bn[Cc]=null}),Uv(),Bt=Bn[Lt],Bt?Bt.p(C,ne):(Bt=Bn[Lt]=Xh[Lt](C),Bt.c()),vr(Bt,1),Bt.m(hi,null)),ne[0]&2){ss=C[1];let Ne;for(Ne=0;Ne<ss.length;Ne+=1){let ma=_w(C,ss,Ne);Rt[Ne]?Rt[Ne].p(ma,ne):(Rt[Ne]=kw(ma),Rt[Ne].c(),Rt[Ne].m(Ue,null))}for(;Ne<Rt.length;Ne+=1)Rt[Ne].d(1);Rt.length=ss.length}(!Ht||ne[0]&131072&&Yr!==(Yr=C[17]("u")))&&L(Ue,"accesskey",Yr),ne[0]&4098&&Xm(Ue,C[12]);let ru={};ne[0]&8&&(ru.forwardOnly=C[3].forwardOnly),!ts&&ne[0]&8&&(ts=!0,ru.date=C[3].createdDate,tr(()=>ts=!1)),!rs&&ne[0]&32&&(rs=!0,ru.isDateValid=C[5],tr(()=>rs=!1)),lr.$set(ru);let nu={};ne[0]&8&&(nu.forwardOnly=C[3].forwardOnly),!je&&ne[0]&8&&(je=!0,nu.date=C[3].doneDate,tr(()=>je=!1)),!fn&&ne[0]&64&&(fn=!0,nu.isDateValid=C[6],tr(()=>fn=!1)),Sr.$set(nu);let iu={};ne[0]&8&&(iu.forwardOnly=C[3].forwardOnly),!wc&&ne[0]&8&&(wc=!0,iu.date=C[3].cancelledDate,tr(()=>wc=!1)),!kc&&ne[0]&16&&(kc=!0,iu.isDateValid=C[4],tr(()=>kc=!1)),pn.$set(iu),(!Ht||ne[0]&32768&&tu!==(tu=!C[15]))&&(bi.disabled=tu),(!Ht||ne[0]&2048)&&Fr(t,"with-accesskeys",C[11])},i(C){Ht||(vr(U.$$.fragment,C),vr(w.$$.fragment,C),vr(I.$$.fragment,C),vr(Bt),vr(lr.$$.fragment,C),vr(Sr.$$.fragment,C),vr(pn.$$.fragment,C),Ht=!0)},o(C){Lr(U.$$.fragment,C),Lr(w.$$.fragment,C),Lr(I.$$.fragment,C),Lr(Bt),Lr(lr.$$.fragment,C),Lr(Sr.$$.fragment,C),Lr(pn.$$.fragment,C),Ht=!1},d(C){C&&Ce(e),r[36](null),Fs(xt,C),Ur(U),Ur(w),Ur(I),Bn[Lt].d(),Fs(Rt,C),Ur(lr),Ur(Sr),Ur(pn),Ec=!1,_r(Qh)}}}function sI(r,e,t){let n;var i;let{task:s}=e,{onSubmit:a}=e,{statusOptions:o}=e,{allTasks:u}=e,l=s.status.symbol,{prioritySymbols:c,recurrenceSymbol:d,startDateSymbol:m,scheduledDateSymbol:p,dueDateSymbol:T,cancelledDateSymbol:y,createdDateSymbol:E,doneDateSymbol:R}=Rn.tasksPluginEmoji.taskSerializer.symbols,x,v={description:"",status:re.TODO,priority:"none",recurrenceRule:"",createdDate:"",startDate:"",scheduledDate:"",dueDate:"",doneDate:"",cancelledDate:"",forwardOnly:!0,blockedBy:[],blocking:[]},V=!0,j=!0,ee=!0,Y=!0,W=!0,de=!0,Te=!0,G="",N=!0,O=!1,B=!0,U=!0,Q=[],f=!1,h=[{value:"lowest",label:"Lowest",symbol:c.Lowest,accessKey:"o",accessKeyIndex:1},{value:"low",label:"Low",symbol:c.Low,accessKey:"l",accessKeyIndex:0},{value:"none",label:"Normal",symbol:c.None,accessKey:"n",accessKeyIndex:0},{value:"medium",label:"Medium",symbol:c.Medium,accessKey:"m",accessKeyIndex:0},{value:"high",label:"High",symbol:c.High,accessKey:"h",accessKeyIndex:0},{value:"highest",label:"Highest",symbol:c.Highest,accessKey:"i",accessKeyIndex:1}];function g($){return Jm(this,void 0,void 0,function*(){if($.id!=="")return $;let Xe=u.filter(Ue=>Ue.id!==""),Ze=qv($,Xe.map(Ue=>Ue.id));return yield nn({originalTask:$,newTasks:Ze}),Ze})}let b=()=>{let $=o.find(Ze=>Ze.symbol===l);if($)t(3,v.status=$,v);else{console.log(`Error in EditTask: cannot find status with symbol ${l}`);return}let Xe=s.handleNewStatus($).pop();Xe&&(t(3,v.doneDate=Xe.done.formatAsDate(),v),t(3,v.cancelledDate=Xe.cancelled.formatAsDate(),v))};Zm(()=>{let{provideAccessKeys:$}=Z();t(11,B=$);let Xe=ye.getInstance().removeAsWordFrom(s.description);(Xe!=s.description||!ye.getInstance().includedIn(s.description))&&(O=!0);let Ze="none";s.priority==="5"?Ze="lowest":s.priority==="4"?Ze="low":s.priority==="2"?Ze="medium":s.priority==="1"?Ze="high":s.priority==="0"&&(Ze="highest");let Ue=[];for(let Yr of s.dependsOn){let gi=u.find(Be=>Be.id===Yr);!gi||Ue.push(gi)}Q=u.filter(Yr=>Yr.dependsOn.includes(s.id)),t(3,v={description:Xe,status:s.status,priority:Ze,recurrenceRule:s.recurrence?s.recurrence.toText():"",createdDate:new Ye(s.createdDate).formatAsDate(),startDate:new Ye(s.startDate).formatAsDate(),scheduledDate:new Ye(s.scheduledDate).formatAsDate(),dueDate:new Ye(s.dueDate).formatAsDate(),doneDate:new Ye(s.doneDate).formatAsDate(),cancelledDate:new Ye(s.cancelledDate).formatAsDate(),forwardOnly:!0,blockedBy:Ue,blocking:Q}),t(16,f=!0),setTimeout(()=>{x.focus()},10)});let w=$=>{if($.key&&!$.altKey&&!$.ctrlKey){let Xe=h.find(Ze=>Ze.label.charAt(0).toLowerCase()==$.key);Xe&&t(3,v.priority=Xe.value,v)}},S=()=>{a([])},M=$=>{$.key==="Enter"&&($.preventDefault(),U&&_())},P=()=>{setTimeout(()=>{t(3,v.description=v.description.replace(/[\r\n]+/g," "),v)},0)},_=()=>Jm(void 0,void 0,void 0,function*(){let $=v.description.trim();O&&($=ye.getInstance().prependTo($));let Xe=Ni(v.startDate,v.forwardOnly),Ze=Ni(v.scheduledDate,v.forwardOnly),Ue=Ni(v.dueDate,v.forwardOnly),Yr=Ni(v.cancelledDate,v.forwardOnly),gi=Ni(v.createdDate,v.forwardOnly),Be=Ni(v.doneDate,v.forwardOnly),yi=null;v.recurrenceRule&&(yi=dt.fromText({recurrenceRuleText:v.recurrenceRule,startDate:Xe,scheduledDate:Ze,dueDate:Ue}));let Br;switch(v.priority){case"lowest":Br="5";break;case"low":Br="4";break;case"medium":Br="2";break;case"high":Br="1";break;case"highest":Br="0";break;default:Br="3"}let lr=[];for(let je of v.blockedBy){let fn=yield g(je);lr.push(fn)}let ts=s.id,rs=[],ca=[];(v.blocking.toString()!==Q.toString()||v.blocking.length!==0)&&(s.id===""&&(ts=eh(u.filter(je=>je.id!=="").map(je=>je.id))),rs=Q.filter(je=>!v.blocking.includes(je)),ca=v.blocking.filter(je=>!Q.includes(je)));let Yn=new oe(Object.assign(Object.assign({},s),{description:$,status:s.status,priority:Br,recurrence:yi,startDate:Xe,scheduledDate:Ze,dueDate:Ue,doneDate:Be,createdDate:gi,cancelledDate:Yr,dependsOn:lr.map(je=>je.id),id:ts}));for(let je of rs){let fn=$v(je,Yn);yield nn({originalTask:je,newTasks:fn})}for(let je of ca){let fn=Wv(je,Yn);yield nn({originalTask:je,newTasks:fn})}let Jo=Be||window.moment(),Sr=Yn.handleNewStatusWithRecurrenceInUsersOrder(v.status,Jo);a(Sr)}),D=[[]];function I(){v.description=this.value,t(3,v)}function me($){nt[$?"unshift":"push"](()=>{x=$,t(13,x)})}function ae(){v.priority=this.__value,t(3,v)}function le(){v.recurrenceRule=this.value,t(3,v)}function Se($){r.$$.not_equal(v.dueDate,$)&&(v.dueDate=$,t(3,v))}function qe($){W=$,t(7,W)}function jn($){r.$$.not_equal(v.scheduledDate,$)&&(v.scheduledDate=$,t(3,v))}function Tt($){de=$,t(8,de)}function ur($){r.$$.not_equal(v.startDate,$)&&(v.startDate=$,t(3,v))}function Gn($){Te=$,t(9,Te)}function Ft(){v.forwardOnly=this.checked,t(3,v)}function Qe(){l=Nv(this),t(12,l),t(1,o)}function hi($){r.$$.not_equal(v.createdDate,$)&&(v.createdDate=$,t(3,v))}function Lt($){ee=$,t(5,ee)}function Bt($){r.$$.not_equal(v.doneDate,$)&&(v.doneDate=$,t(3,v))}function Qo($){Y=$,t(6,Y)}function Xo($){r.$$.not_equal(v.cancelledDate,$)&&(v.cancelledDate=$,t(3,v))}function Zo($){j=$,t(4,j)}return r.$$set=$=>{"task"in $&&t(0,s=$.task),"onSubmit"in $&&t(32,a=$.onSubmit),"statusOptions"in $&&t(1,o=$.statusOptions),"allTasks"in $&&t(2,u=$.allTasks)},r.$$.update=()=>{if(r.$$.dirty[0]&2048){e:t(17,n=$=>B?$:null)}if(r.$$.dirty[0]&8|r.$$.dirty[1]&4){e:if(t(10,N=!0),!v.recurrenceRule)t(14,G="<i>not recurring</>");else{let $=t(33,i=dt.fromText({recurrenceRuleText:v.recurrenceRule,startDate:null,scheduledDate:null,dueDate:null}))===null||i===void 0?void 0:i.toText();$?!v.startDate&&!v.scheduledDate&&!v.dueDate?(t(14,G="<i>due, scheduled or start date required</i>"),t(10,N=!1)):t(14,G=$):(t(14,G="<i>invalid recurrence rule</i>"),t(10,N=!1))}}if(r.$$.dirty[0]&8){e:t(34,V=v.description.trim()!=="")}if(r.$$.dirty[0]&2032|r.$$.dirty[1]&8){e:t(15,U=W&&N&&de&&Te&&V&&j&&ee&&Y)}},[s,o,u,v,j,ee,Y,W,de,Te,N,B,l,x,G,U,f,n,d,m,p,T,y,E,R,h,b,w,S,M,P,_,a,i,V,I,me,ae,D,le,Se,qe,jn,Tt,ur,Gn,Ft,Qe,hi,Lt,Bt,Qo,Xo,Zo]}var mh=class extends ri{constructor(e){super(),Ls(this,e,sI,iI,Is,{task:0,onSubmit:32,statusOptions:1,allTasks:2},null,[-1,-1,-1])}},Ew=mh;var ii=class extends Sw.Modal{constructor({app:t,task:n,onSubmit:i,allTasks:s}){super(t);this.task=n,this.allTasks=s,this.onSubmit=a=>{a.length&&i(a),this.close()}}onOpen(){this.titleEl.setText("Create or edit Task"),this.modalEl.style.paddingBottom="0";let{contentEl:t}=this;this.contentEl.style.paddingBottom="0";let n=this.getKnownStatusesAndCurrentTaskStatusIfNotKnown();new Ew({target:t,props:{task:this.task,statusOptions:n,onSubmit:this.onSubmit,allTasks:this.allTasks}})}getKnownStatusesAndCurrentTaskStatusIfNotKnown(){let t=De.getInstance().registeredStatuses;return De.getInstance().bySymbol(this.task.status.symbol)===re.EMPTY&&t.push(this.task.status),t}onClose(){let{contentEl:t}=this;t.empty()}};function aI(){let{setCreatedDate:r}=Z();return r?window.moment():null}function oI(r){let{setCreatedDate:e}=Z();if(!e||r.createdDate!==null)return!1;let t=r.description==="",n=!ye.getInstance().isEmpty(),i=!ye.getInstance().includedIn(r.description);return t||n&&i}var xl=({line:r,path:e})=>{var m,p;let t=oe.parseTaskSignifiers(r,bt.fromUnknownPosition(new Je(e)),kt.fromPath(e)),n=aI();if(t!==null)return oI(t)?new oe(be(X({},t),{createdDate:n})):t;let i=r.match(J.nonTaskRegex);if(i===null)return console.error("Tasks: Cannot create task on line:",r),new oe({status:re.TODO,description:"",taskLocation:bt.fromUnknownPosition(new Je(e)),indentation:"",listMarker:"-",priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,cancelledDate:null,recurrence:null,dependsOn:[],id:"",blockLink:"",tags:[],originalMarkdown:"",scheduledDateIsInferred:!1});let s=i[1],a=(m=i[2])!=null?m:"-",o=(p=i[4])!=null?p:" ",u=De.getInstance().bySymbolOrCreate(o),l=i[5],c=r.match(J.blockLinkRegex),d=c!==null?c[0]:"";return d!==""&&(l=l.replace(J.blockLinkRegex,"")),new oe({status:u,description:l,taskLocation:bt.fromUnknownPosition(new Je(e)),indentation:s,listMarker:a,blockLink:d,priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,cancelledDate:null,recurrence:null,tags:[],originalMarkdown:"",scheduledDateIsInferred:!1,id:"",dependsOn:[]})};var Ow=(r,e,t,n,i)=>{var m;if(r)return t instanceof hh.MarkdownView;if(!(t instanceof hh.MarkdownView))return;let s=(m=t.file)==null?void 0:m.path;if(s===void 0)return;let o=e.getCursor().line,u=e.getLine(o),l=xl({line:u,path:s}),c=p=>{let T=kt.removeInferredStatusIfNeeded(l,p).map(y=>y.toFileLineString()).join(`
|
|
|
`);e.setLine(o,T)};new ii({app:n,task:l,onSubmit:c,allTasks:i}).open()};var gh=require("obsidian");var Dw=(r,e,t)=>{var u;if(r)return t instanceof gh.MarkdownView;if(!(t instanceof gh.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=uI(a,n);e.setLine(s,o.text),e.setCursor(lI(i,o))},uI=(r,e)=>{let t=oe.fromLine({line:r,taskLocation:bt.fromUnknownPosition(new Je(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(J.taskRegex);if(n!==null){let i=n[3],a=De.getInstance().bySymbol(i).nextStatusSymbol;return{text:r.replace(J.taskRegex,`$1- [${a}] $4`)}}else if(J.listItemRegex.test(r)){let i=r.replace(J.listItemRegex,"$1$2 [ ]");return{text:i,moveTo:{ch:i.length}}}else{let i=r.replace(J.indentationRegex,"$1- ");return{text:i,moveTo:{ch:i.length}}}}},lI=(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 Rl=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)=>Ow(t,n,i,this.app,this.plugin.getTasks())}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:Dw})}};var si=class{constructor(){this.hidePostponeButton=!1;this.hideTaskCount=!1;this.hideBacklinks=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.shortMode=!1;this.explainQuery=!1}};function Hi(r,e){let t=`Error: ${r}.
|
|
|
The error message was:
|
|
|
`,n="";return e instanceof Error?n+=e:n+="Unknown error",`${t}"${n}"`}var cI=Object.prototype.toString,Ys=Array.isArray||function(e){return cI.call(e)==="[object Array]"};function bh(r){return typeof r=="function"}function dI(r){return Ys(r)?"array":typeof r}function yh(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function xw(r,e){return r!=null&&typeof r=="object"&&e in r}function fI(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var pI=RegExp.prototype.test;function mI(r,e){return pI.call(r,e)}var hI=/\S/;function gI(r){return!mI(hI,r)}var yI={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function bI(r){return String(r).replace(/[&<>"'`=\/]/g,function(t){return yI[t]})}var TI=/\s*/,_I=/\s+/,Rw=/\s*=/,vI=/\s*\}/,wI=/#|\^|\/|>|\{|&|=|!/;function kI(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,m,p;function T(W){if(typeof W=="string"&&(W=W.split(_I,2)),!Ys(W)||W.length!==2)throw new Error("Invalid tags: "+W);d=new RegExp(yh(W[0])+"\\s*"),m=new RegExp("\\s*"+yh(W[1])),p=new RegExp("\\s*"+yh("}"+W[1]))}T(e||wr.tags);for(var y=new Wo(r),E,R,x,v,V,j;!y.eos();){if(E=y.pos,x=y.scanUntil(d),x)for(var ee=0,Y=x.length;ee<Y;++ee)v=x.charAt(ee),gI(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(!y.scan(d))break;if(a=!0,R=y.scan(wI)||"name",y.scan(TI),R==="="?(x=y.scanUntil(Rw),y.scan(Rw),y.scanUntil(m)):R==="{"?(x=y.scanUntil(p),y.scan(vI),y.scanUntil(m),R="&"):x=y.scanUntil(m),!y.scan(m))throw new Error("Unclosed tag at "+y.pos);if(R==">"?V=[R,x,E,y.pos,u,l,t]:V=[R,x,E,y.pos],l++,i.push(V),R==="#"||R==="^")n.push(V);else if(R==="/"){if(j=n.pop(),!j)throw new Error('Unopened section "'+x+'" at '+E);if(j[1]!==x)throw new Error('Unclosed section "'+j[1]+'" at '+E)}else R==="name"||R==="{"||R==="&"?o=!0:R==="="&&T(x)}if(c(),j=n.pop(),j)throw new Error('Unclosed section "'+j[1]+'" at '+y.pos);return SI(EI(i))}function EI(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 SI(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 Wo(r){this.string=r,this.tail=r,this.pos=0}Wo.prototype.eos=function(){return this.tail===""};Wo.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};Wo.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 Gs(r,e){this.view=r,this.cache={".":this.view},this.parent=e}Gs.prototype.push=function(e){return new Gs(e,this)};Gs.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=xw(s,a[o])||fI(s,a[o])),s=s[a[o++]];else s=i.view[e],u=xw(i.view,e);if(u){n=s;break}i=i.parent}t[e]=n}return bh(n)&&(n=n.call(this.view)),n};function It(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}It.prototype.clearCache=function(){typeof this.templateCache!="undefined"&&this.templateCache.clear()};It.prototype.parse=function(e,t){var n=this.templateCache,i=e+":"+(t||wr.tags).join(":"),s=typeof n!="undefined",a=s?n.get(i):void 0;return a==null&&(a=kI(e,t),s&&n.set(i,a)),a};It.prototype.render=function(e,t,n,i){var s=this.getConfigTags(i),a=this.parse(e,s),o=t instanceof Gs?t:new Gs(t,void 0);return this.renderTokens(a,o,n,e,i)};It.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};It.prototype.renderSection=function(e,t,n,i,s){var a=this,o="",u=t.lookup(e[1]);function l(m){return a.render(m,t,n,s)}if(!!u){if(Ys(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(bh(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}};It.prototype.renderInverted=function(e,t,n,i,s){var a=t.lookup(e[1]);if(!a||Ys(a)&&a.length===0)return this.renderTokens(e[4],t,n,i,s)};It.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(`
|
|
|
`)};It.prototype.renderPartial=function(e,t,n,i){if(!!n){var s=this.getConfigTags(i),a=bh(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)}}};It.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(n!=null)return n};It.prototype.escapedValue=function(e,t,n){var i=this.getConfigEscape(n)||wr.escape,s=t.lookup(e[1]);if(s!=null)return typeof s=="number"&&i===wr.escape?String(s):i(s)};It.prototype.rawValue=function(e){return e[1]};It.prototype.getConfigTags=function(e){return Ys(e)?e:e&&typeof e=="object"?e.tags:void 0};It.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!Ys(e))return e.escape};var wr={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){qo.templateCache=r},get templateCache(){return qo.templateCache}},qo=new It;wr.clearCache=function(){return qo.clearCache()};wr.parse=function(e,t){return qo.parse(e,t)};wr.render=function(e,t,n,i){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+dI(e)+'" was given as the first argument for mustache#render(template, view, partials)');return qo.render(e,t,n,i)};wr.escape=bI;wr.Scanner=Wo;wr.Context=Gs;wr.Writer=It;var Th=wr;var Nw=ga(Pw());function Iw(r,e){Th.escape=function(t){return t};try{return Th.render(r,(0,Nw.default)(e))}catch(t){let n="";throw t instanceof Error?n=`There was an error expanding one or more placeholders.
|
|
|
|
|
|
The error message was:
|
|
|
${t.message.replace(/ > /g,".").replace("Missing Mustache data property","Unknown property")}`:n="Unknown error expanding placeholders.",n+=`
|
|
|
|
|
|
The problem is in:
|
|
|
${r}`,Error(n)}}function Fw(r){return vh(r,[])}function vh(r,e){return{query:{file:new Je(r),allTasks:e}}}var Bs=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(`
|
|
|
`)}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.
|
|
|
`);let n="";for(let i=0;i<t;i++)n+=this.indentation+e.grouping[i].instruction+`
|
|
|
`;return n}explainSorters(e){let t=e.sorting.length;if(t===0)return this.indent(`No sorting instructions supplied.
|
|
|
`);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}=Z();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 Ee=class{constructor(e,t=[],n=""){this.description=e,this.symbol=n,this.children=t}static booleanAnd(e){return this.combineOrCreateExplanation("All of",e,"AND")}static booleanOr(e){return this.combineOrCreateExplanation("At least one of",e,"OR")}static booleanNot(e){return new Ee("None of",e,"NOT")}static booleanXor(e){return new Ee("Exactly one of",e,"XOR")}asString(e=""){if(this.children.length==0)return e+this.description;let t=e;this.symbol===""?t+=this.description:(t+=this.symbol,this.children.length>1&&(t+=` (${this.description})`),t+=":");let n=e+" ";for(let i=0;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 Ee(e,t,n)}};var Hs=class{matchesAnyOf(e){return e.some(t=>this.matches(t))}};var Vs=class extends Hs{constructor(t){super();this.stringToFind=t}matches(t){return Vs.stringIncludesCaseInsensitive(t,this.stringToFind)}static stringIncludesCaseInsensitive(t,n){return t.toLocaleLowerCase().includes(n.toLocaleLowerCase())}explanation(t){return new Ee(t)}};var ai=class extends Hs{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 ai(s)}else return null}matches(t){return t.match(this.regex)!==null}static helpMessage(){return String.raw`See https://publish.obsidian.md/tasks/Queries/Regular+Expressions
|
|
|
|
|
|
Regular expressions must look like this:
|
|
|
/pattern/
|
|
|
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.
|
|
|
`}explanation(t){let i=OI(t,"using regex: ",this.regexAsString());return new Ee(i)}regexAsString(){let t=`'${this.regex.source}' with `;switch(this.regex.flags.length){case 0:t+="no flags";break;case 1:t+=`flag '${this.regex.flags}'`;break;default:t+=`flags '${this.regex.flags}'`;break}return t}};function OI(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 oi=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 Ds(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 oi(this.grouperInstruction(e),this.fieldNameSingular(),this.grouper(),e)}createNormalGrouper(){return this.createGrouper(!1)}createReverseGrouper(){return this.createGrouper(!0)}};var Ln=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}allLinesIdentical(){return this._rawInstruction===this._anyContinuationLinesRemoved&&this._rawInstruction===this._anyPlaceholdersExpanded}};var St=class{constructor(e,t,n){this._statement=new Ln(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._statement.explainStatement(e);return this.onlyNeedsOneLineExplanation()?`${t}
|
|
|
`:`${t} =>
|
|
|
${this.explanation.asString(e+" ")}
|
|
|
`}simulateExplainFilter(){return this.onlyNeedsOneLineExplanation()?this.explanation:new Ee(this.instruction+" =>",[this.explanation])}onlyNeedsOneLineExplanation(){return this.explanation.asString("")===this.instruction}};var an=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 an(e);return n._queryComponent=t,n}static fromError(e,t){let n=new an(e);return n._error=t,n}};var ie=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 ie(an.fromObject(e.instruction,e))}static fromError(e,t){return new ie(an.fromError(e,t))}};var Ae=class extends we{createFilterOrErrorMessage(e){let t=we.getMatch(this.filterRegExp(),e);if(t===null)return ie.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 Vs(i);else if(n.includes("regex")){try{s=ai.validateAndConstruct(i)}catch(u){let l=Hi("Parsing regular expression",u)+`
|
|
|
|
|
|
${ai.helpMessage()}`;return ie.fromError(e,l)}if(s===null)return ie.fromError(e,`Invalid instruction: '${e}'
|
|
|
|
|
|
${ai.helpMessage()}`)}if(s===null)return ie.fromError(e,`do not understand query filter (${this.fieldName()})`);let a=n.match(/not/)!==null,o=new St(e,this.getFilter(s,a),s.explanation(e));return ie.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 Vi=class extends Ae{fieldName(){return"description"}value(e){return ye.getInstance().removeAsSubstringFrom(e.description)}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Vi.cleanDescription(e.description),i=Vi.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 Ml=class{findUnexpandedDateText(e){let t=["<%","YYYY-MM-DD"];for(let n of t)if(e.includes(n))return this.unexpandedDateTextMessage(n);return null}unexpandedDateTextMessage(e){return`Instruction contains unexpanded template text: "${e}" - and cannot be interpreted.
|
|
|
|
|
|
Possible causes:
|
|
|
- The query is an a template file, and is not intended to be searched.
|
|
|
- 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.
|
|
|
|
|
|
See: https://publish.obsidian.md/tasks/Advanced/Instruction+contains+unexpanded+template+text
|
|
|
`}};var Cl=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e.toLocaleLowerCase()===this._instruction.toLocaleLowerCase()}createFilterOrErrorMessage(e){return this.canCreateFilterForLine(e)?ie.fromFilter(new St(e,this._filter,new Ee(e))):ie.fromError(e,`do not understand filter: ${e}`)}};var Gt=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new Cl(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 ie.fromError(e,`do not understand filter: ${e}`)}};var ft=class extends we{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new Gt,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 m;let n=this.checkForUnexpandedTemplateText(t);if(n)return ie.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 ie.fromError(t,"do not understand query filter ("+this.fieldName()+" date)");let a=s[1],o=(m=s[2])==null?void 0:m.toLowerCase(),u=s[3],l=Qt.parseDateRange(u);if(!l.isValid()){let p=Qt.parseDate(a);p.isValid()&&(l=new At(p,p))}if(!l.isValid())return ie.fromError(t,"do not understand "+this.fieldName()+" date");let c=this.buildFilterFunction(o,l),d=ft.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),l);return ie.fromFilter(new St(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 Ee(`${s.start.format(o)} and`),new Ee(`${s.end.format(o)} inclusive`)];return i&&d.push(new Ee(`OR no ${t} date`)),new Ee(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 Ee(l)}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(t,n)=>Tr(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 Ml().findUnexpandedDateText(t)}};var Al=class extends ft{fieldName(){return"created"}date(e){return e.createdDate}filterResultIfFieldMissing(){return!1}};var Pl=class extends ft{fieldName(){return"done"}date(e){return e.doneDate}filterResultIfFieldMissing(){return!1}};var zs=class extends ft{fieldName(){return"due"}date(e){return e.dueDate}filterResultIfFieldMissing(){return!1}};var on=class extends we{constructor(){super(...arguments);this._filters=new Gt}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var Nl=class extends on{constructor(){super(),this._filters.add("exclude sub-items",e=>{if(e.indentation==="")return!0;let t=e.indentation.lastIndexOf(">");return t===-1?!1:/^ ?$/.test(e.indentation.slice(t+1))})}fieldName(){return"exclude"}};var $o=class extends an{};function wh(r,e){let t=r.map(([n])=>n);try{let n=e.includes("return")?e:`return ${e}`,i=e&&new Function(...t,n);return i instanceof Function?$o.fromObject(e,i):$o.fromError(e,"Error parsing group function")}catch(n){return $o.fromError(e,Hi(`Failed parsing expression "${e}"`,n))}}function kh(r,e){let t=e.map(([n,i])=>i);return r(...t)}function Eh(r,e,t){try{return kh(r,e)}catch(n){return Hi(`Failed calculating expression "${t}"`,n)}}function Il(r,e){return[["task",r],["query",e?e.query:null]]}function Lw(r,e,t){let n=Il(r,t||null),i=wh(n,e);return i.error?i.error:Eh(i.queryComponent,n,e)}var jo=class{constructor(e){this.line=e,this.functionOrError=wh(Il(null,null),e)}isValid(){return this.functionOrError.isValid()}get parseError(){return this.functionOrError.error}evaluate(e,t){if(!this.isValid())throw Error(`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`);return kh(this.functionOrError.queryComponent,Il(e,t||null))}evaluateOrCatch(e,t){return this.isValid()?Eh(this.functionOrError.queryComponent,Il(e,t),this.line):`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`}};function Sh(r){if(r===null)return"null";let e=typeof r;return e==="object"?r.constructor.name:e}var Fl=class extends we{createFilterOrErrorMessage(e){let t=we.getMatch(this.filterRegExp(),e);if(t===null)return ie.fromError(e,"Unable to parse line");let n=t[1],i=new jo(n);return i.isValid()?ie.fromFilter(new St(e,DI(i),new Ee(e))):ie.fromError(e,i.parseError)}fieldName(){return"function"}filterRegExp(){return new RegExp(`^filter by ${this.fieldNameSingularEscaped()} (.*)`,"i")}supportsSorting(){return!0}sorterRegExp(){return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)? (.*)`,"i")}createSorterFromLine(e){let t=we.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1],i=t[2],s=new jo(i);if(!s.isValid())throw new Error(s.parseError);let a=(o,u,l)=>{try{let c=l.queryContext(),d=this.validateTaskSortKey(s.evaluate(o,c)),m=this.validateTaskSortKey(s.evaluate(u,c));return this.compareTaskSortKeys(d,m)}catch(c){throw c instanceof Error&&(c.message+=`: while evaluating instruction '${e}'`),c}};return new Wr(e,this.fieldNameSingular(),a,n)}validateTaskSortKey(e){function t(n){throw new Error(`"${n}" is not a valid sort key`)}return e===void 0&&t("undefined"),Number.isNaN(e)&&t("NaN (Not a Number)"),Array.isArray(e)&&t("array"),e}compareTaskSortKeys(e,t){let n=Sh(e),i=Sh(t),s=this.compareTaskSortKeysIfOptionalMoment(e,t,n,i);if(s!==void 0)return s;let a=this.compareTaskSortKeysIfEitherIsNull(e,t);if(a!==void 0)return a;if(n!==i)throw new Error(`Unable to compare two different sort key types '${n}' and '${i}' order`);if(n==="string")return e.localeCompare(t,void 0,{numeric:!0});if(n==="TasksDate")return Tr(e.moment,t.moment);if(n==="boolean")return Number(t)-Number(e);let o=Number(e)-Number(t);if(isNaN(o))throw new Error(`Unable to determine sort order for sort key types '${n}' and '${i}'`);return o}compareTaskSortKeysIfOptionalMoment(e,t,n,i){let s=n==="Moment",a=i==="Moment";if(s&&a||s&&t===null||a&&e===null)return Tr(e,t)}compareTaskSortKeysIfEitherIsNull(e,t){if(e===null&&t===null)return 0;if(e===null&&t!==null)return-1;if(e!==null&&t===null)return 1}supportsGrouping(){return!0}createGrouperFromLine(e){let t=we.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1],i=t[2];return new oi(e,"function",RI(i),n)}grouperRegExp(){return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)? (.*)`,"i")}grouper(){throw Error("grouper() function not valid for FunctionField. Use createGrouperFromLine() instead.")}};function DI(r){return(e,t)=>{let n=t.queryContext();return xI(r,e,n)}}function xI(r,e,t){let n=r.evaluate(e,t);if(typeof n=="boolean")return n;throw Error(`filtering function must return true or false. This returned "${n}".`)}function RI(r){return(e,t)=>{let n=t.queryContext();return MI(e,r,n)}}function MI(r,e,t){try{let n=Lw(r,e,t);return Array.isArray(n)?n.map(s=>s.toString()):n===null?[]:[n.toString()]}catch(n){let i=`Error: Failed calculating expression "${e}". The error message was: `;return n instanceof Error?[i+n.message]:[i+"Unknown error"]}}var Ll=class extends Ae{fieldName(){return"heading"}value(e){return e.precedingHeader?e.precedingHeader:""}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>e.precedingHeader===null||e.precedingHeader.length===0?["(No heading)"]:[e.precedingHeader]}};var Ks=class extends Ae{fieldName(){return"path"}value(e){return e.path}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>[Ae.escapeMarkdownCharacters(e.path.replace(".md",""))]}};var Oh=class extends we{createFilterOrErrorMessage(e){var n;let t=we.getMatch(this.filterRegExp(),e);if(t!==null){let i=t[5],s=null;switch(i.toLowerCase()){case"lowest":s="5";break;case"low":s="4";break;case"none":s="3";break;case"medium":s="2";break;case"high":s="1";break;case"highest":s="0";break}if(s===null)return ie.fromError(e,"do not understand priority");let a=e,o;switch((n=t[3])==null?void 0:n.toLowerCase()){case"above":o=u=>u.priority.localeCompare(s)<0;break;case"below":o=u=>u.priority.localeCompare(s)>0;break;case"not":o=u=>u.priority!==s;break;default:o=u=>u.priority===s,a=`${this.fieldName()} is ${i}`}return ie.fromFilter(new St(e,o,new Ee(a)))}else return ie.fromError(e,"do not understand query filter (priority)")}fieldName(){return"priority"}filterRegExp(){return Oh.priorityRegexp}supportsSorting(){return!0}comparator(){return(e,t)=>e.priority.localeCompare(t.priority)}supportsGrouping(){return!0}grouper(){return e=>[e.priorityNameGroupText]}},zi=Oh;zi.priorityRegexp=/^priority(\s+is)?(\s+(above|below|not))?(\s+(lowest|low|none|medium|high|highest))$/i;var Ul=class extends ft{fieldName(){return"scheduled"}date(e){return e.scheduledDate}filterResultIfFieldMissing(){return!1}};var ql=class extends ft{fieldName(){return"start"}fieldNameForFilterInstruction(){return"starts"}date(e){return e.startDate}filterResultIfFieldMissing(){return!0}};var Wl=class extends ft{constructor(){let e=new Gt;e.add("has happens date",t=>this.dates(t).some(n=>n!==null)),e.add("no happens date",t=>!this.dates(t).some(n=>n!==null)),super(e)}fieldName(){return"happens"}fieldNameForExplanation(){return"due, start or scheduled"}date(e){return this.earliestDate(e)}dates(e){return e.happensDates}earliestDate(e){return e.happens.moment}filterResultIfFieldMissing(){return!1}getFilter(e){return t=>this.dates(t).some(n=>e(n))}};var $l=class extends on{constructor(){super(),this._filters.add("is recurring",e=>e.recurrence!==null),this._filters.add("is not recurring",e=>e.recurrence===null)}fieldName(){return"recurring"}supportsSorting(){return!0}comparator(){return(e,t)=>e.recurrence!==null&&t.recurrence===null?-1:e.recurrence===null&&t.recurrence!==null?1:0}supportsGrouping(){return!0}grouper(){return e=>e.recurrence!==null?["Recurring"]:["Not Recurring"]}};var ui=class extends on{constructor(){super(),this._filters.add("done",e=>e.isDone),this._filters.add("not done",e=>!e.isDone)}fieldName(){return"status"}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=ui.oldStatusName(e),i=ui.oldStatusName(t);return n<i?1:n>i?-1:0}}static oldStatusName(e){return e.status.symbol===" "?"Todo":"Done"}supportsGrouping(){return!0}grouper(){return e=>[ui.oldStatusName(e)]}};var jl=class extends Ae{fieldNamePlural(){return this.fieldNameSingular()+"s"}fieldName(){return`${this.fieldNameSingular()}/${this.fieldNamePlural()}`}fieldPattern(){return`${this.fieldNameSingular()}|${this.fieldNamePlural()}`}filterOperatorPattern(){return`${super.filterOperatorPattern()}|include|do not include`}value(e){return this.values(e).join(", ")}getFilter(e,t){return n=>{let i=e.matchesAnyOf(this.values(n));return t?!i:i}}createGrouper(e){return new oi(this.grouperInstruction(e),this.fieldNamePlural(),this.grouper(),e)}grouperRegExp(){if(!this.supportsGrouping())throw Error(`grouperRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^group by ${this.fieldNamePlural()}( reverse)?$`,"i")}grouperInstruction(e){let t=`group by ${this.fieldNamePlural()}`;return e&&(t+=" reverse"),t}};var Ki=class extends jl{constructor(){super();this.filterInstructions=new Gt,this.filterInstructions.add(`has ${this.fieldNameSingular()}`,t=>this.values(t).length>0),this.filterInstructions.add(`has ${this.fieldNamePlural()}`,t=>this.values(t).length>0),this.filterInstructions.add(`no ${this.fieldNameSingular()}`,t=>this.values(t).length===0),this.filterInstructions.add(`no ${this.fieldNamePlural()}`,t=>this.values(t).length===0)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.isValid()?n:super.createFilterOrErrorMessage(t)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}fieldNameSingular(){return"tag"}values(t){return t.tags}supportsSorting(){return!0}createSorterFromLine(t){let n=t.match(this.sorterRegExp());if(n===null)return null;let i=!!n[1],s=isNaN(+n[2])?1:+n[2],a=Ki.makeCompareByTagComparator(s);return new Wr(t,this.fieldNameSingular(),a,i)}sorterRegExp(){return/^sort by tag( reverse)?[\s]*(\d+)?/i}comparator(){return Ki.makeCompareByTagComparator(1)}static makeCompareByTagComparator(t){return(n,i)=>{if(n.tags.length===0&&i.tags.length===0)return 0;if(n.tags.length===0)return 1;if(i.tags.length===0)return-1;let s=t-1;if(n.tags.length<t&&i.tags.length>=t)return 1;if(i.tags.length<t&&n.tags.length>=t)return-1;if(n.tags.length<t&&i.tags.length<t)return 0;let a=n.tags[s],o=i.tags[s];return a.localeCompare(o,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return t=>t.tags.length==0?["(No tags)"]:t.tags}};var Xw=ga(Qw());function li(r){return new RegExp("["+Ds(r)+"]").source}var Fh=[["(",")"],["[","]"],["{","}"],['"','"']],qn=class{constructor(e,t,n){this.openFilterChars=e,this.closeFilterChars=t,this.openAndCloseFilterChars=n,this.openFilter=li(this.openFilterChars),this.closeFilter=li(this.closeFilterChars)}static allSupportedDelimiters(){let e="",t="",n="";for(let[i,s]of Fh)e+=i,t+=s,n+=qn.openAndClosing(i,s);return new qn(e,t,n)}static fromInstructionLine(e){let t=e.trim(),i=/^[A-Z ]*\s*(.*)/.exec(t);if(i){let a=i[1],o=a[0],u=a.slice(-1);for(let[l,c]of Fh)if(o===l&&u===c){let d=this.openAndClosing(l,c);return new qn(l,c,d)}}let s="All filters in a Boolean instruction must be inside one of these pairs of delimiter characters: "+Fh.map(([a,o])=>a+"..."+o).join(" or ")+". Combinations of those delimiters are no longer supported.";throw new Error(s)}static openAndClosing(e,t){let n=e;return t!=e&&(n+=t),n}};var ci=class{static preprocessExpression(e,t){let n=ci.splitLine(e,t);return ci.getFiltersAndSimplifiedLine(n,t)}static splitLine(e,t){let n=new RegExp("("+t.closeFilter+"\\s*(?:AND|OR|AND +NOT|OR +NOT|XOR)\\s*"+t.openFilter+")"),i=e.split(n),s=new RegExp("(NOT\\s*"+t.openFilter+")"),a=i.flatMap(l=>l.split(s)).filter(l=>l!==""),o=new RegExp("(^"+li(t.openFilterChars+" ")+"*)"),u=new RegExp("("+li(t.closeFilterChars+" ")+"*$)");return a.flatMap(l=>l.split(o)).flatMap(l=>l.split(u)).filter(l=>l!=="")}static getFiltersAndSimplifiedLine(e,t){let n="",i=1,s={};e.forEach(l=>{if(!ci.isAFilter(l,t))n+=`${l}`;else{let c=`f${i}`;s[c]=l,n+=c,i++}});let a=new RegExp(`(${t.closeFilter})([A-Z])`,"g");n=n.replace(a,"$1 $2");let o=new RegExp(`([A-Z])(${t.openFilter})`,"g");n=n.replace(o,"$1 $2");let u=t.openFilterChars;if(u!='"'&&u!="("){let l=new RegExp(li(u),"g");n=n.replace(l,"(");let c=t.closeFilterChars,d=new RegExp(li(c),"g");n=n.replace(d,")")}return{simplifiedLine:n,filters:s}}static isAFilter(e,t){let n=new RegExp("^"+li(" "+t.openAndCloseFilterChars)+"+$"),i=new RegExp("^ *"+t.closeFilter+" *(AND|OR|XOR) *"+t.openFilter+" *$"),s=new RegExp("^(AND|OR|XOR|NOT) *"+t.openFilter+"$"),a=new RegExp("^"+t.closeFilter+" *(AND|OR|XOR)$");return![n,i,s,a,/^(AND|OR|XOR|NOT)$/].some(u=>RegExp(u).exec(e))}};var Vl=class extends we{constructor(){super();this.supportedOperators=["AND","OR","XOR","NOT"];this.subFields={};let t=qn.allSupportedDelimiters();this.basicBooleanRegexp=new RegExp("(.*(AND|OR|XOR|NOT)\\s*"+t.openFilter+".*|"+t.openFilter+".+"+t.closeFilter+")","g")}filterRegExp(){return this.basicBooleanRegexp}createFilterOrErrorMessage(t){return this.parseLine(t)}fieldName(){return"boolean query"}parseLine(t){if(t.length===0)return ie.fromError(t,"empty line");let n;try{n=qn.fromInstructionLine(t)}catch(o){let u=o instanceof Error?o.message:"unknown error type";return ie.fromError(t,this.helpMessageFromSimpleError(t,u))}let i=ci.preprocessExpression(t,n),s=i.simplifiedLine,a=i.filters;try{let o=(0,Xw.parse)(s);for(let c of o)if(c.name==="IDENTIFIER"&&c.value){let d=c.value.trim(),m=a[d];if(c.value=m,!(m in this.subFields)){let p=Yo(m);if(p===null)return this.helpMessage(t,`couldn't parse sub-expression '${m}'`,i);if(p.error)return this.helpMessage(t,`couldn't parse sub-expression '${m}': ${p.error}`,i);p.filter&&(this.subFields[m]=p.filter)}}else if(c.name==="OPERATOR"){if(c.value==null)return this.helpMessage(t,"empty operator in boolean query",i);if(!this.supportedOperators.includes(c.value))return this.helpMessage(t,`unknown boolean operator '${c.value}'`,i)}let u=(c,d)=>this.filterTaskWithParsedQuery(c,o,d),l=this.constructExplanation(o);return ie.fromFilter(new St(t,u,l))}catch(o){let u=o instanceof Error?o.message:"unknown error type";return this.helpMessage(t,`malformed boolean query -- ${u} (check the documentation for guidelines)`,i)}}filterTaskWithParsedQuery(t,n,i){let s=u=>u==="true",a=u=>u?"true":"false",o=[];for(let u of n)if(u.name==="IDENTIFIER"){if(u.value==null)throw Error("null token value");let c=this.subFields[u.value.trim()].filterFunction(t,i);o.push(a(c))}else if(u.name==="OPERATOR")if(u.value==="NOT"){let l=s(o.pop());o.push(a(!l))}else if(u.value==="OR"){let l=s(o.pop()),c=s(o.pop());o.push(a(l||c))}else if(u.value==="AND"){let l=s(o.pop()),c=s(o.pop());o.push(a(l&&c))}else if(u.value==="XOR"){let l=s(o.pop()),c=s(o.pop());o.push(a(l&&!c||!l&&c))}else throw Error("Unsupported operator: "+u.value);else throw Error("Unsupported token type: "+u);return s(o[0])}constructExplanation(t){let n=[];for(let i of t)if(i.name==="IDENTIFIER")this.explainExpression(i,n);else if(i.name==="OPERATOR")this.explainOperator(i,n);else throw Error("Unsupported token type: "+i.name);return n[0]}explainExpression(t,n){if(t.value==null)throw Error("null token value");let i=this.subFields[t.value.trim()],s=this.simulateExplainFilter(i);n.push(s)}simulateExplainFilter(t){return t.simulateExplainFilter()}explainOperator(t,n){if(t.value==="NOT"){let i=n.pop();n.push(Ee.booleanNot([i]))}else if(t.value==="OR"){let i=n.pop(),s=n.pop();n.push(Ee.booleanOr([s,i]))}else if(t.value==="AND"){let i=n.pop(),s=n.pop();n.push(Ee.booleanAnd([s,i]))}else if(t.value==="XOR"){let i=n.pop(),s=n.pop();n.push(Ee.booleanXor([s,i]))}else throw Error("Unsupported operator: "+t.value)}helpMessage(t,n,i){let s=i.filters,a=this.stringifySubExpressionsForErrorMessage(s),u=`${this.helpMessageFromSimpleError(t,n)}
|
|
|
|
|
|
The instruction was converted to the following simplified line:
|
|
|
${i.simplifiedLine}
|
|
|
|
|
|
Where the sub-expressions in the simplified line are:
|
|
|
${a}
|
|
|
|
|
|
For help, see:
|
|
|
https://publish.obsidian.md/tasks/Queries/Combining+Filters
|
|
|
`;return ie.fromError(t,u)}stringifySubExpressionsForErrorMessage(t){return Object.entries(t).map(([n,i])=>` '${n}': '${i}'
|
|
|
=> ${this.stringifySubExpressionStatus(i)}`).join(`
|
|
|
`)}stringifySubExpressionStatus(t){let n=Yo(t);return n?n.error?`ERROR:
|
|
|
${n.error.split(`
|
|
|
`).map(s=>s.trim()).join(`
|
|
|
`)}`:"OK":`ERROR:
|
|
|
do not understand query`}helpMessageFromSimpleError(t,n){return`Could not interpret the following instruction as a Boolean combination:
|
|
|
${t}
|
|
|
|
|
|
The error message is:
|
|
|
${n}`}};var zl=class extends Ae{fieldName(){return"filename"}value(e){let t=e.filename;return t===null?"":t+".md"}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>{let t=e.filename;return t===null?["Unknown Location"]:["[["+t+"]]"]}}};var na=class extends we{canCreateFilterForLine(e){return!1}createFilterOrErrorMessage(e){return ie.fromError(e,"Filtering by urgency is not yet supported")}fieldName(){return"urgency"}filterRegExp(){throw Error(`filterRegExp() unimplemented for ${this.fieldName()}`)}supportsSorting(){return!0}comparator(){return(e,t)=>t.urgency-e.urgency}supportsGrouping(){return!0}grouper(){return e=>[`${e.urgency.toFixed(2)}`]}createGrouper(e){return super.createGrouper(!e)}grouperInstruction(e){return super.grouperInstruction(!e)}};var Kl=class extends Ae{constructor(){super()}fieldName(){return"status.name"}value(e){return e.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};var dn=class extends we{canCreateFilterForLine(e){let t=new RegExp(`^(?:${this.fieldNameSingularEscaped()})`,"i");return we.lineMatchesFilter(t,e)}createFilterOrErrorMessage(e){let t=we.getMatch(this.filterRegExp(),e);if(t===null)return this.helpMessage(e);let n=t[1].toLowerCase(),i=t[2],s=er[i.toUpperCase()];if(!s)return this.helpMessage(e);let a;switch(n){case"is":a=o=>o.status.type===s;break;case"is not":a=o=>o.status.type!==s;break;default:return this.helpMessage(e)}return ie.fromFilter(new St(e,a,new Ee(e)))}filterRegExp(){return new RegExp(`^(?:${this.fieldNameSingularEscaped()}) (is|is not) ([^ ]+)$`,"i")}helpMessage(e){let t=Object.values(er).filter(i=>i!=="EMPTY").join(" "),n=`Invalid ${this.fieldNameSingular()} instruction: '${e}'.
|
|
|
Allowed options: 'is' and 'is not' (without quotes).
|
|
|
Allowed values: ${t}
|
|
|
Note: values are case-insensitive,
|
|
|
so 'in_progress' works too, for example.
|
|
|
Example: ${this.fieldNameSingular()} is not NON_TASK`;return ie.fromError(e,n)}fieldName(){return"status.type"}value(e){return e.status.type}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=dn.groupName(e),i=dn.groupName(t);return n.localeCompare(i,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return e=>[dn.groupName(e)]}static groupName(e){return e.status.typeGroupText}};var Ql=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 Xl=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 Jl=class extends Ae{fieldName(){return"backlink"}value(e){let t=e.getLinkText({isFilenameUnique:!0});return t===null?"Unknown Location":t}createFilterOrErrorMessage(e){return ie.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 ec=class extends ft{fieldName(){return"cancelled"}date(e){return e.cancelledDate}filterResultIfFieldMissing(){return!1}};var tc=class extends on{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 rc=class extends Ae{constructor(){super();this.filterInstructions=new Gt;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 nc=class extends we{constructor(){super();this.filterInstructions=new Gt;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:ie.fromError(t,"Unknown instruction")}fieldName(){return"blocked by"}filterRegExp(){return null}};var Lh=[()=>new Kl,()=>new dn,()=>new ui,()=>new $l,()=>new zi,()=>new Wl,()=>new ec,()=>new Al,()=>new ql,()=>new Ul,()=>new zs,()=>new Pl,()=>new Ks,()=>new Xl,()=>new Zl,()=>new Jl,()=>new Vi,()=>new Ki,()=>new Ll,()=>new Nl,()=>new zl,()=>new na,()=>new Ql,()=>new Fl,()=>new rc,()=>new nc,()=>new tc,()=>new Vl];function Yo(r){for(let e of Lh){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function Zw(r){let e=/^sort by /i;if(r.match(e)===null)return null;for(let t of Lh){let i=t().createSorterFromLine(r);if(i)return i}return null}function Jw(r){let e=/^group by /i;if(r.match(e)===null)return null;for(let t of Lh){let i=t().createGrouperFromLine(r);if(i)return i}return null}var ic=class{constructor(e,t,n){this.nestingLevel=e,this.displayName=t,this.property=n}};var sc=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.lastHeadingAtLevel[n]){t.push(new ic(n,i,this.groupers[n].property));for(let s=n;s<e.length;s++)this.lastHeadingAtLevel[s]="";this.lastHeadingAtLevel[n]=i}}return t}};var ac=class{constructor(e){this.children=new Map;this.values=[];this.values=e}generateAllPaths(e=[]){let t=new Map;if(this.children.size==0)return t.set([...e],this.values),t;for(let[n,i]of this.children)e.push(n),i.generateAllPaths(e).forEach((a,o)=>t.set(o,a)),e.pop();return t}};var oc=class extends ac{},uc=class{constructor(e,t,n){this.root=new oc(t),this.buildGroupingTree(e,n)}buildGroupingTree(e,t){let n=[this.root];for(let i of e){let s=[];for(let a of n)for(let o of a.values){let u=i.grouper(o,t);u.length===0&&u.push("");for(let l of u){let c=a.children.get(l);c===void 0&&(c=new oc([]),a.children.set(l,c),s.push(c)),c.values.push(o)}}n=s}}generateTaskTreeStorage(){return this.root.generateAllPaths()}};var lc=class{constructor(e,t){this.groups=e,this.groupHeadings=[],this.tasks=t}setGroupHeadings(e){for(let t of e)this.groupHeadings.push(t)}applyTaskLimit(e){this.tasks=this.tasks.slice(0,e)}tasksAsStringOfLines(){let e="";for(let t of this.tasks)e+=t.toFileLineString()+`
|
|
|
`;return e}toString(){let e=`
|
|
|
`;e+=`Group names: [${this.groups}]
|
|
|
`;for(let t of this.groupHeadings)e+=`${"#".repeat(4+t.nestingLevel)} [${t.property}] ${t.displayName}
|
|
|
`;return e+=this.tasksAsStringOfLines(),e}};var ia=class{constructor(e,t,n){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length,this._groupers=e;let s=new uc(e,t,n).generateTaskTreeStorage();this.addTaskGroups(s),this.sortTaskGroups(),this.setGroupsHeadings(s)}get groupers(){return this._groupers}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let e="";e+=`Groupers (if any):
|
|
|
`;for(let n of this._groupers){let i=n.reverse?" reverse":"";e+=`- ${n.property}${i}
|
|
|
`}for(let n of this.groups)e+=n.toString(),e+=`
|
|
|
---
|
|
|
`;return e+=`
|
|
|
${this.totalTasksCount()} tasks
|
|
|
`,e}addTaskGroups(e){for(let[t,n]of e){let i=new lc(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 sc(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 di=class{constructor(e,t){this.queryPath=e,this.allTasks=[...t]}static fromAllTasks(e){return new di(void 0,e)}queryContext(){return this.queryPath?vh(this.queryPath,this.allTasks):void 0}};function ek(r){return`task${r!==1?"s":""}`}var Zi=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} ${ek(e)}`:`${e} of ${t} ${ek(t)}`}get groups(){return this.taskGroups.groups}static fromError(e){let t=new Zi(new ia([],[],di.fromAllTasks([])),0);return t._searchErrorMessage=e,t}};function tk(r){return r.endsWith("\\")}function rk(r){return r.endsWith("\\\\")}function nF(r){return r.replace(/^[ \t]*/,"")}function iF(r){return r.replace(/[ \t]*\\$/,"")}function sF(r,e){let t=r;return e&&(t=nF(r)),rk(t)?t=t.slice(0,-1):tk(r)&&(t=iF(t)),t}function nk(r){let e=[],t=!1,n="",i="";for(let s of r.split(`
|
|
|
`)){let a=sF(s,t);t?(n+=`
|
|
|
`+s,i+=" "+a):(n=s,i=a),rk(s)?t=!1:t=tk(s),t||(i.trim()!==""&&e.push(new Ln(n,i)),n="",i="")}return e}var sa=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(sa.makeCompositeComparator([...s,...i],n))}static defaultSorters(){return[new dn().createNormalSorter(),new na().createNormalSorter(),new zs().createNormalSorter(),new zi().createNormalSorter(),new Ks().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 Wn=class{constructor(e,t=void 0){this._limit=void 0;this._taskGroupLimit=void 0;this._taskLayoutOptions=new Jr;this._queryLayoutOptions=new si;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=Nt.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()}`),nk(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,n);return}})}get queryId(){return this._queryId}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",t)}}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 "}}"
|
|
|
but no file path has been supplied, so cannot expand placeholder values.
|
|
|
The query is:
|
|
|
${n}`,n;let i=n;if(t){let s=Fw(t);try{i=Iw(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 Wn(`${this.source}
|
|
|
${e.source}`,this.filePath)}explainQuery(){return new Bs().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){t.allLinesIdentical()?this._error=`${e}
|
|
|
Problem line: "${t.rawInstruction}"`:this._error=`${e}
|
|
|
Problem statement:
|
|
|
${t.explainStatement(" ")}
|
|
|
`}get ignoreGlobalQuery(){return this._ignoreGlobalQuery}applyQueryToTasks(e){this.debug(`Executing query: ${this.formatQueryForLogging()}`);let t=new di(this.filePath,e);try{this.filters.forEach(o=>{e=e.filter(u=>o.filterFunction(u,t))});let{debugSettings:n}=Z(),i=n.ignoreSortInstructions?e:sa.by(this.sorting,e,t),s=i.slice(0,this.limit),a=new ia(this.grouping,s,t);return this._taskGroupLimit!==void 0&&a.applyTaskLimit(this._taskGroupLimit),new Zi(a,i.length)}catch(n){let i="Search failed";return Zi.fromError(Hi(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",new Ln(e,e))}}}parseFilter(e,t){var i;let n=Yo(e);return n!=null?(n.filter?(n.filter.setStatement(t),this._filters.push(n.filter)):this.setError((i=n.error)!=null?i:"Unknown error",t),!0):!1}parseLimit(e){let t=e.match(this.limitRegexp);if(t===null){this.setError("do not understand query limit",new Ln(e,e));return}let n=Number.parseInt(t[3],10);t[1]!==void 0?this._taskGroupLimit=n:this._limit=n}parseSortBy(e){let t=Zw(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy(e){let t=Jw(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 fi=class{constructor(e=fi.empty){this._source=e}static getInstance(){return fi.instance||(fi.instance=new fi),fi.instance}set(e){this._source=e}query(e=void 0){return new Wn(this._source,e)}hasInstructions(){return this._source.trim()!==fi.empty}},Er=fi;Er.empty="";var cc=class{constructor({obsidianEvents:e}){this.logger=Nt.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 ok=require("obsidian");var ak=require("obsidian");var Uh=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.symbol}};function ik(r){let e=[],t=new Le().coreStatuses.map(n=>n.symbol);for(let n of[!0,!1])for(let i of r.registeredStatuses)t.includes(i.symbol)===n&&e.push(new Uh(i));return e}var sk=require("obsidian");function Bo(r,e){return F(this,null,function*(){yield nn({originalTask:r,newTasks:e})})}var aa=class extends sk.Menu{constructor(t){super();this.taskSaver=t}addItemsForInstructions(t,n){for(let i of t)this.addItemForInstruction(n,i)}addItemForInstruction(t,n){this.addItem(i=>this.getMenuItemCallback(t,i,n))}getMenuItemCallback(t,n,i){n.setTitle(i.instructionDisplayName()).setChecked(i.isCheckedForTask(t)).onClick(()=>F(this,null,function*(){let s=i.apply(t);(s.length!==1||!Object.is(s[0],t))&&(yield this.taskSaver(t,s))}))}};var dc=class extends aa{constructor(e,t,n=Bo){super(n);let i=ik(e);this.addItemsForInstructions(i,t)}};var fc=class{constructor(){this.data=aF}addDataAttribute(e,t,n){this.data[n].addDataAttribute(e,t,n)}addClassName(e,t){let n=this.data[t].className;e.classList.add(n)}},qh=class{constructor(e,t,n){if(e==="")throw Error("Developer note: CSS class cannot be an empty string, please specify one.");this.className=e,this.attributeName=t,this.attributeValueCalculator=n}addDataAttribute(e,t,n){if(this.attributeName===qh.noAttributeName)return;let i=this.attributeValueCalculator(n,t);i!==""&&(e.dataset[this.attributeName]=i)}},jr=qh;jr.noAttributeName="",jr.noAttributeValueCalculator=()=>"",jr.dateAttributeCalculator=(e,t)=>{let i="far";function s(o){let u=window.moment().startOf("day"),l="",c=u.diff(o,"days");return isNaN(c)?null:c===0?"today":(c>0?l+="past-":c<0&&(l+="future-"),Math.abs(c)<=7?l+=Math.abs(c).toString()+"d":l+=i,l)}let a=t[e];if(!Array.isArray(a)&&a instanceof window.moment){let o=s(a);if(o)return o}return""};function Ho(r){return new jr(r,jr.noAttributeName,jr.noAttributeValueCalculator)}function oa(r,e){return new jr(r,e,jr.dateAttributeCalculator)}var aF={createdDate:oa("task-created","taskCreated"),dueDate:oa("task-due","taskDue"),startDate:oa("task-start","taskStart"),scheduledDate:oa("task-scheduled","taskScheduled"),doneDate:oa("task-done","taskDone"),cancelledDate:oa("task-cancelled","taskCancelled"),priority:new jr("task-priority","taskPriority",(r,e)=>Mn.priorityNameUsingNormal(e.priority).toLocaleLowerCase()),description:Ho("task-description"),recurrenceRule:Ho("task-recurring"),dependsOn:Ho("task-dependsOn"),id:Ho("task-id"),blockLink:Ho("task-block-link")};function ar(r,e){let t=document.createElement(r);return e.appendChild(t),t}var pi=class{static obsidianMarkdownRenderer(e,t,n,i){return F(this,null,function*(){if(!i)throw new Error("Must call the Obsidian renderer with an Obsidian Component object");yield ak.MarkdownRenderer.renderMarkdown(e,t,n,i)})}constructor({textRenderer:e=pi.obsidianMarkdownRenderer,obsidianComponent:t,parentUlElement:n,taskLayoutOptions:i,queryLayoutOptions:s}){this.textRenderer=e,this.obsidianComponent=t,this.parentUlElement=n,this.taskLayoutOptions=i,this.queryLayoutOptions=s}renderTaskLine(e,t,n){return F(this,null,function*(){let i=ar("li",this.parentUlElement);i.classList.add("task-list-item","plugin-tasks-list-item");let s=ar("span",i);s.classList.add("tasks-list-text"),yield this.taskToHtml(e,s,i);let a=ar("input",i);return a.classList.add("task-list-item-checkbox"),a.type="checkbox",e.status.symbol!==" "&&(a.checked=!0,i.classList.add("is-checked")),e.taskLocation.hasKnownPath&&(a.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),a.disabled=!0;let l=e.toggleWithRecurrenceInUsersOrder();nn({originalTask:e,newTasks:l})}),a.addEventListener("contextmenu",u=>{new dc(De.getInstance(),e).showAtPosition({x:u.clientX,y:u.clientY})}),a.setAttribute("title","Right-click for options")),i.prepend(a),i.setAttribute("data-task",e.status.symbol.trim()),i.setAttribute("data-line",t.toString()),i.setAttribute("data-task-status-name",e.status.name),i.setAttribute("data-task-status-type",e.status.type),a.setAttribute("data-line",t.toString()),this.queryLayoutOptions.shortMode&&this.addTooltip(e,s,n),i})}taskToHtml(e,t,n){return F(this,null,function*(){let i=new fc,s=Rn.tasksPluginEmoji.taskSerializer;for(let a of this.taskLayoutOptions.shownComponents){let o=s.componentToString(e,this.queryLayoutOptions.shortMode,a);if(o){let u=ar("span",t),l=ar("span",u);yield this.renderComponentText(l,o,a,e),this.addInternalClasses(a,l),i.addClassName(u,a),i.addDataAttribute(u,e,a),i.addDataAttribute(n,e,a)}}for(let a of this.taskLayoutOptions.hiddenComponents)i.addDataAttribute(n,e,a);n.dataset.taskPriority===void 0&&i.addDataAttribute(n,e,"priority")})}renderComponentText(e,t,n,i){return F(this,null,function*(){if(n==="description"){t=ye.getInstance().removeAsWordFromDependingOnSettings(t);let{debugSettings:s}=Z();s.showTaskHiddenData&&(t+=`<br>\u{1F41B} <b>${i.lineNumber}</b> . ${i.sectionStart} . ${i.sectionIndex} . '<code>${i.originalMarkdown}</code>'<br>'<code>${i.path}</code>' > '<code>${i.precedingHeader}</code>'<br>`),yield this.textRenderer(t,e,i.path,this.obsidianComponent);let a=e.querySelector("blockquote"),o=a!=null?a:e,u=o.querySelector("p");if(u!==null){for(;u.firstChild;)o.insertBefore(u.firstChild,u);u.remove()}e.querySelectorAll("p").forEach(l=>{l.hasChildNodes()||l.remove()}),e.querySelectorAll(".footnotes").forEach(l=>{l.remove()})}else e.innerHTML=t})}addInternalClasses(e,t){function n(i){let s=/["&\x00\r\n]/g,a=i.replace(s,"-");return a=a.replace(/^[-_]+/,""),a.length>0?a:null}if(e==="description"){let i=t.getElementsByClassName("tag");for(let s=0;s<i.length;s++){let a=i[s].textContent;if(a){let o=n(a),u=i[s];o&&(u.dataset.tagName=o)}}}}addTooltip(e,t,n){let{recurrenceSymbol:i,startDateSymbol:s,createdDateSymbol:a,scheduledDateSymbol:o,dueDateSymbol:u,cancelledDateSymbol:l,doneDateSymbol:c}=Rn.tasksPluginEmoji.taskSerializer.symbols;t.addEventListener("mouseenter",()=>{function d(y,E,R){E&&y.createDiv().setText(m({signifier:R,date:E}))}function m({signifier:y,date:E}){return`${y} ${E.format(J.dateFormat)} (${E.from(window.moment().startOf("day"))})`}let p=t.createDiv();p.addClasses(["tooltip","pop-up"]),e.recurrence&&p.createDiv().setText(`${i} ${e.recurrence.toText()}`),d(p,e.createdDate,a),d(p,e.startDate,s),d(p,e.scheduledDate,o),d(p,e.dueDate,u),d(p,e.cancelledDate,l),d(p,e.doneDate,c);let T=e.getLinkText({isFilenameUnique:n});T&&p.createDiv().setText(`\u{1F517} ${T}`),t.addEventListener("mouseleave",()=>{p.remove()})})}};var pc=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return F(this,null,function*(){var d;let n=new ok.MarkdownRenderChild(e);t.addChild(n);let i=e.findAll(".task-list-item").filter(m=>{var y;let p=(y=m.textContent)==null?void 0:y.split(`
|
|
|
`);if(p===void 0)return!1;let T=null;for(let E=0;E<p.length;E=E+1)if(p[E]!==""){T=p[E];break}return T===null?!1:ye.getInstance().includedIn(T)});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 m=a.lineStart;m<=a.lineEnd;m++){let p=o[m];if(p===void 0)continue;let T=null,y=oe.fromLine({line:p,taskLocation:new bt(new Je(s),m,a.lineStart,u,T),fallbackDate:null});y!==null&&(l.push(y),u++)}let c=new pi({obsidianComponent:n,parentUlElement:e,taskLayoutOptions:new Jr,queryLayoutOptions:new si});for(let m=0;m<i.length;m++){let p=l[m],T=i[m];if(p===void 0||T===void 0)continue;let y=(d=T.getAttr("data-line"))!=null?d:"0",E=Number.parseInt(y,10),R=yield c.renderTaskLine(p,E),x=T.childNodes;for(let j=0;j<x.length;j=j+1){let ee=x[j];ee.nodeName.toLowerCase()==="div"?R.prepend(ee):ee.nodeName.toLowerCase()==="ul"&&R.append(ee)}let v=T.querySelectorAll("[data-footnote-id]"),V=R.querySelectorAll("[data-footnote-id]");if(v.length===V.length)for(let j=0;j<v.length;j++)V[j].replaceWith(v[j]);T.replaceWith(R)}})}};var uk=require("@codemirror/view"),lk=require("obsidian");var ck=()=>uk.ViewPlugin.fromClass(Wh),Wh=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 m=`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(m),new lk.Notice(m,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:bt.fromUnknownPosition(new Je("")),fallbackDate:null});if(o===null)return!1;e.preventDefault();let l=o.toggleWithRecurrenceInUsersOrder().map(m=>m.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 ua=require("obsidian");function Vo(r,e,t){e&&r.push(oF(t))}function oF(r){return`tasks-layout-hide-${r}`}var mc=class{constructor(e){e?this.queryLayoutOptions=e:this.queryLayoutOptions=new si}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)Vo(e,n,i);return this.queryLayoutOptions.shortMode&&e.push("tasks-layout-short-mode"),e}};function dk(r,e,t,n=void 0){let i="";e.isEmpty()||(i+=`Only tasks containing the global filter '${e.get()}'.
|
|
|
|
|
|
`);let s=new Bs(" "),a=new Wn(r,n);if(!a.ignoreGlobalQuery&&t.hasInstructions()){let o=t.query(n);i+=`Explanation of the global query:
|
|
|
|
|
|
${s.explainQuery(o)}
|
|
|
`}return i+=`Explanation of this Tasks code block query:
|
|
|
|
|
|
${s.explainQuery(a)}`,i}function hc(r,e,t){let n=new Wn(r,t);return n.ignoreGlobalQuery?n:e.query(t).append(n)}function fk(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 gc(r){return r.dueDate?"dueDate":r.scheduledDate?"scheduledDate":r.startDate?"startDate":null}function $h(r,e,t,n){let i=r[e];return mk(i,r,e,t,n)}function pk(r,e,t,n){let i=window.moment();return mk(i,r,e,t,n)}function mk(r,e,t,n,i){let s=new Ye(r).postpone(n,i),a=kt.removeInferredStatusIfNeeded(e,[new oe(be(X({},e),{[t]:s}))])[0];return{postponedDate:s,postponedTask:a}}function hk(r,e){let t=r==null?void 0:r.format("DD MMM YYYY");return`Task's ${e} changed to ${t}`}function gk(r,e,t){return`\u2139\uFE0F ${jh(r,e,t)} (right-click for more options)`}function uF(r){return r.charAt(0).toUpperCase()+r.slice(1)}function jh(r,e,t){let n=gc(r),i=r[n];return bk(n,i,e,t)}function yk(r,e,t){let n=gc(r),i=window.moment().startOf("day");return bk(n,i,e,t)}function bk(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")?`${uF(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 yc=class{constructor(e){e?this.taskLayoutOptions=e:this.taskLayoutOptions=new Jr}generateHiddenClasses(){let e=[];return this.taskLayoutOptions.toggleableComponents.forEach(t=>{Vo(e,!this.taskLayoutOptions.isShown(t),t)}),Vo(e,!this.taskLayoutOptions.areTagsShown(),"tags"),e}};var Gh=require("obsidian");var mi=class extends aa{constructor(e,t,n=Bo){super(n);let i=(l,c,d,m,p,T)=>{let y=p(t,m,d);c.setTitle(y).onClick(()=>mi.postponeOnClickCallback(l,t,m,d,T,n))},s=yk,a=pk;this.addItem(l=>i(e,l,"days",0,s,a)),this.addItem(l=>i(e,l,"day",1,s,a)),this.addSeparator();let o=jh,u=$h;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 F(this,arguments,function*(e,t,n,i,s=$h,a=Bo){let d=gc(t);if(d===null){let T="\u26A0\uFE0F Postponement requires a date: due, scheduled or start.";return new Gh.Notice(T,1e4)}let{postponedDate:m,postponedTask:p}=s(t,d,i,n);yield a(t,p),mi.postponeSuccessCallback(e,d,m)})}static postponeSuccessCallback(e,t,n){e.style.pointerEvents="none";let i=hk(n,t);new Gh.Notice(i,2e3)}};var zo=class{constructor(e){this.label=e,this.start()}start(){!this.recordTimings()||performance.mark(this.labelForStart())}finish(){!this.recordTimings()||(performance.mark(this.labelForEnd()),performance.measure(this.label,this.labelForStart(),this.labelForEnd()),this.printDuration())}printDuration(){let e=performance.getEntriesByName(this.label),t=e[e.length-1];t?console.log(this.label+":",t.duration,"milliseconds"):console.log(`Measurement for ${this.label} not found`)}labelForStart(){return`${this.label} - start`}labelForEnd(){return`${this.label} - end`}recordTimings(){let{debugSettings:e}=Z();return e.recordTimings}};var bc=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 F(this,null,function*(){n.addChild(new Yh({app:this.app,plugin:this.plugin,events:this.events,container:t,source:e,filePath:n.sourcePath}))})}},Yh=class extends ua.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=hc(this.source,Er.getInstance(),this.filePath),this.queryType="tasks";break;default:this.query=hc(this.source,Er.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=hc(this.source,Er.getInstance(),this.filePath),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},i+1e3)}render(i){return F(this,arguments,function*({tasks:t,state:n}){var a;let s=ar("div",this.containerEl);n==="Warm"&&this.query.error===void 0?yield this.renderQuerySearchResults(t,n,s):this.query.error!==void 0?this.renderErrorMessage(s,this.query.error):this.renderLoadingMessage(s),(a=this.containerEl.firstChild)==null||a.replaceWith(s)})}renderQuerySearchResults(t,n,i){return F(this,null,function*(){let s=this.explainAndPerformSearch(n,t,i);if(s.searchErrorMessage!==void 0){this.renderErrorMessage(i,s.searchErrorMessage);return}yield this.renderSearchResults(s,i)})}explainAndPerformSearch(t,n,i){let s=new zo(`Search: ${this.query.queryId} - ${this.filePath}`);s.start(),this.query.debug(`[render] Render called: plugin state: ${t}; searching ${n.length} tasks`),this.query.queryLayoutOptions.explainQuery&&this.createExplanation(i);let a=this.query.applyQueryToTasks(n);return s.finish(),a}renderSearchResults(t,n){return F(this,null,function*(){let i=new zo(`Render: ${this.query.queryId} - ${this.filePath}`);i.start(),yield this.addAllTaskGroups(t.taskGroups,n);let s=t.totalTasksCount;this.addTaskCount(n,t),this.query.debug(`[render] ${s} tasks displayed`),i.finish()})}renderErrorMessage(t,n){t.createDiv().innerHTML=`<pre>Tasks query: ${n.replace(/\n/g,"<br>")}</pre>`}renderLoadingMessage(t){t.setText("Loading Tasks ...")}createExplanation(t){let n=dk(this.source,ye.getInstance(),Er.getInstance(),this.filePath),i=ar("pre",t);i.addClasses(["plugin-tasks-query-explanation"]),i.setText(n),t.appendChild(i)}createTaskList(t,n){return F(this,null,function*(){let i=ar("ul",n);i.addClasses(["contains-task-list","plugin-tasks-query-result"]);let s=new yc(this.query.taskLayoutOptions);i.addClasses(s.generateHiddenClasses());let a=new mc(this.query.queryLayoutOptions);i.addClasses(a.getHiddenClasses());let o=this.getGroupingAttribute();o&&o.length>0&&(i.dataset.taskGroupBy=o);let u=new pi({obsidianComponent:this,parentUlElement:i,taskLayoutOptions:this.query.taskLayoutOptions,queryLayoutOptions:this.query.queryLayoutOptions});for(let[l,c]of t.entries())yield this.addTask(i,u,c,l);n.appendChild(i)})}addTask(t,n,i,s){return F(this,null,function*(){let a=this.isFilenameUnique({task:i}),o=yield n.renderTaskLine(i,s,a);o.querySelectorAll("[data-footnote-id]").forEach(d=>d.remove());let l=o.createSpan("task-extras");this.query.queryLayoutOptions.hideUrgency||this.addUrgency(l,i);let c=this.query.queryLayoutOptions.shortMode;this.query.queryLayoutOptions.hideBacklinks||this.addBacklinks(l,i,c,a),this.query.queryLayoutOptions.hideEditButton||this.addEditButton(l,i,this.plugin.getTasks()),!this.query.queryLayoutOptions.hidePostponeButton&&fk(i)&&this.addPostponeButton(l,i,c),t.appendChild(o)})}addEditButton(t,n,i){let s=ar("a",t);s.addClass("tasks-edit"),s.title="Edit task",s.href="#",s.onClickEvent(a=>{a.preventDefault();let o=l=>F(this,null,function*(){yield nn({originalTask:n,newTasks:kt.removeInferredStatusIfNeeded(n,l)})});new ii({app:this.app,task:n,onSubmit:o,allTasks:i}).open()})}addUrgency(t,n){let i=new Intl.NumberFormat().format(n.urgency);t.createSpan({text:i,cls:"tasks-urgency"})}addAllTaskGroups(t,n){return F(this,null,function*(){for(let i of t.groups)yield this.addGroupHeadings(n,i.groupHeadings),yield this.createTaskList(i.tasks,n)})}addGroupHeadings(t,n){return F(this,null,function*(){for(let i of n)yield this.addGroupHeading(t,i)})}addGroupHeading(t,n){return F(this,null,function*(){let i="h6";n.nestingLevel===0?i="h4":n.nestingLevel===1&&(i="h5");let s=ar(i,t);s.addClass("tasks-group-heading"),yield ua.MarkdownRenderer.renderMarkdown(n.displayName,s,this.filePath,this)})}addBacklinks(t,n,i,s){var c;let a=t.createSpan({cls:"tasks-backlink"});i||a.append(" (");let o=ar("a",a);o.rel="noopener",o.target="_blank",o.addClass("internal-link"),i&&o.addClass("internal-link-short-mode");let u;i?u=" \u{1F517}":u=(c=n.getLinkText({isFilenameUnique:s}))!=null?c:"",o.setText(u);let l=this.app.vault;o.addEventListener("click",d=>F(this,null,function*(){let m=yield nh(n,l);if(m){let[p,T]=m,y=this.app.workspace.getLeaf(ua.Keymap.isModEvent(d));d.preventDefault(),yield y.openFile(T,{eState:{line:p}})}})),o.addEventListener("mousedown",d=>F(this,null,function*(){if(d.button===1){let m=yield nh(n,l);if(m){let[p,T]=m,y=this.app.workspace.getLeaf("tab");d.preventDefault(),yield y.openFile(T,{eState:{line:p}})}}})),i||a.append(")")}addPostponeButton(t,n,i){let a="day",o=gk(n,1,a),u=ar("a",t);u.addClass("tasks-postpone"),i&&u.addClass("tasks-postpone-short-mode"),u.title=o,u.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),mi.postponeOnClickCallback(u,n,1,a)}),u.addEventListener("contextmenu",l=>F(this,null,function*(){l.preventDefault(),l.stopPropagation(),new mi(u,n).showAtPosition({x:l.clientX,y:l.clientY})}))}addTaskCount(t,n){this.query.queryLayoutOptions.hideTaskCount||t.createDiv({text:n.totalTasksCountDisplayText(),cls:"tasks-count"})}isFilenameUnique({task:t}){let n=t.path.match(/([^/]*)\..+$/i);if(n===null)return;let i=n[1];return this.app.vault.getMarkdownFiles().filter(a=>{if(a.basename===i)return!0}).length<2}getGroupingAttribute(){let t=[];for(let n of this.query.grouping)t.push(n.property);return t.join(",")}};var ke=require("obsidian");var Tc=class{constructor(e){this._markdown="";this.columnNames=e,this.addTitleRow()}get markdown(){return this._markdown}addTitleRow(){let e="|",t="|";this.columnNames.forEach(n=>{e+=` ${n} |`,t+=" ----- |"}),this._markdown+=`${e}
|
|
|
`,this._markdown+=`${t}
|
|
|
`}addRow(e){let t=this.makeRowText(e);this._markdown+=`${t}
|
|
|
`}addRowIfNew(e){let t=this.makeRowText(e);this._markdown.includes(t)||(this._markdown+=`${t}
|
|
|
`)}makeRowText(e){let t="|";return e.forEach(n=>{t+=` ${n} |`}),t}};function Tk(r,e){return r.findIndex(t=>t.symbol===e)}function $n(r){return r===""?r:"`"+(r!==" "?r:"space")+"`"}function lF(r,e){let t=re.getTypeForUnknownSymbol(r.symbol);r.type!==t&&(t==="TODO"&&r.symbol!==" "||e.push(`For information, the conventional type for status symbol ${$n(r.symbol)} is ${$n(t)}: you may wish to review this type.`))}function cF(r,e,t){let n=Tk(r,e.nextStatusSymbol);if(n===-1){t.push(`Next symbol ${$n(e.nextStatusSymbol)} is unknown: create a status with symbol ${$n(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 ${$n(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 dF(r,e,t){let n=[];return e.symbol===re.EMPTY.symbol?(n.push("Empty symbol: this status will be ignored."),n):Tk(r,e.symbol)!=t?(n.push(`Duplicate symbol '${$n(e.symbol)}': this status will be ignored.`),n):(lF(e,n),cF(r,e,n),n)}function _k(r){let e=new Tc(["Status Symbol","Next Status Symbol","Status Name","Status Type","Problems (if any)"]),t=Le.allStatuses(r);return t.forEach((n,i)=>{e.addRow([$n(n.symbol),$n(n.nextStatusSymbol),n.name,$n(n.type),dF(t,n,i).join("<br>")])}),e.markdown}function vk(r,e,t,n){let s=_k(r),a=e.mermaidDiagram(!0);return`# ${t}
|
|
|
|
|
|
## 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.
|
|
|
|
|
|
${s}
|
|
|
## Loaded Settings
|
|
|
|
|
|
<!-- Switch to Live Preview or Reading Mode to see the diagram. -->
|
|
|
|
|
|
These are the settings actually used by Tasks.
|
|
|
${a}`}function wk(){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 kk(){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 Ek(){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 Sk(){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 Ok(){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 Dk(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}function xk(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}var Rk=[{text:"Core Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:"<p>These are the core statuses that Tasks supports natively, with no need for custom CSS styling or theming.</p><p>You can add edit and add your own custom statuses in the section below.</p>"},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertTaskCoreStatusSettings",featureFlag:"",notice:null}]},{text:"Custom Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:`<p>You should first <b>select and install a CSS Snippet or Theme</b> to style custom checkboxes.</p><p>Then, use the buttons below to set up your custom statuses, to match your chosen CSS checkboxes.</p><p><b>Note</b> Any statuses with the same symbol as any earlier statuses will be ignored. You can confirm the actually loaded statuses by running the 'Create or edit task' command and looking at the Status drop-down.</p><p></p><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Statuses">documentation</a> to get started!</p>`},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertCustomTaskStatusSettings",featureFlag:"",notice:null}]}];var Gr=require("obsidian");var Ji=class{validate(e){let t=[];return t.push(...this.validateSymbol(e)),t.push(...this.validateName(e)),t.push(...this.validateNextSymbol(e)),t}validateStatusCollectionEntry(e){let[t,n,i,s]=e,a=[];if(a.push(...this.validateType(s)),t===i&&s!=="NON_TASK"&&a.push(`Status symbol '${t}' toggles to itself`),a.length>0)return a;let o=re.createFromImportedValue(e).configuration;return a.push(...this.validateSymbolTypeConventions(o)),a.push(...this.validate(o)),a}validateSymbol(e){return Ji.validateOneSymbol(e.symbol,"Task Status Symbol")}validateNextSymbol(e){return Ji.validateOneSymbol(e.nextStatusSymbol,"Task Next Status Symbol")}validateName(e){let t=[];return e.name.length===0&&t.push("Task Status Name cannot be empty."),t}validateType(e){let t=er[e],n=[];return t||n.push(`Status Type "${e}" is not a valid type`),t=="EMPTY"&&n.push('Status Type "EMPTY" is not permitted in user data'),n}validateSymbolTypeConventions(e){let t=[],n=e.symbol,i=new De,s=n==="X"?"x":n,a=i.bySymbol(s);return a.type!=="EMPTY"&&(e.nextStatusSymbol!==a.nextStatusSymbol&&t.push(`Next Status Symbol for symbol '${n}': '${e.nextStatusSymbol}' is inconsistent with convention '${a.nextStatusSymbol}'`),e.type!==a.type&&t.push(`Status Type for symbol '${n}': '${e.type}' is inconsistent with convention '${a.type}'`)),t}static validateOneSymbol(e,t){let n=[];return e.length===0&&n.push(`${t} cannot be empty.`),e.length>1&&n.push(`${t} ("${e}") must be a single character.`),n}};var es=new Ji,or=class extends Gr.Modal{constructor(t,n,i){super(t.app);this.plugin=t;this.saved=!1;this.error=!1;this.statusSymbol=n.symbol,this.statusName=n.name,this.statusNextSymbol=n.nextStatusSymbol,this.statusAvailableAsCommand=n.availableAsCommand,this.type=n.type,this.isCoreStatus=i}statusConfiguration(){return new tt(this.statusSymbol,this.statusName,this.statusNextSymbol,this.statusAvailableAsCommand,this.type)}display(){return F(this,null,function*(){let{contentEl:t}=this;t.empty();let n=t.createDiv(),i;new Gr.Setting(n).setName("Task Status Symbol").setDesc("This is the character between the square braces. (It can only be edited for Custom statuses, and not Core statuses.)").addText(l=>{i=l,l.setValue(this.statusSymbol).onChange(c=>{this.statusSymbol=c,or.setValid(l,es.validateSymbol(this.statusConfiguration()))})}).setDisabled(this.isCoreStatus).then(l=>{or.setValid(i,es.validateSymbol(this.statusConfiguration()))});let s;new Gr.Setting(n).setName("Task Status Name").setDesc("This is the friendly name of the task status.").addText(l=>{s=l,l.setValue(this.statusName).onChange(c=>{this.statusName=c,or.setValid(l,es.validateName(this.statusConfiguration()))})}).then(l=>{or.setValid(s,es.validateName(this.statusConfiguration()))});let a;new Gr.Setting(n).setName("Task Next Status Symbol").setDesc("When clicked on this is the symbol that should be used next.").addText(l=>{a=l,l.setValue(this.statusNextSymbol).onChange(c=>{this.statusNextSymbol=c,or.setValid(l,es.validateNextSymbol(this.statusConfiguration()))})}).then(l=>{or.setValid(a,es.validateNextSymbol(this.statusConfiguration()))}),new Gr.Setting(n).setName("Task Status Type").setDesc("Control how the status behaves for searching and toggling.").addDropdown(l=>{["TODO","IN_PROGRESS","DONE","CANCELLED","NON_TASK"].forEach(d=>{l.addOption(d,d)}),l.setValue(this.type).onChange(d=>{this.type=re.getTypeFromStatusTypeString(d)})}),re.tasksPluginCanCreateCommandsForStatuses()&&new Gr.Setting(n).setName("Available as command").setDesc("If enabled this status will be available as a command so you can assign a hotkey and toggle the status using it.").addToggle(l=>{l.setValue(this.statusAvailableAsCommand).onChange(c=>F(this,null,function*(){this.statusAvailableAsCommand=c}))});let o=t.createDiv(),u=new Gr.Setting(o);u.addButton(l=>(l.setTooltip("Save").setIcon("checkmark").onClick(()=>F(this,null,function*(){let c=es.validate(this.statusConfiguration());if(c.length>0){let d=c.join(`
|
|
|
`)+`
|
|
|
|
|
|
Fix errors before saving.`;new Gr.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?or.removeValidationError(t):or.setValidationError(t)}};var Yt=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 F(this,null,function*(){yield this.plugin.saveSettings(),t&&this.display()})}display(){let{containerEl:t}=this;t.empty(),this.containerEl.addClass("tasks-settings"),t.createEl("h3",{text:"Tasks Settings"}),t.createEl("p",{cls:"tasks-setting-important",text:"Changing any settings requires a restart of obsidian."}),t.createEl("h4",{text:"Task Format Settings"}),new ke.Setting(t).setName("Task Format").setDesc(Yt.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(Rn))i.addOption(s,Rn[s].displayName);i.setValue(Z().taskFormat).onChange(s=>F(this,null,function*(){rt({taskFormat:s}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global filter Settings"}),new ke.Setting(t).setName("Global task filter").setDesc(Yt.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=>F(this,null,function*(){rt({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=Z();i.setValue(s.removeGlobalFilter).onChange(a=>F(this,null,function*(){rt({removeGlobalFilter:a}),ye.getInstance().setRemoveGlobalFilter(a),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global Query"}),hF(new ke.Setting(t).setDesc(Yt.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=Z();i.inputEl.rows=4,i.setPlaceholder(`# For example...
|
|
|
path does not include _templates/
|
|
|
limit 300
|
|
|
show urgency`).setValue(s.globalQuery).onChange(a=>F(this,null,function*(){rt({globalQuery:a}),Er.getInstance().set(a),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=Z();Rk.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(Yt.createFragmentWithHTML(`Enabling this will add a timestamp \u2795 YYYY-MM-DD before other date values, when a task is created with 'Create or edit task', or by completing a recurring task.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Dates#Created+date">documentation</a>.</p>`)).addToggle(i=>{let s=Z();i.setValue(s.setCreatedDate).onChange(a=>F(this,null,function*(){rt({setCreatedDate:a}),yield this.plugin.saveSettings()}))}),new ke.Setting(t).setName("Set done date on every completed task").setDesc(Yt.createFragmentWithHTML('Enabling this will add a timestamp \u2705 YYYY-MM-DD at the end when a task is toggled to done.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Dates#Done+date">documentation</a>.</p>')).addToggle(i=>{let s=Z();i.setValue(s.setDoneDate).onChange(a=>F(this,null,function*(){rt({setDoneDate:a}),yield this.plugin.saveSettings()}))}),new ke.Setting(t).setName("Set cancelled date on every cancelled task").setDesc(Yt.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=Z();i.setValue(s.setCancelledDate).onChange(a=>F(this,null,function*(){rt({setCancelledDate:a}),yield this.plugin.saveSettings()}))}),new ke.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(Yt.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=Z();i.setValue(s.useFilenameAsScheduledDate).onChange(a=>F(this,null,function*(){rt({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=>F(this,null,function*(){let s=Z();yield this.plugin.saveSettings(),i.setValue(Yt.renderFolderArray(s.filenameAsDateFolders)).onChange(a=>F(this,null,function*(){let o=Yt.parseCommaSeparatedFolders(a);rt({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(Yt.createFragmentWithHTML('Enabling this will make the next recurrence of a task appear on the line below the completed task. Otherwise the next recurrence will appear before the completed one.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Recurring+Tasks">documentation</a>.</p>')).addToggle(i=>{let{recurrenceOnNextLine:s}=Z();i.setValue(s).onChange(a=>F(this,null,function*(){rt({recurrenceOnNextLine:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Auto-suggest Settings"}),new ke.Setting(t).setName("Auto-suggest task content").setDesc(Yt.createFragmentWithHTML('Enabling this will open an intelligent suggest menu while typing inside a recognized task line.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Auto-Suggest">documentation</a>.</p>')).addToggle(i=>{let s=Z();i.setValue(s.autoSuggestInEditor).onChange(a=>F(this,null,function*(){rt({autoSuggestInEditor:a}),yield this.plugin.saveSettings()}))}),new ke.Setting(t).setName("Minimum match length for auto-suggest").setDesc("If higher than 0, auto-suggest will be triggered only when the beginning of any supported keywords is recognized.").addSlider(i=>{let s=Z();i.setLimits(0,3,1).setValue(s.autoSuggestMinMatch).setDynamicTooltip().onChange(a=>F(this,null,function*(){rt({autoSuggestMinMatch:a}),yield this.plugin.saveSettings()}))}),new ke.Setting(t).setName("Maximum number of auto-suggestions to show").setDesc('How many suggestions should be shown when an auto-suggest menu pops up (including the "\u23CE" option).').addSlider(i=>{let s=Z();i.setLimits(3,12,1).setValue(s.autoSuggestMaxItems).setDynamicTooltip().onChange(a=>F(this,null,function*(){rt({autoSuggestMaxItems:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Dialog Settings"}),new ke.Setting(t).setName("Provide access keys in dialogs").setDesc(Yt.createFragmentWithHTML('If the access keys (keyboard shortcuts) for various controls in dialog boxes conflict with system keyboard shortcuts or assistive technology functionality that is important for you, you may want to deactivate them here.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Create+or+edit+Task#Keyboard+shortcuts">documentation</a>.</p>')).addToggle(i=>{let s=Z();i.setValue(s.provideAccessKeys).onChange(a=>F(this,null,function*(){rt({provideAccessKeys:a}),yield this.plugin.saveSettings()}))})}addOneSettingsBlock(t,n,i){let s=t.createEl("details",{cls:"tasks-nested-settings",attr:X({},n.open||i[n.text]?{open:!0}:{})});s.empty(),s.ontoggle=()=>{i[n.text]=s.open,rt({headingOpened:i}),this.plugin.saveSettings()};let a=s.createEl("summary");if(new ke.Setting(a).setHeading().setName(n.text),a.createDiv("collapser").createDiv("handle"),n.notice!==null){let o=s.createEl("div",{cls:n.notice.class,text:n.notice.text});n.notice.html!==null&&o.insertAdjacentHTML("beforeend",n.notice.html)}n.settings.forEach(o=>{if(!(o.featureFlag!==""&&!vv(o.featureFlag))&&(o.type==="checkbox"?new ke.Setting(s).setName(o.name).setDesc(o.description).addToggle(u=>{let l=Z();l.generalSettings[o.settingName]||Li(o.settingName,o.initialValue),u.setValue(l.generalSettings[o.settingName]).onChange(c=>F(this,null,function*(){Li(o.settingName,c),yield this.plugin.saveSettings()}))}):o.type==="text"?new ke.Setting(s).setName(o.name).setDesc(o.description).addText(u=>{let l=Z();l.generalSettings[o.settingName]||Li(o.settingName,o.initialValue);let c=d=>F(this,null,function*(){Li(o.settingName,d),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,ke.debounce)(c,500,!0))}):o.type==="textarea"?new ke.Setting(s).setName(o.name).setDesc(o.description).addTextArea(u=>{let l=Z();l.generalSettings[o.settingName]||Li(o.settingName,o.initialValue);let c=d=>F(this,null,function*(){Li(o.settingName,d),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,ke.debounce)(c,500,!0)),u.inputEl.rows=8,u.inputEl.cols=40}):o.type==="function"&&this.customFunctions[o.settingName](s,this),o.notice!==null)){let u=s.createEl("p",{cls:o.notice.class,text:o.notice.text});o.notice.html!==null&&u.insertAdjacentHTML("beforeend",o.notice.html)}})}static parseCommaSeparatedFolders(t){return t.split(",").map(n=>n.trim()).map(n=>n.replace(/^\/|\/$/g,"")).filter(n=>n!=="")}static renderFolderArray(t){return t.join(",")}insertTaskCoreStatusSettings(t,n){let{statusSettings:i}=Z();i.coreStatuses.forEach(a=>{Mk(t,a,i.coreStatuses,i,n,n.plugin,!0)}),new ke.Setting(t).addButton(a=>{let o="Review and check your Statuses";a.setButtonText(o).setCta().onClick(()=>F(this,null,function*(){let l=window.moment().format("YYYY-MM-DD HH-mm-ss"),c=`Tasks Plugin - ${o} ${l}.md`,d=this.plugin.manifest.version,m=De.getInstance(),p=vk(i,m,o,d),T=yield app.vault.create(c,p);yield this.app.workspace.getLeaf(!0).openFile(T)})),a.setTooltip("Create a new file in the root of the vault, containing a Mermaid diagram of the current status settings.")}).infoEl.remove()}insertCustomTaskStatusSettings(t,n){let{statusSettings:i}=Z();i.customStatuses.forEach(l=>{Mk(t,l,i.customStatuses,i,n,n.plugin,!1)}),t.createEl("div"),new ke.Setting(t).addButton(l=>{l.setButtonText("Add New Task Status").setCta().onClick(()=>F(this,null,function*(){Le.addStatus(i.customStatuses,new tt("","","",!1,"TODO")),yield la(i,n)}))}).infoEl.remove();let a=[["AnuPpuccin Theme",wk()],["Aura Theme",kk()],["Ebullientworks Theme",Ek()],["ITS Theme & SlRvb Checkboxes",Sk()],["Minimal Theme",Dk()],["Things Theme",xk()],["LYT Mode Theme (Dark mode only)",Ok()]];for(let[l,c]of a)new ke.Setting(t).addButton(m=>{let p=`${l}: Add ${c.length} supported Statuses`;m.setButtonText(p).onClick(()=>F(this,null,function*(){yield mF(c,i,n)}))}).infoEl.remove();new ke.Setting(t).addButton(l=>{l.setButtonText("Add All Unknown Status Types").setCta().onClick(()=>F(this,null,function*(){let d=this.plugin.getTasks().map(p=>p.status),m=De.getInstance().findUnknownStatuses(d);m.length!==0&&(m.forEach(p=>{Le.addStatus(i.customStatuses,p)}),yield la(i,n))}))}).infoEl.remove(),new ke.Setting(t).addButton(l=>{l.setButtonText("Reset Custom Status Types to Defaults").setWarning().onClick(()=>F(this,null,function*(){Le.resetAllCustomStatuses(i),yield la(i,n)}))}).infoEl.remove()}},Ko=Yt;Ko.createFragmentWithHTML=t=>createFragment(n=>n.createDiv().innerHTML=t);function Mk(r,e,t,n,i,s,a){let o=r.createEl("pre");o.addClass("row-for-status"),o.textContent=new re(e).previewText();let u=new ke.Setting(r);u.infoEl.replaceWith(o),a||u.addExtraButton(l=>{l.setIcon("cross").setTooltip("Delete").onClick(()=>F(this,null,function*(){Le.deleteStatus(t,e)&&(yield la(n,i))}))}),u.addExtraButton(l=>{l.setIcon("pencil").setTooltip("Edit").onClick(()=>F(this,null,function*(){let c=new or(s,e,a);c.onClose=()=>F(this,null,function*(){c.saved&&Le.replaceStatus(t,e,c.statusConfiguration())&&(yield la(n,i))}),c.open()}))}),u.infoEl.remove()}function mF(r,e,t){return F(this,null,function*(){Le.bulkAddStatusCollection(e,r).forEach(i=>{new ke.Notice(i)}),yield la(e,t)})}function la(r,e){return F(this,null,function*(){rt({statusSettings:r}),Le.applyToStatusRegistry(r,De.getInstance()),yield e.saveSettings(!0)})}function hF(r){let{settingEl:e,infoEl:t,controlEl:n}=r,i=n.querySelector("textarea");i!==null&&(e.style.display="block",t.style.marginRight="0px",i.style.minWidth="-webkit-fill-available")}var Ck=require("obsidian");var _c=class extends Ck.EditorSuggest{constructor(t,n){super(t);this.settings=n,t.scope.register([],"Tab",()=>{var s;let i=(s=this.context)==null?void 0:s.editor;return i?(i.exec("indentMore"),!1):!0})}onTrigger(t,n,i){if(!this.settings.autoSuggestInEditor)return null;let s=n.getLine(t.line);return Tv(s,t.ch)?{start:{line:t.line,ch:0},end:{line:t.line,ch:s.length},query:s}:null}getSuggestions(t){var a,o,u;let n=t.query,i=t.editor.getCursor();return((u=(o=(a=Do()).buildSuggestions)==null?void 0:o.call(a,n,i.ch,this.settings))!=null?u:[]).map(l=>be(X({},l),{context:t}))}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){var u,l,c;let i=t.context.editor;if(t.suggestionType==="empty"){this.close();let d=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(l=(u=i==null?void 0:i.cm)==null?void 0:u.contentDOM)==null||l.dispatchEvent(d);return}let s=t.context.editor.getCursor(),a={line:s.line,ch:(c=t.insertAt)!=null?c:s.ch},o=t.insertSkip?{line:s.line,ch:a.ch+t.insertSkip}:void 0;t.context.editor.replaceRange(t.appendText,a,o),t.context.editor.setCursor({line:s.line,ch:a.ch+t.appendText.length})}};var Ak=(r,e)=>{let t,n=new Promise((a,o)=>{t=a});return e(r,a=>{let o=a.map(u=>u.toFileLineString()).join(`
|
|
|
`);t(o)}).open(),n};var Pk=(r,e)=>{let t=xl({line:"",path:""});return new ii({app:r,task:t,onSubmit:e,allTasks:[]})};var Nk=r=>({createTaskLineModal:()=>Ak(r,Pk)});var vc=class extends Ik.Plugin{get apiV1(){return Nk(app)}onload(){return F(this,null,function*(){Nt.registerConsoleLogger(),Hm("info",`loading plugin "${this.manifest.name}" v${this.manifest.version}`),yield this.loadSettings();let{loggingOptions:t}=Z();Nt.configure(t),this.addSettingTab(new Ko({plugin:this})),jv({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let n=new cc({obsidianEvents:this.app.workspace});this.cache=new Ui({metadataCache:this.app.metadataCache,vault:this.app.vault,events:n}),this.inlineRenderer=new pc({plugin:this}),this.queryRenderer=new bc({plugin:this,events:n}),this.registerEditorExtension(ck()),this.registerEditorSuggest(new _c(this.app,Z())),new Rl({plugin:this})})}loadTaskStatuses(){return F(this,null,function*(){let{statusSettings:t}=Z();Le.applyToStatusRegistry(t,De.getInstance())})}onunload(){var t;Hm("info",`unloading plugin "${this.manifest.name}" v${this.manifest.version}`),(t=this.cache)==null||t.unload()}loadSettings(){return F(this,null,function*(){let t=yield this.loadData();rt(t),t=Z(),ye.getInstance().set(t.globalFilter),ye.getInstance().setRemoveGlobalFilter(t.removeGlobalFilter),Er.getInstance().set(t.globalQuery),yield this.loadTaskStatuses()})}saveSettings(){return F(this,null,function*(){yield this.saveData(Z())})}getTasks(){var t;return(t=this.cache)==null?void 0:t.getTasks()}};
|
|
|
/*!
|
|
|
* EventEmitter2
|
|
|
* https://github.com/hij1nx/EventEmitter2
|
|
|
*
|
|
|
* Copyright (c) 2013 hij1nx
|
|
|
* Licensed under the MIT license.
|
|
|
*/
|
|
|
/*!
|
|
|
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
|
* http://github.com/janl/mustache.js
|
|
|
*/
|