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

349 lines
418 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
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 Wv=Object.create;var Ti=Object.defineProperty,Yv=Object.defineProperties,jv=Object.getOwnPropertyDescriptor,Gv=Object.getOwnPropertyDescriptors,$v=Object.getOwnPropertyNames,Cm=Object.getOwnPropertySymbols,Bv=Object.getPrototypeOf,Pm=Object.prototype.hasOwnProperty,Hv=Object.prototype.propertyIsEnumerable;var Am=(r,e,t)=>e in r?Ti(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Se=(r,e)=>{for(var t in e||(e={}))Pm.call(e,t)&&Am(r,t,e[t]);if(Cm)for(var t of Cm(e))Hv.call(e,t)&&Am(r,t,e[t]);return r},ot=(r,e)=>Yv(r,Gv(e));var T=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),zv=(r,e)=>{for(var t in e)Ti(r,t,{get:e[t],enumerable:!0})},Nm=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of $v(e))!Pm.call(r,s)&&s!==t&&Ti(r,s,{get:()=>e[s],enumerable:!(n=jv(e,s))||n.enumerable});return r};var _i=(r,e,t)=>(t=r!=null?Wv(Bv(r)):{},Nm(e||!r||!r.__esModule?Ti(t,"default",{value:r,enumerable:!0}):t,r)),Vv=r=>Nm(Ti({},"__esModule",{value:!0}),r);var L=(r,e,t)=>new Promise((n,s)=>{var i=u=>{try{o(t.next(u))}catch(l){s(l)}},a=u=>{try{o(t.throw(u))}catch(l){s(l)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(i,a);o((t=t.apply(r,e)).next())});var Oe=T(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.matchAnyPattern=pn.extractTerms=pn.repeatedTimeunitPattern=void 0;function Zv(r,e){let t=e.replace(/\((?!\?)/g,"(?:");return`${r}${t}\\s{0,5}(?:,?\\s{0,5}${t}){0,10}`}pn.repeatedTimeunitPattern=Zv;function Im(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}pn.extractTerms=Im;function Jv(r){return`(?:${Im(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}pn.matchAnyPattern=Jv});var be=T((ml,hl)=>{(function(r,e){typeof ml=="object"&&typeof hl!="undefined"?hl.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(ml,function(){"use strict";var r=1e3,e=6e4,t=36e5,n="millisecond",s="second",i="minute",a="hour",o="day",u="week",l="month",c="quarter",f="year",m="date",y="Invalid Date",k=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,E=/\[([^\]]+)]|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,x={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("_")},v=function($,N,w){var H=String($);return!H||H.length>=N?$:""+Array(N+1-H.length).join(w)+$},I={s:v,z:function($){var N=-$.utcOffset(),w=Math.abs(N),H=Math.floor(w/60),C=w%60;return(N<=0?"+":"-")+v(H,2,"0")+":"+v(C,2,"0")},m:function $(N,w){if(N.date()<w.date())return-$(w,N);var H=12*(w.year()-N.year())+(w.month()-N.month()),C=N.clone().add(H,l),X=w-C<0,d=N.clone().add(H+(X?-1:1),l);return+(-(H+(w-C)/(X?C-d:d-C))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:l,y:f,w:u,d:o,D:m,h:a,m:i,s,ms:n,Q:c}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},F="en",le={};le[F]=x;var B=function($){return $ instanceof ce},ie=function($,N,w){var H;if(!$)return F;if(typeof $=="string")le[$]&&(H=$),N&&(le[$]=N,H=$);else{var C=$.name;le[C]=$,H=C}return!w&&H&&(F=H),H||!w&&F},W=function($,N){if(B($))return $.clone();var w=typeof N=="object"?N:{};return w.date=$,w.args=arguments,new ce(w)},G=I;G.l=ie,G.i=B,G.w=function($,N){return W($,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var ce=function(){function $(w){this.$L=ie(w.locale,null,!0),this.parse(w)}var N=$.prototype;return N.parse=function(w){this.$d=function(H){var C=H.date,X=H.utc;if(C===null)return new Date(NaN);if(G.u(C))return new Date;if(C instanceof Date)return new Date(C);if(typeof C=="string"&&!/Z$/i.test(C)){var d=C.match(k);if(d){var p=d[2]-1||0,h=(d[7]||"0").substring(0,3);return X?new Date(Date.UTC(d[1],p,d[3]||1,d[4]||0,d[5]||0,d[6]||0,h)):new Date(d[1],p,d[3]||1,d[4]||0,d[5]||0,d[6]||0,h)}}return new Date(C)}(w),this.$x=w.x||{},this.init()},N.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.getDate(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},N.$utils=function(){return G},N.isValid=function(){return this.$d.toString()!==y},N.isSame=function(w,H){var C=W(w);return this.startOf(H)<=C&&C<=this.endOf(H)},N.isAfter=function(w,H){return W(w)<this.startOf(H)},N.isBefore=function(w,H){return this.endOf(H)<W(w)},N.$g=function(w,H,C){return G.u(w)?this[H]:this.set(C,w)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function(w,H){var C=this,X=!!G.u(H)||H,d=G.p(w),p=function(R,U){var ge=G.w(C.$u?Date.UTC(C.$y,U,R):new Date(C.$y,U,R),C);return X?ge:ge.endOf(o)},h=function(R,U){return G.w(C.toDate()[R].apply(C.toDate("s"),(X?[0,0,0,0]:[23,59,59,999]).slice(U)),C)},g=this.$W,b=this.$M,_=this.$D,S="set"+(this.$u?"UTC":"");switch(d){case f:return X?p(1,0):p(31,11);case l:return X?p(1,b):p(0,b+1);case u:var M=this.$locale().weekStart||0,D=(g<M?g+7:g)-M;return p(X?_-D:_+(6-D),b);case o:case m:return h(S+"Hours",0);case a:return h(S+"Minutes",1);case i:return h(S+"Seconds",2);case s:return h(S+"Milliseconds",3);default:return this.clone()}},N.endOf=function(w){return this.startOf(w,!1)},N.$set=function(w,H){var C,X=G.p(w),d="set"+(this.$u?"UTC":""),p=(C={},C[o]=d+"Date",C[m]=d+"Date",C[l]=d+"Month",C[f]=d+"FullYear",C[a]=d+"Hours",C[i]=d+"Minutes",C[s]=d+"Seconds",C[n]=d+"Milliseconds",C)[X],h=X===o?this.$D+(H-this.$W):H;if(X===l||X===f){var g=this.clone().set(m,1);g.$d[p](h),g.init(),this.$d=g.set(m,Math.min(this.$D,g.daysInMonth())).$d}else p&&this.$d[p](h);return this.init(),this},N.set=function(w,H){return this.clone().$set(w,H)},N.get=function(w){return this[G.p(w)]()},N.add=function(w,H){var C,X=this;w=Number(w);var d=G.p(H),p=function(b){var _=W(X);return G.w(_.date(_.date()+Math.round(b*w)),X)};if(d===l)return this.set(l,this.$M+w);if(d===f)return this.set(f,this.$y+w);if(d===o)return p(1);if(d===u)return p(7);var h=(C={},C[i]=e,C[a]=t,C[s]=r,C)[d]||1,g=this.$d.getTime()+w*h;return G.w(g,this)},N.subtract=function(w,H){return this.add(-1*w,H)},N.format=function(w){var H=this,C=this.$locale();if(!this.isValid())return C.invalidDate||y;var X=w||"YYYY-MM-DDTHH:mm:ssZ",d=G.z(this),p=this.$H,h=this.$m,g=this.$M,b=C.weekdays,_=C.months,S=function(U,ge,ae,te){return U&&(U[ge]||U(H,X))||ae[ge].substr(0,te)},M=function(U){return G.s(p%12||12,U,"0")},D=C.meridiem||function(U,ge,ae){var te=U<12?"AM":"PM";return ae?te.toLowerCase():te},R={YY:String(this.$y).slice(-2),YYYY:this.$y,M:g+1,MM:G.s(g+1,2,"0"),MMM:S(C.monthsShort,g,_,3),MMMM:S(_,g),D:this.$D,DD:G.s(this.$D,2,"0"),d:String(this.$W),dd:S(C.weekdaysMin,this.$W,b,2),ddd:S(C.weekdaysShort,this.$W,b,3),dddd:b[this.$W],H:String(p),HH:G.s(p,2,"0"),h:M(1),hh:M(2),a:D(p,h,!0),A:D(p,h,!1),m:String(h),mm:G.s(h,2,"0"),s:String(this.$s),ss:G.s(this.$s,2,"0"),SSS:G.s(this.$ms,3,"0"),Z:d};return X.replace(E,function(U,ge){return ge||R[U]||d.replace(":","")})},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function(w,H,C){var X,d=G.p(H),p=W(w),h=(p.utcOffset()-this.utcOffset())*e,g=this-p,b=G.m(this,p);return b=(X={},X[f]=b/12,X[l]=b,X[c]=b/3,X[u]=(g-h)/6048e5,X[o]=(g-h)/864e5,X[a]=g/t,X[i]=g/e,X[s]=g/r,X)[d]||g,C?b:G.a(b)},N.daysInMonth=function(){return this.endOf(l).$D},N.$locale=function(){return le[this.$L]},N.locale=function(w,H){if(!w)return this.$L;var C=this.clone(),X=ie(w,H,!0);return X&&(C.$L=X),C},N.clone=function(){return G.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()},$}(),Ie=ce.prototype;return W.prototype=Ie,[["$ms",n],["$s",s],["$m",i],["$H",a],["$W",o],["$M",l],["$y",f],["$D",m]].forEach(function($){Ie[$[1]]=function(N){return this.$g(N,$[0],$[1])}}),W.extend=function($,N){return $.$i||($(N,ce,W),$.$i=!0),W},W.locale=ie,W.isDayjs=B,W.unix=function($){return W(1e3*$)},W.en=le[F],W.Ls=le,W.p={},W})});var ut=T(mn=>{"use strict";var ew=mn&&mn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(mn,"__esModule",{value:!0});mn.findYearClosestToRef=mn.findMostLikelyADYear=void 0;var tw=ew(be());function rw(r){return r<100&&(r>50?r=r+1900:r=r+2e3),r}mn.findMostLikelyADYear=rw;function nw(r,e,t){let n=tw.default(r),s=n;s=s.month(t-1),s=s.date(e),s=s.year(n.year());let i=s.add(1,"y"),a=s.add(-1,"y");return Math.abs(i.diff(n))<Math.abs(s.diff(n))?s=i:Math.abs(a.diff(n))<Math.abs(s.diff(n))&&(s=a),s.year()}mn.findYearClosestToRef=nw});var lt=T(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.parseTimeUnits=ne.TIME_UNITS_PATTERN=ne.parseYear=ne.YEAR_PATTERN=ne.parseOrdinalNumberPattern=ne.ORDINAL_NUMBER_PATTERN=ne.parseNumberPattern=ne.NUMBER_PATTERN=ne.TIME_UNIT_DICTIONARY=ne.ORDINAL_WORD_DICTIONARY=ne.INTEGER_WORD_DICTIONARY=ne.MONTH_DICTIONARY=ne.FULL_MONTH_NAME_DICTIONARY=ne.WEEKDAY_DICTIONARY=void 0;var oo=Oe(),sw=ut();ne.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};ne.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};ne.MONTH_DICTIONARY=Object.assign(Object.assign({},ne.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});ne.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};ne.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};ne.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"};ne.NUMBER_PATTERN=`(?:${oo.matchAnyPattern(ne.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 Lm(r){let e=r.toLowerCase();return ne.INTEGER_WORD_DICTIONARY[e]!==void 0?ne.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)}ne.parseNumberPattern=Lm;ne.ORDINAL_NUMBER_PATTERN=`(?:${oo.matchAnyPattern(ne.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function iw(r){let e=r.toLowerCase();return ne.ORDINAL_WORD_DICTIONARY[e]!==void 0?ne.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}ne.parseOrdinalNumberPattern=iw;ne.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 aw(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 sw.findMostLikelyADYear(e)}ne.parseYear=aw;var Um=`(${ne.NUMBER_PATTERN})\\s{0,3}(${oo.matchAnyPattern(ne.TIME_UNIT_DICTIONARY)})`,Fm=new RegExp(Um,"i");ne.TIME_UNITS_PATTERN=oo.repeatedTimeunitPattern("(?:(?:about|around)\\s{0,3})?",Um);function ow(r){let e={},t=r,n=Fm.exec(t);for(;n;)uw(e,n),t=t.substring(n[0].length).trim(),n=Fm.exec(t);return e}ne.parseTimeUnits=ow;function uw(r,e){let t=Lm(e[1]),n=ne.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var qm=T((gl,yl)=>{(function(r,e){typeof gl=="object"&&typeof yl!="undefined"?yl.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs_plugin_quarterOfYear=e()})(gl,function(){"use strict";var r="month",e="quarter";return function(t,n){var s=n.prototype;s.quarter=function(o){return this.$utils().u(o)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(o-1))};var i=s.add;s.add=function(o,u){return o=Number(o),this.$utils().p(u)===e?this.add(3*o,r):i.bind(this)(o,u)};var a=s.startOf;s.startOf=function(o,u){var l=this.$utils(),c=!!l.u(u)||u;if(l.p(o)===e){var f=this.quarter()-1;return c?this.month(3*f).startOf(r).startOf("day"):this.month(3*f+2).endOf(r).endOf("day")}return a.bind(this)(o,u)}}})});var Kt=T(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.implySimilarTime=kr.assignSimilarTime=kr.assignSimilarDate=kr.assignTheNextDay=void 0;var Wm=ze();function lw(r,e){e=e.add(1,"day"),Ym(r,e),jm(r,e)}kr.assignTheNextDay=lw;function Ym(r,e){r.assign("day",e.date()),r.assign("month",e.month()+1),r.assign("year",e.year())}kr.assignSimilarDate=Ym;function cw(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",Wm.Meridiem.AM):r.assign("meridiem",Wm.Meridiem.PM)}kr.assignSimilarTime=cw;function jm(r,e){r.imply("hour",e.hour()),r.imply("minute",e.minute()),r.imply("second",e.second()),r.imply("millisecond",e.millisecond())}kr.implySimilarTime=jm});var Gm=T(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.toTimezoneOffset=Un.TIMEZONE_ABBR_MAP=void 0;Un.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 dw(r){var e;return r==null?null:typeof r=="number"?r:(e=Un.TIMEZONE_ABBR_MAP[r])!==null&&e!==void 0?e:null}Un.toTimezoneOffset=dw});var Le=T(Sr=>{"use strict";var $m=Sr&&Sr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sr,"__esModule",{value:!0});Sr.ParsingResult=Sr.ParsingComponents=Sr.ReferenceWithTimezone=void 0;var fw=$m(qm()),uo=$m(be()),bl=Kt(),pw=Gm();uo.default.extend(fw.default);var Tl=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=pw.toTimezoneOffset(e.timezone))}};Sr.ReferenceWithTimezone=Tl;var qn=class{constructor(e,t){if(this.reference=e,this.knownValues={},this.impliedValues={},t)for(let s in t)this.knownValues[s]=t[s];let n=uo.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 qn(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 uo.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 s=-e.getTimezoneOffset(),i=(n=(t=this.get("timezoneOffset"))!==null&&t!==void 0?t:this.reference.timezoneOffset)!==null&&n!==void 0?n:s;return s-i}static createRelativeFromReference(e,t){let n=uo.default(e.instant);for(let i in t)n=n.add(t[i],i);let s=new qn(e);return t.hour||t.minute||t.second?(bl.assignSimilarTime(s,n),bl.assignSimilarDate(s,n),e.timezoneOffset!==null&&s.assign("timezoneOffset",-e.instant.getTimezoneOffset())):(bl.implySimilarTime(s,n),e.timezoneOffset!==null&&s.imply("timezoneOffset",-e.instant.getTimezoneOffset()),t.d?(s.assign("day",n.date()),s.assign("month",n.month()+1),s.assign("year",n.year())):(t.week&&s.imply("weekday",n.day()),s.imply("day",n.date()),t.month?(s.assign("month",n.month()+1),s.assign("year",n.year())):(s.imply("month",n.month()+1),t.year?s.assign("year",n.year()):s.imply("year",n.year())))),s}};Sr.ParsingComponents=qn;var vi=class{constructor(e,t,n,s,i){this.reference=e,this.refDate=e.instant,this.index=t,this.text=n,this.start=s||new qn(e),this.end=i}clone(){let e=new vi(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}', ...}]`}};Sr.ParsingResult=vi});var Y=T(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.AbstractParserWithWordBoundaryChecking=void 0;var _l=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 s=(n=t[1])!==null&&n!==void 0?n:"";t.index=t.index+s.length,t[0]=t[0].substring(s.length);for(let i=2;i<t.length;i++)t[i-1]=t[i];return this.innerExtract(e,t)}};lo.AbstractParserWithWordBoundaryChecking=_l});var Bm=T(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});var wl=lt(),mw=Le(),hw=Y(),gw=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${wl.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),yw=new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${wl.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),vl=class extends hw.AbstractParserWithWordBoundaryChecking{innerPattern(e){return e.option.forwardDate?yw:gw}innerExtract(e,t){let n=wl.parseTimeUnits(t[1]);return mw.ParsingComponents.createRelativeFromReference(e.reference,n)}};El.default=vl});var Xm=T(Sl=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});var bw=ut(),Km=lt(),Qm=lt(),co=lt(),Tw=Oe(),_w=Y(),vw=new RegExp(`(?:on\\s{0,3})?(${co.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${co.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${Tw.matchAnyPattern(Km.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s{0,3})(${Qm.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Hm=1,zm=2,ww=3,Vm=4,kl=class extends _w.AbstractParserWithWordBoundaryChecking{innerPattern(){return vw}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=Km.MONTH_DICTIONARY[t[ww].toLowerCase()],i=co.parseOrdinalNumberPattern(t[Hm]);if(i>31)return t.index=t.index+t[Hm].length,null;if(n.start.assign("month",s),n.start.assign("day",i),t[Vm]){let a=Qm.parseYear(t[Vm]);n.start.assign("year",a)}else{let a=bw.findYearClosestToRef(e.refDate,i,s);n.start.imply("year",a)}if(t[zm]){let a=co.parseOrdinalNumberPattern(t[zm]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Sl.default=kl});var rh=T(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});var Ew=ut(),eh=lt(),fo=lt(),th=lt(),kw=Oe(),Sw=Y(),Ow=new RegExp(`(${kw.matchAnyPattern(eh.MONTH_DICTIONARY)})(?:-|/|\\s*,?\\s*)(${fo.ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${fo.ORDINAL_NUMBER_PATTERN})\\s*)?(?:(?:-|/|\\s*,?\\s*)(${th.YEAR_PATTERN}))?(?=\\W|$)(?!\\:\\d)`,"i"),Dw=1,xw=2,Zm=3,Jm=4,Ol=class extends Sw.AbstractParserWithWordBoundaryChecking{innerPattern(){return Ow}innerExtract(e,t){let n=eh.MONTH_DICTIONARY[t[Dw].toLowerCase()],s=fo.parseOrdinalNumberPattern(t[xw]);if(s>31)return null;let i=e.createParsingComponents({day:s,month:n});if(t[Jm]){let u=th.parseYear(t[Jm]);i.assign("year",u)}else{let u=Ew.findYearClosestToRef(e.refDate,s,n);i.imply("year",u)}if(!t[Zm])return i;let a=fo.parseOrdinalNumberPattern(t[Zm]),o=e.createParsingResult(t.index,t[0]);return o.start=i,o.end=i.clone(),o.end.assign("day",a),o}};Dl.default=Ol});var ih=T(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});var xl=lt(),Rw=ut(),Mw=Oe(),sh=lt(),Cw=Y(),Aw=new RegExp(`((?:in)\\s*)?(${Mw.matchAnyPattern(xl.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${sh.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),Pw=1,Nw=2,nh=3,Rl=class extends Cw.AbstractParserWithWordBoundaryChecking{innerPattern(){return Aw}innerExtract(e,t){let n=t[Nw].toLowerCase();if(t[0].length<=3&&!xl.FULL_MONTH_NAME_DICTIONARY[n])return null;let s=e.createParsingResult(t.index+(t[Pw]||"").length,t.index+t[0].length);s.start.imply("day",1);let i=xl.MONTH_DICTIONARY[n];if(s.start.assign("month",i),t[nh]){let a=sh.parseYear(t[nh]);s.start.assign("year",a)}else{let a=Rw.findYearClosestToRef(e.refDate,1,i);s.start.imply("year",a)}return s}};Ml.default=Rl});var uh=T(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});var oh=lt(),Iw=Oe(),Fw=Y(),Lw=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${Iw.matchAnyPattern(oh.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),Uw=1,qw=2,ah=3,Ww=4,Cl=class extends Fw.AbstractParserWithWordBoundaryChecking{innerPattern(){return Lw}innerExtract(e,t){let n=t[ah]?parseInt(t[ah]):oh.MONTH_DICTIONARY[t[qw].toLowerCase()];if(n<1||n>12)return null;let s=parseInt(t[Uw]);return{day:parseInt(t[Ww]),month:n,year:s}}};Al.default=Cl});var lh=T(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});var Yw=Y(),jw=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),Gw=1,$w=2,Pl=class extends Yw.AbstractParserWithWordBoundaryChecking{innerPattern(){return jw}innerExtract(e,t){let n=parseInt(t[$w]),s=parseInt(t[Gw]);return e.createParsingComponents().imply("day",1).assign("month",s).assign("year",n)}};Nl.default=Pl});var Wn=T(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.AbstractTimeExpressionParser=void 0;var Ot=ze();function Bw(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 Hw(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 ch=2,bs=3,po=4,mo=5,wi=6,Il=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 s=t.index+t[1].length,i=t[0].substring(t[1].length),a=e.createParsingResult(s,i,n);t.index+=t[0].length;let o=e.text.substring(t.index),l=this.getFollowingTimePatternThroughCache().exec(o);return i.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 s=e.createParsingComponents(),i=0,a=null,o=parseInt(t[ch]);if(o>100){if(this.strictMode||t[bs]!=null)return null;i=o%100,o=Math.floor(o/100)}if(o>24)return null;if(t[bs]!=null){if(t[bs].length==1&&!t[wi])return null;i=parseInt(t[bs])}if(i>=60)return null;if(o>12&&(a=Ot.Meridiem.PM),t[wi]!=null){if(o>12)return null;let u=t[wi][0].toLowerCase();u=="a"&&(a=Ot.Meridiem.AM,o==12&&(o=0)),u=="p"&&(a=Ot.Meridiem.PM,o!=12&&(o+=12))}if(s.assign("hour",o),s.assign("minute",i),a!==null?s.assign("meridiem",a):o<12?s.imply("meridiem",Ot.Meridiem.AM):s.imply("meridiem",Ot.Meridiem.PM),t[mo]!=null){let u=parseInt(t[mo].substring(0,3));if(u>=1e3)return null;s.assign("millisecond",u)}if(t[po]!=null){let u=parseInt(t[po]);if(u>=60)return null;s.assign("second",u)}return s}extractFollowingTimeComponents(e,t,n){let s=e.createParsingComponents();if(t[mo]!=null){let u=parseInt(t[mo].substring(0,3));if(u>=1e3)return null;s.assign("millisecond",u)}if(t[po]!=null){let u=parseInt(t[po]);if(u>=60)return null;s.assign("second",u)}let i=parseInt(t[ch]),a=0,o=-1;if(t[bs]!=null?a=parseInt(t[bs]):i>100&&(a=i%100,i=Math.floor(i/100)),a>=60||i>24)return null;if(i>=12&&(o=Ot.Meridiem.PM),t[wi]!=null){if(i>12)return null;let u=t[wi][0].toLowerCase();u=="a"&&(o=Ot.Meridiem.AM,i==12&&(i=0,s.isCertain("day")||s.imply("day",s.get("day")+1))),u=="p"&&(o=Ot.Meridiem.PM,i!=12&&(i+=12)),n.start.isCertain("meridiem")||(o==Ot.Meridiem.AM?(n.start.imply("meridiem",Ot.Meridiem.AM),n.start.get("hour")==12&&n.start.assign("hour",0)):(n.start.imply("meridiem",Ot.Meridiem.PM),n.start.get("hour")!=12&&n.start.assign("hour",n.start.get("hour")+12)))}return s.assign("hour",i),s.assign("minute",a),o>=0?s.assign("meridiem",o):n.start.isCertain("meridiem")&&n.start.get("hour")>12?n.start.get("hour")-12>i?s.imply("meridiem",Ot.Meridiem.AM):i<=12&&(s.assign("hour",i+12),s.assign("meridiem",Ot.Meridiem.PM)):i>12?s.imply("meridiem",Ot.Meridiem.PM):i<=12&&s.imply("meridiem",Ot.Meridiem.AM),s.date().getTime()<n.start.date().getTime()&&s.imply("day",s.get("day")+1),s}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],s=t[2];if(s.includes(".")&&!s.match(/\d(\.\d{2})+$/))return null;let i=parseInt(s),a=parseInt(n);if(i>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=Bw(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=Hw(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}};ho.AbstractTimeExpressionParser=Il});var dh=T(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});var go=ze(),zw=Wn(),Fl=class extends zw.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 s=n.get("hour");s>=6&&s<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",go.Meridiem.PM)):s<6&&n.assign("meridiem",go.Meridiem.AM)}if(t[0].endsWith("afternoon")){n.assign("meridiem",go.Meridiem.PM);let s=n.get("hour");s>=0&&s<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("morning")&&(n.assign("meridiem",go.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};Ll.default=Fl});var Qt=T(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.addImpliedTimeUnits=Ts.reverseTimeUnits=void 0;function Vw(r){let e={};for(let t in r)e[t]=-r[t];return e}Ts.reverseTimeUnits=Vw;function Kw(r,e){let t=r.clone(),n=r.dayjs();for(let s in e)n=n.add(e[s],s);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}Ts.addImpliedTimeUnits=Kw});var fh=T(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});var ql=lt(),Qw=Le(),Xw=Y(),Zw=Qt(),Jw=new RegExp(`(${ql.TIME_UNITS_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=(?:\\W|$))`,"i"),eE=new RegExp(`(${ql.TIME_UNITS_PATTERN})\\s{0,5}ago(?=(?:\\W|$))`,"i"),Ul=class extends Xw.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?eE:Jw}innerExtract(e,t){let n=ql.parseTimeUnits(t[1]),s=Zw.reverseTimeUnits(n);return Qw.ParsingComponents.createRelativeFromReference(e.reference,s)}};Wl.default=Ul});var ph=T(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});var jl=lt(),tE=Le(),rE=Y(),nE=new RegExp(`(${jl.TIME_UNITS_PATTERN})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),sE=new RegExp("("+jl.TIME_UNITS_PATTERN+")(later|from now)(?=(?:\\W|$))","i"),iE=1,Yl=class extends rE.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?sE:nE}innerExtract(e,t){let n=jl.parseTimeUnits(t[iE]);return tE.ParsingComponents.createRelativeFromReference(e.reference,n)}};Gl.default=Yl});var vs=T(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.MergingRefiner=_s.Filter=void 0;var $l=class{refine(e,t){return t.filter(n=>this.isValid(e,n))}};_s.Filter=$l;var Bl=class{refine(e,t){if(t.length<2)return t;let n=[],s=t[0],i=null;for(let a=1;a<t.length;a++){i=t[a];let o=e.text.substring(s.index+s.text.length,i.index);if(!this.shouldMergeResults(o,s,i,e))n.push(s),s=i;else{let u=s,l=i,c=this.mergeResults(o,u,l,e);e.debug(()=>{console.log(`${this.constructor.name} merged ${u} and ${l} into ${c}`)}),s=c}}return s!=null&&n.push(s),n}};_s.MergingRefiner=Bl});var Or=T(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});var aE=vs(),Hl=class extends aE.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(i=>{t.start.isCertain(i)||t.start.assign(i,n.start.get(i))}),t.start.getCertainComponents().forEach(i=>{n.start.isCertain(i)||n.start.assign(i,t.start.get(i))})),t.start.date().getTime()>n.start.date().getTime()){let i=t.start.dayjs(),a=n.start.dayjs();t.start.isOnlyWeekdayComponent()&&i.add(-7,"days").isBefore(a)?(i=i.add(-7,"days"),t.start.imply("day",i.date()),t.start.imply("month",i.month()+1),t.start.imply("year",i.year())):n.start.isOnlyWeekdayComponent()&&a.add(7,"days").isAfter(i)?(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 s=t.clone();return s.start=t.start,s.end=n.start,s.index=Math.min(t.index,n.index),t.index<n.index?s.text=t.text+e+n.text:s.text=n.text+e+t.text,s}};zl.default=Hl});var mh=T(Ei=>{"use strict";var oE=Ei&&Ei.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ei,"__esModule",{value:!0});var uE=oE(Or()),Vl=class extends uE.default{patternBetween(){return/^\s*(to|-)\s*$/i}};Ei.default=Vl});var hh=T(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.mergeDateTimeComponent=ws.mergeDateTimeResult=void 0;var lE=ze();function cE(r,e){let t=r.clone(),n=r.start,s=e.start;if(t.start=Kl(n,s),r.end!=null||e.end!=null){let i=r.end==null?r.start:r.end,a=e.end==null?e.start:e.end,o=Kl(i,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}ws.mergeDateTimeResult=cE;function Kl(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")==lE.Meridiem.PM&&t.get("hour")<12&&(e.isCertain("hour")?t.assign("hour",t.get("hour")+12):t.imply("hour",t.get("hour")+12)),t}ws.mergeDateTimeComponent=Kl});var Yr=T(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});var dE=vs(),gh=hh(),Ql=class extends dE.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 s=t.start.isOnlyDate()?gh.mergeDateTimeResult(t,n):gh.mergeDateTimeResult(n,t);return s.index=t.index,s.text=t.text+e+n.text,s}};Xl.default=Ql});var yh=T(ki=>{"use strict";var fE=ki&&ki.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ki,"__esModule",{value:!0});var pE=fE(Yr()),Zl=class extends pE.default{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$")}};ki.default=Zl});var bh=T(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});var mE=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),hE={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},Jl=class{constructor(e){this.timezone=Object.assign(Object.assign({},hE),e)}refine(e,t){var n;let s=(n=e.option.timezones)!==null&&n!==void 0?n:{};return t.forEach(i=>{var a,o;let u=e.text.substring(i.index+i.text.length),l=mE.exec(u);if(!l)return;let c=l[1].toUpperCase(),f=(o=(a=s[c])!==null&&a!==void 0?a:this.timezone[c])!==null&&o!==void 0?o:null;if(f===null)return;e.debug(()=>{console.log(`Extracting timezone: '${c}' into: ${f} for: ${i.start}`)});let m=i.start.get("timezoneOffset");m!==null&&f!=m&&(i.start.isCertain("timezoneOffset")||c!=l[1])||i.start.isOnlyDate()&&c!=l[1]||(i.text+=l[0],i.start.isCertain("timezoneOffset")||i.start.assign("timezoneOffset",f),i.end!=null&&!i.end.isCertain("timezoneOffset")&&i.end.assign("timezoneOffset",f))}),t}};ec.default=Jl});var yo=T(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});var gE=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),yE=1,bE=2,TE=3,tc=class{refine(e,t){return t.forEach(function(n){if(n.start.isCertain("timezoneOffset"))return;let s=e.text.substring(n.index+n.text.length),i=gE.exec(s);if(!i)return;e.debug(()=>{console.log(`Extracting timezone: '${i[0]}' into : ${n}`)});let a=parseInt(i[bE]),o=parseInt(i[TE]||"0"),u=a*60+o;u>14*60||(i[yE]==="-"&&(u=-u),n.end!=null&&n.end.assign("timezoneOffset",u),n.start.assign("timezoneOffset",u),n.text+=i[0])}),t}};rc.default=tc});var Th=T(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});var nc=class{refine(e,t){if(t.length<2)return t;let n=[],s=t[0];for(let i=1;i<t.length;i++){let a=t[i];a.index<s.index+s.text.length?a.text.length>s.text.length&&(s=a):(n.push(s),s=a)}return s!=null&&n.push(s),n}};sc.default=nc});var _h=T(Si=>{"use strict";var _E=Si&&Si.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Si,"__esModule",{value:!0});var vE=_E(be()),ic=class{refine(e,t){return e.option.forwardDate&&t.forEach(function(n){let s=vE.default(e.refDate);if(n.start.isOnlyDayMonthComponent()&&s.isAfter(n.start.dayjs()))for(let i=0;i<3&&s.isAfter(n.start.dayjs());i++)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()&&s.isAfter(n.start.dayjs())&&(s.day()>=n.start.get("weekday")?s=s.day(n.start.get("weekday")+7):s=s.day(n.start.get("weekday")),n.start.imply("day",s.date()),n.start.imply("month",s.month()+1),n.start.imply("year",s.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.start})`)}),n.end&&n.end.isOnlyWeekdayComponent()&&(s.day()>n.end.get("weekday")?s=s.day(n.end.get("weekday")+7):s=s.day(n.end.get("weekday")),n.end.imply("day",s.date()),n.end.imply("month",s.month()+1),n.end.imply("year",s.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.end})`)})))}),t}};Si.default=ic});var vh=T(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});var wE=vs(),ac=class extends wE.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}};oc.default=ac});var cc=T(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});var EE=Y(),kE=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"),SE=1,OE=2,DE=3,wh=4,xE=5,Eh=6,kh=7,Sh=8,Oh=9,uc=class extends EE.AbstractParserWithWordBoundaryChecking{innerPattern(){return kE}innerExtract(e,t){let n={};if(n.year=parseInt(t[SE]),n.month=parseInt(t[OE]),n.day=parseInt(t[DE]),t[wh]!=null)if(n.hour=parseInt(t[wh]),n.minute=parseInt(t[xE]),t[Eh]!=null&&(n.second=parseInt(t[Eh])),t[kh]!=null&&(n.millisecond=parseInt(t[kh])),t[Sh]==null)n.timezoneOffset=0;else{let s=parseInt(t[Sh]),i=0;t[Oh]!=null&&(i=parseInt(t[Oh]));let a=s*60;a<0?a-=i:a+=i,n.timezoneOffset=a}return n}};lc.default=uc});var Dh=T(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});var RE=vs(),dc=class extends RE.MergingRefiner{mergeResults(e,t,n){let s=n.clone();return s.index=t.index,s.text=t.text+e+s.text,s.start.assign("weekday",t.start.get("weekday")),s.end&&s.end.assign("weekday",t.start.get("weekday")),s}shouldMergeResults(e,t,n){return t.start.isOnlyWeekdayComponent()&&!t.start.isCertain("hour")&&n.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}};fc.default=dc});var jr=T(Es=>{"use strict";var Yn=Es&&Es.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Es,"__esModule",{value:!0});Es.includeCommonConfiguration=void 0;var ME=Yn(bh()),CE=Yn(yo()),xh=Yn(Th()),AE=Yn(_h()),PE=Yn(vh()),NE=Yn(cc()),IE=Yn(Dh());function FE(r,e=!1){return r.parsers.unshift(new NE.default),r.refiners.unshift(new IE.default),r.refiners.unshift(new ME.default),r.refiners.unshift(new CE.default),r.refiners.unshift(new xh.default),r.refiners.push(new xh.default),r.refiners.push(new AE.default),r.refiners.push(new PE.default(e)),r}Es.includeCommonConfiguration=FE});var $r=T(we=>{"use strict";var LE=we&&we.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(we,"__esModule",{value:!0});we.noon=we.morning=we.midnight=we.yesterdayEvening=we.evening=we.lastNight=we.tonight=we.theDayAfter=we.tomorrow=we.theDayBefore=we.yesterday=we.today=we.now=void 0;var Dr=Le(),ks=LE(be()),Gr=Kt(),Oi=ze();function UE(r){let e=ks.default(r.instant),t=new Dr.ParsingComponents(r,{});return Gr.assignSimilarDate(t,e),Gr.assignSimilarTime(t,e),r.timezoneOffset!==null&&t.assign("timezoneOffset",e.utcOffset()),t}we.now=UE;function qE(r){let e=ks.default(r.instant),t=new Dr.ParsingComponents(r,{});return Gr.assignSimilarDate(t,e),Gr.implySimilarTime(t,e),t}we.today=qE;function WE(r){return Rh(r,1)}we.yesterday=WE;function Rh(r,e){return pc(r,-e)}we.theDayBefore=Rh;function YE(r){return pc(r,1)}we.tomorrow=YE;function pc(r,e){let t=ks.default(r.instant),n=new Dr.ParsingComponents(r,{});return t=t.add(e,"day"),Gr.assignSimilarDate(n,t),Gr.implySimilarTime(n,t),n}we.theDayAfter=pc;function jE(r,e=22){let t=ks.default(r.instant),n=new Dr.ParsingComponents(r,{});return n.imply("hour",e),n.imply("meridiem",Oi.Meridiem.PM),Gr.assignSimilarDate(n,t),n}we.tonight=jE;function GE(r,e=0){let t=ks.default(r.instant),n=new Dr.ParsingComponents(r,{});return t.hour()<6&&(t=t.add(-1,"day")),Gr.assignSimilarDate(n,t),n.imply("hour",e),n}we.lastNight=GE;function $E(r,e=20){let t=new Dr.ParsingComponents(r,{});return t.imply("meridiem",Oi.Meridiem.PM),t.imply("hour",e),t}we.evening=$E;function BE(r,e=20){let t=ks.default(r.instant),n=new Dr.ParsingComponents(r,{});return t=t.add(-1,"day"),Gr.assignSimilarDate(n,t),n.imply("hour",e),n.imply("meridiem",Oi.Meridiem.PM),n}we.yesterdayEvening=BE;function HE(r){let e=new Dr.ParsingComponents(r,{});return e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e}we.midnight=HE;function zE(r,e=6){let t=new Dr.ParsingComponents(r,{});return t.imply("meridiem",Oi.Meridiem.AM),t.imply("hour",e),t}we.morning=zE;function VE(r){let e=new Dr.ParsingComponents(r,{});return e.imply("meridiem",Oi.Meridiem.AM),e.imply("hour",12),e}we.noon=VE});var Mh=T(dr=>{"use strict";var KE=dr&&dr.__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]}),QE=dr&&dr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),XE=dr&&dr.__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)&&KE(e,r,t);return QE(e,r),e},ZE=dr&&dr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(dr,"__esModule",{value:!0});var JE=ZE(be()),ek=Y(),tk=Kt(),Di=XE($r()),rk=/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,mc=class extends ek.AbstractParserWithWordBoundaryChecking{innerPattern(e){return rk}innerExtract(e,t){let n=JE.default(e.refDate),s=t[0].toLowerCase(),i=e.createParsingComponents();switch(s){case"now":return Di.now(e.reference);case"today":return Di.today(e.reference);case"yesterday":return Di.yesterday(e.reference);case"tomorrow":case"tmr":case"tmrw":return Di.tomorrow(e.reference);case"tonight":return Di.tonight(e.reference);default:s.match(/last\s*night/)&&(n.hour()>6&&(n=n.add(-1,"day")),tk.assignSimilarDate(i,n),i.imply("hour",0));break}return i}};dr.default=mc});var Ch=T(xi=>{"use strict";var nk=xi&&xi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xi,"__esModule",{value:!0});var bo=ze(),sk=Y(),ik=nk(be()),ak=Kt(),ok=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i,hc=class extends sk.AbstractParserWithWordBoundaryChecking{innerPattern(){return ok}innerExtract(e,t){let n=ik.default(e.refDate),s=e.createParsingComponents();switch(t[1].toLowerCase()){case"afternoon":s.imply("meridiem",bo.Meridiem.PM),s.imply("hour",15);break;case"evening":case"night":s.imply("meridiem",bo.Meridiem.PM),s.imply("hour",20);break;case"midnight":ak.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"morning":s.imply("meridiem",bo.Meridiem.AM),s.imply("hour",6);break;case"noon":s.imply("meridiem",bo.Meridiem.AM),s.imply("hour",12);break}return s}};xi.default=hc});var jn=T(hn=>{"use strict";var uk=hn&&hn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(hn,"__esModule",{value:!0});hn.toDayJSClosestWeekday=hn.toDayJSWeekday=void 0;var Ah=uk(be());function lk(r,e,t){if(!t)return Ph(r,e);let n=Ah.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}hn.toDayJSWeekday=lk;function Ph(r,e){let t=Ah.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}hn.toDayJSClosestWeekday=Ph});var Ih=T(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});var Nh=lt(),ck=Oe(),dk=Y(),fk=jn(),pk=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${ck.matchAnyPattern(Nh.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),mk=1,hk=2,gk=3,gc=class extends dk.AbstractParserWithWordBoundaryChecking{innerPattern(){return pk}innerExtract(e,t){let n=t[hk].toLowerCase(),s=Nh.WEEKDAY_DICTIONARY[n],i=t[mk],a=t[gk],o=i||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=fk.toDayJSWeekday(e.refDate,s,u);return e.createParsingComponents().assign("weekday",s).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};yc.default=gc});var Uh=T(Ri=>{"use strict";var yk=Ri&&Ri.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ri,"__esModule",{value:!0});var Lh=lt(),Fh=Le(),bk=yk(be()),Tk=Y(),_k=Oe(),vk=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${_k.matchAnyPattern(Lh.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),wk=1,Ek=2,bc=class extends Tk.AbstractParserWithWordBoundaryChecking{innerPattern(){return vk}innerExtract(e,t){let n=t[wk].toLowerCase(),s=t[Ek].toLowerCase(),i=Lh.TIME_UNIT_DICTIONARY[s];if(n=="next"||n.startsWith("after")){let u={};return u[i]=1,Fh.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="last"||n=="past"){let u={};return u[i]=-1,Fh.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=bk.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}};Ri.default=bc});var fr=T(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.ParsingContext=Ds.Chrono=void 0;var Ss=Le(),kk=Tc(),Os=class{constructor(e){e=e||kk.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new Os({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,t,n){let s=this.parse(e,t,n);return s.length>0?s[0].start.date():null}parse(e,t,n){let s=new To(e,t,n),i=[];return this.parsers.forEach(a=>{let o=Os.executeParser(s,a);i=i.concat(o)}),i.sort((a,o)=>a.index-o.index),this.refiners.forEach(function(a){i=a.refine(s,i)}),i}static executeParser(e,t){let n=[],s=t.pattern(e),i=e.text,a=e.text,o=s.exec(a);for(;o;){let u=o.index+i.length-a.length;o.index=u;let l=t.extract(e,o);if(!l){a=i.substring(o.index+1),o=s.exec(a);continue}let c=null;l instanceof Ss.ParsingResult?c=l:l instanceof Ss.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=i.substring(u+c.text.length),o=s.exec(a)}return n}};Ds.Chrono=Os;var To=class{constructor(e,t,n){this.text=e,this.reference=new Ss.ReferenceWithTimezone(t),this.option=n!=null?n:{},this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof Ss.ParsingComponents?e:new Ss.ParsingComponents(this.reference,e)}createParsingResult(e,t,n,s){let i=typeof t=="string"?t:this.text.substring(e,t),a=n?this.createParsingComponents(n):null,o=s?this.createParsingComponents(s):null;return new Ss.ParsingResult(this.reference,e,i,a,o)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}};Ds.ParsingContext=To});var Gn=T(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});var qh=ut(),Sk=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"),_o=1,Wh=5,Yh=2,jh=3,_c=4,vc=class{constructor(e){this.groupNumberMonth=e?jh:Yh,this.groupNumberDay=e?Yh:jh}pattern(){return Sk}extract(e,t){if(t[_o]=="/"||t[Wh]=="/"){t.index+=t[0].length;return}let n=t.index+t[_o].length,s=t[0].substr(t[_o].length,t[0].length-t[_o].length-t[Wh].length);if(s.match(/^\d\.\d$/)||s.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!t[_c]&&t[0].indexOf("/")<0)return;let i=e.createParsingResult(n,s),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(i.start.assign("day",o),i.start.assign("month",a),t[_c]){let u=parseInt(t[_c]),l=qh.findMostLikelyADYear(u);i.start.assign("year",l)}else{let u=qh.findYearClosestToRef(e.refDate,o,a);i.start.imply("year",u)}return i}};wc.default=vc});var $h=T(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});var Gh=lt(),Ok=Le(),Dk=Y(),xk=Qt(),Rk=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${Gh.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Ec=class extends Dk.AbstractParserWithWordBoundaryChecking{innerPattern(){return Rk}innerExtract(e,t){let n=t[1].toLowerCase(),s=Gh.parseTimeUnits(t[2]);switch(n){case"last":case"past":case"-":s=xk.reverseTimeUnits(s);break}return Ok.ParsingComponents.createRelativeFromReference(e.reference,s)}};kc.default=Ec});var Hh=T(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});var Mk=vs(),Sc=Le(),Ck=lt(),Ak=Qt();function Bh(r){return r.text.match(/\s+(before|from)$/i)!=null}function Pk(r){return r.text.match(/\s+(after|since)$/i)!=null}var Oc=class extends Mk.MergingRefiner{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,n){return!e.match(this.patternBetween())||!Bh(t)&&!Pk(t)?!1:!!n.start.get("day")&&!!n.start.get("month")&&!!n.start.get("year")}mergeResults(e,t,n){let s=Ck.parseTimeUnits(t.text);Bh(t)&&(s=Ak.reverseTimeUnits(s));let i=Sc.ParsingComponents.createRelativeFromReference(new Sc.ReferenceWithTimezone(n.start.date()),s);return new Sc.ParsingResult(n.reference,t.index,`${t.text}${e}${n.text}`,i)}};Dc.default=Oc});var Tc=T(Ge=>{"use strict";var Xe=Ge&&Ge.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.createConfiguration=Ge.createCasualConfiguration=Ge.parseDate=Ge.parse=Ge.GB=Ge.strict=Ge.casual=void 0;var Nk=Xe(Bm()),Ik=Xe(Xm()),Fk=Xe(rh()),Lk=Xe(ih()),Uk=Xe(uh()),qk=Xe(lh()),Wk=Xe(dh()),Yk=Xe(fh()),jk=Xe(ph()),Gk=Xe(mh()),$k=Xe(yh()),Bk=jr(),Hk=Xe(Mh()),zk=Xe(Ch()),Vk=Xe(Ih()),Kk=Xe(Uh()),xc=fr(),Qk=Xe(Gn()),Xk=Xe($h()),Zk=Xe(Hh());Ge.casual=new xc.Chrono(zh(!1));Ge.strict=new xc.Chrono(vo(!0,!1));Ge.GB=new xc.Chrono(vo(!1,!0));function Jk(r,e,t){return Ge.casual.parse(r,e,t)}Ge.parse=Jk;function e1(r,e,t){return Ge.casual.parseDate(r,e,t)}Ge.parseDate=e1;function zh(r=!1){let e=vo(!1,r);return e.parsers.unshift(new Hk.default),e.parsers.unshift(new zk.default),e.parsers.unshift(new Lk.default),e.parsers.unshift(new Kk.default),e.parsers.unshift(new Xk.default),e}Ge.createCasualConfiguration=zh;function vo(r=!0,e=!1){return Bk.includeCommonConfiguration({parsers:[new Qk.default(e),new Nk.default,new Ik.default,new Fk.default,new Vk.default,new Uk.default,new qk.default,new Wk.default(r),new Yk.default(r),new jk.default(r)],refiners:[new Zk.default,new $k.default,new Gk.default]},r)}Ge.createConfiguration=vo});var Vh=T(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});var t1=Wn(),Rc=class extends t1.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)}};Mc.default=Rc});var Mi=T(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.parseTimeUnits=xe.TIME_UNITS_PATTERN=xe.parseYear=xe.YEAR_PATTERN=xe.parseNumberPattern=xe.NUMBER_PATTERN=xe.TIME_UNIT_DICTIONARY=xe.INTEGER_WORD_DICTIONARY=xe.MONTH_DICTIONARY=xe.WEEKDAY_DICTIONARY=void 0;var Cc=Oe(),r1=ut();xe.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};xe.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};xe.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};xe.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"};xe.NUMBER_PATTERN=`(?:${Cc.matchAnyPattern(xe.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s*an?)?|an?\\b(?:\\s*few)?|few|several|a?\\s*couple\\s*(?:of)?)`;function Qh(r){let e=r.toLowerCase();return xe.INTEGER_WORD_DICTIONARY[e]!==void 0?xe.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)}xe.parseNumberPattern=Qh;xe.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 n1(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 r1.findMostLikelyADYear(e)}xe.parseYear=n1;var Xh=`(${xe.NUMBER_PATTERN})\\s{0,5}(${Cc.matchAnyPattern(xe.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Kh=new RegExp(Xh,"i");xe.TIME_UNITS_PATTERN=Cc.repeatedTimeunitPattern("",Xh);function s1(r){let e={},t=r,n=Kh.exec(t);for(;n;)i1(e,n),t=t.substring(n[0].length),n=Kh.exec(t);return e}xe.parseTimeUnits=s1;function i1(r,e){let t=Qh(e[1]),n=xe.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Jh=T(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});var Zh=Mi(),a1=Oe(),o1=Y(),u1=jn(),l1=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:a[mn]\\s*?)?(?:(diese[mn]|letzte[mn]|n(?:\xE4|ae)chste[mn])\\s*)?(${a1.matchAnyPattern(Zh.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(diese|letzte|n(?:\xE4|ae)chste)\\s*woche)?(?=\\W|$)`,"i"),c1=1,d1=3,f1=2,Ac=class extends o1.AbstractParserWithWordBoundaryChecking{innerPattern(){return l1}innerExtract(e,t){let n=t[f1].toLowerCase(),s=Zh.WEEKDAY_DICTIONARY[n],i=t[c1],a=t[d1],o=i||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=u1.toDayJSWeekday(e.refDate,s,u);return e.createParsingComponents().assign("weekday",s).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Pc.default=Ac});var ng=T(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});var gn=ze(),p1=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"),m1=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"),h1=2,eg=3,tg=4,rg=5,xs=class{pattern(e){return p1}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=xs.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let s=e.text.substring(t.index+t[0].length),i=m1.exec(s);return i&&(n.end=xs.extractTimeComponent(n.start.clone(),i),n.end&&(n.text+=i[0])),n}static extractTimeComponent(e,t){let n=0,s=0,i=null;if(n=parseInt(t[h1]),t[eg]!=null&&(s=parseInt(t[eg])),s>=60||n>24)return null;if(n>=12&&(i=gn.Meridiem.PM),t[rg]!=null){if(n>12)return null;let a=t[rg].toLowerCase();a.match(/morgen|vormittag/)&&(i=gn.Meridiem.AM,n==12&&(n=0)),a.match(/nachmittag|abend/)&&(i=gn.Meridiem.PM,n!=12&&(n+=12)),a.match(/nacht/)&&(n==12?(i=gn.Meridiem.AM,n=0):n<6?i=gn.Meridiem.AM:(i=gn.Meridiem.PM,n+=12))}if(e.assign("hour",n),e.assign("minute",s),i!==null?e.assign("meridiem",i):n<12?e.imply("meridiem",gn.Meridiem.AM):e.imply("meridiem",gn.Meridiem.PM),t[tg]!=null){let a=parseInt(t[tg]);if(a>=60)return null;e.assign("second",a)}return e}};Nc.default=xs});var sg=T(Ci=>{"use strict";var g1=Ci&&Ci.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ci,"__esModule",{value:!0});var y1=g1(Or()),Ic=class extends y1.default{patternBetween(){return/^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i}};Ci.default=Ic});var ig=T(Ai=>{"use strict";var b1=Ai&&Ai.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ai,"__esModule",{value:!0});var T1=b1(Yr()),Fc=class extends T1.default{patternBetween(){return new RegExp("^\\s*(T|um|am|,|-)?\\s*$")}};Ai.default=Fc});var Lc=T(Ni=>{"use strict";var _1=Ni&&Ni.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ni,"__esModule",{value:!0});var v1=_1(be()),$n=ze(),w1=Y(),E1=Kt(),k1=Qt(),Pi=class extends w1.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i}innerExtract(e,t){let n=v1.default(e.refDate),s=t[2].toLowerCase(),i=e.createParsingComponents();return E1.implySimilarTime(i,n),Pi.extractTimeComponents(i,s)}static extractTimeComponents(e,t){switch(t){case"morgen":e.imply("hour",6),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",$n.Meridiem.AM);break;case"vormittag":e.imply("hour",9),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",$n.Meridiem.AM);break;case"mittag":case"mittags":e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",$n.Meridiem.AM);break;case"nachmittag":e.imply("hour",15),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",$n.Meridiem.PM);break;case"abend":e.imply("hour",18),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",$n.Meridiem.PM);break;case"nacht":e.imply("hour",22),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",$n.Meridiem.PM);break;case"mitternacht":e.get("hour")>1&&(e=k1.addImpliedTimeUnits(e,{day:1})),e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",$n.Meridiem.AM);break}return e}};Ni.default=Pi});var ug=T(pr=>{"use strict";var S1=pr&&pr.__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]}),O1=pr&&pr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),D1=pr&&pr.__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)&&S1(e,r,t);return O1(e,r),e},og=pr&&pr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pr,"__esModule",{value:!0});var x1=og(be()),R1=Y(),Bn=Kt(),M1=og(Lc()),ag=D1($r()),C1=new RegExp("(jetzt|heute|morgen|\xFCbermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?(?=\\W|$)","i"),A1=1,P1=2,Uc=class extends R1.AbstractParserWithWordBoundaryChecking{innerPattern(e){return C1}innerExtract(e,t){let n=x1.default(e.refDate),s=(t[A1]||"").toLowerCase(),i=(t[P1]||"").toLowerCase(),a=e.createParsingComponents();switch(s){case"jetzt":a=ag.now(e.reference);break;case"heute":a=ag.today(e.reference);break;case"morgen":Bn.assignTheNextDay(a,n);break;case"\xFCbermorgen":case"uebermorgen":n=n.add(1,"day"),Bn.assignTheNextDay(a,n);break;case"gestern":n=n.add(-1,"day"),Bn.assignSimilarDate(a,n),Bn.implySimilarTime(a,n);break;case"vorgestern":n=n.add(-2,"day"),Bn.assignSimilarDate(a,n),Bn.implySimilarTime(a,n);break;default:s.match(/letzte\s*nacht/)&&(n.hour()>6&&(n=n.add(-1,"day")),Bn.assignSimilarDate(a,n),a.imply("hour",0));break}return i&&(a=M1.default.extractTimeComponents(a,i)),a}};pr.default=Uc});var mg=T(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});var N1=ut(),fg=Mi(),pg=Mi(),I1=Oe(),F1=Y(),L1=new RegExp(`(?:am\\s*?)?(?:den\\s*?)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\\u2013|\\s)\\s*([0-9]{1,2})\\.?)?\\s*(${I1.matchAnyPattern(fg.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${pg.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),lg=1,cg=2,U1=3,dg=4,qc=class extends F1.AbstractParserWithWordBoundaryChecking{innerPattern(){return L1}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=fg.MONTH_DICTIONARY[t[U1].toLowerCase()],i=parseInt(t[lg]);if(i>31)return t.index=t.index+t[lg].length,null;if(n.start.assign("month",s),n.start.assign("day",i),t[dg]){let a=pg.parseYear(t[dg]);n.start.assign("year",a)}else{let a=N1.findYearClosestToRef(e.refDate,i,s);n.start.imply("year",a)}if(t[cg]){let a=parseInt(t[cg]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Wc.default=qc});var hg=T(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});var wo=Mi(),q1=Le(),W1=Y(),Y1=Qt(),j1=Oe(),Yc=class extends W1.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*)?(${wo.NUMBER_PATTERN})?(?:\\s*(n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?\\s*(${j1.matchAnyPattern(wo.TIME_UNIT_DICTIONARY)})`,"i")}innerExtract(e,t){let n=t[2]?wo.parseNumberPattern(t[2]):1,s=wo.TIME_UNIT_DICTIONARY[t[4].toLowerCase()],i={};i[s]=n;let a=t[1]||t[3]||"";if(a=a.toLowerCase(),!!a)return(/vor/.test(a)||/letzte/.test(a)||/vergangen/.test(a))&&(i=Y1.reverseTimeUnits(i)),q1.ParsingComponents.createRelativeFromReference(e.reference,i)}};jc.default=Yc});var bg=T(Ze=>{"use strict";var mr=Ze&&Ze.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.createConfiguration=Ze.createCasualConfiguration=Ze.parseDate=Ze.parse=Ze.strict=Ze.casual=void 0;var G1=jr(),gg=fr(),$1=mr(Gn()),B1=mr(cc()),H1=mr(Vh()),z1=mr(Jh()),V1=mr(ng()),K1=mr(sg()),Q1=mr(ig()),X1=mr(ug()),Z1=mr(Lc()),J1=mr(mg()),eS=mr(hg());Ze.casual=new gg.Chrono(yg());Ze.strict=new gg.Chrono(Gc(!0));function tS(r,e,t){return Ze.casual.parse(r,e,t)}Ze.parse=tS;function rS(r,e,t){return Ze.casual.parseDate(r,e,t)}Ze.parseDate=rS;function yg(r=!0){let e=Gc(!1,r);return e.parsers.unshift(new Z1.default),e.parsers.unshift(new X1.default),e.parsers.unshift(new eS.default),e}Ze.createCasualConfiguration=yg;function Gc(r=!0,e=!0){return G1.includeCommonConfiguration({parsers:[new B1.default,new $1.default(e),new H1.default,new V1.default,new J1.default,new z1.default],refiners:[new K1.default,new Q1.default]},r)}Ze.createConfiguration=Gc});var _g=T(hr=>{"use strict";var nS=hr&&hr.__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]}),sS=hr&&hr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),iS=hr&&hr.__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)&&nS(e,r,t);return sS(e,r),e},aS=hr&&hr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(hr,"__esModule",{value:!0});var oS=aS(be()),uS=ze(),lS=Y(),Tg=Kt(),Eo=iS($r()),$c=class extends lS.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i}innerExtract(e,t){let n=oS.default(e.refDate),s=t[0].toLowerCase(),i=e.createParsingComponents();switch(s){case"maintenant":return Eo.now(e.reference);case"aujourd'hui":return Eo.today(e.reference);case"hier":return Eo.yesterday(e.reference);case"demain":return Eo.tomorrow(e.reference);default:s.match(/cette\s*nuit/)?(Tg.assignSimilarDate(i,n),i.imply("hour",22),i.imply("meridiem",uS.Meridiem.PM)):s.match(/la\s*veille/)&&(n=n.add(-1,"day"),Tg.assignSimilarDate(i,n),i.imply("hour",0))}return i}};hr.default=$c});var vg=T(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});var Ii=ze(),cS=Y(),Bc=class extends cS.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(),s=e.createParsingComponents();switch(n){case"apr\xE8s-midi":case"aprem":s.imply("hour",14),s.imply("minute",0),s.imply("meridiem",Ii.Meridiem.PM);break;case"soir":s.imply("hour",18),s.imply("minute",0),s.imply("meridiem",Ii.Meridiem.PM);break;case"matin":s.imply("hour",8),s.imply("minute",0),s.imply("meridiem",Ii.Meridiem.AM);break;case"a midi":s.imply("hour",12),s.imply("minute",0),s.imply("meridiem",Ii.Meridiem.AM);break;case"\xE0 minuit":s.imply("hour",0),s.imply("meridiem",Ii.Meridiem.AM);break}return s}};Hc.default=Bc});var wg=T(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});var dS=Wn(),zc=class extends dS.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)}};Vc.default=zc});var Eg=T(Fi=>{"use strict";var fS=Fi&&Fi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fi,"__esModule",{value:!0});var pS=fS(Yr()),Kc=class extends pS.default{patternBetween(){return new RegExp("^\\s*(T|\xE0|a|vers|de|,|-)?\\s*$")}};Fi.default=Kc});var kg=T(Li=>{"use strict";var mS=Li&&Li.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Li,"__esModule",{value:!0});var hS=mS(Or()),Qc=class extends hS.default{patternBetween(){return/^\s*(à|a|-)\s*$/i}};Li.default=Qc});var yn=T(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.parseTimeUnits=Te.TIME_UNITS_PATTERN=Te.parseYear=Te.YEAR_PATTERN=Te.parseOrdinalNumberPattern=Te.ORDINAL_NUMBER_PATTERN=Te.parseNumberPattern=Te.NUMBER_PATTERN=Te.TIME_UNIT_DICTIONARY=Te.INTEGER_WORD_DICTIONARY=Te.MONTH_DICTIONARY=Te.WEEKDAY_DICTIONARY=void 0;var Xc=Oe();Te.WEEKDAY_DICTIONARY={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6};Te.MONTH_DICTIONARY={janvier:1,jan:1,"jan.":1,f\u00E9vrier:2,f\u00E9v:2,"f\xE9v.":2,fevrier:2,fev:2,"fev.":2,mars:3,mar:3,"mar.":3,avril:4,avr:4,"avr.":4,mai:5,juin:6,jun:6,juillet:7,juil:7,jul:7,"jul.":7,ao\u00FBt:8,aout:8,septembre:9,sep:9,"sep.":9,sept:9,"sept.":9,octobre:10,oct:10,"oct.":10,novembre:11,nov:11,"nov.":11,d\u00E9cembre:12,decembre:12,dec:12,"dec.":12};Te.INTEGER_WORD_DICTIONARY={un:1,deux:2,trois:3,quatre:4,cinq:5,six:6,sept:7,huit:8,neuf:9,dix:10,onze:11,douze:12,treize:13};Te.TIME_UNIT_DICTIONARY={sec:"second",seconde:"second",secondes:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",heure:"hour",heures:"hour",jour:"d",jours:"d",semaine:"week",semaines:"week",mois:"month",trimestre:"quarter",trimestres:"quarter",ans:"year",ann\u00E9e:"year",ann\u00E9es:"year"};Te.NUMBER_PATTERN=`(?:${Xc.matchAnyPattern(Te.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`;function Og(r){let e=r.toLowerCase();return Te.INTEGER_WORD_DICTIONARY[e]!==void 0?Te.INTEGER_WORD_DICTIONARY[e]:e==="une"||e==="un"?1:e.match(/quelques?/)?3:e.match(/demi-?/)?.5:parseFloat(e)}Te.parseNumberPattern=Og;Te.ORDINAL_NUMBER_PATTERN="(?:[0-9]{1,2}(?:er)?)";function gS(r){let e=r.toLowerCase();return e=e.replace(/(?:er)$/i,""),parseInt(e)}Te.parseOrdinalNumberPattern=gS;Te.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:AC|AD|p\\.\\s*C(?:hr?)?\\.\\s*n\\.)|[1-2][0-9]{3}|[5-9][0-9])";function yS(r){if(/AC/i.test(r))return r=r.replace(/BC/i,""),-parseInt(r);if(/AD/i.test(r)||/C/i.test(r))return r=r.replace(/[^\d]+/i,""),parseInt(r);let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}Te.parseYear=yS;var Dg=`(${Te.NUMBER_PATTERN})\\s{0,5}(${Xc.matchAnyPattern(Te.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Sg=new RegExp(Dg,"i");Te.TIME_UNITS_PATTERN=Xc.repeatedTimeunitPattern("",Dg);function bS(r){let e={},t=r,n=Sg.exec(t);for(;n;)TS(e,n),t=t.substring(n[0].length),n=Sg.exec(t);return e}Te.parseTimeUnits=bS;function TS(r,e){let t=Og(e[1]),n=Te.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Rg=T(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});var xg=yn(),_S=Oe(),vS=Y(),wS=jn(),ES=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(?:ce)\\s*)?(${_S.matchAnyPattern(xg.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(dernier|prochain)\\s*)?(?=\\W|\\d|$)`,"i"),kS=1,SS=2,Zc=class extends vS.AbstractParserWithWordBoundaryChecking{innerPattern(){return ES}innerExtract(e,t){let n=t[kS].toLowerCase(),s=xg.WEEKDAY_DICTIONARY[n];if(s===void 0)return null;let i=t[SS];i=i||"",i=i.toLowerCase();let a=null;i=="dernier"?a="last":i=="prochain"&&(a="next");let o=wS.toDayJSWeekday(e.refDate,s,a);return e.createParsingComponents().assign("weekday",s).imply("day",o.date()).imply("month",o.month()+1).imply("year",o.year())}};Jc.default=Zc});var Pg=T(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});var Ui=ze(),OS=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"),DS=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"),xS=2,Mg=3,Cg=4,Ag=5,Rs=class{pattern(e){return OS}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=Rs.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let s=e.text.substring(t.index+t[0].length),i=DS.exec(s);return i&&(n.end=Rs.extractTimeComponent(n.start.clone(),i),n.end&&(n.text+=i[0])),n}static extractTimeComponent(e,t){let n=0,s=0,i=null;if(n=parseInt(t[xS]),t[Mg]!=null&&(s=parseInt(t[Mg])),s>=60||n>24)return null;if(n>=12&&(i=Ui.Meridiem.PM),t[Ag]!=null){if(n>12)return null;let a=t[Ag][0].toLowerCase();a=="a"&&(i=Ui.Meridiem.AM,n==12&&(n=0)),a=="p"&&(i=Ui.Meridiem.PM,n!=12&&(n+=12))}if(e.assign("hour",n),e.assign("minute",s),i!==null?e.assign("meridiem",i):n<12?e.imply("meridiem",Ui.Meridiem.AM):e.imply("meridiem",Ui.Meridiem.PM),t[Cg]!=null){let a=parseInt(t[Cg]);if(a>=60)return null;e.assign("second",a)}return e}};ed.default=Rs});var qg=T(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});var RS=ut(),Lg=yn(),Ug=yn(),ko=yn(),MS=Oe(),CS=Y(),AS=new RegExp(`(?:on\\s*?)?(${ko.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:au|\\-|\\\u2013|jusqu'au?|\\s)\\s*(${ko.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:de)?\\s*)(${MS.matchAnyPattern(Lg.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${Ug.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Ng=1,Ig=2,PS=3,Fg=4,td=class extends CS.AbstractParserWithWordBoundaryChecking{innerPattern(){return AS}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=Lg.MONTH_DICTIONARY[t[PS].toLowerCase()],i=ko.parseOrdinalNumberPattern(t[Ng]);if(i>31)return t.index=t.index+t[Ng].length,null;if(n.start.assign("month",s),n.start.assign("day",i),t[Fg]){let a=Ug.parseYear(t[Fg]);n.start.assign("year",a)}else{let a=RS.findYearClosestToRef(e.refDate,i,s);n.start.imply("year",a)}if(t[Ig]){let a=ko.parseOrdinalNumberPattern(t[Ig]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};rd.default=td});var Yg=T(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});var Wg=yn(),NS=Le(),IS=Y(),FS=Qt(),nd=class extends IS.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`il y a\\s*(${Wg.TIME_UNITS_PATTERN})(?=(?:\\W|$))`,"i")}innerExtract(e,t){let n=Wg.parseTimeUnits(t[1]),s=FS.reverseTimeUnits(n);return NS.ParsingComponents.createRelativeFromReference(e.reference,s)}};sd.default=nd});var Gg=T(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});var jg=yn(),LS=Le(),US=Y(),id=class extends US.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${jg.TIME_UNITS_PATTERN})(?=\\W|$)`,"i")}innerExtract(e,t){let n=jg.parseTimeUnits(t[1]);return LS.ParsingComponents.createRelativeFromReference(e.reference,n)}};ad.default=id});var $g=T(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});var So=yn(),qS=Le(),WS=Y(),YS=Qt(),jS=Oe(),od=class extends WS.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:les?|la|l'|du|des?)\\s*(${So.NUMBER_PATTERN})?(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?\\s*(${jS.matchAnyPattern(So.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]?So.parseNumberPattern(t[1]):1,s=So.TIME_UNIT_DICTIONARY[t[3].toLowerCase()],i={};i[s]=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))&&(i=YS.reverseTimeUnits(i)),qS.ParsingComponents.createRelativeFromReference(e.reference,i)}};ud.default=od});var zg=T(Je=>{"use strict";var Xt=Je&&Je.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Je,"__esModule",{value:!0});Je.createConfiguration=Je.createCasualConfiguration=Je.parseDate=Je.parse=Je.strict=Je.casual=void 0;var GS=jr(),Bg=fr(),$S=Xt(_g()),BS=Xt(vg()),HS=Xt(Gn()),zS=Xt(wg()),VS=Xt(Eg()),KS=Xt(kg()),QS=Xt(Rg()),XS=Xt(Pg()),ZS=Xt(qg()),JS=Xt(Yg()),eO=Xt(Gg()),tO=Xt($g());Je.casual=new Bg.Chrono(Hg());Je.strict=new Bg.Chrono(ld(!0));function rO(r,e,t){return Je.casual.parse(r,e,t)}Je.parse=rO;function nO(r,e,t){return Je.casual.parseDate(r,e,t)}Je.parseDate=nO;function Hg(r=!0){let e=ld(!1,r);return e.parsers.unshift(new $S.default),e.parsers.unshift(new BS.default),e.parsers.unshift(new tO.default),e}Je.createCasualConfiguration=Hg;function ld(r=!0,e=!0){return GS.includeCommonConfiguration({parsers:[new HS.default(e),new ZS.default,new zS.default,new XS.default,new JS.default,new eO.default,new QS.default],refiners:[new VS.default,new KS.default]},r)}Je.createConfiguration=ld});var Vg=T(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.toHankaku=void 0;function sO(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,iO)}Oo.toHankaku=sO;function iO(r){return String.fromCharCode(r.charCodeAt(0)-65248)}});var Qg=T(qi=>{"use strict";var aO=qi&&qi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qi,"__esModule",{value:!0});var cd=Vg(),oO=ut(),uO=aO(be()),lO=/(?:(?:([同今本])|((昭和|平成|令和)?([0-9-]{1,4}|元)))年\s*)?([0-9-]{1,2})月\s*([0-9-]{1,2})日/i,Kg=1,cO=2,dd=3,dO=4,fO=5,pO=6,fd=class{pattern(){return lO}extract(e,t){let n=parseInt(cd.toHankaku(t[fO])),s=parseInt(cd.toHankaku(t[pO])),i=e.createParsingComponents({day:s,month:n});if(t[Kg]&&t[Kg].match("\u540C|\u4ECA|\u672C")){let a=uO.default(e.refDate);i.assign("year",a.year())}if(t[cO]){let a=t[dO],o=a=="\u5143"?1:parseInt(cd.toHankaku(a));t[dd]=="\u4EE4\u548C"?o+=2018:t[dd]=="\u5E73\u6210"?o+=1988:t[dd]=="\u662D\u548C"&&(o+=1925),i.assign("year",o)}else{let a=oO.findYearClosestToRef(e.refDate,s,n);i.imply("year",a)}return i}};qi.default=fd});var Xg=T(Wi=>{"use strict";var mO=Wi&&Wi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wi,"__esModule",{value:!0});var hO=mO(Or()),pd=class extends hO.default{patternBetween(){return/^\s*(から|ー|-)\s*$/i}};Wi.default=pd});var Jg=T(gr=>{"use strict";var gO=gr&&gr.__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]}),yO=gr&&gr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),bO=gr&&gr.__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)&&gO(e,r,t);return yO(e,r),e},TO=gr&&gr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(gr,"__esModule",{value:!0});var _O=TO(be()),Zg=ze(),md=bO($r()),vO=/今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i,hd=class{pattern(){return vO}extract(e,t){let n=t[0],s=_O.default(e.refDate),i=e.createParsingComponents();switch(n){case"\u6628\u65E5":return md.yesterday(e.reference);case"\u660E\u65E5":return md.tomorrow(e.reference);case"\u4ECA\u65E5":case"\u5F53\u65E5":return md.today(e.reference)}return n=="\u4ECA\u591C"||n=="\u4ECA\u5915"||n=="\u4ECA\u6669"?(i.imply("hour",22),i.assign("meridiem",Zg.Meridiem.PM)):n.match("\u4ECA\u671D")&&(i.imply("hour",6),i.assign("meridiem",Zg.Meridiem.AM)),i.assign("day",s.date()),i.assign("month",s.month()+1),i.assign("year",s.year()),i}};gr.default=hd});var ry=T(et=>{"use strict";var gd=et&&et.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(et,"__esModule",{value:!0});et.createConfiguration=et.createCasualConfiguration=et.parseDate=et.parse=et.strict=et.casual=void 0;var wO=gd(Qg()),EO=gd(Xg()),kO=gd(Jg()),ey=fr();et.casual=new ey.Chrono(ty());et.strict=new ey.Chrono(yd());function SO(r,e,t){return et.casual.parse(r,e,t)}et.parse=SO;function OO(r,e,t){return et.casual.parseDate(r,e,t)}et.parseDate=OO;function ty(){let r=yd();return r.parsers.unshift(new kO.default),r}et.createCasualConfiguration=ty;function yd(){return{parsers:[new wO.default],refiners:[new EO.default]}}et.createConfiguration=yd});var Do=T(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.parseYear=xr.YEAR_PATTERN=xr.MONTH_DICTIONARY=xr.WEEKDAY_DICTIONARY=void 0;xr.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};xr.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};xr.YEAR_PATTERN="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";function DO(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)}xr.parseYear=DO});var sy=T(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});var ny=Do(),xO=Oe(),RO=Y(),MO=jn(),CO=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|passado|pr[o\xF3]ximo)\\s*)?(${xO.matchAnyPattern(ny.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|passado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),AO=1,PO=2,NO=3,bd=class extends RO.AbstractParserWithWordBoundaryChecking{innerPattern(){return CO}innerExtract(e,t){let n=t[PO].toLowerCase(),s=ny.WEEKDAY_DICTIONARY[n];if(s===void 0)return null;let i=t[AO],a=t[NO],o=i||a||"";o=o.toLowerCase();let u=null;o=="passado"?u="this":o=="pr\xF3ximo"||o=="proximo"?u="next":o=="este"&&(u="this");let l=MO.toDayJSWeekday(e.refDate,s,u);return e.createParsingComponents().assign("weekday",s).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Td.default=bd});var iy=T(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});var IO=Wn(),_d=class extends IO.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:ao?|\xE0s?|das|da|de|do)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:o)?|\\?)\\s*"}};vd.default=_d});var ay=T(Yi=>{"use strict";var FO=Yi&&Yi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yi,"__esModule",{value:!0});var LO=FO(Yr()),wd=class extends LO.default{patternBetween(){return new RegExp("^\\s*(?:,|\xE0)?\\s*$")}};Yi.default=wd});var oy=T(ji=>{"use strict";var UO=ji&&ji.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ji,"__esModule",{value:!0});var qO=UO(Or()),Ed=class extends qO.default{patternBetween(){return/^\s*(?:-)\s*$/i}};ji.default=Ed});var py=T(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});var WO=ut(),dy=Do(),fy=Do(),YO=Oe(),jO=Y(),GO=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*)(${YO.matchAnyPattern(dy.MONTH_DICTIONARY)})(?:\\s*(?:de|,)?\\s*(${fy.YEAR_PATTERN}))?(?=\\W|$)`,"i"),uy=1,ly=2,$O=3,cy=4,kd=class extends jO.AbstractParserWithWordBoundaryChecking{innerPattern(){return GO}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=dy.MONTH_DICTIONARY[t[$O].toLowerCase()],i=parseInt(t[uy]);if(i>31)return t.index=t.index+t[uy].length,null;if(n.start.assign("month",s),n.start.assign("day",i),t[cy]){let a=fy.parseYear(t[cy]);n.start.assign("year",a)}else{let a=WO.findYearClosestToRef(e.refDate,i,s);n.start.imply("year",a)}if(t[ly]){let a=parseInt(t[ly]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Sd.default=kd});var my=T(Br=>{"use strict";var BO=Br&&Br.__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]}),HO=Br&&Br.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),zO=Br&&Br.__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)&&BO(e,r,t);return HO(e,r),e};Object.defineProperty(Br,"__esModule",{value:!0});var VO=Y(),xo=zO($r()),Od=class extends VO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),s=e.createParsingComponents();switch(n){case"agora":return xo.now(e.reference);case"hoje":return xo.today(e.reference);case"amanha":case"amanh\xE3":return xo.tomorrow(e.reference);case"ontem":return xo.yesterday(e.reference)}return s}};Br.default=Od});var hy=T(Gi=>{"use strict";var KO=Gi&&Gi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gi,"__esModule",{value:!0});var Ro=ze(),QO=Y(),XO=Kt(),ZO=KO(be()),Dd=class extends QO.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i}innerExtract(e,t){let n=ZO.default(e.refDate),s=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":s.imply("meridiem",Ro.Meridiem.PM),s.imply("hour",15);break;case"noite":s.imply("meridiem",Ro.Meridiem.PM),s.imply("hour",22);break;case"manha":case"manh\xE3":s.imply("meridiem",Ro.Meridiem.AM),s.imply("hour",6);break;case"meia-noite":XO.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"meio-dia":s.imply("meridiem",Ro.Meridiem.AM),s.imply("hour",12);break}return s}};Gi.default=Dd});var by=T(tt=>{"use strict";var bn=tt&&tt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(tt,"__esModule",{value:!0});tt.createConfiguration=tt.createCasualConfiguration=tt.parseDate=tt.parse=tt.strict=tt.casual=void 0;var JO=jr(),gy=fr(),eD=bn(Gn()),tD=bn(sy()),rD=bn(iy()),nD=bn(ay()),sD=bn(oy()),iD=bn(py()),aD=bn(my()),oD=bn(hy());tt.casual=new gy.Chrono(yy());tt.strict=new gy.Chrono(xd(!0));function uD(r,e,t){return tt.casual.parse(r,e,t)}tt.parse=uD;function lD(r,e,t){return tt.casual.parseDate(r,e,t)}tt.parseDate=lD;function yy(r=!0){let e=xd(!1,r);return e.parsers.push(new aD.default),e.parsers.push(new oD.default),e}tt.createCasualConfiguration=yy;function xd(r=!0,e=!0){return JO.includeCommonConfiguration({parsers:[new eD.default(e),new tD.default,new rD.default,new iD.default],refiners:[new nD.default,new sD.default]},r)}tt.createConfiguration=xd});var Ty=T($i=>{"use strict";var cD=$i&&$i.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($i,"__esModule",{value:!0});var dD=cD(Or()),Rd=class extends dD.default{patternBetween(){return/^\s*(tot|-)\s*$/i}};$i.default=Rd});var _y=T(Bi=>{"use strict";var fD=Bi&&Bi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Bi,"__esModule",{value:!0});var pD=fD(Yr()),Md=class extends pD.default{patternBetween(){return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$")}};Bi.default=Md});var vy=T(Hr=>{"use strict";var mD=Hr&&Hr.__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]}),hD=Hr&&Hr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),gD=Hr&&Hr.__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)&&mD(e,r,t);return hD(e,r),e};Object.defineProperty(Hr,"__esModule",{value:!0});var yD=Y(),Mo=gD($r()),Cd=class extends yD.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(nu|vandaag|morgen|morgend|gisteren)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),s=e.createParsingComponents();switch(n){case"nu":return Mo.now(e.reference);case"vandaag":return Mo.today(e.reference);case"morgen":case"morgend":return Mo.tomorrow(e.reference);case"gisteren":return Mo.yesterday(e.reference)}return s}};Hr.default=Cd});var wy=T(Hi=>{"use strict";var bD=Hi&&Hi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Hi,"__esModule",{value:!0});var Co=ze(),TD=Y(),_D=bD(be()),vD=Kt(),wD=1,ED=2,Ad=class extends TD.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i}innerExtract(e,t){let n=_D.default(e.refDate),s=e.createParsingComponents();switch(t[wD]==="deze"&&(s.assign("day",e.refDate.getDate()),s.assign("month",e.refDate.getMonth()+1),s.assign("year",e.refDate.getFullYear())),t[ED].toLowerCase()){case"namiddag":case"'s namiddags":s.imply("meridiem",Co.Meridiem.PM),s.imply("hour",15);break;case"avond":case"'s avonds'":s.imply("meridiem",Co.Meridiem.PM),s.imply("hour",20);break;case"middernacht":vD.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"ochtend":case"'s ochtends":s.imply("meridiem",Co.Meridiem.AM),s.imply("hour",6);break;case"middag":case"'s middags":s.imply("meridiem",Co.Meridiem.AM),s.imply("hour",12);break}return s}};Hi.default=Ad});var Lt=T(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.parseTimeUnits=de.TIME_UNITS_PATTERN=de.parseYear=de.YEAR_PATTERN=de.parseOrdinalNumberPattern=de.ORDINAL_NUMBER_PATTERN=de.parseNumberPattern=de.NUMBER_PATTERN=de.TIME_UNIT_DICTIONARY=de.ORDINAL_WORD_DICTIONARY=de.INTEGER_WORD_DICTIONARY=de.MONTH_DICTIONARY=de.WEEKDAY_DICTIONARY=void 0;var Ao=Oe(),kD=ut();de.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};de.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};de.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};de.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};de.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"};de.NUMBER_PATTERN=`(?:${Ao.matchAnyPattern(de.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`;function ky(r){let e=r.toLowerCase();return de.INTEGER_WORD_DICTIONARY[e]!==void 0?de.INTEGER_WORD_DICTIONARY[e]:e==="paar"?2:e==="half"||e.match(/halve?/)?.5:parseFloat(e.replace(",","."))}de.parseNumberPattern=ky;de.ORDINAL_NUMBER_PATTERN=`(?:${Ao.matchAnyPattern(de.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`;function SD(r){let e=r.toLowerCase();return de.ORDINAL_WORD_DICTIONARY[e]!==void 0?de.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:ste|de)$/i,""),parseInt(e))}de.parseOrdinalNumberPattern=SD;de.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])";function OD(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 kD.findMostLikelyADYear(e)}de.parseYear=OD;var Sy=`(${de.NUMBER_PATTERN})\\s{0,5}(${Ao.matchAnyPattern(de.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Ey=new RegExp(Sy,"i");de.TIME_UNITS_PATTERN=Ao.repeatedTimeunitPattern("(?:(?:binnen|in)\\s*)?",Sy);function DD(r){let e={},t=r,n=Ey.exec(t);for(;n;)xD(e,n),t=t.substring(n[0].length),n=Ey.exec(t);return e}de.parseTimeUnits=DD;function xD(r,e){let t=ky(e[1]),n=de.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Dy=T(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});var Oy=Lt(),RD=Le(),MD=Y(),Pd=class extends MD.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(?:binnen|in|binnen de|voor)\\s*("+Oy.TIME_UNITS_PATTERN+")(?=\\W|$)","i")}innerExtract(e,t){let n=Oy.parseTimeUnits(t[1]);return RD.ParsingComponents.createRelativeFromReference(e.reference,n)}};Nd.default=Pd});var Ry=T(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var xy=Lt(),CD=Oe(),AD=Y(),PD=jn(),ND=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:op\\s*?)?(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?(${CD.matchAnyPattern(xy.WEEKDAY_DICTIONARY)})(?=\\W|$)`,"i"),ID=1,FD=2,LD=3,Id=class extends AD.AbstractParserWithWordBoundaryChecking{innerPattern(){return ND}innerExtract(e,t){let n=t[FD].toLowerCase(),s=xy.WEEKDAY_DICTIONARY[n],i=t[ID],a=t[LD],o=i||a;o=o||"",o=o.toLowerCase();let u=null;o=="vorige"?u="last":o=="volgende"?u="next":o=="deze"&&(u="this");let l=PD.toDayJSWeekday(e.refDate,s,u);return e.createParsingComponents().assign("weekday",s).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Fd.default=Id});var Iy=T(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var UD=ut(),Py=Lt(),Po=Lt(),Ny=Lt(),qD=Oe(),WD=Y(),YD=new RegExp(`(?:on\\s*?)?(${Po.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:tot|\\-|\\\u2013|until|through|till|\\s)\\s*(${Po.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:of)?\\s*)(`+qD.matchAnyPattern(Py.MONTH_DICTIONARY)+`)(?:(?:-|/|,?\\s*)(${Ny.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),jD=3,My=1,Cy=2,Ay=4,Ld=class extends WD.AbstractParserWithWordBoundaryChecking{innerPattern(){return YD}innerExtract(e,t){let n=Py.MONTH_DICTIONARY[t[jD].toLowerCase()],s=Po.parseOrdinalNumberPattern(t[My]);if(s>31)return t.index=t.index+t[My].length,null;let i=e.createParsingComponents({day:s,month:n});if(t[Ay]){let u=Ny.parseYear(t[Ay]);i.assign("year",u)}else{let u=UD.findYearClosestToRef(e.refDate,s,n);i.imply("year",u)}if(!t[Cy])return i;let a=Po.parseOrdinalNumberPattern(t[Cy]),o=e.createParsingResult(t.index,t[0]);return o.start=i,o.end=i.clone(),o.end.assign("day",a),o}};Ud.default=Ld});var qy=T(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});var Ly=Lt(),GD=ut(),$D=Oe(),Uy=Lt(),BD=Y(),HD=new RegExp(`(${$D.matchAnyPattern(Ly.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${Uy.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),zD=1,Fy=2,qd=class extends BD.AbstractParserWithWordBoundaryChecking{innerPattern(){return HD}innerExtract(e,t){let n=e.createParsingComponents();n.imply("day",1);let s=t[zD],i=Ly.MONTH_DICTIONARY[s.toLowerCase()];if(n.assign("month",i),t[Fy]){let a=Uy.parseYear(t[Fy]);n.assign("year",a)}else{let a=GD.findYearClosestToRef(e.refDate,1,i);n.imply("year",a)}return n}};Wd.default=qd});var Wy=T(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});var VD=Y(),KD=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),QD=1,XD=2,Yd=class extends VD.AbstractParserWithWordBoundaryChecking{innerPattern(){return KD}innerExtract(e,t){let n=parseInt(t[XD]),s=parseInt(t[QD]);return e.createParsingComponents().imply("day",1).assign("month",s).assign("year",n)}};jd.default=Yd});var Yy=T($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});var ZD=Wn(),Gd=class extends ZD.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:om)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|om|\\?)\\s*"}primarySuffix(){return"(?:\\s*(?:uur))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};$d.default=Gd});var $y=T(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});var Gy=Lt(),JD=Oe(),e0=Y(),t0=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${JD.matchAnyPattern(Gy.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),r0=1,n0=2,jy=3,s0=4,Bd=class extends e0.AbstractParserWithWordBoundaryChecking{innerPattern(){return t0}innerExtract(e,t){let n=t[jy]?parseInt(t[jy]):Gy.MONTH_DICTIONARY[t[n0].toLowerCase()];if(n<1||n>12)return null;let s=parseInt(t[r0]);return{day:parseInt(t[s0]),month:n,year:s}}};Hd.default=Bd});var By=T(zi=>{"use strict";var i0=zi&&zi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(zi,"__esModule",{value:!0});var a0=Y(),No=ze(),zd=Kt(),o0=i0(be()),u0=1,l0=2,Vd=class extends a0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i}innerExtract(e,t){let n=t[u0].toLowerCase(),s=t[l0].toLowerCase(),i=e.createParsingComponents(),a=o0.default(e.refDate);switch(n){case"gisteren":zd.assignSimilarDate(i,a.add(-1,"day"));break;case"van":zd.assignSimilarDate(i,a);break;case"morgen":zd.assignTheNextDay(i,a);break}switch(s){case"ochtend":i.imply("meridiem",No.Meridiem.AM),i.imply("hour",6);break;case"middag":i.imply("meridiem",No.Meridiem.AM),i.imply("hour",12);break;case"namiddag":i.imply("meridiem",No.Meridiem.PM),i.imply("hour",15);break;case"avond":i.imply("meridiem",No.Meridiem.PM),i.imply("hour",20);break}return i}};zi.default=Vd});var zy=T(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});var Hy=Lt(),c0=Le(),d0=Y(),f0=Qt(),p0=new RegExp(`(deze|vorige|afgelopen|komende|over|\\+|-)\\s*(${Hy.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Kd=class extends d0.AbstractParserWithWordBoundaryChecking{innerPattern(){return p0}innerExtract(e,t){let n=t[1].toLowerCase(),s=Hy.parseTimeUnits(t[2]);switch(n){case"vorige":case"afgelopen":case"-":s=f0.reverseTimeUnits(s);break}return c0.ParsingComponents.createRelativeFromReference(e.reference,s)}};Qd.default=Kd});var Qy=T(Vi=>{"use strict";var m0=Vi&&Vi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vi,"__esModule",{value:!0});var Ky=Lt(),Vy=Le(),h0=m0(be()),g0=Y(),y0=Oe(),b0=new RegExp(`(dit|deze|komende|volgend|volgende|afgelopen|vorige)\\s*(${y0.matchAnyPattern(Ky.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),T0=1,_0=2,Xd=class extends g0.AbstractParserWithWordBoundaryChecking{innerPattern(){return b0}innerExtract(e,t){let n=t[T0].toLowerCase(),s=t[_0].toLowerCase(),i=Ky.TIME_UNIT_DICTIONARY[s];if(n=="volgend"||n=="volgende"||n=="komende"){let u={};return u[i]=1,Vy.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="afgelopen"||n=="vorige"){let u={};return u[i]=-1,Vy.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=h0.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(/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)):s.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}};Vi.default=Xd});var Xy=T(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});var Jd=Lt(),v0=Le(),w0=Y(),E0=Qt(),k0=new RegExp("("+Jd.TIME_UNITS_PATTERN+")(?:geleden|voor|eerder)(?=(?:\\W|$))","i"),S0=new RegExp("("+Jd.TIME_UNITS_PATTERN+")geleden(?=(?:\\W|$))","i"),Zd=class extends w0.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?S0:k0}innerExtract(e,t){let n=Jd.parseTimeUnits(t[1]),s=E0.reverseTimeUnits(n);return v0.ParsingComponents.createRelativeFromReference(e.reference,s)}};ef.default=Zd});var Zy=T(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});var rf=Lt(),O0=Le(),D0=Y(),x0=new RegExp("("+rf.TIME_UNITS_PATTERN+")(later|na|vanaf nu|voortaan|vooruit|uit)(?=(?:\\W|$))","i"),R0=new RegExp("("+rf.TIME_UNITS_PATTERN+")(later|vanaf nu)(?=(?:\\W|$))","i"),M0=1,tf=class extends D0.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?R0:x0}innerExtract(e,t){let n=rf.parseTimeUnits(t[M0]);return O0.ParsingComponents.createRelativeFromReference(e.reference,n)}};nf.default=tf});var rb=T(rt=>{"use strict";var ct=rt&&rt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(rt,"__esModule",{value:!0});rt.createConfiguration=rt.createCasualConfiguration=rt.parseDate=rt.parse=rt.strict=rt.casual=void 0;var C0=jr(),Jy=fr(),A0=ct(Ty()),P0=ct(_y()),N0=ct(vy()),I0=ct(wy()),F0=ct(Gn()),L0=ct(Dy()),U0=ct(Ry()),q0=ct(Iy()),eb=ct(qy()),W0=ct(Wy()),Y0=ct(Yy()),j0=ct($y()),G0=ct(By()),$0=ct(zy()),B0=ct(Qy()),H0=ct(Xy()),z0=ct(Zy());rt.casual=new Jy.Chrono(tb());rt.strict=new Jy.Chrono(sf(!0));function V0(r,e,t){return rt.casual.parse(r,e,t)}rt.parse=V0;function K0(r,e,t){return rt.casual.parseDate(r,e,t)}rt.parseDate=K0;function tb(r=!0){let e=sf(!1,r);return e.parsers.unshift(new N0.default),e.parsers.unshift(new I0.default),e.parsers.unshift(new G0.default),e.parsers.unshift(new eb.default),e.parsers.unshift(new B0.default),e.parsers.unshift(new $0.default),e}rt.createCasualConfiguration=tb;function sf(r=!0,e=!0){return C0.includeCommonConfiguration({parsers:[new F0.default(e),new L0.default,new q0.default,new eb.default,new U0.default,new j0.default,new W0.default,new Y0.default(r),new H0.default(r),new z0.default(r)],refiners:[new P0.default,new A0.default]},r)}rt.createConfiguration=sf});var ab=T(Ki=>{"use strict";var Q0=Ki&&Ki.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ki,"__esModule",{value:!0});var X0=Q0(be()),Z0=Y(),J0=1,nb=2,ex=3,sb=4,ib=5,tx=6,af=class extends Z0.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,s=e.createParsingResult(n,t[0]),i=X0.default(e.refDate),a=i;if(t[J0])s.start.imply("hour",i.hour()),s.start.imply("minute",i.minute()),s.start.imply("second",i.second()),s.start.imply("millisecond",i.millisecond());else if(t[nb]){let o=t[nb],u=t[ex];o=="\u660E"||o=="\u807D"?i.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"?s.start.imply("hour",6):u=="\u665A"&&(s.start.imply("hour",22),s.start.imply("meridiem",1))}else if(t[sb]){let u=t[sb][0];u=="\u65E9"||u=="\u671D"||u=="\u4E0A"?s.start.imply("hour",6):u=="\u4E0B"||u=="\u664F"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):u=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):u=="\u51CC"&&s.start.imply("hour",0)}else if(t[ib]){let o=t[ib];o=="\u660E"||o=="\u807D"?i.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[tx];if(u){let l=u[0];l=="\u65E9"||l=="\u671D"||l=="\u4E0A"?s.start.imply("hour",6):l=="\u4E0B"||l=="\u664F"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):l=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):l=="\u51CC"&&s.start.imply("hour",0)}}return s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year()),s}};Ki.default=af});var Ms=T(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.zhStringToYear=At.zhStringToNumber=At.WEEKDAY_OFFSET=At.NUMBER=void 0;At.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};At.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function rx(r){let e=0;for(let t=0;t<r.length;t++){let n=r[t];n==="\u5341"?e=e===0?At.NUMBER[n]:e*At.NUMBER[n]:e+=At.NUMBER[n]}return e}At.zhStringToNumber=rx;function nx(r){let e="";for(let t=0;t<r.length;t++){let n=r[t];e=e+At.NUMBER[n]}return parseInt(e)}At.zhStringToYear=nx});var ub=T(Qi=>{"use strict";var sx=Qi&&Qi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qi,"__esModule",{value:!0});var ix=sx(be()),ax=Y(),Hn=Ms(),of=1,ob=2,uf=3,lf=class extends ax.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(Hn.NUMBER).join("")+"]{4}|["+Object.keys(Hn.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(Hn.NUMBER).join("")+"]{1,2})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(Hn.NUMBER).join("")+"]{1,2})?(?:\\s*)(?:\u65E5|\u865F)?")}innerExtract(e,t){let n=ix.default(e.refDate),s=e.createParsingResult(t.index,t[0]),i=parseInt(t[ob]);if(isNaN(i)&&(i=Hn.zhStringToNumber(t[ob])),s.start.assign("month",i),t[uf]){let a=parseInt(t[uf]);isNaN(a)&&(a=Hn.zhStringToNumber(t[uf])),s.start.assign("day",a)}else s.start.imply("day",n.date());if(t[of]){let a=parseInt(t[of]);isNaN(a)&&(a=Hn.zhStringToYear(t[of])),s.start.assign("year",a)}else s.start.imply("year",n.year());return s}};Qi.default=lf});var cb=T(Xi=>{"use strict";var ox=Xi&&Xi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xi,"__esModule",{value:!0});var ux=ox(be()),lx=Y(),lb=Ms(),cx=new RegExp("(\\d+|["+Object.keys(lb.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"),cf=1,dx=2,df=class extends lx.AbstractParserWithWordBoundaryChecking{innerPattern(){return cx}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=parseInt(t[cf]);if(isNaN(s)&&(s=lb.zhStringToNumber(t[cf])),isNaN(s)){let u=t[cf];if(u==="\u5E7E")s=3;else if(u==="\u534A")s=.5;else return null}let i=ux.default(e.refDate),o=t[dx][0];return o.match(/[日天星禮月年]/)?(o=="\u65E5"||o=="\u5929"?i=i.add(s,"d"):o=="\u661F"||o=="\u79AE"?i=i.add(s*7,"d"):o=="\u6708"?i=i.add(s,"month"):o=="\u5E74"&&(i=i.add(s,"year")),n.start.assign("year",i.year()),n.start.assign("month",i.month()+1),n.start.assign("day",i.date()),n):(o=="\u79D2"?i=i.add(s,"second"):o=="\u5206"?i=i.add(s,"minute"):(o=="\u5C0F"||o=="\u9418")&&(i=i.add(s,"hour")),n.start.imply("year",i.year()),n.start.imply("month",i.month()+1),n.start.imply("day",i.date()),n.start.assign("hour",i.hour()),n.start.assign("minute",i.minute()),n.start.assign("second",i.second()),n)}};Xi.default=df});var fb=T(Zi=>{"use strict";var fx=Zi&&Zi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Zi,"__esModule",{value:!0});var px=fx(be()),mx=Y(),db=Ms(),hx=new RegExp("(?<prefix>\u4E0A|\u4ECA|\u4E0B|\u9019|\u5462)(?:\u500B)?(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?<weekday>"+Object.keys(db.WEEKDAY_OFFSET).join("|")+")"),ff=class extends mx.AbstractParserWithWordBoundaryChecking{innerPattern(){return hx}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,i=db.WEEKDAY_OFFSET[s];if(i===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=px.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(i-7),l=!0):a=="next"?(u=u.day(i+7),l=!0):a=="this"?u=u.day(i):Math.abs(i-7-c)<Math.abs(i-c)?u=u.day(i-7):Math.abs(i+7-c)<Math.abs(i-c)?u=u.day(i+7):u=u.day(i),n.start.assign("weekday",i),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}};Zi.default=ff});var pb=T(Ji=>{"use strict";var gx=Ji&&Ji.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ji,"__esModule",{value:!0});var yx=gx(be()),bx=Y(),Jt=Ms(),Tx=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(Jt.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Jt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Jt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),_x=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(Jt.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Jt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Jt.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Io=1,Fo=2,Lo=3,Uo=4,qo=5,Wo=6,Zt=7,Cs=8,Yo=9,pf=class extends bx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Tx}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=yx.default(e.refDate),s=e.createParsingResult(t.index,t[0]),i=n.clone();if(t[Io]){var a=t[Io];a=="\u660E"||a=="\u807D"?n.hour()>1&&i.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?i.add(-1,"day"):a=="\u524D"?i.add(-2,"day"):a=="\u5927\u524D"?i.add(-3,"day"):a=="\u5F8C"?i.add(2,"day"):a=="\u5927\u5F8C"&&i.add(3,"day"),s.start.assign("day",i.date()),s.start.assign("month",i.month()+1),s.start.assign("year",i.year())}else if(t[Uo]){var o=t[Uo];o=="\u660E"||o=="\u807D"?i.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?i.add(-1,"day"):o=="\u524D"?i.add(-2,"day"):o=="\u5927\u524D"?i.add(-3,"day"):o=="\u5F8C"?i.add(2,"day"):o=="\u5927\u5F8C"&&i.add(3,"day"),s.start.assign("day",i.date()),s.start.assign("month",i.month()+1),s.start.assign("year",i.year())}else s.start.imply("day",i.date()),s.start.imply("month",i.month()+1),s.start.imply("year",i.year());let u=0,l=0,c=-1;if(t[Cs]){var f=parseInt(t[Cs]);if(isNaN(f)&&(f=Jt.zhStringToNumber(t[Cs])),f>=60)return null;s.start.assign("second",f)}if(u=parseInt(t[Wo]),isNaN(u)&&(u=Jt.zhStringToNumber(t[Wo])),t[Zt]?t[Zt]=="\u534A"?l=30:t[Zt]=="\u6B63"||t[Zt]=="\u6574"?l=0:(l=parseInt(t[Zt]),isNaN(l)&&(l=Jt.zhStringToNumber(t[Zt]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[Yo]){if(u>12)return null;var m=t[Yo][0].toLowerCase();m=="a"&&(c=0,u==12&&(u=0)),m=="p"&&(c=1,u!=12&&(u+=12))}else if(t[Fo]){var y=t[Fo],k=y[0];k=="\u671D"||k=="\u65E9"?(c=0,u==12&&(u=0)):k=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[Lo]){var E=t[Lo],x=E[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))}else if(t[qo]){var v=t[qo],I=v[0];I=="\u4E0A"||I=="\u671D"||I=="\u65E9"||I=="\u51CC"?(c=0,u==12&&(u=0)):(I=="\u4E0B"||I=="\u664F"||I=="\u665A")&&(c=1,u!=12&&(u+=12))}if(s.start.assign("hour",u),s.start.assign("minute",l),c>=0?s.start.assign("meridiem",c):u<12?s.start.imply("meridiem",0):s.start.imply("meridiem",1),t=_x.exec(e.text.substring(s.index+s.text.length)),!t)return s.text.match(/^\d+$/)?null:s;let F=i.clone();if(s.end=e.createParsingComponents(),t[Io]){var a=t[Io];a=="\u660E"||a=="\u807D"?n.hour()>1&&F.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?F.add(-1,"day"):a=="\u524D"?F.add(-2,"day"):a=="\u5927\u524D"?F.add(-3,"day"):a=="\u5F8C"?F.add(2,"day"):a=="\u5927\u5F8C"&&F.add(3,"day"),s.end.assign("day",F.date()),s.end.assign("month",F.month()+1),s.end.assign("year",F.year())}else if(t[Uo]){var o=t[Uo];o=="\u660E"||o=="\u807D"?F.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?F.add(-1,"day"):o=="\u524D"?F.add(-2,"day"):o=="\u5927\u524D"?F.add(-3,"day"):o=="\u5F8C"?F.add(2,"day"):o=="\u5927\u5F8C"&&F.add(3,"day"),s.end.assign("day",F.date()),s.end.assign("month",F.month()+1),s.end.assign("year",F.year())}else s.end.imply("day",F.date()),s.end.imply("month",F.month()+1),s.end.imply("year",F.year());if(u=0,l=0,c=-1,t[Cs]){var f=parseInt(t[Cs]);if(isNaN(f)&&(f=Jt.zhStringToNumber(t[Cs])),f>=60)return null;s.end.assign("second",f)}if(u=parseInt(t[Wo]),isNaN(u)&&(u=Jt.zhStringToNumber(t[Wo])),t[Zt]?t[Zt]=="\u534A"?l=30:t[Zt]=="\u6B63"||t[Zt]=="\u6574"?l=0:(l=parseInt(t[Zt]),isNaN(l)&&(l=Jt.zhStringToNumber(t[Zt]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[Yo]){if(u>12)return null;var m=t[Yo][0].toLowerCase();m=="a"&&(c=0,u==12&&(u=0)),m=="p"&&(c=1,u!=12&&(u+=12)),s.start.isCertain("meridiem")||(c==0?(s.start.imply("meridiem",0),s.start.get("hour")==12&&s.start.assign("hour",0)):(s.start.imply("meridiem",1),s.start.get("hour")!=12&&s.start.assign("hour",s.start.get("hour")+12)))}else if(t[Fo]){var y=t[Fo],k=y[0];k=="\u671D"||k=="\u65E9"?(c=0,u==12&&(u=0)):k=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[Lo]){var E=t[Lo],x=E[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))}else if(t[qo]){var v=t[qo],I=v[0];I=="\u4E0A"||I=="\u671D"||I=="\u65E9"||I=="\u51CC"?(c=0,u==12&&(u=0)):(I=="\u4E0B"||I=="\u664F"||I=="\u665A")&&(c=1,u!=12&&(u+=12))}return s.text=s.text+t[0],s.end.assign("hour",u),s.end.assign("minute",l),c>=0?s.end.assign("meridiem",c):s.start.isCertain("meridiem")&&s.start.get("meridiem")==1&&s.start.get("hour")>u?s.end.imply("meridiem",0):u>12&&s.end.imply("meridiem",1),s.end.date().getTime()<s.start.date().getTime()&&s.end.imply("day",s.end.get("day")+1),s}};Ji.default=pf});var hb=T(ea=>{"use strict";var vx=ea&&ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ea,"__esModule",{value:!0});var wx=vx(be()),Ex=Y(),mb=Ms(),kx=new RegExp("(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?<weekday>"+Object.keys(mb.WEEKDAY_OFFSET).join("|")+")"),mf=class extends Ex.AbstractParserWithWordBoundaryChecking{innerPattern(){return kx}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,i=mb.WEEKDAY_OFFSET[s];if(i===void 0)return null;let a=wx.default(e.refDate),o=!1,u=a.day();return Math.abs(i-7-u)<Math.abs(i-u)?a=a.day(i-7):Math.abs(i+7-u)<Math.abs(i-u)?a=a.day(i+7):a=a.day(i),n.start.assign("weekday",i),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}};ea.default=mf});var gb=T(ta=>{"use strict";var Sx=ta&&ta.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ta,"__esModule",{value:!0});var Ox=Sx(Or()),hf=class extends Ox.default{patternBetween(){return/^\s*(至|到|\-|\~|||ー)\s*$/i}};ta.default=hf});var yb=T(ra=>{"use strict";var Dx=ra&&ra.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ra,"__esModule",{value:!0});var xx=Dx(Yr()),gf=class extends xx.default{patternBetween(){return/^\s*$/i}};ra.default=gf});var bb=T($e=>{"use strict";var zr=$e&&$e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($e,"__esModule",{value:!0});$e.createConfiguration=$e.createCasualConfiguration=$e.parseDate=$e.parse=$e.strict=$e.casual=$e.hant=void 0;var yf=fr(),Rx=zr(yo()),Mx=jr(),Cx=zr(ab()),Ax=zr(ub()),Px=zr(cb()),Nx=zr(fb()),Ix=zr(pb()),Fx=zr(hb()),Lx=zr(gb()),Ux=zr(yb());$e.hant=new yf.Chrono(bf());$e.casual=new yf.Chrono(bf());$e.strict=new yf.Chrono(Tf());function qx(r,e,t){return $e.casual.parse(r,e,t)}$e.parse=qx;function Wx(r,e,t){return $e.casual.parseDate(r,e,t)}$e.parseDate=Wx;function bf(){let r=Tf();return r.parsers.unshift(new Cx.default),r}$e.createCasualConfiguration=bf;function Tf(){let r=Mx.includeCommonConfiguration({parsers:[new Ax.default,new Nx.default,new Fx.default,new Ix.default,new Px.default],refiners:[new Lx.default,new Ux.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof Rx.default)),r}$e.createConfiguration=Tf});var wb=T(na=>{"use strict";var Yx=na&&na.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(na,"__esModule",{value:!0});var jx=Yx(be()),Gx=Y(),$x=1,Tb=2,Bx=3,_b=4,vb=5,Hx=6,_f=class extends Gx.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,s=e.createParsingResult(n,t[0]),i=jx.default(e.refDate),a=i;if(t[$x])s.start.imply("hour",i.hour()),s.start.imply("minute",i.minute()),s.start.imply("second",i.second()),s.start.imply("millisecond",i.millisecond());else if(t[Tb]){let o=t[Tb],u=t[Bx];o=="\u660E"?i.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"?s.start.imply("hour",6):u=="\u665A"&&(s.start.imply("hour",22),s.start.imply("meridiem",1))}else if(t[_b]){let u=t[_b][0];u=="\u65E9"||u=="\u4E0A"?s.start.imply("hour",6):u=="\u4E0B"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):u=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):u=="\u51CC"&&s.start.imply("hour",0)}else if(t[vb]){let o=t[vb];o=="\u660E"?i.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[Hx];if(u){let l=u[0];l=="\u65E9"||l=="\u4E0A"?s.start.imply("hour",6):l=="\u4E0B"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):l=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):l=="\u51CC"&&s.start.imply("hour",0)}}return s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year()),s}};na.default=_f});var As=T(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.zhStringToYear=Pt.zhStringToNumber=Pt.WEEKDAY_OFFSET=Pt.NUMBER=void 0;Pt.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};Pt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function zx(r){let e=0;for(let t=0;t<r.length;t++){let n=r[t];n==="\u5341"?e=e===0?Pt.NUMBER[n]:e*Pt.NUMBER[n]:e+=Pt.NUMBER[n]}return e}Pt.zhStringToNumber=zx;function Vx(r){let e="";for(let t=0;t<r.length;t++){let n=r[t];e=e+Pt.NUMBER[n]}return parseInt(e)}Pt.zhStringToYear=Vx});var kb=T(sa=>{"use strict";var Kx=sa&&sa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(sa,"__esModule",{value:!0});var Qx=Kx(be()),Xx=Y(),zn=As(),vf=1,Eb=2,wf=3,Ef=class extends Xx.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(zn.NUMBER).join("")+"]{4}|["+Object.keys(zn.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(zn.NUMBER).join("")+"]{1,3})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(zn.NUMBER).join("")+"]{1,3})?(?:\\s*)(?:\u65E5|\u53F7)?")}innerExtract(e,t){let n=Qx.default(e.refDate),s=e.createParsingResult(t.index,t[0]),i=parseInt(t[Eb]);if(isNaN(i)&&(i=zn.zhStringToNumber(t[Eb])),s.start.assign("month",i),t[wf]){let a=parseInt(t[wf]);isNaN(a)&&(a=zn.zhStringToNumber(t[wf])),s.start.assign("day",a)}else s.start.imply("day",n.date());if(t[vf]){let a=parseInt(t[vf]);isNaN(a)&&(a=zn.zhStringToYear(t[vf])),s.start.assign("year",a)}else s.start.imply("year",n.year());return s}};sa.default=Ef});var Ob=T(ia=>{"use strict";var Zx=ia&&ia.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ia,"__esModule",{value:!0});var Jx=Zx(be()),eR=Y(),Sb=As(),tR=new RegExp("(\\d+|["+Object.keys(Sb.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"),kf=1,rR=2,Sf=class extends eR.AbstractParserWithWordBoundaryChecking{innerPattern(){return tR}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=parseInt(t[kf]);if(isNaN(s)&&(s=Sb.zhStringToNumber(t[kf])),isNaN(s)){let u=t[kf];if(u==="\u51E0")s=3;else if(u==="\u534A")s=.5;else return null}let i=Jx.default(e.refDate),o=t[rR][0];return o.match(/[日天星礼月年]/)?(o=="\u65E5"||o=="\u5929"?i=i.add(s,"d"):o=="\u661F"||o=="\u793C"?i=i.add(s*7,"d"):o=="\u6708"?i=i.add(s,"month"):o=="\u5E74"&&(i=i.add(s,"year")),n.start.assign("year",i.year()),n.start.assign("month",i.month()+1),n.start.assign("day",i.date()),n):(o=="\u79D2"?i=i.add(s,"second"):o=="\u5206"?i=i.add(s,"minute"):(o=="\u5C0F"||o=="\u949F")&&(i=i.add(s,"hour")),n.start.imply("year",i.year()),n.start.imply("month",i.month()+1),n.start.imply("day",i.date()),n.start.assign("hour",i.hour()),n.start.assign("minute",i.minute()),n.start.assign("second",i.second()),n)}};ia.default=Sf});var xb=T(aa=>{"use strict";var nR=aa&&aa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(aa,"__esModule",{value:!0});var sR=nR(be()),iR=Y(),Db=As(),aR=new RegExp("(?<prefix>\u4E0A|\u4E0B|\u8FD9)(?:\u4E2A)?(?:\u661F\u671F|\u793C\u62DC|\u5468)(?<weekday>"+Object.keys(Db.WEEKDAY_OFFSET).join("|")+")"),Of=class extends iR.AbstractParserWithWordBoundaryChecking{innerPattern(){return aR}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,i=Db.WEEKDAY_OFFSET[s];if(i===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=sR.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(i-7),l=!0):a=="next"?(u=u.day(i+7),l=!0):a=="this"?u=u.day(i):Math.abs(i-7-c)<Math.abs(i-c)?u=u.day(i-7):Math.abs(i+7-c)<Math.abs(i-c)?u=u.day(i+7):u=u.day(i),n.start.assign("weekday",i),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}};aa.default=Of});var Rb=T(oa=>{"use strict";var oR=oa&&oa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oa,"__esModule",{value:!0});var uR=oR(be()),lR=Y(),tr=As(),cR=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(tr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(tr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(tr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),dR=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(tr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(tr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(tr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),jo=1,Go=2,$o=3,Bo=4,Ho=5,zo=6,er=7,Ps=8,Vo=9,Df=class extends lR.AbstractParserWithWordBoundaryChecking{innerPattern(){return cR}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=uR.default(e.refDate),s=e.createParsingResult(t.index,t[0]),i=n.clone();if(t[jo]){let c=t[jo];c=="\u660E"?n.hour()>1&&i.add(1,"day"):c=="\u6628"?i.add(-1,"day"):c=="\u524D"?i.add(-2,"day"):c=="\u5927\u524D"?i.add(-3,"day"):c=="\u540E"?i.add(2,"day"):c=="\u5927\u540E"&&i.add(3,"day"),s.start.assign("day",i.date()),s.start.assign("month",i.month()+1),s.start.assign("year",i.year())}else if(t[Bo]){let c=t[Bo];c=="\u660E"?i.add(1,"day"):c=="\u6628"?i.add(-1,"day"):c=="\u524D"?i.add(-2,"day"):c=="\u5927\u524D"?i.add(-3,"day"):c=="\u540E"?i.add(2,"day"):c=="\u5927\u540E"&&i.add(3,"day"),s.start.assign("day",i.date()),s.start.assign("month",i.month()+1),s.start.assign("year",i.year())}else s.start.imply("day",i.date()),s.start.imply("month",i.month()+1),s.start.imply("year",i.year());let a=0,o=0,u=-1;if(t[Ps]){let c=parseInt(t[Ps]);if(isNaN(c)&&(c=tr.zhStringToNumber(t[Ps])),c>=60)return null;s.start.assign("second",c)}if(a=parseInt(t[zo]),isNaN(a)&&(a=tr.zhStringToNumber(t[zo])),t[er]?t[er]=="\u534A"?o=30:t[er]=="\u6B63"||t[er]=="\u6574"?o=0:(o=parseInt(t[er]),isNaN(o)&&(o=tr.zhStringToNumber(t[er]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[Vo]){if(a>12)return null;let c=t[Vo][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12))}else if(t[Go]){let f=t[Go][0];f=="\u65E9"?(u=0,a==12&&(a=0)):f=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[$o]){let f=t[$o][0];f=="\u4E0A"||f=="\u65E9"||f=="\u51CC"?(u=0,a==12&&(a=0)):(f=="\u4E0B"||f=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[Ho]){let f=t[Ho][0];f=="\u4E0A"||f=="\u65E9"||f=="\u51CC"?(u=0,a==12&&(a=0)):(f=="\u4E0B"||f=="\u665A")&&(u=1,a!=12&&(a+=12))}if(s.start.assign("hour",a),s.start.assign("minute",o),u>=0?s.start.assign("meridiem",u):a<12?s.start.imply("meridiem",0):s.start.imply("meridiem",1),t=dR.exec(e.text.substring(s.index+s.text.length)),!t)return s.text.match(/^\d+$/)?null:s;let l=i.clone();if(s.end=e.createParsingComponents(),t[jo]){let c=t[jo];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"),s.end.assign("day",l.date()),s.end.assign("month",l.month()+1),s.end.assign("year",l.year())}else if(t[Bo]){let c=t[Bo];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"),s.end.assign("day",l.date()),s.end.assign("month",l.month()+1),s.end.assign("year",l.year())}else s.end.imply("day",l.date()),s.end.imply("month",l.month()+1),s.end.imply("year",l.year());if(a=0,o=0,u=-1,t[Ps]){let c=parseInt(t[Ps]);if(isNaN(c)&&(c=tr.zhStringToNumber(t[Ps])),c>=60)return null;s.end.assign("second",c)}if(a=parseInt(t[zo]),isNaN(a)&&(a=tr.zhStringToNumber(t[zo])),t[er]?t[er]=="\u534A"?o=30:t[er]=="\u6B63"||t[er]=="\u6574"?o=0:(o=parseInt(t[er]),isNaN(o)&&(o=tr.zhStringToNumber(t[er]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[Vo]){if(a>12)return null;let c=t[Vo][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12)),s.start.isCertain("meridiem")||(u==0?(s.start.imply("meridiem",0),s.start.get("hour")==12&&s.start.assign("hour",0)):(s.start.imply("meridiem",1),s.start.get("hour")!=12&&s.start.assign("hour",s.start.get("hour")+12)))}else if(t[Go]){let f=t[Go][0];f=="\u65E9"?(u=0,a==12&&(a=0)):f=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[$o]){let f=t[$o][0];f=="\u4E0A"||f=="\u65E9"||f=="\u51CC"?(u=0,a==12&&(a=0)):(f=="\u4E0B"||f=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[Ho]){let f=t[Ho][0];f=="\u4E0A"||f=="\u65E9"||f=="\u51CC"?(u=0,a==12&&(a=0)):(f=="\u4E0B"||f=="\u665A")&&(u=1,a!=12&&(a+=12))}return s.text=s.text+t[0],s.end.assign("hour",a),s.end.assign("minute",o),u>=0?s.end.assign("meridiem",u):s.start.isCertain("meridiem")&&s.start.get("meridiem")==1&&s.start.get("hour")>a?s.end.imply("meridiem",0):a>12&&s.end.imply("meridiem",1),s.end.date().getTime()<s.start.date().getTime()&&s.end.imply("day",s.end.get("day")+1),s}};oa.default=Df});var Cb=T(ua=>{"use strict";var fR=ua&&ua.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ua,"__esModule",{value:!0});var pR=fR(be()),mR=Y(),Mb=As(),hR=new RegExp("(?:\u661F\u671F|\u793C\u62DC|\u5468)(?<weekday>"+Object.keys(Mb.WEEKDAY_OFFSET).join("|")+")"),xf=class extends mR.AbstractParserWithWordBoundaryChecking{innerPattern(){return hR}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,i=Mb.WEEKDAY_OFFSET[s];if(i===void 0)return null;let a=pR.default(e.refDate),o=!1,u=a.day();return Math.abs(i-7-u)<Math.abs(i-u)?a=a.day(i-7):Math.abs(i+7-u)<Math.abs(i-u)?a=a.day(i+7):a=a.day(i),n.start.assign("weekday",i),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}};ua.default=xf});var Ab=T(la=>{"use strict";var gR=la&&la.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(la,"__esModule",{value:!0});var yR=gR(Or()),Rf=class extends yR.default{patternBetween(){return/^\s*(至|到|-|~|||ー)\s*$/i}};la.default=Rf});var Pb=T(ca=>{"use strict";var bR=ca&&ca.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ca,"__esModule",{value:!0});var TR=bR(Yr()),Mf=class extends TR.default{patternBetween(){return/^\s*$/i}};ca.default=Mf});var Nb=T(Be=>{"use strict";var Vr=Be&&Be.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Be,"__esModule",{value:!0});Be.createConfiguration=Be.createCasualConfiguration=Be.parseDate=Be.parse=Be.strict=Be.casual=Be.hans=void 0;var Cf=fr(),_R=Vr(yo()),vR=jr(),wR=Vr(wb()),ER=Vr(kb()),kR=Vr(Ob()),SR=Vr(xb()),OR=Vr(Rb()),DR=Vr(Cb()),xR=Vr(Ab()),RR=Vr(Pb());Be.hans=new Cf.Chrono(Af());Be.casual=new Cf.Chrono(Af());Be.strict=new Cf.Chrono(Pf());function MR(r,e,t){return Be.casual.parse(r,e,t)}Be.parse=MR;function CR(r,e,t){return Be.casual.parseDate(r,e,t)}Be.parseDate=CR;function Af(){let r=Pf();return r.parsers.unshift(new wR.default),r}Be.createCasualConfiguration=Af;function Pf(){let r=vR.includeCommonConfiguration({parsers:[new ER.default,new SR.default,new DR.default,new OR.default,new kR.default],refiners:[new xR.default,new RR.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof _R.default)),r}Be.createConfiguration=Pf});var Fb=T(Ut=>{"use strict";var Ib=Ut&&Ut.__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]}),AR=Ut&&Ut.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),PR=Ut&&Ut.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Ib(e,r,t)},NR=Ut&&Ut.__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)&&Ib(e,r,t);return AR(e,r),e};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.hans=void 0;PR(bb(),Ut);Ut.hans=NR(Nb())});var Nt=T(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.parseTimeUnits=ee.TIME_UNITS_PATTERN=ee.parseYear=ee.YEAR_PATTERN=ee.parseOrdinalNumberPattern=ee.ORDINAL_NUMBER_PATTERN=ee.parseNumberPattern=ee.NUMBER_PATTERN=ee.TIME_UNIT_DICTIONARY=ee.ORDINAL_WORD_DICTIONARY=ee.INTEGER_WORD_DICTIONARY=ee.MONTH_DICTIONARY=ee.FULL_MONTH_NAME_DICTIONARY=ee.WEEKDAY_DICTIONARY=ee.REGEX_PARTS=void 0;var Ko=Oe(),IR=ut();ee.REGEX_PARTS={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"};ee.WEEKDAY_DICTIONARY={\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435:0,\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u044F:0,\u0432\u0441\u043A:0,"\u0432\u0441\u043A.":0,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A:1,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A\u0430:1,\u043F\u043D:1,"\u043F\u043D.":1,\u0432\u0442\u043E\u0440\u043D\u0438\u043A:2,\u0432\u0442\u043E\u0440\u043D\u0438\u043A\u0430:2,\u0432\u0442:2,"\u0432\u0442.":2,\u0441\u0440\u0435\u0434\u0430:3,\u0441\u0440\u0435\u0434\u044B:3,\u0441\u0440\u0435\u0434\u0443:3,\u0441\u0440:3,"\u0441\u0440.":3,\u0447\u0435\u0442\u0432\u0435\u0440\u0433:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430:4,\u0447\u0442:4,"\u0447\u0442.":4,\u043F\u044F\u0442\u043D\u0438\u0446\u0430:5,\u043F\u044F\u0442\u043D\u0438\u0446\u0443:5,\u043F\u044F\u0442\u043D\u0438\u0446\u044B:5,\u043F\u0442:5,"\u043F\u0442.":5,\u0441\u0443\u0431\u0431\u043E\u0442\u0430:6,\u0441\u0443\u0431\u0431\u043E\u0442\u0443:6,\u0441\u0443\u0431\u0431\u043E\u0442\u044B:6,\u0441\u0431:6,"\u0441\u0431.":6};ee.FULL_MONTH_NAME_DICTIONARY={\u044F\u043D\u0432\u0430\u0440\u044C:1,\u044F\u043D\u0432\u0430\u0440\u044F:1,\u044F\u043D\u0432\u0430\u0440\u0435:1,\u0444\u0435\u0432\u0440\u044F\u043B\u044C:2,\u0444\u0435\u0432\u0440\u044F\u043B\u044F:2,\u0444\u0435\u0432\u0440\u044F\u043B\u0435:2,\u043C\u0430\u0440\u0442:3,\u043C\u0430\u0440\u0442\u0430:3,\u043C\u0430\u0440\u0442\u0435:3,\u0430\u043F\u0440\u0435\u043B\u044C:4,\u0430\u043F\u0440\u0435\u043B\u044F:4,\u0430\u043F\u0440\u0435\u043B\u0435:4,\u043C\u0430\u0439:5,\u043C\u0430\u044F:5,\u043C\u0430\u0435:5,\u0438\u044E\u043D\u044C:6,\u0438\u044E\u043D\u044F:6,\u0438\u044E\u043D\u0435:6,\u0438\u044E\u043B\u044C:7,\u0438\u044E\u043B\u044F:7,\u0438\u044E\u043B\u0435:7,\u0430\u0432\u0433\u0443\u0441\u0442:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0430:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0435:8,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044C:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044F:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u0435:9,\u043E\u043A\u0442\u044F\u0431\u0440\u044C:10,\u043E\u043A\u0442\u044F\u0431\u0440\u044F:10,\u043E\u043A\u0442\u044F\u0431\u0440\u0435:10,\u043D\u043E\u044F\u0431\u0440\u044C:11,\u043D\u043E\u044F\u0431\u0440\u044F:11,\u043D\u043E\u044F\u0431\u0440\u0435:11,\u0434\u0435\u043A\u0430\u0431\u0440\u044C:12,\u0434\u0435\u043A\u0430\u0431\u0440\u044F:12,\u0434\u0435\u043A\u0430\u0431\u0440\u0435:12};ee.MONTH_DICTIONARY=Object.assign(Object.assign({},ee.FULL_MONTH_NAME_DICTIONARY),{\u044F\u043D\u0432:1,"\u044F\u043D\u0432.":1,\u0444\u0435\u0432:2,"\u0444\u0435\u0432.":2,\u043C\u0430\u0440:3,"\u043C\u0430\u0440.":3,\u0430\u043F\u0440:4,"\u0430\u043F\u0440.":4,\u0430\u0432\u0433:8,"\u0430\u0432\u0433.":8,\u0441\u0435\u043D:9,"\u0441\u0435\u043D.":9,\u043E\u043A\u0442:10,"\u043E\u043A\u0442.":10,\u043D\u043E\u044F:11,"\u043D\u043E\u044F.":11,\u0434\u0435\u043A:12,"\u0434\u0435\u043A.":12});ee.INTEGER_WORD_DICTIONARY={\u043E\u0434\u0438\u043D:1,\u043E\u0434\u043D\u0430:1,\u043E\u0434\u043D\u043E\u0439:1,\u043E\u0434\u043D\u0443:1,\u0434\u0432\u0435:2,\u0434\u0432\u0430:2,\u0434\u0432\u0443\u0445:2,\u0442\u0440\u0438:3,\u0442\u0440\u0435\u0445:3,\u0442\u0440\u0451\u0445:3,\u0447\u0435\u0442\u044B\u0440\u0435:4,\u0447\u0435\u0442\u044B\u0440\u0435\u0445:4,\u0447\u0435\u0442\u044B\u0440\u0451\u0445:4,\u043F\u044F\u0442\u044C:5,\u043F\u044F\u0442\u0438:5,\u0448\u0435\u0441\u0442\u044C:6,\u0448\u0435\u0441\u0442\u0438:6,\u0441\u0435\u043C\u044C:7,\u0441\u0435\u043C\u0438:7,\u0432\u043E\u0441\u0435\u043C\u044C:8,\u0432\u043E\u0441\u0435\u043C\u044C\u043C\u0438:8,\u0434\u0435\u0432\u044F\u0442\u044C:9,\u0434\u0435\u0432\u044F\u0442\u0438:9,\u0434\u0435\u0441\u044F\u0442\u044C:10,\u0434\u0435\u0441\u044F\u0442\u0438:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u044C:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u0438:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u044C:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u0438:12};ee.ORDINAL_WORD_DICTIONARY={\u043F\u0435\u0440\u0432\u043E\u0435:1,\u043F\u0435\u0440\u0432\u043E\u0433\u043E:1,\u0432\u0442\u043E\u0440\u043E\u0435:2,\u0432\u0442\u043E\u0440\u043E\u0433\u043E:2,\u0442\u0440\u0435\u0442\u044C\u0435:3,\u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E:3,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E:4,\u043F\u044F\u0442\u043E\u0435:5,\u043F\u044F\u0442\u043E\u0433\u043E:5,\u0448\u0435\u0441\u0442\u043E\u0435:6,\u0448\u0435\u0441\u0442\u043E\u0433\u043E:6,\u0441\u0435\u0434\u044C\u043C\u043E\u0435:7,\u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E:7,\u0432\u043E\u0441\u044C\u043C\u043E\u0435:8,\u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E:8,\u0434\u0435\u0432\u044F\u0442\u043E\u0435:9,\u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E:9,\u0434\u0435\u0441\u044F\u0442\u043E\u0435:10,\u0434\u0435\u0441\u044F\u0442\u043E\u0433\u043E:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:12,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:13,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:13,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:14,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:14,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:15,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:15,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:16,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:16,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:17,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:17,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:18,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:18,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:19,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:19,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0435:20,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:20,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0435":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0433\u043E":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0435":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0433\u043E":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0435":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0433\u043E":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0435":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0435":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0435":29,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E":29,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0435:30,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0433\u043E:30,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":31,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":31};ee.TIME_UNIT_DICTIONARY={\u0441\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u044B:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0443:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0443:"second",\u043C\u0438\u043D:"minute",\u043C\u0438\u043D\u0443\u0442\u0430:"minute",\u043C\u0438\u043D\u0443\u0442:"minute",\u043C\u0438\u043D\u0443\u0442\u044B:"minute",\u043C\u0438\u043D\u0443\u0442\u0443:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u043A:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0438:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0443:"minute",\u0447\u0430\u0441:"hour",\u0447\u0430\u0441\u043E\u0432:"hour",\u0447\u0430\u0441\u0430:"hour",\u0447\u0430\u0441\u0443:"hour",\u0447\u0430\u0441\u0438\u043A\u043E\u0432:"hour",\u0447\u0430\u0441\u0438\u043A\u0430:"hour",\u0447\u0430\u0441\u0438\u043A\u0435:"hour",\u0447\u0430\u0441\u0438\u043A:"hour",\u0434\u0435\u043D\u044C:"d",\u0434\u043D\u044F:"d",\u0434\u043D\u0435\u0439:"d",\u0441\u0443\u0442\u043E\u043A:"d",\u0441\u0443\u0442\u043A\u0438:"d",\u043D\u0435\u0434\u0435\u043B\u044F:"week",\u043D\u0435\u0434\u0435\u043B\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u044E:"week",\u043D\u0435\u0434\u0435\u043B\u044C:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u0435\u043A:"week",\u043C\u0435\u0441\u044F\u0446:"month",\u043C\u0435\u0441\u044F\u0446\u0435:"month",\u043C\u0435\u0441\u044F\u0446\u0435\u0432:"month",\u043C\u0435\u0441\u044F\u0446\u0430:"month",\u043A\u0432\u0430\u0440\u0442\u0430\u043B:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0435:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u043E\u0432:"quarter",\u0433\u043E\u0434:"year",\u0433\u043E\u0434\u0430:"year",\u0433\u043E\u0434\u0443:"year",\u0433\u043E\u0434\u043E\u0432:"year",\u043B\u0435\u0442:"year",\u0433\u043E\u0434\u0438\u043A:"year",\u0433\u043E\u0434\u0438\u043A\u0430:"year",\u0433\u043E\u0434\u0438\u043A\u043E\u0432:"year"};ee.NUMBER_PATTERN=`(?:${Ko.matchAnyPattern(ee.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|\u043F\u043E\u043B|\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E|\u043F\u0430\u0440(?:\u044B|\u0443)|\\s{0,3})`;function Ub(r){let e=r.toLowerCase();return ee.INTEGER_WORD_DICTIONARY[e]!==void 0?ee.INTEGER_WORD_DICTIONARY[e]:e.match(/несколько/)?3:e.match(/пол/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}ee.parseNumberPattern=Ub;ee.ORDINAL_NUMBER_PATTERN=`(?:${Ko.matchAnyPattern(ee.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435|\u043E\u0435)?)`;function FR(r){let e=r.toLowerCase();return ee.ORDINAL_WORD_DICTIONARY[e]!==void 0?ee.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}ee.parseOrdinalNumberPattern=FR;var Nf="(?:\\s+(?:\u0433\u043E\u0434\u0443|\u0433\u043E\u0434\u0430|\u0433\u043E\u0434|\u0433|\u0433.))?";ee.YEAR_PATTERN=`(?:[1-9][0-9]{0,3}${Nf}\\s*(?:\u043D.\u044D.|\u0434\u043E \u043D.\u044D.|\u043D. \u044D.|\u0434\u043E \u043D. \u044D.)|[1-2][0-9]{3}${Nf}|[5-9][0-9]${Nf})`;function LR(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 IR.findMostLikelyADYear(e)}ee.parseYear=LR;var qb=`(${ee.NUMBER_PATTERN})\\s{0,3}(${Ko.matchAnyPattern(ee.TIME_UNIT_DICTIONARY)})`,Lb=new RegExp(qb,"i");ee.TIME_UNITS_PATTERN=Ko.repeatedTimeunitPattern("(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s{0,3})?",qb);function UR(r){let e={},t=r,n=Lb.exec(t);for(;n;)qR(e,n),t=t.substring(n[0].length).trim(),n=Lb.exec(t);return e}ee.parseTimeUnits=UR;function qR(r,e){let t=Ub(e[1]),n=ee.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Yb=T(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});var da=Nt(),WR=Le(),YR=Y(),Wb=`(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s*(?:~\\s*)?)?(${da.TIME_UNITS_PATTERN})${da.REGEX_PARTS.rightBoundary}`,jR=new RegExp(`(?:\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435|\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0438)\\s*${Wb}`,da.REGEX_PARTS.flags),GR=new RegExp(Wb,"i"),If=class extends YR.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return da.REGEX_PARTS.leftBoundary}innerPattern(e){return e.option.forwardDate?GR:jR}innerExtract(e,t){let n=da.parseTimeUnits(t[1]);return WR.ParsingComponents.createRelativeFromReference(e.reference,n)}};Ff.default=If});var Hb=T(Uf=>{"use strict";Object.defineProperty(Uf,"__esModule",{value:!0});var $R=ut(),fa=Nt(),Bb=Nt(),Qo=Nt(),BR=Oe(),HR=Y(),zR=new RegExp(`(?:\u0441)?\\s*(${Qo.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${Qo.ORDINAL_NUMBER_PATTERN}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${BR.matchAnyPattern(fa.MONTH_DICTIONARY)})(?:(?:-|\\/|,?\\s{0,3})(${Bb.YEAR_PATTERN}(?![^\\s]\\d)))?${fa.REGEX_PARTS.rightBoundary}`,fa.REGEX_PARTS.flags),jb=1,Gb=2,VR=3,$b=4,Lf=class extends HR.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return fa.REGEX_PARTS.leftBoundary}innerPattern(){return zR}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=fa.MONTH_DICTIONARY[t[VR].toLowerCase()],i=Qo.parseOrdinalNumberPattern(t[jb]);if(i>31)return t.index=t.index+t[jb].length,null;if(n.start.assign("month",s),n.start.assign("day",i),t[$b]){let a=Bb.parseYear(t[$b]);n.start.assign("year",a)}else{let a=$R.findYearClosestToRef(e.refDate,i,s);n.start.imply("year",a)}if(t[Gb]){let a=Qo.parseOrdinalNumberPattern(t[Gb]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Uf.default=Lf});var Kb=T(Wf=>{"use strict";Object.defineProperty(Wf,"__esModule",{value:!0});var pa=Nt(),KR=ut(),QR=Oe(),Vb=Nt(),XR=Y(),ZR=new RegExp(`((?:\u0432)\\s*)?(${QR.matchAnyPattern(pa.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${Vb.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,pa.REGEX_PARTS.flags),JR=2,zb=3,qf=class extends XR.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return pa.REGEX_PARTS.leftBoundary}innerPattern(){return ZR}innerExtract(e,t){let n=t[JR].toLowerCase();if(t[0].length<=3&&!pa.FULL_MONTH_NAME_DICTIONARY[n])return null;let s=e.createParsingResult(t.index,t.index+t[0].length);s.start.imply("day",1);let i=pa.MONTH_DICTIONARY[n];if(s.start.assign("month",i),t[zb]){let a=Vb.parseYear(t[zb]);s.start.assign("year",a)}else{let a=KR.findYearClosestToRef(e.refDate,1,i);s.start.imply("year",a)}return s}};Wf.default=qf});var Xb=T(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});var Xo=ze(),eM=Wn(),Qb=Nt(),Yf=class extends eM.AbstractTimeExpressionParser{constructor(e){super(e)}patternFlags(){return Qb.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))?(?!\\/)${Qb.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 s=n.get("hour");s>=6&&s<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",Xo.Meridiem.PM)):s<6&&n.assign("meridiem",Xo.Meridiem.AM)}if(t[0].endsWith("\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F")){n.assign("meridiem",Xo.Meridiem.PM);let s=n.get("hour");s>=0&&s<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("\u0443\u0442\u0440\u0430")&&(n.assign("meridiem",Xo.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};jf.default=Yf});var Zb=T($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});var Zo=Nt(),tM=Le(),rM=Y(),nM=Qt(),sM=new RegExp(`(${Zo.TIME_UNITS_PATTERN})\\s{0,5}\u043D\u0430\u0437\u0430\u0434(?=(?:\\W|$))`,Zo.REGEX_PARTS.flags),Gf=class extends rM.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Zo.REGEX_PARTS.leftBoundary}innerPattern(){return sM}innerExtract(e,t){let n=Zo.parseTimeUnits(t[1]),s=nM.reverseTimeUnits(n);return tM.ParsingComponents.createRelativeFromReference(e.reference,s)}};$f.default=Gf});var Jb=T(ma=>{"use strict";var iM=ma&&ma.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ma,"__esModule",{value:!0});var aM=iM(Or()),Bf=class extends aM.default{patternBetween(){return/^\s*(и до|и по|до|по|-)\s*$/i}};ma.default=Bf});var eT=T(ha=>{"use strict";var oM=ha&&ha.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ha,"__esModule",{value:!0});var uM=oM(Yr()),Hf=class extends uM.default{patternBetween(){return new RegExp("^\\s*(T|\u0432|,|-)?\\s*$")}};ha.default=Hf});var tT=T(Kr=>{"use strict";var lM=Kr&&Kr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),cM=Kr&&Kr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),dM=Kr&&Kr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&lM(e,r,t);return cM(e,r),e};Object.defineProperty(Kr,"__esModule",{value:!0});var fM=Y(),ga=dM($r()),zf=Nt(),pM=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)${zf.REGEX_PARTS.rightBoundary}`,zf.REGEX_PARTS.flags),Vf=class extends fM.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return zf.REGEX_PARTS.leftBoundary}innerPattern(e){return pM}innerExtract(e,t){let n=t[1].toLowerCase(),s=e.createParsingComponents();switch(n){case"\u0441\u0435\u0433\u043E\u0434\u043D\u044F":return ga.today(e.reference);case"\u0432\u0447\u0435\u0440\u0430":return ga.yesterday(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return ga.tomorrow(e.reference);case"\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return ga.theDayAfter(e.reference,2);case"\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return ga.theDayBefore(e.reference,2)}return s}};Kr.default=Vf});var rT=T(yr=>{"use strict";var mM=yr&&yr.__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]}),hM=yr&&yr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),gM=yr&&yr.__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)&&mM(e,r,t);return hM(e,r),e},yM=yr&&yr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(yr,"__esModule",{value:!0});var bM=Y(),Vn=gM($r()),TM=Kt(),_M=yM(be()),Kf=Nt(),vM=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)${Kf.REGEX_PARTS.rightBoundary}`,Kf.REGEX_PARTS.flags),Qf=class extends bM.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Kf.REGEX_PARTS.leftBoundary}innerPattern(){return vM}innerExtract(e,t){let n=_M.default(e.refDate),s=t[0].toLowerCase(),i=e.createParsingComponents();if(s==="\u0441\u0435\u0439\u0447\u0430\u0441")return Vn.now(e.reference);if(s==="\u0432\u0435\u0447\u0435\u0440\u043E\u043C"||s==="\u0432\u0435\u0447\u0435\u0440\u0430")return Vn.evening(e.reference);if(s.endsWith("\u0443\u0442\u0440\u043E\u043C")||s.endsWith("\u0443\u0442\u0440\u0430"))return Vn.morning(e.reference);if(s.match(/в\s*полдень/))return Vn.noon(e.reference);if(s.match(/прошлой\s*ночью/))return Vn.lastNight(e.reference);if(s.match(/прошлым\s*вечером/))return Vn.yesterdayEvening(e.reference);if(s.match(/следующей\s*ночью/)){let a=n.hour()<22?1:2;n=n.add(a,"day"),TM.assignSimilarDate(i,n),i.imply("hour",0)}return s.match(/в\s*полночь/)||s.endsWith("\u043D\u043E\u0447\u044C\u044E")?Vn.midnight(e.reference):i}};yr.default=Qf});var nT=T(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});var ya=Nt(),wM=Oe(),EM=Y(),kM=jn(),SM=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*)?(${wM.matchAnyPattern(ya.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)?${ya.REGEX_PARTS.rightBoundary}`,ya.REGEX_PARTS.flags),OM=1,DM=2,xM=3,Xf=class extends EM.AbstractParserWithWordBoundaryChecking{innerPattern(){return SM}patternLeftBoundary(){return ya.REGEX_PARTS.leftBoundary}innerExtract(e,t){let n=t[DM].toLowerCase(),s=ya.WEEKDAY_DICTIONARY[n],i=t[OM],a=t[xM],o=i||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=kM.toDayJSWeekday(e.refDate,s,u);return e.createParsingComponents().assign("weekday",s).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Zf.default=Xf});var iT=T(Ta=>{"use strict";var RM=Ta&&Ta.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ta,"__esModule",{value:!0});var ba=Nt(),sT=Le(),MM=RM(be()),CM=Y(),AM=Oe(),PM=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*(${AM.matchAnyPattern(ba.TIME_UNIT_DICTIONARY)})(?=\\s*)${ba.REGEX_PARTS.rightBoundary}`,ba.REGEX_PARTS.flags),NM=1,IM=2,Jf=class extends CM.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return ba.REGEX_PARTS.leftBoundary}innerPattern(){return PM}innerExtract(e,t){let n=t[NM].toLowerCase(),s=t[IM].toLowerCase(),i=ba.TIME_UNIT_DICTIONARY[s];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[i]=1,sT.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[i]=-1,sT.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=MM.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}};Ta.default=Jf});var aT=T(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});var _a=Nt(),FM=Le(),LM=Y(),UM=Qt(),qM=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*(${_a.TIME_UNITS_PATTERN})${_a.REGEX_PARTS.rightBoundary}`,_a.REGEX_PARTS.flags),ep=class extends LM.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return _a.REGEX_PARTS.leftBoundary}innerPattern(){return qM}innerExtract(e,t){let n=t[1].toLowerCase(),s=_a.parseTimeUnits(t[2]);switch(n){case"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435":case"\u043F\u0440\u043E\u0448\u043B\u044B\u0435":case"-":s=UM.reverseTimeUnits(s);break}return FM.ParsingComponents.createRelativeFromReference(e.reference,s)}};tp.default=ep});var lT=T(nt=>{"use strict";var qt=nt&&nt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(nt,"__esModule",{value:!0});nt.createConfiguration=nt.createCasualConfiguration=nt.parseDate=nt.parse=nt.strict=nt.casual=void 0;var WM=qt(Yb()),YM=qt(Hb()),jM=qt(Kb()),GM=qt(Xb()),$M=qt(Zb()),BM=qt(Jb()),HM=qt(eT()),zM=jr(),VM=qt(tT()),KM=qt(rT()),QM=qt(nT()),XM=qt(iT()),oT=fr(),ZM=qt(Gn()),JM=qt(aT());nt.casual=new oT.Chrono(uT());nt.strict=new oT.Chrono(rp(!0));function eC(r,e,t){return nt.casual.parse(r,e,t)}nt.parse=eC;function tC(r,e,t){return nt.casual.parseDate(r,e,t)}nt.parseDate=tC;function uT(){let r=rp(!1);return r.parsers.unshift(new VM.default),r.parsers.unshift(new KM.default),r.parsers.unshift(new jM.default),r.parsers.unshift(new XM.default),r.parsers.unshift(new JM.default),r}nt.createCasualConfiguration=uT;function rp(r=!0){return zM.includeCommonConfiguration({parsers:[new ZM.default(!0),new WM.default,new YM.default,new QM.default,new GM.default(r),new $M.default],refiners:[new HM.default,new BM.default]},r)}nt.createConfiguration=rp});var ze=T(se=>{"use strict";var rC=se&&se.__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]}),nC=se&&se.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Tn=se&&se.__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)&&rC(e,r,t);return nC(e,r),e};Object.defineProperty(se,"__esModule",{value:!0});se.parseDate=se.parse=se.casual=se.strict=se.ru=se.zh=se.nl=se.pt=se.ja=se.fr=se.de=se.Meridiem=se.Chrono=se.en=void 0;var np=Tn(Tc());se.en=np;var sC=fr();Object.defineProperty(se,"Chrono",{enumerable:!0,get:function(){return sC.Chrono}});var iC;(function(r){r[r.AM=0]="AM",r[r.PM=1]="PM"})(iC=se.Meridiem||(se.Meridiem={}));var aC=Tn(bg());se.de=aC;var oC=Tn(zg());se.fr=oC;var uC=Tn(ry());se.ja=uC;var lC=Tn(by());se.pt=lC;var cC=Tn(rb());se.nl=cC;var dC=Tn(Fb());se.zh=dC;var fC=Tn(lT());se.ru=fC;se.strict=np.strict;se.casual=np.casual;function pC(r,e,t){return se.casual.parse(r,e,t)}se.parse=pC;function mC(r,e,t){return se.casual.parseDate(r,e,t)}se.parseDate=mC});var a_=T((s_,i_)=>{(function(r){var e=Object.hasOwnProperty,t=Array.isArray?Array.isArray:function(p){return Object.prototype.toString.call(p)==="[object Array]"},n=10,s=typeof process=="object"&&typeof process.nextTick=="function",i=typeof Symbol=="function",a=typeof Reflect=="object",o=typeof setImmediate=="function",u=o?setImmediate:setTimeout,l=i?a&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(d){var p=Object.getOwnPropertyNames(d);return p.push.apply(p,Object.getOwnPropertySymbols(d)),p}:Object.keys;function c(){this._events={},this._conf&&f.call(this,this._conf)}function f(d){d&&(this._conf=d,d.delimiter&&(this.delimiter=d.delimiter),d.maxListeners!==r&&(this._maxListeners=d.maxListeners),d.wildcard&&(this.wildcard=d.wildcard),d.newListener&&(this._newListener=d.newListener),d.removeListener&&(this._removeListener=d.removeListener),d.verboseMemoryLeak&&(this.verboseMemoryLeak=d.verboseMemoryLeak),d.ignoreErrors&&(this.ignoreErrors=d.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function m(d,p){var h="(node) warning: possible EventEmitter memory leak detected. "+d+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(h+=" Event name: "+p+"."),typeof process!="undefined"&&process.emitWarning){var g=new Error(h);g.name="MaxListenersExceededWarning",g.emitter=this,g.count=d,process.emitWarning(g)}else console.error(h),console.trace&&console.trace()}var y=function(d,p,h){var g=arguments.length;switch(g){case 0:return[];case 1:return[d];case 2:return[d,p];case 3:return[d,p,h];default:for(var b=new Array(g);g--;)b[g]=arguments[g];return b}};function k(d,p){for(var h={},g,b=d.length,_=p?p.length:0,S=0;S<b;S++)g=d[S],h[g]=S<_?p[S]:r;return h}function E(d,p,h){this._emitter=d,this._target=p,this._listeners={},this._listenersCount=0;var g,b;if((h.on||h.off)&&(g=h.on,b=h.off),p.addEventListener?(g=p.addEventListener,b=p.removeEventListener):p.addListener?(g=p.addListener,b=p.removeListener):p.on&&(g=p.on,b=p.off),!g&&!b)throw Error("target does not implement any known event API");if(typeof g!="function")throw TypeError("on method must be a function");if(typeof b!="function")throw TypeError("off method must be a function");this._on=g,this._off=b;var _=d._observers;_?_.push(this):d._observers=[this]}Object.assign(E.prototype,{subscribe:function(d,p,h){var g=this,b=this._target,_=this._emitter,S=this._listeners,M=function(){var D=y.apply(null,arguments),R={data:D,name:p,original:d};if(h){var U=h.call(b,R);U!==!1&&_.emit.apply(_,[R.name].concat(D));return}_.emit.apply(_,[p].concat(D))};if(S[d])throw Error("Event '"+d+"' is already listening");this._listenersCount++,_._newListener&&_._removeListener&&!g._onNewListener?(this._onNewListener=function(D){D===p&&S[d]===null&&(S[d]=M,g._on.call(b,d,M))},_.on("newListener",this._onNewListener),this._onRemoveListener=function(D){D===p&&!_.hasListeners(D)&&S[d]&&(S[d]=null,g._off.call(b,d,M))},S[d]=null,_.on("removeListener",this._onRemoveListener)):(S[d]=M,g._on.call(b,d,M))},unsubscribe:function(d){var p=this,h=this._listeners,g=this._emitter,b,_,S=this._off,M=this._target,D;if(d&&typeof d!="string")throw TypeError("event must be a string");function R(){p._onNewListener&&(g.off("newListener",p._onNewListener),g.off("removeListener",p._onRemoveListener),p._onNewListener=null,p._onRemoveListener=null);var U=ie.call(g,p);g._observers.splice(U,1)}if(d){if(b=h[d],!b)return;S.call(M,d,b),delete h[d],--this._listenersCount||R()}else{for(_=l(h),D=_.length;D-- >0;)d=_[D],S.call(M,d,h[d]);this._listeners={},this._listenersCount=0,R()}}});function x(d,p,h,g){var b=Object.assign({},p);if(!d)return b;if(typeof d!="object")throw TypeError("options must be an object");var _=Object.keys(d),S=_.length,M,D,R;function U(ae){throw Error('Invalid "'+M+'" option value'+(ae?". Reason: "+ae:""))}for(var ge=0;ge<S;ge++){if(M=_[ge],!g&&!e.call(p,M))throw Error('Unknown "'+M+'" option');D=d[M],D!==r&&(R=h[M],b[M]=R?R(D,U):D)}return b}function v(d,p){return(typeof d!="function"||!d.hasOwnProperty("prototype"))&&p("value must be a constructor"),d}function I(d){var p="value must be type of "+d.join("|"),h=d.length,g=d[0],b=d[1];return h===1?function(_,S){if(typeof _===g)return _;S(p)}:h===2?function(_,S){var M=typeof _;if(M===g||M===b)return _;S(p)}:function(_,S){for(var M=typeof _,D=h;D-- >0;)if(M===d[D])return _;S(p)}}var F=I(["function"]),le=I(["object","function"]);function B(d,p,h){var g,b,_=0,S,M=new d(function(D,R,U){h=x(h,{timeout:0,overload:!1},{timeout:function(Re,ve){return Re*=1,(typeof Re!="number"||Re<0||!Number.isFinite(Re))&&ve("timeout must be a positive number"),Re}}),g=!h.overload&&typeof d.prototype.cancel=="function"&&typeof U=="function";function ge(){b&&(b=null),_&&(clearTimeout(_),_=0)}var ae=function(Re){ge(),D(Re)},te=function(Re){ge(),R(Re)};g?p(ae,te,U):(b=[function(Re){te(Re||Error("canceled"))}],p(ae,te,function(Re){if(S)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof Re!="function")throw TypeError("onCancel callback must be a function");b.push(Re)}),S=!0),h.timeout>0&&(_=setTimeout(function(){var Re=Error("timeout");Re.code="ETIMEDOUT",_=0,M.cancel(Re),R(Re)},h.timeout))});return g||(M.cancel=function(D){if(!!b){for(var R=b.length,U=1;U<R;U++)b[U](D);b[0](D),b=null}}),M}function ie(d){var p=this._observers;if(!p)return-1;for(var h=p.length,g=0;g<h;g++)if(p[g]._target===d)return g;return-1}function W(d,p,h,g,b){if(!h)return null;if(g===0){var _=typeof p;if(_==="string"){var S,M,D=0,R=0,U=this.delimiter,ge=U.length;if((M=p.indexOf(U))!==-1){S=new Array(5);do S[D++]=p.slice(R,M),R=M+ge;while((M=p.indexOf(U,R))!==-1);S[D++]=p.slice(R),p=S,b=D}else p=[p],b=1}else _==="object"?b=p.length:(p=[p],b=1)}var ae=null,te,Re,ve,wr,ln,Ft=p[g],cn=p[g+1],Ct,qe;if(g===b)h._listeners&&(typeof h._listeners=="function"?(d&&d.push(h._listeners),ae=[h]):(d&&d.push.apply(d,h._listeners),ae=[h]));else if(Ft==="*"){for(Ct=l(h),M=Ct.length;M-- >0;)te=Ct[M],te!=="_listeners"&&(qe=W(d,p,h[te],g+1,b),qe&&(ae?ae.push.apply(ae,qe):ae=qe));return ae}else if(Ft==="**"){for(ln=g+1===b||g+2===b&&cn==="*",ln&&h._listeners&&(ae=W(d,p,h,b,b)),Ct=l(h),M=Ct.length;M-- >0;)te=Ct[M],te!=="_listeners"&&(te==="*"||te==="**"?(h[te]._listeners&&!ln&&(qe=W(d,p,h[te],b,b),qe&&(ae?ae.push.apply(ae,qe):ae=qe)),qe=W(d,p,h[te],g,b)):te===cn?qe=W(d,p,h[te],g+2,b):qe=W(d,p,h[te],g,b),qe&&(ae?ae.push.apply(ae,qe):ae=qe));return ae}else h[Ft]&&(ae=W(d,p,h[Ft],g+1,b));if(Re=h["*"],Re&&W(d,p,Re,g+1,b),ve=h["**"],ve)if(g<b)for(ve._listeners&&W(d,p,ve,b,b),Ct=l(ve),M=Ct.length;M-- >0;)te=Ct[M],te!=="_listeners"&&(te===cn?W(d,p,ve[te],g+2,b):te===Ft?W(d,p,ve[te],g+1,b):(wr={},wr[te]=ve[te],W(d,p,{"**":wr},g+1,b)));else ve._listeners?W(d,p,ve,b,b):ve["*"]&&ve["*"]._listeners&&W(d,p,ve["*"],b,b);return ae}function G(d,p,h){var g=0,b=0,_,S=this.delimiter,M=S.length,D;if(typeof d=="string")if((_=d.indexOf(S))!==-1){D=new Array(5);do D[g++]=d.slice(b,_),b=_+M;while((_=d.indexOf(S,b))!==-1);D[g++]=d.slice(b)}else D=[d],g=1;else D=d,g=d.length;if(g>1){for(_=0;_+1<g;_++)if(D[_]==="**"&&D[_+1]==="**")return}var R=this.listenerTree,U;for(_=0;_<g;_++)if(U=D[_],R=R[U]||(R[U]={}),_===g-1)return R._listeners?(typeof R._listeners=="function"&&(R._listeners=[R._listeners]),h?R._listeners.unshift(p):R._listeners.push(p),!R._listeners.warned&&this._maxListeners>0&&R._listeners.length>this._maxListeners&&(R._listeners.warned=!0,m.call(this,R._listeners.length,U))):R._listeners=p,!0;return!0}function ce(d,p,h,g){for(var b=l(d),_=b.length,S,M,D,R=d._listeners,U;_-- >0;)M=b[_],S=d[M],M==="_listeners"?D=h:D=h?h.concat(M):[M],U=g||typeof M=="symbol",R&&p.push(U?D:D.join(this.delimiter)),typeof S=="object"&&ce.call(this,S,p,D,U);return p}function Ie(d){for(var p=l(d),h=p.length,g,b,_;h-- >0;)b=p[h],g=d[b],g&&(_=!0,b!=="_listeners"&&!Ie(g)&&delete d[b]);return _}function $(d,p,h){this.emitter=d,this.event=p,this.listener=h}$.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function N(d,p,h){if(h===!0)b=!0;else if(h===!1)g=!0;else{if(!h||typeof h!="object")throw TypeError("options should be an object or true");var g=h.async,b=h.promisify,_=h.nextTick,S=h.objectify}if(g||_||b){var M=p,D=p._origin||p;if(_&&!s)throw Error("process.nextTick is not supported");b===r&&(b=p.constructor.name==="AsyncFunction"),p=function(){var R=arguments,U=this,ge=this.event;return b?_?Promise.resolve():new Promise(function(ae){u(ae)}).then(function(){return U.event=ge,M.apply(U,R)}):(_?process.nextTick:u)(function(){U.event=ge,M.apply(U,R)})},p._async=!0,p._origin=D}return[p,S?new $(this,d,p):this]}function w(d){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,f.call(this,d)}w.EventEmitter2=w,w.prototype.listenTo=function(d,p,h){if(typeof d!="object")throw TypeError("target musts be an object");var g=this;h=x(h,{on:r,off:r,reducers:r},{on:F,off:F,reducers:le});function b(_){if(typeof _!="object")throw TypeError("events must be an object");var S=h.reducers,M=ie.call(g,d),D;M===-1?D=new E(g,d,h):D=g._observers[M];for(var R=l(_),U=R.length,ge,ae=typeof S=="function",te=0;te<U;te++)ge=R[te],D.subscribe(ge,_[ge]||ge,ae?S:S&&S[ge])}return t(p)?b(k(p)):b(typeof p=="string"?k(p.split(/\s+/)):p),this},w.prototype.stopListeningTo=function(d,p){var h=this._observers;if(!h)return!1;var g=h.length,b,_=!1;if(d&&typeof d!="object")throw TypeError("target should be an object");for(;g-- >0;)b=h[g],(!d||b._target===d)&&(b.unsubscribe(p),_=!0);return _},w.prototype.delimiter=".",w.prototype.setMaxListeners=function(d){d!==r&&(this._maxListeners=d,this._conf||(this._conf={}),this._conf.maxListeners=d)},w.prototype.getMaxListeners=function(){return this._maxListeners},w.prototype.event="",w.prototype.once=function(d,p,h){return this._once(d,p,!1,h)},w.prototype.prependOnceListener=function(d,p,h){return this._once(d,p,!0,h)},w.prototype._once=function(d,p,h,g){return this._many(d,1,p,h,g)},w.prototype.many=function(d,p,h,g){return this._many(d,p,h,!1,g)},w.prototype.prependMany=function(d,p,h,g){return this._many(d,p,h,!0,g)},w.prototype._many=function(d,p,h,g,b){var _=this;if(typeof h!="function")throw new Error("many only accepts instances of Function");function S(){return--p===0&&_.off(d,S),h.apply(this,arguments)}return S._origin=h,this._on(d,S,g,b)},w.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||c.call(this);var d=arguments[0],p,h=this.wildcard,g,b,_,S,M;if(d==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(h&&(p=d,d!=="newListener"&&d!=="removeListener"&&typeof d=="object")){if(b=d.length,i){for(_=0;_<b;_++)if(typeof d[_]=="symbol"){M=!0;break}}M||(d=d.join(this.delimiter))}var D=arguments.length,R;if(this._all&&this._all.length)for(R=this._all.slice(),_=0,b=R.length;_<b;_++)switch(this.event=d,D){case 1:R[_].call(this,d);break;case 2:R[_].call(this,d,arguments[1]);break;case 3:R[_].call(this,d,arguments[1],arguments[2]);break;default:R[_].apply(this,arguments)}if(h)R=[],W.call(this,R,p,this.listenerTree,0,b);else if(R=this._events[d],typeof R=="function"){switch(this.event=d,D){case 1:R.call(this);break;case 2:R.call(this,arguments[1]);break;case 3:R.call(this,arguments[1],arguments[2]);break;default:for(g=new Array(D-1),S=1;S<D;S++)g[S-1]=arguments[S];R.apply(this,g)}return!0}else R&&(R=R.slice());if(R&&R.length){if(D>3)for(g=new Array(D-1),S=1;S<D;S++)g[S-1]=arguments[S];for(_=0,b=R.length;_<b;_++)switch(this.event=d,D){case 1:R[_].call(this);break;case 2:R[_].call(this,arguments[1]);break;case 3:R[_].call(this,arguments[1],arguments[2]);break;default:R[_].apply(this,g)}return!0}else if(!this.ignoreErrors&&!this._all&&d==="error")throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");return!!this._all},w.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||c.call(this);var d=arguments[0],p=this.wildcard,h,g,b,_,S,M;if(d==="newListener"&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(p&&(h=d,d!=="newListener"&&d!=="removeListener"&&typeof d=="object")){if(_=d.length,i){for(S=0;S<_;S++)if(typeof d[S]=="symbol"){g=!0;break}}g||(d=d.join(this.delimiter))}var D=[],R=arguments.length,U;if(this._all)for(S=0,_=this._all.length;S<_;S++)switch(this.event=d,R){case 1:D.push(this._all[S].call(this,d));break;case 2:D.push(this._all[S].call(this,d,arguments[1]));break;case 3:D.push(this._all[S].call(this,d,arguments[1],arguments[2]));break;default:D.push(this._all[S].apply(this,arguments))}if(p?(U=[],W.call(this,U,h,this.listenerTree,0)):U=this._events[d],typeof U=="function")switch(this.event=d,R){case 1:D.push(U.call(this));break;case 2:D.push(U.call(this,arguments[1]));break;case 3:D.push(U.call(this,arguments[1],arguments[2]));break;default:for(b=new Array(R-1),M=1;M<R;M++)b[M-1]=arguments[M];D.push(U.apply(this,b))}else if(U&&U.length){if(U=U.slice(),R>3)for(b=new Array(R-1),M=1;M<R;M++)b[M-1]=arguments[M];for(S=0,_=U.length;S<_;S++)switch(this.event=d,R){case 1:D.push(U[S].call(this));break;case 2:D.push(U[S].call(this,arguments[1]));break;case 3:D.push(U[S].call(this,arguments[1],arguments[2]));break;default:D.push(U[S].apply(this,b))}}else if(!this.ignoreErrors&&!this._all&&d==="error")return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");return Promise.all(D)},w.prototype.on=function(d,p,h){return this._on(d,p,!1,h)},w.prototype.prependListener=function(d,p,h){return this._on(d,p,!0,h)},w.prototype.onAny=function(d){return this._onAny(d,!1)},w.prototype.prependAny=function(d){return this._onAny(d,!0)},w.prototype.addListener=w.prototype.on,w.prototype._onAny=function(d,p){if(typeof d!="function")throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),p?this._all.unshift(d):this._all.push(d),this},w.prototype._on=function(d,p,h,g){if(typeof d=="function")return this._onAny(d,p),this;if(typeof p!="function")throw new Error("on only accepts instances of Function");this._events||c.call(this);var b=this,_;return g!==r&&(_=N.call(this,d,p,g),p=_[0],b=_[1]),this._newListener&&this.emit("newListener",d,p),this.wildcard?(G.call(this,d,p,h),b):(this._events[d]?(typeof this._events[d]=="function"&&(this._events[d]=[this._events[d]]),h?this._events[d].unshift(p):this._events[d].push(p),!this._events[d].warned&&this._maxListeners>0&&this._events[d].length>this._maxListeners&&(this._events[d].warned=!0,m.call(this,this._events[d].length,d))):this._events[d]=p,b)},w.prototype.off=function(d,p){if(typeof p!="function")throw new Error("removeListener only takes instances of Function");var h,g=[];if(this.wildcard){var b=typeof d=="string"?d.split(this.delimiter):d.slice();if(g=W.call(this,null,b,this.listenerTree,0),!g)return this}else{if(!this._events[d])return this;h=this._events[d],g.push({_listeners:h})}for(var _=0;_<g.length;_++){var S=g[_];if(h=S._listeners,t(h)){for(var M=-1,D=0,R=h.length;D<R;D++)if(h[D]===p||h[D].listener&&h[D].listener===p||h[D]._origin&&h[D]._origin===p){M=D;break}if(M<0)continue;return this.wildcard?S._listeners.splice(M,1):this._events[d].splice(M,1),h.length===0&&(this.wildcard?delete S._listeners:delete this._events[d]),this._removeListener&&this.emit("removeListener",d,p),this}else(h===p||h.listener&&h.listener===p||h._origin&&h._origin===p)&&(this.wildcard?delete S._listeners:delete this._events[d],this._removeListener&&this.emit("removeListener",d,p))}return this.listenerTree&&Ie(this.listenerTree),this},w.prototype.offAny=function(d){var p=0,h=0,g;if(d&&this._all&&this._all.length>0){for(g=this._all,p=0,h=g.length;p<h;p++)if(d===g[p])return g.splice(p,1),this._removeListener&&this.emit("removeListenerAny",d),this}else{if(g=this._all,this._removeListener)for(p=0,h=g.length;p<h;p++)this.emit("removeListenerAny",g[p]);this._all=[]}return this},w.prototype.removeListener=w.prototype.off,w.prototype.removeAllListeners=function(d){if(d===r)return!this._events||c.call(this),this;if(this.wildcard){var p=W.call(this,null,d,this.listenerTree,0),h,g;if(!p)return this;for(g=0;g<p.length;g++)h=p[g],h._listeners=null;this.listenerTree&&Ie(this.listenerTree)}else this._events&&(this._events[d]=null);return this},w.prototype.listeners=function(d){var p=this._events,h,g,b,_,S;if(d===r){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!p)return[];for(h=l(p),_=h.length,b=[];_-- >0;)g=p[h[_]],typeof g=="function"?b.push(g):b.push.apply(b,g);return b}else{if(this.wildcard){if(S=this.listenerTree,!S)return[];var M=[],D=typeof d=="string"?d.split(this.delimiter):d.slice();return W.call(this,M,D,S,0),M}return p?(g=p[d],g?typeof g=="function"?[g]:g:[]):[]}},w.prototype.eventNames=function(d){var p=this._events;return this.wildcard?ce.call(this,this.listenerTree,[],null,d):p?l(p):[]},w.prototype.listenerCount=function(d){return this.listeners(d).length},w.prototype.hasListeners=function(d){if(this.wildcard){var p=[],h=typeof d=="string"?d.split(this.delimiter):d.slice();return W.call(this,p,h,this.listenerTree,0),p.length>0}var g=this._events,b=this._all;return!!(b&&b.length||g&&(d===r?l(g).length:g[d]))},w.prototype.listenersAny=function(){return this._all?this._all:[]},w.prototype.waitFor=function(d,p){var h=this,g=typeof p;return g==="number"?p={timeout:p}:g==="function"&&(p={filter:p}),p=x(p,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:F,Promise:v}),B(p.Promise,function(b,_,S){function M(){var D=p.filter;if(!(D&&!D.apply(h,arguments)))if(h.off(d,M),p.handleError){var R=arguments[0];R?_(R):b(y.apply(null,arguments).slice(1))}else b(y.apply(null,arguments))}S(function(){h.off(d,M)}),h._on(d,M,!1)},{timeout:p.timeout,overload:p.overload})};function H(d,p,h){h=x(h,{Promise,timeout:0,overload:!1},{Promise:v});var g=h.Promise;return B(g,function(b,_,S){var M;if(typeof d.addEventListener=="function"){M=function(){b(y.apply(null,arguments))},S(function(){d.removeEventListener(p,M)}),d.addEventListener(p,M,{once:!0});return}var D=function(){R&&d.removeListener("error",R),b(y.apply(null,arguments))},R;p!=="error"&&(R=function(U){d.removeListener(p,D),_(U)},d.once("error",R)),S(function(){R&&d.removeListener("error",R),d.removeListener(p,D)}),d.once(p,D)},{timeout:h.timeout,overload:h.overload})}var C=w.prototype;if(Object.defineProperties(w,{defaultMaxListeners:{get:function(){return C._maxListeners},set:function(d){if(typeof d!="number"||d<0||Number.isNaN(d))throw TypeError("n must be a non-negative number");C._maxListeners=d},enumerable:!0},once:{value:H,writable:!0,configurable:!0}}),Object.defineProperties(C,{_maxListeners:{value:n,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define=="function"&&define.amd)define(function(){return w});else if(typeof s_=="object")i_.exports=w;else{var X=new Function("","return this")();X.EventEmitter2=w}})()});var P_=T(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});var C_=Symbol("MustacheDataPath");function M_({target:r,propertyName:e}){return[...r[C_]||[],e]}function A_(r,e){return typeof r!="object"?r:new Proxy(r,{get(t,n){let s=t[n];if(s===void 0&&!(n in t)){let i=M_({target:t,propertyName:n});if(e!=null&&e.handleError)return e.handleError(i),s;throw Error(`Missing Mustache data property: ${i.join(" > ")}`)}return s&&typeof s=="object"?(s[C_]=M_({target:t,propertyName:n}),A_(s,e)):s}})}Up.default=A_});var Lr=T(_r=>{"use strict";_r.__esModule=!0;_r.Tokens=_r.StructuralCharacters=_r.Operators=void 0;var HA;(function(r){r.AND="AND",r.OR="OR",r.XOR="XOR",r.NOT="NOT"})(HA=_r.Operators||(_r.Operators={}));var zA;(function(r){r.OPEN_PARENTHESIS="(",r.CLOSE_PARENTHESIS=")"})(zA=_r.StructuralCharacters||(_r.StructuralCharacters={}));var VA;(function(r){r.IDENTIFIER="IDENTIFIER",r.OPERATOR="OPERATOR",r.STRUCTURAL_CHARACTER="STRUCTURAL_CHARACTER",r.EOF="EOF",r.COMMENT="COMMENT"})(VA=_r.Tokens||(_r.Tokens={}))});var $p=T(ti=>{"use strict";ti.__esModule=!0;ti.VALID_TOKENS=ti.OPERATOR_PRECEDENCE=void 0;var Ue=Lr();ti.OPERATOR_PRECEDENCE={NOT:0,XOR:1,AND:2,OR:3};ti.VALID_TOKENS={identifierOnly:[{name:Ue.Tokens.IDENTIFIER},{name:Ue.Tokens.STRUCTURAL_CHARACTER,value:Ue.StructuralCharacters.OPEN_PARENTHESIS}],identifierOrNot:[{name:Ue.Tokens.IDENTIFIER},{name:Ue.Tokens.STRUCTURAL_CHARACTER,value:Ue.StructuralCharacters.OPEN_PARENTHESIS},{name:Ue.Tokens.OPERATOR,value:Ue.Operators.NOT}],binaryOperator:[{name:Ue.Tokens.OPERATOR,value:Ue.Operators.AND},{name:Ue.Tokens.OPERATOR,value:Ue.Operators.OR},{name:Ue.Tokens.OPERATOR,value:Ue.Operators.XOR}],binaryOperatorOrClose:[{name:Ue.Tokens.OPERATOR,value:Ue.Operators.AND},{name:Ue.Tokens.OPERATOR,value:Ue.Operators.OR},{name:Ue.Tokens.OPERATOR,value:Ue.Operators.XOR},{name:Ue.Tokens.STRUCTURAL_CHARACTER,value:Ue.StructuralCharacters.CLOSE_PARENTHESIS}]}});var Bp=T(vt=>{"use strict";vt.__esModule=!0;vt.ESCAPE_CHARACTER=vt.EOL=vt.COMMENT_DELIMITER=vt.QUOTED_IDENTIFIER_DELIMITER=vt.SEPARATORS=vt.OPERATORS=vt.STRUCTURAL_CHARACTERS=void 0;var ri=Lr();vt.STRUCTURAL_CHARACTERS={"(":ri.StructuralCharacters.OPEN_PARENTHESIS,")":ri.StructuralCharacters.CLOSE_PARENTHESIS};vt.OPERATORS={AND:ri.Operators.AND,OR:ri.Operators.OR,XOR:ri.Operators.XOR,NOT:ri.Operators.NOT};vt.SEPARATORS=new Set([32,9,10,13].map(function(r){return String.fromCodePoint(r)}));vt.QUOTED_IDENTIFIER_DELIMITER=String.fromCodePoint(34);vt.COMMENT_DELIMITER=String.fromCodePoint(35);vt.EOL=String.fromCodePoint(10);vt.ESCAPE_CHARACTER=String.fromCodePoint(92)});var U_=T(ar=>{"use strict";var Hp=ar&&ar.__assign||function(){return Hp=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},Hp.apply(this,arguments)};ar.__esModule=!0;ar.getQuotedIdentifier=ar.getComment=ar.createResult=void 0;var L_=Lr(),us=Bp(),KA=function(r,e,t){return{token:Hp({name:r},e!==null?{value:e}:{}),remainingString:t}};ar.createResult=KA;var QA=function(r){for(var e=r.length,t=0;t<r.length;t+=1){var n=r[t];if(n===us.EOL){e=t;break}}return(0,ar.createResult)(L_.Tokens.COMMENT,r.slice(0,e),r.slice(e+1))};ar.getComment=QA;var XA=function(r){for(var e=!1,t="",n=null,s=0;s<r.length;s+=1){var i=r[s];if(n===null)i===us.QUOTED_IDENTIFIER_DELIMITER?e?t=t.slice(-1)+us.QUOTED_IDENTIFIER_DELIMITER:n=s:(i===us.ESCAPE_CHARACTER?e=!0:e=!1,t=t+=i);else{if(!us.SEPARATORS.has(i)&&!us.STRUCTURAL_CHARACTERS[i])throw new Error("Unexpected character: ".concat(i," Expected ) character or separator"));break}}if(n===null)throw new Error("Unexpected end of expression: expected ".concat(us.QUOTED_IDENTIFIER_DELIMITER," character"));return(0,ar.createResult)(L_.Tokens.IDENTIFIER,t,r.slice(n+1))};ar.getQuotedIdentifier=XA});var q_=T(Wu=>{"use strict";Wu.__esModule=!0;Wu.lex=void 0;var ni=Lr(),Bt=Bp(),si=U_(),ZA=function(r){for(var e=null,t=null,n=null,s=0;s<r.length;s+=1){var i=r[s];if(e===null){if(!Bt.SEPARATORS.has(i)){var a=Bt.STRUCTURAL_CHARACTERS[i];if(a){var o=r[s+1];if(a===ni.StructuralCharacters.CLOSE_PARENTHESIS&&o&&!Bt.SEPARATORS.has(o)&&o!==ni.StructuralCharacters.CLOSE_PARENTHESIS)throw new Error("Unexpected character: ".concat(o,". A closing parenthesis should be followed by another closing parenthesis or whitespace"));return(0,si.createResult)(ni.Tokens.STRUCTURAL_CHARACTER,Bt.STRUCTURAL_CHARACTERS[i],r.slice(s+1))}if(i===Bt.QUOTED_IDENTIFIER_DELIMITER)return(0,si.getQuotedIdentifier)(r.slice(s+1));if(i===Bt.COMMENT_DELIMITER)return(0,si.getComment)(r.slice(s+1));e=s}}else if(Bt.SEPARATORS.has(i)||Bt.STRUCTURAL_CHARACTERS[i]){t=s,n=i;break}else if(i===Bt.QUOTED_IDENTIFIER_DELIMITER||i===Bt.COMMENT_DELIMITER)throw new Error("Unexpected character: ".concat(i))}if(e!==null){t=t!=null?t:r.length;var u=r.slice(e,t),l=r.slice(t);if(Bt.OPERATORS[u]){if(n&&!Bt.SEPARATORS.has(n))throw new Error("Unexpected character: ".concat(n,". Operators should be separated using whitespace"));return(0,si.createResult)(ni.Tokens.OPERATOR,Bt.OPERATORS[u],l)}else return(0,si.createResult)(ni.Tokens.IDENTIFIER,u,l)}return(0,si.createResult)(ni.Tokens.EOF,null,"")};Wu.lex=ZA});var Y_=T(Ht=>{"use strict";var W_=Ht&&Ht.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))};Ht.__esModule=!0;Ht.validateToken=Ht.previousOperatorTakesPrecedent=Ht.getValue=Ht.newTokenGenerator=void 0;var JA=q_(),ii=Lr(),Yu=$p(),eP=function(r){var e=r;return function(t,n){for(n===void 0&&(n=!1);;){var s=(0,JA.lex)(e),i=s.token,a=s.remainingString;if(e=a,i.name!==ii.Tokens.COMMENT)return(0,Ht.validateToken)(i,t,n),i}}};Ht.newTokenGenerator=eP;var tP=function(r,e){var t=r(Yu.VALID_TOKENS.identifierOrNot),n=t.value===ii.Operators.NOT;n&&(t=r(Yu.VALID_TOKENS.identifierOnly));var s=t.name===ii.Tokens.STRUCTURAL_CHARACTER?e(r,!0):[t];return n?W_(W_([],s,!0),[{name:ii.Tokens.OPERATOR,value:ii.Operators.NOT}],!1):s};Ht.getValue=tP;var rP=function(r,e){return Yu.OPERATOR_PRECEDENCE[r]<=Yu.OPERATOR_PRECEDENCE[e]};Ht.previousOperatorTakesPrecedent=rP;var nP=function(r,e,t){if(t===void 0&&(t=!1),r.name===ii.Tokens.EOF){if(t)return;throw new Error("Unexpected end of expression")}for(var n=0,s=e;n<s.length;n++){var i=s[n];if(i.name===r.name&&(!i.value||i.value===r.value))return}throw new TypeError("Invalid token")};Ht.validateToken=nP});var Vp=T(ai=>{"use strict";var Ur=ai&&ai.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))};ai.__esModule=!0;ai.parse=void 0;var j_=Lr(),G_=$p(),ju=Y_(),sP=function(r){if(typeof r!="string")throw new Error("Expected string but received ".concat(typeof r));var e=(0,ju.newTokenGenerator)(r);return zp(e)};ai.parse=sP;var zp=function(r,e){e===void 0&&(e=!1);for(var t=Ur([],(0,ju.getValue)(r,zp),!0),n=[];;){var s=e?G_.VALID_TOKENS.binaryOperatorOrClose:G_.VALID_TOKENS.binaryOperator,i=r(s,!e);if(i.name===j_.Tokens.EOF||i.name===j_.Tokens.STRUCTURAL_CHARACTER)return Ur(Ur([],t,!0),Ur([],n,!0).reverse(),!0);for(;n.length;){var a=n[n.length-1]||null;if(a&&(0,ju.previousOperatorTakesPrecedent)(a.value,i.value))t=Ur(Ur([],t,!0),[a],!1),n=n.slice(0,-1);else break}n=Ur(Ur([],n,!0),[i],!1),t=Ur(Ur([],t,!0),(0,ju.getValue)(r,zp),!0)}}});var Kp=T(wt=>{"use strict";wt.__esModule=!0;wt.throwInvalidExpression=wt.isOperator=wt.isIdentifier=wt.notUtil=wt.xorUtil=wt.orUtil=wt.andUtil=void 0;var $_=Lr(),iP=function(r,e){return r&&e};wt.andUtil=iP;var aP=function(r,e){return r||e};wt.orUtil=aP;var oP=function(r,e){return r!==e};wt.xorUtil=oP;var uP=function(r){return!r};wt.notUtil=uP;var lP=function(r){var e=r.name,t=r.value;return e===$_.Tokens.IDENTIFIER&&typeof t=="string"};wt.isIdentifier=lP;var cP=function(r){var e=r.name,t=r.value;return e===$_.Tokens.OPERATOR&&typeof t=="string"};wt.isOperator=cP;var dP=function(r){throw new TypeError("Invalid postfix expression: ".concat(r))};wt.throwInvalidExpression=dP});var B_=T(Gu=>{"use strict";var Ya;Gu.__esModule=!0;Gu.OPERATOR_MAP=void 0;var Qp=Lr(),Xp=Kp();Gu.OPERATOR_MAP=(Ya={},Ya[Qp.Operators.AND]=Xp.andUtil,Ya[Qp.Operators.OR]=Xp.orUtil,Ya[Qp.Operators.XOR]=Xp.xorUtil,Ya)});var z_=T(on=>{"use strict";var oi=on&&on.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))};on.__esModule=!0;on.evaluate=on.getEvaluator=void 0;var fP=Vp(),H_=Lr(),pP=B_(),ls=Kp(),mP=function(r){var e=(0,fP.parse)(r);return function(t){return(0,on.evaluate)(e,t)}};on.getEvaluator=mP;var hP=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,s,i){if(!(s&&((0,ls.isIdentifier)(s)||(0,ls.isOperator)(s))))throw new Error("Invalid token: ".concat(s,". Found in parsed expression at index ").concat(i));if(s.name===H_.Tokens.IDENTIFIER)return oi(oi([],n,!0),[Boolean(e[s.value])],!1);var a=n[n.length-2],o=n[n.length-1];if(s.value===H_.Operators.NOT)return o===void 0&&(0,ls.throwInvalidExpression)("missing identifier"),oi(oi([],n.slice(0,-1),!0),[(0,ls.notUtil)(o)],!1);(o===void 0||a===void 0)&&(0,ls.throwInvalidExpression)("missing identifier");var u=pP.OPERATOR_MAP[s.value];return u||(0,ls.throwInvalidExpression)("unknown operator"),oi(oi([],n.slice(0,-2),!0),[u(a,o)],!1)},[]);return t.length!==1&&(0,ls.throwInvalidExpression)("too many identifiers after evaluation"),t[0]};on.evaluate=hP});var K_=T(qr=>{"use strict";var Zp=qr&&qr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]});qr.__esModule=!0;qr.parse=qr.evaluate=qr.getEvaluator=void 0;var V_=z_();Zp(qr,V_,"getEvaluator");Zp(qr,V_,"evaluate");var gP=Vp();Zp(qr,gP,"parse")});var UP={};zv(UP,{default:()=>dl});module.exports=Vv(UP);var qv=require("obsidian");var Ws=require("obsidian");var WP=new Error("timeout while waiting for mutex to become available"),YP=new Error("mutex already locked"),Kv=new Error("request for lock canceled"),Qv=function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(c){try{l(n.next(c))}catch(f){a(f)}}function u(c){try{l(n.throw(c))}catch(f){a(f)}}function l(c){c.done?i(c.value):s(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},pl=class{constructor(e,t=Kv){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 Qv(this,void 0,void 0,function*(){let[n,s]=yield this.acquire(t);try{return yield e(n)}finally{s()}})}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 s=this._value,i=t;this._value-=t,t=this._value+1,n.resolve([s,this._newReleaser(i)])}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]=[])}},Xv=function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(c){try{l(n.next(c))}catch(f){a(f)}}function u(c){try{l(n.throw(c))}catch(f){a(f)}}function l(c){c.done?i(c.value):s(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},ao=class{constructor(e){this._semaphore=new pl(1,e)}acquire(){return Xv(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 Jo=_i(ze());var Dt=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 Dt(window.moment().startOf(t).startOf("day"),window.moment().endOf(t).startOf("day"))}static buildInvalid(){return new Dt(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 Wt=class{static parseDate(e,t=!1){return window.moment(Jo.parseDate(e,void 0,{forwardDate:t})).startOf("day")}static parseDateRange(e,t=!1){let n=[Wt.parseRelativeDateRange,Wt.parseNumberedDateRange,Wt.parseAbsoluteDateRange];for(let s of n){let i=s(e,t);if(i.isValid())return i}return Dt.buildInvalid()}static parseAbsoluteDateRange(e,t){let n=Jo.parse(e,void 0,{forwardDate:t});if(n.length===0)return Dt.buildInvalid();let s=n[0].start,i=n[1]&&n[1].start?n[1].start:s,a=window.moment(s.date()),o=window.moment(i.date());return new Dt(a,o)}static parseRelativeDateRange(e,t){let n=/(last|this|next) (week|month|quarter|year)/,s=e.match(n);if(s&&s.length===3){let i=s[1],a=s[2],o=Dt.buildRelative(a);switch(i){case"last":o.moveToPrevious(a);break;case"next":o.moveToNext(a);break}return o}return Dt.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[s,i,a]of n){let o=e.match(s);if(o){let u=o[0].trim();return new Dt(window.moment(u,i).startOf(a),window.moment(u,i).endOf(a))}}return Dt.buildInvalid()}};var hC={td:"today",tm:"tomorrow",yd:"yesterday",tw:"this week",nw:"next week",weekend:"sat",we:"sat"};function Qr(r){for(let[e,t]of Object.entries(hC))r=r.replace(RegExp(`\\b${e}\\s`,"i"),t);return r}var eu=["MO","TU","WE","TH","FR","SA","SU"],He=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(eu.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=eu[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 Ae=function(r){return r!=null},Yt=function(r){return typeof r=="number"},sp=function(r){return typeof r=="string"&&eu.includes(r)},dt=Array.isArray,rr=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 pe=function(r,e){var t=0,n=[];if(dt(r))for(;t<e;t++)n[t]=[].concat(r);else for(;t<e;t++)n[t]=r;return n},cT=function(r){return dt(r)?r:[r]};function Kn(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+=pe(t,e/t.length)),t.slice(0,e)+String(n))}var dT=function(r,e,t){var n=r.split(e);return t?n.slice(0,t).concat([n.slice(t).join(e)]):n},gt=function(r,e){var t=r%e;return t*e<0?t+e:t},tu=function(r,e){return{div:Math.floor(r/e),mod:gt(r,e)}},jt=function(r){return!Ae(r)||r.length===0},We=function(r){return!jt(r)},he=function(r,e){return We(r)&&r.indexOf(e)!==-1};var Rr=function(r,e,t,n,s,i){return n===void 0&&(n=0),s===void 0&&(s=0),i===void 0&&(i=0),new Date(Date.UTC(r,e-1,t,n,s,i))},gC=[31,28,31,30,31,30,31,31,30,31,30,31],mT=1e3*60*60*24,ru=9999,hT=Rr(1970,1,1),yC=[6,0,1,2,3,4,5];var Ns=function(r){return r%4===0&&r%100!==0||r%400===0},ip=function(r){return r instanceof Date},Qn=function(r){return ip(r)&&!isNaN(r.getTime())},fT=function(r){return r.getTimezoneOffset()*60*1e3},bC=function(r,e){var t=r.getTime()-fT(r),n=e.getTime()-fT(e),s=t-n;return Math.round(s/mT)},va=function(r){return bC(r,hT)},nu=function(r){return new Date(hT.getTime()+r*mT)},TC=function(r){var e=r.getUTCMonth();return e===1&&Ns(r.getUTCFullYear())?29:gC[e]},Xr=function(r){return yC[r.getUTCDay()]},ap=function(r,e){var t=Rr(r,e+1,1);return[Xr(t),TC(t)]},su=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()))},iu=function(r){var e=new Date(r.getTime());return e},op=function(r){for(var e=[],t=0;t<r.length;t++)e.push(iu(r[t]));return e},Zr=function(r){r.sort(function(e,t){return e.getTime()-t.getTime()})},Is=function(r,e){e===void 0&&(e=!0);var t=new Date(r);return[Kn(t.getUTCFullYear().toString(),4,"0"),Kn(t.getUTCMonth()+1,2,"0"),Kn(t.getUTCDate(),2,"0"),"T",Kn(t.getUTCHours(),2,"0"),Kn(t.getUTCMinutes(),2,"0"),Kn(t.getUTCSeconds(),2,"0"),e?"Z":""].join("")},wa=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))},pT=function(r,e){var t=r.toLocaleString("sv-SE",{timeZone:e});return t.replace(" ","T")+"Z"},gT=function(r,e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date(pT(r,t)),s=new Date(pT(r,e!=null?e:"UTC")),i=s.getTime()-n.getTime();return new Date(r.getTime()-i)};var _C=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}(),Jr=_C;var up=function(r,e){return up=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])},up(r,e)};function Fs(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");up(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ft=function(){return ft=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},ft.apply(this,arguments)};function P(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))}var vC=function(r){Fs(e,r);function e(t,n,s){var i=r.call(this,t,n)||this;return i.iterator=s,i}return e.prototype.add=function(t){return this.iterator(t,this._result.length)?(this._result.push(t),!0):!1},e}(Jr),lp=vC;var wC={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}},Xn=wC;var yT=function(r,e){return r.indexOf(e)!==-1},EC=function(r){return r.toString()},kC=function(r,e,t){return"".concat(e," ").concat(t,", ").concat(r)},SC=function(){function r(e,t,n,s){if(t===void 0&&(t=EC),n===void 0&&(n=Xn),s===void 0&&(s=kC),this.text=[],this.language=n||Xn,this.gettext=t,this.dateFormatter=s,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var i=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);i.sort(function(c,f){return c-f}),a.sort(function(c,f){return f-c}),this.bymonthday=i.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(Ae(this.origOptions.byweekday)){var o=dt(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,f){return c.weekday-f.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(yT(["dtstart","wkst","freq"],n))return!0;if(!yT(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[j.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 s=Math.abs(e);switch(s){case 1:case 21:case 31:t=s+n("st");break;case 2:case 22:t=s+n("nd");break;case 3:case 23:t=s+n("rd");break;default:t=s+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=Yt(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,s){var i=this;s===void 0&&(s=","),dt(e)||(e=[e]);var a=function(u,l,c){for(var f="",m=0;m<u.length;m++)m!==0&&(m===u.length-1?f+=" "+c+" ":f+=l+" "),f+=u[m];return f};t=t||function(u){return u.toString()};var o=function(u){return t&&t.call(i,u)};return n?a(e.map(o),s,n):e.map(o).join(s+" ")},r}(),Mr=SC;var OC=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 s in this.rules){n=this.rules[s];var i=n.exec(this.text);i&&(e===null||i[0].length>e[0].length)&&(e=i,t=s)}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 Ea(r,e){e===void 0&&(e=Xn);var t={},n=new OC(e.tokens);if(!n.start(r))return null;return s(),t;function s(){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=j.DAILY,n.nextSymbol()&&(a(),f());break;case"weekday(s)":t.freq=j.WEEKLY,t.byweekday=[j.MO,j.TU,j.WE,j.TH,j.FR],n.nextSymbol(),f();break;case"week(s)":t.freq=j.WEEKLY,n.nextSymbol()&&(i(),f());break;case"hour(s)":t.freq=j.HOURLY,n.nextSymbol()&&(i(),f());break;case"minute(s)":t.freq=j.MINUTELY,n.nextSymbol()&&(i(),f());break;case"month(s)":t.freq=j.MONTHLY,n.nextSymbol()&&(i(),f());break;case"year(s)":t.freq=j.YEARLY,n.nextSymbol()&&(i(),f());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=j.WEEKLY;var y=n.symbol.substr(0,2).toUpperCase();if(t.byweekday=[j[y]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var k=u();if(!k)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push(j[k]),n.nextSymbol()}c(),f();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(t.freq=j.YEARLY,t.bymonth=[o()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var E=o();if(!E)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(E),n.nextSymbol()}i(),f();break;default:throw new Error("Unknown symbol")}}function i(){var m=n.accept("on"),y=n.accept("the");if(!!(m||y))do{var k=l(),E=u(),x=o();if(k)E?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(j[E].nth(k))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(k),n.accept("day(s)"));else if(E)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(j[E]);else if(n.symbol==="weekday(s)")n.nextSymbol(),t.byweekday||(t.byweekday=[j.MO,j.TU,j.WE,j.TH,j.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var v=n.acceptNumber();if(!v)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt(v[0],10)];n.accept("comma");){if(v=n.acceptNumber(),!v)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt(v[0],10))}}else if(x)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(x);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function a(){var m=n.accept("at");if(!!m)do{var y=n.acceptNumber();if(!y)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(t.byhour=[parseInt(y[0],10)];n.accept("comma");){if(y=n.acceptNumber(),!y)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");t.byhour.push(parseInt(y[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 f(){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 ue;(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"})(ue||(ue={}));function ka(r){return r<ue.HOURLY}var bT=function(r,e){return e===void 0&&(e=Xn),new j(Ea(r,e)||void 0)},Ls=["count","until","interval","byweekday","bymonthday","bymonth"];Mr.IMPLEMENTED=[];Mr.IMPLEMENTED[ue.HOURLY]=Ls;Mr.IMPLEMENTED[ue.MINUTELY]=Ls;Mr.IMPLEMENTED[ue.DAILY]=["byhour"].concat(Ls);Mr.IMPLEMENTED[ue.WEEKLY]=Ls;Mr.IMPLEMENTED[ue.MONTHLY]=Ls;Mr.IMPLEMENTED[ue.YEARLY]=["byweekno","byyearday"].concat(Ls);var TT=function(r,e,t,n){return new Mr(r,e,t,n).toString()},_T=Mr.isFullyConvertible;var Us=function(){function r(e,t,n,s){this.hour=e,this.minute=t,this.second=n,this.millisecond=s||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 vT=function(r){Fs(e,r);function e(t,n,s,i,a,o,u){var l=r.call(this,i,a,o,u)||this;return l.year=t,l.month=n,l.day=s,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 Xr(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),s=gt(this.month,12);this.month=s,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,s){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var i=tu(this.hour,24),a=i.div,o=i.mod;if(a&&(this.hour=o,this.addDaily(a)),jt(s)||he(s,this.hour))break}},e.prototype.addMinutes=function(t,n,s,i){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/t)*t);;){this.minute+=t;var a=tu(this.minute,60),o=a.div,u=a.mod;if(o&&(this.minute=u,this.addHours(o,!1,s)),(jt(s)||he(s,this.hour))&&(jt(i)||he(i,this.minute)))break}},e.prototype.addSeconds=function(t,n,s,i,a){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var o=tu(this.second,60),u=o.div,l=o.mod;if(u&&(this.second=l,this.addMinutes(u,!1,s,i)),(jt(s)||he(s,this.hour))&&(jt(i)||he(i,this.minute))&&(jt(a)||he(a,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=ap(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>ru))return;t=ap(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var s=t.freq,i=t.interval,a=t.wkst,o=t.byhour,u=t.byminute,l=t.bysecond;switch(s){case ue.YEARLY:return this.addYears(i);case ue.MONTHLY:return this.addMonths(i);case ue.WEEKLY:return this.addWeekly(i,a);case ue.DAILY:return this.addDaily(i);case ue.HOURLY:return this.addHours(i,n,o);case ue.MINUTELY:return this.addMinutes(i,n,o,u);case ue.SECONDLY:return this.addSeconds(i,n,o,u,l)}},e}(Us);function cp(r){for(var e=[],t=Object.keys(r),n=0,s=t;n<s.length;n++){var i=s[n];he(kT,i)||e.push(i),ip(r[i])&&!Qn(r[i])&&e.push(i)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return ft({},r)}function wT(r){var e=ft(ft({},Sa),cp(r));if(Ae(e.byeaster)&&(e.freq=j.YEARLY),!(Ae(e.freq)&&j.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))),Ae(e.wkst)?Yt(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=j.MO.weekday,Ae(e.bysetpos)){Yt(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)||We(e.byweekno)||We(e.byyearday)||Boolean(e.bymonthday)||We(e.bymonthday)||Ae(e.byweekday)||Ae(e.byeaster)))switch(e.freq){case j.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case j.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case j.WEEKLY:e.byweekday=[Xr(e.dtstart)];break}if(Ae(e.bymonth)&&!dt(e.bymonth)&&(e.bymonth=[e.bymonth]),Ae(e.byyearday)&&!dt(e.byyearday)&&Yt(e.byyearday)&&(e.byyearday=[e.byyearday]),!Ae(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(dt(e.bymonthday)){for(var s=[],i=[],t=0;t<e.bymonthday.length;t++){var n=e.bymonthday[t];n>0?s.push(n):n<0&&i.push(n)}e.bymonthday=s,e.bynmonthday=i}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(Ae(e.byweekno)&&!dt(e.byweekno)&&(e.byweekno=[e.byweekno]),!Ae(e.byweekday))e.bynweekday=null;else if(Yt(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(sp(e.byweekday))e.byweekday=[He.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof He)!e.byweekday.n||e.freq>j.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(Yt(u)){a.push(u);continue}else if(sp(u)){a.push(He.fromStr(u).weekday);continue}!u.n||e.freq>j.MONTHLY?a.push(u.weekday):o.push([u.weekday,u.n])}e.byweekday=We(a)?a:null,e.bynweekday=We(o)?o:null}return Ae(e.byhour)?Yt(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<j.HOURLY?[e.dtstart.getUTCHours()]:null,Ae(e.byminute)?Yt(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<j.MINUTELY?[e.dtstart.getUTCMinutes()]:null,Ae(e.bysecond)?Yt(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<j.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function ET(r){var e=r.dtstart.getTime()%1e3;if(!ka(r.freq))return[];var t=[];return r.byhour.forEach(function(n){r.byminute.forEach(function(s){r.bysecond.forEach(function(i){t.push(new Us(n,s,i,e))})})}),t}function Da(r){var e=r.split(`
`).map(DC).filter(function(t){return t!==null});return ft(ft({},e[0]),e[1])}function Oa(r){var e={},t=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(r);if(!t)return e;var n=t[1],s=t[2];return n&&(e.tzid=n),e.dtstart=wa(s),e}function DC(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return ST(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return ST(r);case"DTSTART":return Oa(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function ST(r){var e=r.replace(/^RRULE:/i,""),t=Oa(e),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(s){var i=s.split("="),a=i[0],o=i[1];switch(a.toUpperCase()){case"FREQ":t.freq=ue[o.toUpperCase()];break;case"WKST":t.wkst=nr[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=xC(o),l=a.toLowerCase();t[l]=u;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=RC(o);break;case"DTSTART":case"TZID":var c=Oa(r);t.tzid=c.tzid,t.dtstart=c.dtstart;break;case"UNTIL":t.until=wa(o);break;case"BYEASTER":t.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),t}function xC(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(OT)}return OT(r)}function OT(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function RC(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return nr[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 s=Number(n[1]),i=n[2],a=nr[i].weekday;return new He(a,s)})}var Zn=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=Is(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:gT(this.date,this.tzid)},r}();function xa(r){for(var e=[],t="",n=Object.keys(r),s=Object.keys(Sa),i=0;i<n.length;i++)if(n[i]!=="tzid"&&!!he(s,n[i])){var a=n[i].toUpperCase(),o=r[n[i]],u="";if(!(!Ae(o)||dt(o)&&!o.length)){switch(a){case"FREQ":u=j.FREQUENCIES[r.freq];break;case"WKST":Yt(o)?u=new He(o).toString():u=o.toString();break;case"BYWEEKDAY":a="BYDAY",u=cT(o).map(function(y){return y instanceof He?y:dt(y)?new He(y[0],y[1]):new He(y)}).toString();break;case"DTSTART":t=MC(o,r.tzid);break;case"UNTIL":u=Is(o,!r.tzid);break;default:if(dt(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 f=e.map(function(y){var k=y[0],E=y[1];return"".concat(k,"=").concat(E.toString())}).join(";"),m="";return f!==""&&(m="RRULE:".concat(f)),[t,m].filter(function(y){return!!y}).join(`
`)}function MC(r,e){return r?"DTSTART"+new Zn(new Date(r),e).toString():""}function CC(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 DT=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?iu(t):op(t)),e==="all"?this.all=t:(n._value=t,this[e].push(n))},r.prototype._cacheGet=function(e,t){var n=!1,s=t?Object.keys(t):[],i=function(c){for(var f=0;f<s.length;f++){var m=s[f];if(!CC(t[m],c[m]))return!0}return!1},a=this[e];if(e==="all")n=this.all;else if(dt(a))for(var o=0;o<a.length;o++){var u=a[o];if(!(s.length&&i(u))){n=u._value;break}}if(!n&&this.all){for(var l=new Jr(e,t),o=0;o<this.all.length&&l.accept(this.all[o]);o++);n=l.getValue(),this._cacheAdd(e,n,t)}return dt(n)?op(n):n instanceof Date?iu(n):n},r}();var xT=P(P(P(P(P(P(P(P(P(P(P(P(P([],pe(1,31),!0),pe(2,28),!0),pe(3,31),!0),pe(4,30),!0),pe(5,31),!0),pe(6,30),!0),pe(7,31),!0),pe(8,31),!0),pe(9,30),!0),pe(10,31),!0),pe(11,30),!0),pe(12,31),!0),pe(1,7),!0),RT=P(P(P(P(P(P(P(P(P(P(P(P(P([],pe(1,31),!0),pe(2,29),!0),pe(3,31),!0),pe(4,30),!0),pe(5,31),!0),pe(6,30),!0),pe(7,31),!0),pe(8,31),!0),pe(9,30),!0),pe(10,31),!0),pe(11,30),!0),pe(12,31),!0),pe(1,7),!0),AC=rr(1,29),PC=rr(1,30),_n=rr(1,31),yt=rr(1,32),MT=P(P(P(P(P(P(P(P(P(P(P(P(P([],yt,!0),PC,!0),yt,!0),_n,!0),yt,!0),_n,!0),yt,!0),yt,!0),_n,!0),yt,!0),_n,!0),yt,!0),yt.slice(0,7),!0),CT=P(P(P(P(P(P(P(P(P(P(P(P(P([],yt,!0),AC,!0),yt,!0),_n,!0),yt,!0),_n,!0),yt,!0),yt,!0),_n,!0),yt,!0),_n,!0),yt,!0),yt.slice(0,7),!0),NC=rr(-28,0),IC=rr(-29,0),vn=rr(-30,0),bt=rr(-31,0),AT=P(P(P(P(P(P(P(P(P(P(P(P(P([],bt,!0),IC,!0),bt,!0),vn,!0),bt,!0),vn,!0),bt,!0),bt,!0),vn,!0),bt,!0),vn,!0),bt,!0),bt.slice(0,7),!0),PT=P(P(P(P(P(P(P(P(P(P(P(P(P([],bt,!0),NC,!0),bt,!0),vn,!0),bt,!0),vn,!0),bt,!0),bt,!0),vn,!0),bt,!0),vn,!0),bt,!0),bt.slice(0,7),!0),NT=[0,31,60,91,121,152,182,213,244,274,305,335,366],IT=[0,31,59,90,120,151,181,212,243,273,304,334,365],dp=function(){for(var r=[],e=0;e<55;e++)r=r.concat(rr(7));return r}();function FT(r,e){var t=Rr(r,1,1),n=Ns(r)?366:365,s=Ns(r+1)?366:365,i=va(t),a=Xr(t),o=ft(ft({yearlen:n,nextyearlen:s,yearordinal:i,yearweekday:a},FC(r)),{wnomask:null});if(jt(e.byweekno))return o;o.wnomask=pe(0,n+7);var u,l,c=u=gt(7-a+e.wkst,7);c>=4?(c=0,l=o.yearlen+gt(a-e.wkst,7)):l=n-c;for(var f=Math.floor(l/7),m=gt(l,7),y=Math.floor(f+m/4),k=0;k<e.byweekno.length;k++){var E=e.byweekno[k];if(E<0&&(E+=y+1),E>0&&E<=y){var x=void 0;E>1?(x=c+(E-1)*7,c!==u&&(x-=7-u)):x=c;for(var v=0;v<7&&(o.wnomask[x]=1,x++,o.wdaymask[x]!==e.wkst);v++);}}if(he(e.byweekno,1)){var x=c+y*7;if(c!==u&&(x-=7-u),x<n)for(var k=0;k<7&&(o.wnomask[x]=1,x+=1,o.wdaymask[x]!==e.wkst);k++);}if(c){var I=void 0;if(he(e.byweekno,-1))I=-1;else{var F=Xr(Rr(r-1,1,1)),le=gt(7-F.valueOf()+e.wkst,7),B=Ns(r-1)?366:365,ie=void 0;le>=4?(le=0,ie=B+gt(F-e.wkst,7)):ie=n-c,I=Math.floor(52+gt(ie,7)/4)}if(he(e.byweekno,I))for(var x=0;x<c;x++)o.wnomask[x]=1}return o}function FC(r){var e=Ns(r)?366:365,t=Rr(r,1,1),n=Xr(t);return e===365?{mmask:xT,mdaymask:CT,nmdaymask:PT,wdaymask:dp.slice(n),mrange:IT}:{mmask:RT,mdaymask:MT,nmdaymask:AT,wdaymask:dp.slice(n),mrange:NT}}function LT(r,e,t,n,s,i){var a={lastyear:r,lastmonth:e,nwdaymask:[]},o=[];if(i.freq===j.YEARLY)if(jt(i.bymonth))o=[[0,t]];else for(var u=0;u<i.bymonth.length;u++)e=i.bymonth[u],o.push(n.slice(e-1,e+1));else i.freq===j.MONTHLY&&(o=[n.slice(e-1,e+1)]);if(jt(o))return a;a.nwdaymask=pe(0,t);for(var u=0;u<o.length;u++)for(var l=o[u],c=l[0],f=l[1]-1,m=0;m<i.bynweekday.length;m++){var y=void 0,k=i.bynweekday[m],E=k[0],x=k[1];x<0?(y=f+(x+1)*7,y-=gt(s[y]-E,7)):(y=c+(x-1)*7,y+=gt(7-s[y]+E,7)),c<=y&&y<=f&&(a.nwdaymask[y]=1)}return a}function UT(r,e){e===void 0&&(e=0);var t=r%19,n=Math.floor(r/100),s=r%100,i=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-i-u+15)%30,c=Math.floor(s/4),f=s%4,m=Math.floor(32+2*a+2*c-l-f)%7,y=Math.floor((t+11*l+22*m)/451),k=Math.floor((l+m-7*y+114)/31),E=(l+m-7*y+114)%31+1,x=Date.UTC(r,k-1,E+e),v=Date.UTC(r,0,1);return[Math.ceil((x-v)/(1e3*60*60*24))]}var LC=function(){function r(e){this.options=e}return r.prototype.rebuild=function(e,t){var n=this.options;if(e!==this.lastyear&&(this.yearinfo=FT(e,n)),We(n.bynweekday)&&(t!==this.lastmonth||e!==this.lastyear)){var s=this.yearinfo,i=s.yearlen,a=s.mrange,o=s.wdaymask;this.monthinfo=LT(e,t,i,a,o,n)}Ae(n.byeaster)&&(this.eastermask=UT(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[rr(this.yearlen),0,this.yearlen]},r.prototype.mdayset=function(e,t){for(var n=this.mrange[t-1],s=this.mrange[t],i=pe(null,this.yearlen),a=n;a<s;a++)i[a]=a;return[i,n,s]},r.prototype.wdayset=function(e,t,n){for(var s=pe(null,this.yearlen+7),i=va(Rr(e,t,n))-this.yearordinal,a=i,o=0;o<7&&(s[i]=i,++i,this.wdaymask[i]!==this.options.wkst);o++);return[s,a,i]},r.prototype.ddayset=function(e,t,n){var s=pe(null,this.yearlen),i=va(Rr(e,t,n))-this.yearordinal;return s[i]=i,[s,i,i+1]},r.prototype.htimeset=function(e,t,n,s){var i=this,a=[];return this.options.byminute.forEach(function(o){a=a.concat(i.mtimeset(e,o,n,s))}),Zr(a),a},r.prototype.mtimeset=function(e,t,n,s){var i=this.options.bysecond.map(function(a){return new Us(e,t,a,s)});return Zr(i),i},r.prototype.stimeset=function(e,t,n,s){return[new Us(e,t,n,s)]},r.prototype.getdayset=function(e){switch(e){case ue.YEARLY:return this.ydayset.bind(this);case ue.MONTHLY:return this.mdayset.bind(this);case ue.WEEKLY:return this.wdayset.bind(this);case ue.DAILY:return this.ddayset.bind(this);default:return this.ddayset.bind(this)}},r.prototype.gettimeset=function(e){switch(e){case ue.HOURLY:return this.htimeset.bind(this);case ue.MINUTELY:return this.mtimeset.bind(this);case ue.SECONDLY:return this.stimeset.bind(this)}},r}(),qT=LC;function WT(r,e,t,n,s,i){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=gt(c,e.length)):(u=Math.floor((c-1)/e.length),l=gt(c-1,e.length));for(var f=[],m=t;m<n;m++){var y=i[m];!Ae(y)||f.push(y)}var k=void 0;u<0?k=f.slice(u)[0]:k=f[u];var E=e[l],x=nu(s.yearordinal+k),v=su(x,E);he(a,v)||a.push(v)}return Zr(a),a}function au(r,e){var t=e.dtstart,n=e.freq,s=e.interval,i=e.until,a=e.bysetpos,o=e.count;if(o===0||s===0)return en(r);var u=vT.fromDate(t),l=new qT(e);l.rebuild(u.year,u.month);for(var c=WC(l,u,e);;){var f=l.getdayset(n)(u.year,u.month,u.day),m=f[0],y=f[1],k=f[2],E=qC(m,y,k,l,e);if(We(a))for(var x=WT(a,c,y,k,l,m),v=0;v<x.length;v++){var I=x[v];if(i&&I>i)return en(r);if(I>=t){var F=YT(I,e);if(!r.accept(F)||o&&(--o,!o))return en(r)}}else for(var v=y;v<k;v++){var le=m[v];if(!!Ae(le))for(var B=nu(l.yearordinal+le),ie=0;ie<c.length;ie++){var W=c[ie],I=su(B,W);if(i&&I>i)return en(r);if(I>=t){var F=YT(I,e);if(!r.accept(F)||o&&(--o,!o))return en(r)}}}if(e.interval===0||(u.add(e,E),u.year>ru))return en(r);ka(n)||(c=l.gettimeset(n)(u.hour,u.minute,u.second,0)),l.rebuild(u.year,u.month)}}function UC(r,e,t){var n=t.bymonth,s=t.byweekno,i=t.byweekday,a=t.byeaster,o=t.bymonthday,u=t.bynmonthday,l=t.byyearday;return We(n)&&!he(n,r.mmask[e])||We(s)&&!r.wnomask[e]||We(i)&&!he(i,r.wdaymask[e])||We(r.nwdaymask)&&!r.nwdaymask[e]||a!==null&&!he(r.eastermask,e)||(We(o)||We(u))&&!he(o,r.mdaymask[e])&&!he(u,r.nmdaymask[e])||We(l)&&(e<r.yearlen&&!he(l,e+1)&&!he(l,-r.yearlen+e)||e>=r.yearlen&&!he(l,e+1-r.yearlen)&&!he(l,-r.nextyearlen+e-r.yearlen))}function YT(r,e){return new Zn(r,e.tzid).rezonedDate()}function en(r){return r.getValue()}function qC(r,e,t,n,s){for(var i=!1,a=e;a<t;a++){var o=r[a];i=UC(n,o,s),i&&(r[o]=null)}return i}function WC(r,e,t){var n=t.freq,s=t.byhour,i=t.byminute,a=t.bysecond;return ka(n)?ET(t):n>=j.HOURLY&&We(s)&&!he(s,e.hour)||n>=j.MINUTELY&&We(i)&&!he(i,e.minute)||n>=j.SECONDLY&&We(a)&&!he(a,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var nr={MO:new He(0),TU:new He(1),WE:new He(2),TH:new He(3),FR:new He(4),SA:new He(5),SU:new He(6)},Sa={freq:ue.YEARLY,dtstart:null,interval:1,wkst:nr.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},kT=Object.keys(Sa),j=function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new DT,this.origOptions=cp(e);var n=wT(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return Ea(e,t)},r.fromText=function(e,t){return bT(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return au(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 lp("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new Jr("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,s){if(n===void 0&&(n=!1),!Qn(e)||!Qn(t))throw new Error("Invalid date passed in to RRule.between");var i={before:t,after:e,inc:n};if(s)return this._iter(new lp("between",i,s));var a=this._cacheGet("between",i);return a===!1&&(a=this._iter(new Jr("between",i)),this._cacheAdd("between",a,i)),a},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!Qn(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},s=this._cacheGet("before",n);return s===!1&&(s=this._iter(new Jr("before",n)),this._cacheAdd("before",s,n)),s},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!Qn(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},s=this._cacheGet("after",n);return s===!1&&(s=this._iter(new Jr("after",n)),this._cacheAdd("after",s,n)),s},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return xa(this.origOptions)},r.prototype.toText=function(e,t,n){return TT(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return _T(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=ue.YEARLY,r.MONTHLY=ue.MONTHLY,r.WEEKLY=ue.WEEKLY,r.DAILY=ue.DAILY,r.HOURLY=ue.HOURLY,r.MINUTELY=ue.MINUTELY,r.SECONDLY=ue.SECONDLY,r.MO=nr.MO,r.TU=nr.TU,r.WE=nr.WE,r.TH=nr.TH,r.FR=nr.FR,r.SA=nr.SA,r.SU=nr.SU,r.parseString=Da,r.optionsToString=xa,r}();function jT(r,e,t,n,s,i){var a={},o=r.accept;function u(m,y){t.forEach(function(k){k.between(m,y,!0).forEach(function(E){a[Number(E)]=!0})})}s.forEach(function(m){var y=new Zn(m,i).rezonedDate();a[Number(y)]=!0}),r.accept=function(m){var y=Number(m);return isNaN(y)?o.call(this,m):!a[y]&&(u(new Date(y-1),new Date(y+1)),!a[y])?(a[y]=!0,o.call(this,m)):!0},r.method==="between"&&(u(r.args.after,r.args.before),r.accept=function(m){var y=Number(m);return a[y]?!0:(a[y]=!0,o.call(this,m))});for(var l=0;l<n.length;l++){var c=new Zn(n[l],i).rezonedDate();if(!r.accept(new Date(c.getTime())))break}e.forEach(function(m){au(r,m.options)});var f=r._result;switch(Zr(f),r.method){case"all":case"between":return f;case"before":return f.length&&f[f.length-1]||null;case"after":default:return f.length&&f[0]||null}}var GT={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function YC(r,e){var t=[],n=[],s=[],i=[],a=Oa(r),o=a.dtstart,u=a.tzid,l=HC(r,e.unfold);return l.forEach(function(c){var f;if(!!c){var m=BC(c),y=m.name,k=m.parms,E=m.value;switch(y.toUpperCase()){case"RRULE":if(k.length)throw new Error("unsupported RRULE parm: ".concat(k.join(",")));t.push(Da(c));break;case"RDATE":var x=(f=/RDATE(?:;TZID=([^:=]+))?/i.exec(c))!==null&&f!==void 0?f:[],v=x[1];v&&!u&&(u=v),n=n.concat($T(E,k));break;case"EXRULE":if(k.length)throw new Error("unsupported EXRULE parm: ".concat(k.join(",")));s.push(Da(E));break;case"EXDATE":i=i.concat($T(E,k));break;case"DTSTART":break;default:throw new Error("unsupported property: "+y)}}}),{dtstart:o,tzid:u,rrulevals:t,rdatevals:n,exrulevals:s,exdatevals:i}}function jC(r,e){var t=YC(r,e),n=t.rrulevals,s=t.rdatevals,i=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||s.length||i.length||a.length){var c=new pp(l);return c.dtstart(o),c.tzid(u||void 0),n.forEach(function(m){c.rrule(new j(fp(m,o,u),l))}),s.forEach(function(m){c.rdate(m)}),i.forEach(function(m){c.exrule(new j(fp(m,o,u),l))}),a.forEach(function(m){c.exdate(m)}),e.compatible&&e.dtstart&&c.rdate(o),c}var f=n[0]||{};return new j(fp(f,f.dtstart||e.dtstart||o,f.tzid||e.tzid||u),l)}function ou(r,e){return e===void 0&&(e={}),jC(r,GC(e))}function fp(r,e,t){return ft(ft({},r),{dtstart:e,tzid:t})}function GC(r){var e=[],t=Object.keys(r),n=Object.keys(GT);if(t.forEach(function(s){he(n,s)||e.push(s)}),e.length)throw new Error("Invalid options: "+e.join(", "));return ft(ft({},GT),r)}function $C(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=dT(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function BC(r){var e=$C(r),t=e.name,n=e.value,s=t.split(";");if(!s)throw new Error("empty property name");return{name:s[0].toUpperCase(),parms:s.slice(1),value:n}}function HC(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 s=t[n]=t[n].replace(/\s+$/g,"");s?n>0&&s[0]===" "?(t[n-1]+=s.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function zC(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function $T(r,e){return zC(e),r.split(",").map(function(t){return wa(t)})}function BT(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 s=e._rrule[n].origOptions[r];if(s)return s}}}var pp=function(r){Fs(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=BT.apply(n,["dtstart"]),n.tzid=BT.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return jT(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){HT(t,this._rrule)},e.prototype.exrule=function(t){HT(t,this._exrule)},e.prototype.rdate=function(t){zT(t,this._rdate)},e.prototype.exdate=function(t){zT(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return ou(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return ou(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(xa({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(s){return s.replace(/^RRULE:/,"EXRULE:")}).filter(function(s){return!/^DTSTART/.test(s)}))}),this._rdate.length&&t.push(VT("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(VT("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}(j);function HT(r,e){if(!(r instanceof j))throw new TypeError(String(r)+" is not RRule instance");he(e.map(String),String(r))||e.push(r)}function zT(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");he(e.map(Number),Number(r))||(e.push(r),Zr(e))}function VT(r,e,t){var n=!t||t.toUpperCase()==="UTC",s=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),i=e.map(function(a){return Is(a.valueOf(),n)}).join(",");return"".concat(s).concat(i)}function sr(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}var st=class{constructor({rrule:e,baseOnToday:t,referenceDate:n,startDate:s,scheduledDate:i,dueDate:a}){this.rrule=e,this.baseOnToday=t,this.referenceDate=n,this.startDate=s,this.scheduledDate=i,this.dueDate=a}static fromText({recurrenceRuleText:e,startDate:t,scheduledDate:n,dueDate:s}){try{let i=e.match(/^([a-zA-Z0-9, !]+?)( when done)?$/i);if(i==null)return null;let a=i[1].trim(),o=i[2]!==void 0,u=j.parseText(a);if(u!==null){let l=null;s?l=window.moment(s):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 j(u);return new st({rrule:c,baseOnToday:o,referenceDate:l,startDate:t,scheduledDate:n,dueDate:s})}}catch(i){i instanceof Error&&console.log(i.message)}return null}toText(){let e=this.rrule.toText();return this.baseOnToday&&(e+=" when done"),e}next(){let e=this.nextReferenceDate();if(e!==null){let t=null,n=null,s=null;if(this.referenceDate){if(this.startDate){let i=window.moment.duration(this.startDate.diff(this.referenceDate));t=window.moment(e),t.add(Math.round(i.asDays()),"days")}if(this.scheduledDate){let i=window.moment.duration(this.scheduledDate.diff(this.referenceDate));n=window.moment(e),n.add(Math.round(i.asDays()),"days")}if(this.dueDate){let i=window.moment.duration(this.dueDate.diff(this.referenceDate));s=window.moment(e),s.add(Math.round(i.asDays()),"days")}}return{startDate:t,scheduledDate:n,dueDate:s}}return null}identicalTo(e){return this.baseOnToday!==e.baseOnToday||sr(this.startDate,e.startDate)!==0||sr(this.scheduledDate,e.scheduledDate)!==0||sr(this.dueDate,e.dueDate)!==0?!1:this.toText()===e.toText()}nextReferenceDate(){if(this.baseOnToday){let e=window.moment();return this.nextReferenceDateFromToday(e).toDate()}else return this.nextReferenceDateFromOriginalReferenceDate().toDate()}nextReferenceDateFromToday(e){let t=new j(ot(Se({},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())),s=this.toText(),i=s.match(/every( \d+)? month(s)?(.*)?/);i!==null&&(s.includes(" on ")||(n=st.nextAfterMonths(e,n,t,i[1])));let a=s.match(/every( \d+)? year(s)?(.*)?/);return a!==null&&(n=st.nextAfterYears(e,n,t,a[1])),st.addTimezone(n)}static nextAfterMonths(e,t,n,s){let i=1;for(s!==void 0&&(i=Number.parseInt(s.trim(),10));st.isSkippingTooManyMonths(e,t,i);)t=st.fromOneDayEarlier(e,n);return t}static isSkippingTooManyMonths(e,t,n){let s=t.month()-e.month();return s+=(t.year()-e.year())*12,s>n}static nextAfterYears(e,t,n,s){let i=1;for(s!==void 0&&(i=Number.parseInt(s.trim(),10));st.isSkippingTooManyYears(e,t,i);)t=st.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 j(n),window.moment(t.after(e.toDate()))}static addTimezone(e){return window.moment.utc(e).local(!0).startOf("day")}};function uu(r){return r.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")}var wn=class{constructor(){this._globalFilter="";this._removeGlobalFilter=!1}static getInstance(){return wn.instance||(wn.instance=new wn),wn.instance}get(){return this._globalFilter}set(e){this._globalFilter=e}reset(){this.set(wn.empty)}isEmpty(){return this.get()===wn.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)"+uu(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=wn;ye.empty="";var mp=5;function hp(r,e){let t=[r.startDateSymbol,r.scheduledDateSymbol,r.dueDateSymbol].join("|");return(n,s,i)=>{let a=[];return a=a.concat(KC(n,s,i,t,e)),a=a.concat(QC(n,s,i,r.recurrenceSymbol)),a=a.concat(VC(n,s,i,r)),a.length>0&&!a.some(o=>o.suggestionType==="match")&&a.unshift({suggestionType:"empty",displayText:"\u23CE",appendText:`
`}),a=a.slice(0,i.autoSuggestMaxItems),a}}function VC(r,e,t,n){let s=u=>Object.values(n.prioritySymbols).some(l=>l.length>0&&u.includes(l)),i=[];if(r.includes(n.dueDateSymbol)||i.push({displayText:`${n.dueDateSymbol} due date`,appendText:`${n.dueDateSymbol} `}),r.includes(n.startDateSymbol)||i.push({displayText:`${n.startDateSymbol} start date`,appendText:`${n.startDateSymbol} `}),r.includes(n.scheduledDateSymbol)||i.push({displayText:`${n.scheduledDateSymbol} scheduled date`,appendText:`${n.scheduledDateSymbol} `}),s(r)||(i.push({displayText:`${n.prioritySymbols.High} high priority`,appendText:`${n.prioritySymbols.High} `}),i.push({displayText:`${n.prioritySymbols.Medium} medium priority`,appendText:`${n.prioritySymbols.Medium} `}),i.push({displayText:`${n.prioritySymbols.Low} low priority`,appendText:`${n.prioritySymbols.Low} `}),i.push({displayText:`${n.prioritySymbols.Highest} highest priority`,appendText:`${n.prioritySymbols.Highest} `}),i.push({displayText:`${n.prioritySymbols.Lowest} lowest priority`,appendText:`${n.prioritySymbols.Lowest} `})),r.includes(n.recurrenceSymbol)||i.push({displayText:`${n.recurrenceSymbol} recurring (repeat)`,appendText:`${n.recurrenceSymbol} `}),!r.includes(n.createdDateSymbol)){let l=Wt.parseDate("today",!0).format(z.dateFormat);i.push({textToMatch:`${n.createdDateSymbol} created`,displayText:`${n.createdDateSymbol} created today (${l})`,appendText:`${n.createdDateSymbol} ${l} `})}let a=gp(r,/([a-zA-Z'_-]*)/g,e),o=[];if(a&&a.length>0){let u=a[0];if(u.length>=Math.max(1,t.autoSuggestMinMatch)){let l=i.filter(c=>(c.textToMatch||c.displayText).toLowerCase().includes(u.toLowerCase()));for(let c of l)o.push({suggestionType:"match",displayText:c.displayText,appendText:c.appendText,insertAt:a.index,insertSkip:u.length})}}return o.length===0&&t.autoSuggestMinMatch===0?i:o}function KC(r,e,t,n,s){let i=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],a=[],o=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),u=gp(r,o,e);if(u&&u.length>=2){let l=u[1],c=u[2];if(c.length<t.autoSuggestMinMatch)return[];let f=c&&c.length>1?Wt.parseDate(Qr(c),!0):null;f&&f.isValid()&&a.push({displayText:`${f.format(z.dateFormat)}`,appendText:`${l} ${f.format(z.dateFormat)} `,insertAt:u.index,insertSkip:u[0].length});let m=1,y=i.filter(k=>c&&c.length>=m&&k.toLowerCase().includes(c.toLowerCase())).slice(0,s);y.length===0&&(y=i.slice(0,s));for(let k of y){let x=`${Wt.parseDate(k,!0).format(z.dateFormat)}`;a.push({suggestionType:"match",displayText:`${k} (${x})`,appendText:`${l} ${x} `,insertAt:u.index,insertSkip:u[0].length})}}return a}function QC(r,e,t,n){var u;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"],i=[],a=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),o=gp(r,a,e);if(o&&o.length>=2){let l=o[1],c=o[2];if(c.length<t.autoSuggestMinMatch)return[];if(c.length>0){let k=(u=st.fromText({recurrenceRuleText:c,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:u.toText();if(k){let E=`${l} ${k} `;if(i.push({suggestionType:"match",displayText:`\u2705 ${k}`,appendText:E,insertAt:o.index,insertSkip:o[0].length}),o[0]==E)return[]}}let f=1,m=t.autoSuggestMaxItems/2,y=s.filter(k=>c&&c.length>=f&&k.toLowerCase().includes(c.toLowerCase())).slice(0,m);y.length===0&&c.trim().length===0&&(y=s.slice(0,m));for(let k of y)i.push({suggestionType:"match",displayText:`${k}`,appendText:`${l} ${k} `,insertAt:o.index,insertSkip:o[0].length})}return i}function gp(r,e,t){let n=r.matchAll(e);for(let s of n)if((s==null?void 0:s.index)&&s.index<=t&&t<=s.index+s[0].length)return s}function XC(r,e){if(e.length===0)return!1;let t=Object.fromEntries(e.map(([s,i])=>[s,0])),n=Object.fromEntries(e.map(([s,i])=>[i,s]));for(let s of r)s in t?t[s]++:s in n&&(t[n[s]]=Math.max(0,t[n[s]]-1));return Object.values(t).some(s=>s>0)}function QT(r,e){return(t,n,s)=>XC(t.slice(0,n),e)?r(t,n,s):[]}function XT(r,e){return ye.getInstance().includedIn(r)&&ZC(r,e)}function ZC(r,e){if(r.length===0)return!1;let t=fe.extractTaskComponents(r);if(!t)return!1;let n=t.indentation+t.listMarker+" ["+t.status.symbol+"] ";return e>=n.length}var En=class{constructor(){this.hidePostponeButton=!1;this.hideTaskCount=!1;this.hideBacklinks=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.shortMode=!1;this.explainQuery=!1}};var Ra=["description","priority","recurrenceRule","createdDate","startDate","scheduledDate","dueDate","cancelledDate","doneDate","blockLink"],yp=class{constructor(e){e?this.queryLayoutOptions=e:this.queryLayoutOptions=new En}applyQueryLayoutOptions(e){let t=[[this.queryLayoutOptions.hideUrgency,"urgency"],[this.queryLayoutOptions.hideBacklinks,"backlinks"],[this.queryLayoutOptions.hideEditButton,"edit-button"],[this.queryLayoutOptions.hidePostponeButton,"postpone-button"]];for(let[n,s]of t)bp(e,n,s);this.queryLayoutOptions.shortMode&&e.push("tasks-layout-short-mode")}};function bp(r,e,t){e&&r.push(JC(t))}function JC(r){return`tasks-layout-hide-${r}`}var lu=class extends yp{constructor(t,n){super(n);this._taskListHiddenClasses=[];t?this.taskLayoutOptions=t:this.taskLayoutOptions=new Cr,this.applyTaskLayoutOptions(),this.applyQueryLayoutOptions(this._taskListHiddenClasses)}taskListHiddenClasses(){return this._taskListHiddenClasses}applyTaskLayoutOptions(){this.taskLayoutOptions.toggleableComponents.forEach(t=>{bp(this._taskListHiddenClasses,!this.taskLayoutOptions.isShown(t),t)}),bp(this._taskListHiddenClasses,!this.taskLayoutOptions.areTagsShown(),"tags")}};var Cr=class{constructor(){this.visible={};this.tagsVisible=!0;Ra.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 Ra.filter(e=>this.visible[e])}get hiddenComponents(){return Ra.filter(e=>!this.visible[e])}get toggleableComponents(){return Ra.filter(e=>e!=="description"&&e!=="blockLink")}toggleVisibilityExceptDescriptionAndBlockLink(){this.toggleableComponents.forEach(e=>{this.visible[e]=!this.visible[e]}),this.setTagsVisibility(!this.areTagsShown())}};var Tp={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}",TaskFormatRegularExpressions:{priorityRegex:/([🔺⏫🔼🔽⏬])$/u,startDateRegex:/🛫 *(\d{4}-\d{2}-\d{2})$/u,createdDateRegex:/ *(\d{4}-\d{2}-\d{2})$/u,scheduledDateRegex:/[⏳⌛] *(\d{4}-\d{2}-\d{2})$/u,dueDateRegex:/[📅📆🗓] *(\d{4}-\d{2}-\d{2})$/u,doneDateRegex:/✅ *(\d{4}-\d{2}-\d{2})$/u,cancelledDateRegex:/❌ *(\d{4}-\d{2}-\d{2})$/u,recurrenceRegex:/🔁 ?([a-zA-Z0-9, !]+)$/iu}},Jn=class{constructor(e){this.symbols=e}serialize(e){let t=new Cr,n="",s=!1;for(let i of t.shownComponents)n+=this.componentToString(e,s,i);return n}componentToString(e,t,n){var m;let{prioritySymbols:s,startDateSymbol:i,createdDateSymbol:a,scheduledDateSymbol:o,doneDateSymbol:u,cancelledDateSymbol:l,recurrenceSymbol:c,dueDateSymbol:f}=this.symbols;switch(n){case"description":return e.description;case"priority":{let y="";return e.priority==="0"?y=" "+s.Highest:e.priority==="1"?y=" "+s.High:e.priority==="2"?y=" "+s.Medium:e.priority==="4"?y=" "+s.Low:e.priority==="5"&&(y=" "+s.Lowest),y}case"startDate":return e.startDate?t?" "+i:` ${i} ${e.startDate.format(z.dateFormat)}`:"";case"createdDate":return e.createdDate?t?" "+a:` ${a} ${e.createdDate.format(z.dateFormat)}`:"";case"scheduledDate":return!e.scheduledDate||e.scheduledDateIsInferred?"":t?" "+o:` ${o} ${e.scheduledDate.format(z.dateFormat)}`;case"doneDate":return e.doneDate?t?" "+u:` ${u} ${e.doneDate.format(z.dateFormat)}`:"";case"cancelledDate":return e.cancelledDate?t?" "+l:` ${l} ${e.cancelledDate.format(z.dateFormat)}`:"";case"dueDate":return e.dueDate?t?" "+f:` ${f} ${e.dueDate.format(z.dateFormat)}`:"";case"recurrenceRule":return e.recurrence?t?" "+c:` ${c} ${e.recurrence.toText()}`:"";case"blockLink":return(m=e.blockLink)!=null?m:"";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,s="3",i=null,a=null,o=null,u=null,l=null,c=null,f="",m=null,y="",k=20,E=0;do{n=!1;let x=e.match(t.priorityRegex);x!==null&&(s=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],z.dateFormat),e=e.replace(t.doneDateRegex,"").trim(),n=!0);let I=e.match(t.cancelledDateRegex);I!==null&&(l=window.moment(I[1],z.dateFormat),e=e.replace(t.cancelledDateRegex,"").trim(),n=!0);let F=e.match(t.dueDateRegex);F!==null&&(o=window.moment(F[1],z.dateFormat),e=e.replace(t.dueDateRegex,"").trim(),n=!0);let le=e.match(t.scheduledDateRegex);le!==null&&(a=window.moment(le[1],z.dateFormat),e=e.replace(t.scheduledDateRegex,"").trim(),n=!0);let B=e.match(t.startDateRegex);B!==null&&(i=window.moment(B[1],z.dateFormat),e=e.replace(t.startDateRegex,"").trim(),n=!0);let ie=e.match(t.createdDateRegex);ie!==null&&(c=window.moment(ie[1],z.dateFormat),e=e.replace(t.createdDateRegex,"").trim(),n=!0);let W=e.match(t.recurrenceRegex);W!==null&&(f=W[1].trim(),e=e.replace(t.recurrenceRegex,"").trim(),n=!0);let G=e.match(z.hashTagsFromEnd);if(G!=null){e=e.replace(z.hashTagsFromEnd,"").trim(),n=!0;let ce=G[0].trim();y=y.length>0?[ce,y].join(" "):ce}E++}while(n&&E<=k);return f.length>0&&(m=st.fromText({recurrenceRuleText:f,startDate:i,scheduledDate:a,dueDate:o})),y.length>0&&(e+=" "+y),{description:e,priority:s,startDate:i,createdDate:c,scheduledDate:a,dueDate:o,doneDate:u,cancelledDate:l,recurrence:m,tags:fe.extractHashtags(e)}}};function kn(r){let e=["(?:",/(?=[^\]]+\])\[/,"|",/(?=[^)]+\))\(/,")",/ */,r,/ */,/[)\]]/,/(?: *,)?/,/$/].map(t=>t instanceof RegExp?t.source:t).join("");return new RegExp(e,r.flags)}var _p={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::",TaskFormatRegularExpressions:{priorityRegex:kn(/priority:: *(highest|high|medium|low|lowest)/),startDateRegex:kn(/start:: *(\d{4}-\d{2}-\d{2})/),createdDateRegex:kn(/created:: *(\d{4}-\d{2}-\d{2})/),scheduledDateRegex:kn(/scheduled:: *(\d{4}-\d{2}-\d{2})/),dueDateRegex:kn(/due:: *(\d{4}-\d{2}-\d{2})/),doneDateRegex:kn(/completion:: *(\d{4}-\d{2}-\d{2})/),cancelledDateRegex:kn(/cancelled:: *(\d{4}-\d{2}-\d{2})/),recurrenceRegex:kn(/repeat:: *([a-zA-Z0-9, !]+)/)}},cu=class extends Jn{constructor(){super(_p)}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 s=super.componentToString(e,t,n);return s!==""&&!["blockLink","description"].includes(n)?` [${s.trim()}]`:s}};var Gt=(a=>(a.TODO="TODO",a.DONE="DONE",a.IN_PROGRESS="IN_PROGRESS",a.CANCELLED="CANCELLED",a.NON_TASK="NON_TASK",a.EMPTY="EMPTY",a))(Gt||{}),Ve=class{constructor(e,t,n,s,i="TODO"){this.symbol=e,this.name=t,this.nextStatusSymbol=n,this.availableAsCommand=s,this.type=i}};var xt=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 xt(new Ve("x","Done"," ",!0,"DONE"))}static makeEmpty(){return new xt(new Ve("","EMPTY","",!0,"EMPTY"))}static makeTodo(){return new xt(new Ve(" ","Todo","x",!0,"TODO"))}static makeCancelled(){return new xt(new Ve("-","Cancelled"," ",!0,"CANCELLED"))}static makeInProgress(){return new xt(new Ve("/","In Progress","x",!0,"IN_PROGRESS"))}static makeNonTask(){return new xt(new Ve("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 Gt[e]||"TODO"}static createUnknownStatus(e){return new xt(new Ve(e,"Unknown","x",!1,"TODO"))}static createFromImportedValue(e){let t=e[0],n=xt.getTypeFromStatusTypeString(e[3]);return new xt(new Ve(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 xt.tasksPluginCanCreateCommandsForStatuses()&&this.availableAsCommand&&(e=" Available as a command."),`- [${this.symbol}] => [${this.nextStatusSymbol}], name: '${this.name}', type: '${this.configuration.type}'.${e}`}static tasksPluginCanCreateCommandsForStatuses(){return!1}},Q=xt;Q.DONE=xt.makeDone(),Q.EMPTY=xt.makeEmpty(),Q.TODO=xt.makeTodo();var du=class{constructor(e=!1,t=!1){this.ignoreSortInstructions=e,this.showTaskHiddenData=t}};var Ne=class{constructor(){this.coreStatuses=[Q.makeTodo().configuration,Q.makeDone().configuration],this.customStatuses=[Q.makeInProgress().configuration,Q.makeCancelled().configuration]}static addStatus(e,t){e.push(t)}static replaceStatus(e,t,n){let s=this.findStatusIndex(t,e);return s<=-1?!1:(e.splice(s,1,n),!0)}static findStatusIndex(e,t){let n=new Q(e);return t.findIndex(s=>new Q(s).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){Ne.deleteAllCustomStatuses(e),new Ne().customStatuses.forEach(n=>{Ne.addStatus(e.customStatuses,n)})}static bulkAddStatusCollection(e,t){let n=[];return t.forEach(s=>{e.customStatuses.find(a=>a.symbol==s[0]&&a.name==s[1]&&a.nextStatusSymbol==s[2])?n.push(`The status ${s[1]} (${s[0]}) is already added.`):Ne.addStatus(e.customStatuses,Q.createFromImportedValue(s))}),n}static allStatuses(e){return e.coreStatuses.concat(e.customStatuses)}static applyToStatusRegistry(e,t){t.clearStatuses(),Ne.allStatuses(e).forEach(n=>{t.add(n)})}};var ZT=[{index:9999,internalName:"INTERNAL_TESTING_ENABLED_BY_DEFAULT",displayName:"Test Item. Used to validate the Feature Framework.",description:"Description",enabledByDefault:!0,stable:!1}];var tn=class{constructor(e,t,n,s,i,a){this.internalName=e;this.index=t;this.description=n;this.displayName=s;this.enabledByDefault=i;this.stable=a}static get values(){let e=[];return ZT.forEach(t=>{e=[...e,new tn(t.internalName,t.index,t.description,t.displayName,t.enabledByDefault,t.stable)]}),e}static get settingsFlags(){let e={};return tn.values.forEach(t=>{e[t.internalName]=t.enabledByDefault}),e}static fromString(e){for(let t of tn.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 Jn(Tp),buildSuggestions:hp(Tp,mp)},dataview:{displayName:"Dataview",taskSerializer:new cu,buildSuggestions:QT(hp(_p,mp),[["(",")"],["[","]"]])}},e_={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 Ne,features:tn.settingsFlags,generalSettings:{},headingOpened:{},debugSettings:new du,loggingOptions:{minLevels:{"":"info",tasks:"info","tasks.Cache":"info","tasks.Events":"info","tasks.File":"info","tasks.Query":"info","tasks.Task":"info"}}},Sn=Se({},e_);function JT(r,e){for(let t in r)e[t]===void 0&&(e[t]=r[t])}var K=()=>(JT(tn.settingsFlags,Sn.features),JT(e_.loggingOptions.minLevels,Sn.loggingOptions.minLevels),Sn.statusSettings.customStatuses.forEach((r,e,t)=>{var s,i;let n=Q.getTypeFromStatusTypeString(r.type);t[e]=new Ve((s=r.symbol)!=null?s:" ",r.name,(i=r.nextStatusSymbol)!=null?i:"x",r.availableAsCommand,n)}),Se({},Sn)),Ke=r=>(Sn=Se(Se({},Sn),r),K());var es=(r,e)=>(Sn.generalSettings[r]=e,K()),t_=r=>{var e;return(e=Sn.features[r])!=null?e:!1};function Ca(){return rn[K().taskFormat]}function fu(r){let t={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;"}[r];return t!==void 0?t:r}function r_(r){let e=[...r],t="";return e.forEach(n=>{t+=fu(n)}),t}var Ee=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!==Q.EMPTY.symbol)}static getInstance(){return Ee.instance||(Ee.instance=new Ee),Ee.instance}add(e){this.hasSymbol(e.symbol)||(e instanceof Q?this._registeredStatuses.push(e):this._registeredStatuses.push(new Q(e)))}bySymbol(e){return this.hasSymbol(e)?this.getSymbol(e):Q.EMPTY}bySymbolOrCreate(e){return this.hasSymbol(e)?this.getSymbol(e):Q.createUnknownStatus(e)}byName(e){return this._registeredStatuses.filter(({name:t})=>t===e).length>0?this._registeredStatuses.filter(({name:t})=>t===e)[0]:Q.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 Q.EMPTY}getNextStatusOrCreate(e){let t=this.getNextStatus(e);return t.type!=="EMPTY"?t:Q.createUnknownStatus(e.nextStatusSymbol)}getNextRecurrenceStatusOrCreate(e){let t=this.getNextStatusOrCreate(e),n=this.getNextRecurrenceStatusOfType(t,"TODO");if(n)return n;let s=this.getNextRecurrenceStatusOfType(t,"IN_PROGRESS");return s||this.bySymbolOrCreate(" ")}getNextRecurrenceStatusOfType(e,t){if(e.type===t)return e;let n=e;for(let s=0;s<this.registeredStatuses.length-1;s++)if(n=this.getNextStatusOrCreate(n),n.type===t)return n}findUnknownStatuses(e){let t=e.filter(i=>!this.hasSymbol(i.symbol)),n=new Ee,s=[];return t.forEach(i=>{if(n.hasSymbol(i.symbol))return;let a=Ee.copyStatusWithNewName(i,`Unknown (${i.symbol})`);s.push(a),n.add(a)}),s.sort((i,a)=>i.symbol.localeCompare(a.symbol,void 0,{numeric:!0}))}static copyStatusWithNewName(e,t){let n=new Ve(e.symbol,t,e.nextStatusSymbol,e.availableAsCommand,e.type);return new Q(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(){[Q.makeTodo(),Q.makeInProgress(),Q.makeDone(),Q.makeCancelled()].forEach(t=>{this.add(t)})}mermaidDiagram(e=!1){let t=this.registeredStatuses,n="mermaid",s=[],i=[];return t.forEach((a,o)=>{let u=this.getMermaidNodeLabel(a,e);s.push(`${o+1}${u}`);let l=this.getNextStatus(a);if(this.addEdgeIfNotToInternal(t,l,i,o,!1),a.type==="DONE"){let c=this.getNextRecurrenceStatusOrCreate(a);c.symbol!==l.symbol&&this.addEdgeIfNotToInternal(t,c,i,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;
${s.join(`
`)}
${i.join(`
`)}
linkStyle default stroke:gray
\`\`\`
`}addEdgeIfNotToInternal(e,t,n,s,i){let a=e.findIndex(l=>l.symbol===t.symbol),o=a!==-1,u=t.type!=="EMPTY";if(o&&u){let l;i?l='-. "\u{1F501}" .-> ':l=" --> ";let c=`${s+1}${l}${a+1}`;n.push(c)}}getMermaidNodeLabel(e,t){let n=r_(e.name),s=e.type;if(t){let i=fu(e.symbol),a=fu(e.nextStatusSymbol),o=`[${i}] -> [${a}]`,u=`'${n}'`,l=`(${s})`;return`["${u}<br>${o}<br>${l}"]:::${s}`}else return`["${n}"]:::${s}`}};var br=class{static calculate(e){var n,s,i;let t=0;if((n=e.dueDate)!=null&&n.isValid()){let a=window.moment().startOf("day"),o=Math.round(a.diff(e.dueDate)/br.milliSecondsPerDay),u;o>=7?u=1:o>=-14?u=(o+14)*.8/21+.2:u=.2,t+=u*br.dueCoefficient}switch((s=e.scheduledDate)!=null&&s.isValid()&&window.moment().isSameOrAfter(e.scheduledDate)&&(t+=1*br.scheduledCoefficient),(i=e.startDate)!=null&&i.isValid()&&window.moment().isBefore(e.startDate)&&(t+=1*br.startedCoefficient),e.priority){case"0":t+=1.5*br.priorityCoefficient;break;case"1":t+=1*br.priorityCoefficient;break;case"2":t+=.65*br.priorityCoefficient;break;case"3":t+=.325*br.priorityCoefficient;break;case"5":t-=.3*br.priorityCoefficient;break}return t}},nn=br;nn.dueCoefficient=12,nn.scheduledCoefficient=5,nn.startedCoefficient=-3,nn.priorityCoefficient=6,nn.milliSecondsPerDay=1e3*60*60*24;var Tt=class{static fromPath(e){let{useFilenameAsScheduledDate:t,filenameAsDateFolders:n}=K();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("."),s=e.substring(t,n),i=/(\d{4})-(\d{2})-(\d{2})/.exec(s);if(i||(i=/(\d{4})(\d{2})(\d{2})/.exec(s)),i){let a=window.moment([parseInt(i[1]),parseInt(i[2])-1,parseInt(i[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 s=e.scheduledDate,i=e.scheduledDateIsInferred;return n===null?i&&(i=!1,s=null):i?s=n:this.canApplyFallback(e)&&(s=n,i=!0),new fe(ot(Se({},e),{taskLocation:e.taskLocation.fromRenamedFile(t),scheduledDate:s,scheduledDateIsInferred:i}))}static removeInferredStatusIfNeeded(e,t){let n=e.scheduledDateIsInferred?e.scheduledDate:null;return t.map(s=>(n!==null&&!n.isSame(s.scheduledDate,"day")&&(s=new fe(ot(Se({},s),{scheduledDateIsInferred:!1}))),s))}};var n_=require("obsidian");var Ar=class{constructor(e,t){this.name=e,this.sortOrder=t}get groupText(){return this.name!==""?`%%${this.sortOrder}%% ${this.name}`:""}};var Ye=class{constructor(e){this._date=null;this._date=e}get moment(){return this._date}formatAsDate(e=""){return this.format(z.dateFormat,e)}formatAsDateAndTime(e=""){return this.format(z.dateTimeFormat,e)}format(e,t=""){return this._date?this._date.format(e):t}toISOString(e){return this._date?this._date.toISOString(e):""}get category(){let e=window.moment(),t=this.moment;return t?t.isBefore(e,"day")?new Ar("Overdue",1):t.isSame(e,"day")?new Ar("Today",2):t.isValid()?new Ar("Future",3):new Ar("Invalid date",0):new Ar("Undated",4)}get fromNow(){let e=this.moment;if(!e)return new Ar("",0);let t=this.fromNowOrder(e);return new Ar(e.fromNow(),t)}fromNowOrder(e){if(!e.isValid())return 0;let t=window.moment(),n=e.isSameOrBefore(t,"day"),s=this.fromNowStartDateOfGroup(e,n,t);return Number((n?1:3)+s.format("YYYYMMDD"))}fromNowStartDateOfGroup(e,t,n){let s=e.fromNow(!0).split(" "),i,a=Number(s[0]);isNaN(a)?i=1:i=a;let o=s[1];return t?n.subtract(i,o):n.add(i,o)}postpone(e="days",t=1){if(!this._date)throw new n_.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 qs=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 sn=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 sn.priorityNameUsingNone(e).replace("None","Normal")}};var tA=require("obsidian"),o_=_i(a_());var vp=class extends o_.EventEmitter2{constructor(){super(...arguments);this.options={minLevels:{"":"info",tasks:"info"}};this.consoleLoggerRegistered=!1;this.arrAvg=t=>t.reduce((n,s)=>n+s,0)/t.length}configure(t){return this.options=Object.assign({},this.options,t),this}getLogger(t){let n="none",s="";for(let i in this.options.minLevels)t.startsWith(i)&&i.length>=s.length&&(n=this.options.minLevels[i],s=i);return new wp(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)}},Rt=new vp,wp=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 i={level:e,module:this.module,message:t,objects:n,traceId:void 0};this.logManager.emit("log",i)}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,s){if(this.levelToInt(e)<this.minLevel)return;let a={level:e,module:this.module,message:n,objects:s,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 Ep(r,e){let t=Rt.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 pu(r,e,t){r.debug(`${e}: task line number: ${t.taskLocation.lineNumber}. file path: "${t.path}"`),r.debug(`${e} original: ${t.originalMarkdown}`)}function mu(r,e,t){t.map((n,s)=>{r.debug(`${e} ==> ${s+1} : ${n.toFileLineString()}`)})}var $t=class{},z=$t;z.dateFormat="YYYY-MM-DD",z.dateTimeFormat="YYYY-MM-DD HH:mm",z.indentationRegex=/^([\s\t>]*)/,z.listMarkerRegex=/([-*+]|[0-9]+\.)/,z.checkboxRegex=/\[(.)\]/u,z.afterCheckboxRegex=/ *(.*)/u,z.taskRegex=new RegExp($t.indentationRegex.source+$t.listMarkerRegex.source+" +"+$t.checkboxRegex.source+$t.afterCheckboxRegex.source,"u"),z.nonTaskRegex=new RegExp($t.indentationRegex.source+$t.listMarkerRegex.source+"? *("+$t.checkboxRegex.source+")?"+$t.afterCheckboxRegex.source,"u"),z.listItemRegex=new RegExp($t.indentationRegex.source+$t.listMarkerRegex.source),z.blockLinkRegex=/ \^[a-zA-Z0-9-]+$/u,z.hashTags=/(^|\s)#[^ !@#$%^&*(),.?":{}|<>]+/g,z.hashTagsFromEnd=new RegExp($t.hashTags.source+"$");var fe=class{constructor({status:e,description:t,taskLocation:n,indentation:s,listMarker:i,priority:a,createdDate:o,startDate:u,scheduledDate:l,dueDate:c,doneDate:f,cancelledDate:m,recurrence:y,blockLink:k,tags:E,originalMarkdown:x,scheduledDateIsInferred:v}){this._urgency=null;this.status=e,this.description=t,this.indentation=s,this.listMarker=i,this.taskLocation=n,this.tags=E,this.priority=a,this.createdDate=o,this.startDate=u,this.scheduledDate=l,this.dueDate=c,this.doneDate=f,this.cancelledDate=m,this.recurrence=y,this.blockLink=k,this.originalMarkdown=x,this.scheduledDateIsInferred=v}static fromLine({line:e,taskLocation:t,fallbackDate:n}){let s=fe.extractTaskComponents(e);return s===null||!ye.getInstance().includedIn(s.body)?null:fe.parseTaskSignifiers(e,t,n)}static parseTaskSignifiers(e,t,n){let s=fe.extractTaskComponents(e);if(s===null)return null;let{taskSerializer:i}=Ca(),a=i.deserialize(s.body),o=!1;return Tt.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 fe(ot(Se(Se({},s),a),{taskLocation:t,originalMarkdown:e,scheduledDateIsInferred:o}))}static extractTaskComponents(e){let t=e.match(z.taskRegex);if(t===null)return null;let n=t[1],s=t[2],i=t[3],a=Ee.getInstance().bySymbolOrCreate(i),o=t[4].trim(),u=o.match(z.blockLinkRegex),l=u!==null?u[0]:"";return l!==""&&(o=o.replace(z.blockLinkRegex,"").trim()),{indentation:n,listMarker:s,status:a,body:o,blockLink:l}}toString(){return Ca().taskSerializer.serialize(this)}toFileLineString(){return`${this.indentation}${this.listMarker} [${this.status.symbol}] ${this.toString()}`}toggle(){let e=Rt.getLogger("tasks.Task"),t="toggle()";pu(e,t,this);let n=Ee.getInstance().getNextStatusOrCreate(this.status),s=this.handleNewStatus(n);return mu(e,t,s),s}handleNewStatus(e){if(e.identicalTo(this.status))return[this];let t=null;if(e.isCompleted())if(this.status.isCompleted())t=this.doneDate;else{let{setDoneDate:o}=K();o&&(t=window.moment())}let n=null;if(e.isCancelled())if(this.status.isCancelled())n=this.cancelledDate;else{let{setCancelledDate:o}=K();o&&(n=window.moment())}let s=null;e.isCompleted()&&!this.status.isCompleted()&&this.recurrence!==null&&(s=this.recurrence.next());let i=new fe(ot(Se({},this),{status:e,doneDate:t,cancelledDate:n})),a=[];if(s!==null){let{setCreatedDate:o}=K(),u=null;o&&(u=window.moment());let l=null,f=Ee.getInstance().getNextRecurrenceStatusOrCreate(e),m=new fe(ot(Se(Se({},this),s),{status:f,blockLink:"",createdDate:u,cancelledDate:l}));a.push(m)}return a.push(i),a}toggleWithRecurrenceInUsersOrder(){let e=this.toggle();return this.putRecurrenceInUsersOrder(e)}handleNewStatusWithRecurrenceInUsersOrder(e){Rt.getLogger("tasks.Task").debug(`changed task ${this.taskLocation.path} ${this.taskLocation.lineNumber} ${this.originalMarkdown} status to '${e.symbol}'`);let n=this.handleNewStatus(e);return this.putRecurrenceInUsersOrder(n)}putRecurrenceInUsersOrder(e){let{recurrenceOnNextLine:t}=K();return t?e.reverse():e}get isDone(){return this.status.type==="DONE"||this.status.type==="CANCELLED"||this.status.type==="NON_TASK"}get priorityNumber(){return Number.parseInt(this.priority)}get priorityNameGroupText(){let e=sn.priorityNameUsingNormal(this.priority);return`%%${this.priority}%%${e} priority`}get descriptionWithoutTags(){return this.description.replace(z.hashTags,"").trim()}get priorityName(){return sn.priorityNameUsingNormal(this.priority)}get urgency(){return this._urgency===null&&(this._urgency=nn.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(sr);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 new qs(this.path)}get filename(){let e=this.path.match(/([^/]+)\.md$/);return e!==null?e[1]:null}get lineNumber(){return this.taskLocation.lineNumber}get sectionStart(){return this.taskLocation.sectionStart}get sectionIndex(){return this.taskLocation.sectionIndex}get precedingHeader(){return this.taskLocation.precedingHeader}getLinkText({isFilenameUnique:e}){let t;return e?t=this.filename:t="/"+this.path,t===null?null:(this.precedingHeader!==null&&this.precedingHeader!==t&&(t=t+" > "+this.precedingHeader),t)}static tasksListsIdentical(e,t){return e.length!==t.length?!1:e.every((n,s)=>n.identicalTo(t[s]))}identicalTo(e){let t=["description","path","indentation","listMarker","lineNumber","sectionStart","sectionIndex","precedingHeader","priority","blockLink","scheduledDateIsInferred"];for(let i of t)if(this[i]!==e[i])return!1;if(!this.status.identicalTo(e.status)||this.tags.length!==e.tags.length||!this.tags.every(function(i,a){return i===e.tags[a]}))return!1;t=fe.allDateFields();for(let i of t){let a=this[i],o=e[i];if(sr(a,o)!==0)return!1}let n=this.recurrence,s=e.recurrence;return n===null&&s!==null||n!==null&&s===null?!1:!(n&&s&&!n.identicalTo(s))}static allDateFields(){return["createdDate","startDate","scheduledDate","dueDate","doneDate","cancelledDate"]}static extractHashtags(e){var t,n;return(n=(t=e.match(z.hashTags))==null?void 0:t.map(s=>s.trim()))!=null?n:[]}};var Aa=class{constructor(e){this.fetch=e;this._value=void 0}get value(){return this._value===void 0&&(this._value=this.fetch()),this._value}};var pt=class{constructor(e,t,n,s,i){this._path=e,this._lineNumber=t,this._sectionStart=n,this._sectionIndex=s,this._precedingHeader=i}static fromUnknownPosition(e){return new pt(e,0,0,0,null)}fromRenamedFile(e){return new pt(e,this.lineNumber,this.sectionStart,this.sectionIndex,this.precedingHeader)}get path(){return this._path}get lineNumber(){return this._lineNumber}get sectionStart(){return this._sectionStart}get sectionIndex(){return this._sectionIndex}get precedingHeader(){return this._precedingHeader}};var ts=class{constructor({metadataCache:e,vault:t,events:n}){this.logger=Rt.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 ao,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",()=>L(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}=K(),t=this.vault.on("create",i=>{i instanceof Ws.TFile&&(this.logger.debug(`Cache.subscribeToVault.createdEventReference() ${i.path}`),this.tasksMutex.runExclusive(()=>{this.indexFile(i)}))});this.vaultEventReferences.push(t);let n=this.vault.on("delete",i=>{i instanceof Ws.TFile&&(this.logger.debug(`Cache.subscribeToVault.deletedEventReference() ${i.path}`),this.tasksMutex.runExclusive(()=>{this.tasks=this.tasks.filter(a=>a.path!==i.path),this.notifySubscribers()}))});this.vaultEventReferences.push(n);let s=this.vault.on("rename",(i,a)=>{i instanceof Ws.TFile&&(this.logger.debug(`Cache.subscribeToVault.renamedEventReference() ${i.path}`),this.tasksMutex.runExclusive(()=>{let o=new Aa(()=>Tt.fromPath(i.path));this.tasks=this.tasks.map(u=>u.path===a?e?Tt.updateTaskPath(u,i.path,o.value):new fe(ot(Se({},u),{taskLocation:u.taskLocation.fromRenamedFile(i.path)})):u),this.notifySubscribers()}))});this.vaultEventReferences.push(s)}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(()=>L(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 L(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),s=t.listItems,i=[];if(s!==void 0){let a=yield this.vault.cachedRead(e);i=this.getTasksFromFileContent(a,s,t,e)}fe.tasksListsIdentical(n,i)||(this.tasks=this.tasks.filter(a=>a.path!==e.path),this.tasks.push(...i),this.logger.debug("Cache.indexFile: "+e.path+`: read ${i.length} task(s)`),this.notifySubscribers())})}getTasksFromFileContent(e,t,n,s){let i=[],a=e.split(`
`),o=a.length,u=new Aa(()=>Tt.fromPath(s.path)),l=null,c=0;for(let f of t)if(f.task!==void 0){let m=f.position.start.line;if(m>=o)return this.logger.debug(`${s.path} Obsidian gave us a line number ${m} past the end of the file. ${o}.`),i;if((l===null||l.position.end.line<m)&&(l=ts.getSection(m,n.sections),c=0),l===null)continue;let y=a[m];if(y===void 0){this.logger.debug(`${s.path}: line ${m} - ignoring 'undefined' line.`);continue}let k;try{k=fe.fromLine({line:y,taskLocation:new pt(s.path,m,l.position.start.line,c,ts.getPrecedingHeader(m,n.headings)),fallbackDate:u.value})}catch(E){this.reportTaskParsingErrorToUser(E,s,f,y);continue}k!==null&&(c++,i.push(k))}return i}reportTaskParsingErrorToUser(e,t,n,s){let i=`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: ${s}
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(i),e instanceof Error&&this.logger.error(e.stack?e.stack:"Cannot determine stack"),this.state==="Initializing"&&new Ws.Notice(i,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 s of t){if(s.position.start.line>e)return n;n=s.heading}return n}};var Pp=require("obsidian");var S_=require("obsidian");function an(){}function Op(r){return r()}function u_(){return Object.create(null)}function rs(r){r.forEach(Op)}function hu(r){return typeof r=="function"}function c_(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function d_(r){return Object.keys(r).length===0}var f_=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global,Na=class{constructor(e){this.options=e,this._listeners="WeakMap"in f_?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 s of t)Na.entries.set(s.target,s),(n=this._listeners.get(s.target))===null||n===void 0||n(s)})}};Na.entries="WeakMap"in f_?new WeakMap:void 0;var p_=!1;function nA(){p_=!0}function sA(){p_=!1}function O(r,e){r.appendChild(e)}function $s(r,e,t){r.insertBefore(e,t||null)}function ns(r){r.parentNode&&r.parentNode.removeChild(r)}function Dp(r,e){for(let t=0;t<r.length;t+=1)r[t]&&r[t].d(e)}function V(r){return document.createElement(r)}function iA(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Qe(r){return document.createTextNode(r)}function Z(){return Qe(" ")}function it(r,e,t,n){return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function m_(r){return function(e){return e.preventDefault(),r.call(this,e)}}function A(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function h_(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 aA(r){return Array.from(r.childNodes)}function xp(r,e){e=""+e,r.data!==e&&(r.data=e)}function mt(r,e){r.value=e==null?"":e}function Rp(r,e,t){for(let n=0;n<r.options.length;n+=1){let s=r.options[n];if(s.__value===e){s.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function g_(r){let e=r.querySelector(":checked");return e&&e.__value}function ht(r,e,t){r.classList[t?"add":"remove"](e)}var Pr=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=iA(t.nodeName):this.e=V(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)$s(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(ns)}};var Ia;function Pa(r){Ia=r}function oA(){if(!Ia)throw new Error("Function called outside component initialization");return Ia}function Mp(r){oA().$$.on_mount.push(r)}var js=[];var gu=[],Gs=[],l_=[],uA=Promise.resolve(),Sp=!1;function lA(){Sp||(Sp=!0,uA.then(y_))}function Fa(r){Gs.push(r)}var kp=new Set,Ys=0;function y_(){if(Ys!==0)return;let r=Ia;do{try{for(;Ys<js.length;){let e=js[Ys];Ys++,Pa(e),cA(e.$$)}}catch(e){throw js.length=0,Ys=0,e}for(Pa(null),js.length=0,Ys=0;gu.length;)gu.pop()();for(let e=0;e<Gs.length;e+=1){let t=Gs[e];kp.has(t)||(kp.add(t),t())}Gs.length=0}while(js.length);for(;l_.length;)l_.pop()();Sp=!1,kp.clear(),Pa(r)}function cA(r){if(r.fragment!==null){r.update(),rs(r.before_update);let e=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,e),r.after_update.forEach(Fa)}}function dA(r){let e=[],t=[];Gs.forEach(n=>r.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),Gs=e}var fA=new Set;function pA(r,e){r&&r.i&&(fA.delete(r),r.i(e))}var mA=["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"],vq=new Set([...mA]);function hA(r,e,t,n){let{fragment:s,after_update:i}=r.$$;s&&s.m(e,t),n||Fa(()=>{let a=r.$$.on_mount.map(Op).filter(hu);r.$$.on_destroy?r.$$.on_destroy.push(...a):rs(a),r.$$.on_mount=[]}),i.forEach(Fa)}function b_(r,e){let t=r.$$;t.fragment!==null&&(dA(t.after_update),rs(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function gA(r,e){r.$$.dirty[0]===-1&&(js.push(r),lA(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<<e%31}function T_(r,e,t,n,s,i,a,o=[-1]){let u=Ia;Pa(r);let l=r.$$={fragment:null,ctx:[],props:i,update:an,not_equal:s,bound:u_(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:u_(),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||{},(f,m,...y)=>{let k=y.length?y[0]:m;return l.ctx&&s(l.ctx[f],l.ctx[f]=k)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](k),c&&gA(r,f)),m}):[],l.update(),c=!0,rs(l.before_update),l.fragment=n?n(l.ctx):!1,e.target){if(e.hydrate){nA();let f=aA(e.target);l.fragment&&l.fragment.l(f),f.forEach(ns)}else l.fragment&&l.fragment.c();e.intro&&pA(r.$$.fragment),hA(r,e.target,e.anchor,e.customElement),sA(),y_()}Pa(u)}var yA;typeof HTMLElement=="function"&&(yA=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:r}=this.$$;this.$$.on_disconnect=r.map(Op).filter(hu);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(r,e,t){this[r]=t}disconnectedCallback(){rs(this.$$.on_disconnect)}$destroy(){b_(this,1),this.$destroy=an}$on(r,e){if(!hu(e))return an;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&&!d_(r)&&(this.$$.skip_bound=!0,this.$$set(r),this.$$.skip_bound=!1)}});var yu=class{$destroy(){b_(this,1),this.$destroy=an}$on(e,t){if(!hu(t))return an;let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{let s=n.indexOf(t);s!==-1&&n.splice(s,1)}}$set(e){this.$$set&&!d_(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var Cp=_i(ze());function __(r,e,t){let n=r.slice();return n[55]=e[t],n}function v_(r,e,t){let n=r.slice();return n[58]=e[t].value,n[59]=e[t].label,n[60]=e[t].symbol,n[61]=e[t].accessKey,n[62]=e[t].accessKeyIndex,n}function bA(r){let e,t=r[60]+"",n;return{c(){e=V("span"),n=Qe(t)},m(s,i){$s(s,e,i),O(e,n)},p:an,d(s){s&&ns(e)}}}function w_(r){let e,t,n,s,i,a,o,u,l=r[59].substring(0,r[62])+"",c,f,m=r[59].substring(r[62],r[62]+1)+"",y,k,E=r[59].substring(r[62]+1)+"",x,v,I=r[60]&&r[60].charCodeAt(0)>=256,F,le,B,ie,W,G=I&&bA(r);return B=h_(r[40][0]),{c(){e=V("span"),t=V("input"),a=Z(),o=V("label"),u=V("span"),c=Qe(l),f=V("span"),y=Qe(m),k=V("span"),x=Qe(E),v=Z(),G&&G.c(),le=Z(),A(t,"type","radio"),A(t,"id",n="priority-"+r[58]),t.__value=s=r[58],t.value=t.__value,A(t,"accesskey",i=r[19](r[61])),A(f,"class","accesskey"),A(o,"for",F="priority-"+r[58]),B.p(t)},m(ce,Ie){$s(ce,e,Ie),O(e,t),t.checked=t.__value===r[1].priority,O(e,a),O(e,o),O(o,u),O(u,c),O(o,f),O(f,y),O(o,k),O(k,x),O(o,v),G&&G.m(o,null),O(e,le),ie||(W=it(t,"change",r[39]),ie=!0)},p(ce,Ie){Ie[0]&524288&&i!==(i=ce[19](ce[61]))&&A(t,"accesskey",i),Ie[0]&3&&(t.checked=t.__value===ce[1].priority),I&&G.p(ce,Ie)},d(ce){ce&&ns(e),G&&G.d(),B.r(),ie=!1,W()}}}function E_(r){let e,t=r[55].name+"",n,s,i=r[55].symbol+"",a,o,u;return{c(){e=V("option"),n=Qe(t),s=Qe(" ["),a=Qe(i),o=Qe("]"),e.__value=u=r[55],e.value=e.__value},m(l,c){$s(l,e,c),O(e,n),O(e,s),O(e,a),O(e,o)},p(l,c){c[0]&1&&t!==(t=l[55].name+"")&&xp(n,t),c[0]&1&&i!==(i=l[55].symbol+"")&&xp(a,i),c[0]&1&&u!==(u=l[55])&&(e.__value=u,e.value=e.__value)},d(l){l&&ns(e)}}}function TA(r){let e,t,n,s,i,a,o,u,l,c,f,m,y,k,E,x,v,I,F,le,B,ie,W,G,ce,Ie,$,N,w,H,C,X,d,p,h,g,b,_,S,M,D,R,U,ge,ae,te,Re,ve,wr,ln,Ft,cn,Ct,qe,Ha,Fn,ps,oe,Me,Fe,dn,Er,ms,za,Et,Vt,Va,Ka,cm,Qa,pi,Xa,dm,fn,Za,fm,je,Ja,pm,ur,mm,mi,hm,gm,eo,ym,to,bm,lr,Tm,hi,_m,vm,ro,wm,no,Em,cr,km,gi,Sm,Om,so,Dm,hs,Ln,xm,io,Rm,yi,fl,Mm,gs=r[27],kt=[];for(let q=0;q<gs.length;q+=1)kt[q]=w_(v_(r,gs,q));let ys=r[0],St=[];for(let q=0;q<ys.length;q+=1)St[q]=E_(__(r,ys,q));return{c(){e=V("div"),t=V("form"),n=V("div"),s=V("label"),s.innerHTML='Descrip<span class="accesskey">t</span>ion',i=Z(),a=V("textarea"),u=Z(),l=V("div"),c=V("label"),f=Qe("Priority"),y=Z();for(let q=0;q<kt.length;q+=1)kt[q].c();k=Z(),E=V("div"),x=V("label"),x.textContent="Recurs",v=Z(),I=V("input"),le=Z(),B=V("code"),ie=Qe(r[20]),W=Z(),G=new Pr(!1),ce=Z(),Ie=V("label"),Ie.textContent="Due",$=Z(),N=V("input"),H=Z(),C=V("code"),X=Qe(r[23]),d=Z(),p=new Pr(!1),h=Z(),g=V("label"),g.textContent="Scheduled",b=Z(),_=V("input"),M=Z(),D=V("code"),R=Qe(r[22]),U=Z(),ge=new Pr(!1),ae=Z(),te=V("label"),te.innerHTML='St<span class="accesskey">a</span>rt',Re=Z(),ve=V("input"),ln=Z(),Ft=V("code"),cn=Qe(r[21]),Ct=Z(),qe=new Pr(!1),Ha=Z(),Fn=V("div"),ps=V("label"),ps.innerHTML=`Only
<span class="accesskey-first">future</span> dates:`,oe=Z(),Me=V("input"),dn=Z(),Er=V("div"),ms=V("label"),ms.innerHTML='Stat<span class="accesskey">u</span>s',za=Z(),Et=V("select");for(let q=0;q<St.length;q+=1)St[q].c();Va=Z(),Ka=V("label"),Ka.textContent=`\u26A0\uFE0F Changing the status does not yet auto-update Done or Cancelled Dates, nor create a new recurrence.
Complete tasks via command, by clicking on task checkboxes or by right-clicking on task checkboxes.`,cm=Z(),Qa=V("div"),pi=V("div"),Xa=V("label"),Xa.textContent="Completed:",dm=Z(),fn=V("input"),fm=Z(),je=V("div"),Ja=V("label"),Ja.textContent="Created",pm=Z(),ur=V("input"),mm=Z(),mi=V("code"),hm=Qe(r[25]),gm=Z(),eo=new Pr(!1),ym=Z(),to=V("label"),to.textContent="Done",bm=Z(),lr=V("input"),Tm=Z(),hi=V("code"),_m=Qe(r[26]),vm=Z(),ro=new Pr(!1),wm=Z(),no=V("label"),no.textContent="Cancelled",Em=Z(),cr=V("input"),km=Z(),gi=V("code"),Sm=Qe(r[24]),Om=Z(),so=new Pr(!1),Dm=Z(),hs=V("div"),Ln=V("button"),xm=Qe("Apply"),Rm=Z(),yi=V("button"),yi.textContent="Cancel",A(s,"for","description"),A(a,"id","description"),A(a,"class","tasks-modal-description"),A(a,"placeholder","Take out the trash"),A(a,"accesskey",o=r[19]("t")),A(n,"class","tasks-modal-section"),A(c,"for",m="priority-"+r[1].priority),A(l,"class","tasks-modal-section tasks-modal-priorities"),A(x,"for","recurrence"),A(x,"class","accesskey-first"),A(I,"id","recurrence"),A(I,"type","text"),A(I,"placeholder","Try 'every 2 weeks on Thursday'."),A(I,"accesskey",F=r[19]("r")),ht(I,"tasks-modal-error",!r[10]),G.a=null,A(Ie,"for","due"),A(Ie,"class","accesskey-first"),A(N,"id","due"),A(N,"type","text"),A(N,"placeholder",Bs),A(N,"accesskey",w=r[19]("d")),ht(N,"tasks-modal-error",!r[9]),p.a=null,A(g,"for","scheduled"),A(g,"class","accesskey-first"),A(_,"id","scheduled"),A(_,"type","text"),A(_,"placeholder",Bs),A(_,"accesskey",S=r[19]("s")),ht(_,"tasks-modal-error",!r[7]),ge.a=null,A(te,"for","start"),A(ve,"id","start"),A(ve,"type","text"),A(ve,"placeholder",Bs),A(ve,"accesskey",wr=r[19]("a")),ht(ve,"tasks-modal-error",!r[5]),qe.a=null,A(ps,"for","forwardOnly"),A(Me,"id","forwardOnly"),A(Me,"type","checkbox"),A(Me,"class","task-list-item-checkbox tasks-modal-checkbox"),A(Me,"accesskey",Fe=r[19]("f")),A(E,"class","tasks-modal-section tasks-modal-dates"),A(ms,"for","status"),A(Et,"id","status-type"),A(Et,"class","dropdown"),A(Et,"accesskey",Vt=r[19]("u")),r[1].status===void 0&&Fa(()=>r[46].call(Et)),A(Ka,"class","tasks-modal-warning"),A(Er,"class","tasks-modal-section"),A(Xa,"for","status"),A(fn,"id","status"),A(fn,"type","checkbox"),A(fn,"class","task-list-item-checkbox tasks-modal-checkbox"),fn.checked=Za=r[1].status.isCompleted(),fn.disabled=!0,A(Qa,"class","tasks-modal-section tasks-modal-status"),A(Ja,"for","created"),A(ur,"id","created"),A(ur,"type","text"),A(ur,"placeholder",Bs),ht(ur,"tasks-modal-error",!r[3]),eo.a=null,A(to,"for","done"),A(lr,"id","done"),A(lr,"type","text"),A(lr,"placeholder",Bs),ht(lr,"tasks-modal-error",!r[12]),ro.a=null,A(no,"for","cancelled"),A(cr,"id","cancelled"),A(cr,"type","text"),A(cr,"placeholder",Bs),ht(cr,"tasks-modal-error",!r[14]),so.a=null,A(je,"class","tasks-modal-section tasks-modal-dates"),Ln.disabled=io=!r[18],A(Ln,"type","submit"),A(Ln,"class","mod-cta"),A(yi,"type","button"),A(hs,"class","tasks-modal-section tasks-modal-buttons"),ht(t,"with-accesskeys",r[15]),A(e,"class","tasks-modal")},m(q,re){$s(q,e,re),O(e,t),O(t,n),O(n,s),O(n,i),O(n,a),mt(a,r[1].description),r[38](a),O(t,u),O(t,l),O(l,c),O(c,f),O(l,y);for(let me=0;me<kt.length;me+=1)kt[me]&&kt[me].m(l,null);O(t,k),O(t,E),O(E,x),O(E,v),O(E,I),mt(I,r[1].recurrenceRule),O(E,le),O(E,B),O(B,ie),O(B,W),G.m(r[17],B),O(E,ce),O(E,Ie),O(E,$),O(E,N),mt(N,r[1].dueDate),O(E,H),O(E,C),O(C,X),O(C,d),p.m(r[8],C),O(E,h),O(E,g),O(E,b),O(E,_),mt(_,r[1].scheduledDate),O(E,M),O(E,D),O(D,R),O(D,U),ge.m(r[6],D),O(E,ae),O(E,te),O(E,Re),O(E,ve),mt(ve,r[1].startDate),O(E,ln),O(E,Ft),O(Ft,cn),O(Ft,Ct),qe.m(r[4],Ft),O(E,Ha),O(E,Fn),O(Fn,ps),O(Fn,oe),O(Fn,Me),Me.checked=r[1].forwardOnly,O(t,dn),O(t,Er),O(Er,ms),O(Er,za),O(Er,Et);for(let me=0;me<St.length;me+=1)St[me]&&St[me].m(Et,null);Rp(Et,r[1].status,!0),O(Er,Va),O(Er,Ka),O(t,cm),O(t,Qa),O(Qa,pi),O(pi,Xa),O(pi,dm),O(pi,fn),O(t,fm),O(t,je),O(je,Ja),O(je,pm),O(je,ur),mt(ur,r[1].createdDate),O(je,mm),O(je,mi),O(mi,hm),O(mi,gm),eo.m(r[2],mi),O(je,ym),O(je,to),O(je,bm),O(je,lr),mt(lr,r[1].doneDate),O(je,Tm),O(je,hi),O(hi,_m),O(hi,vm),ro.m(r[11],hi),O(je,wm),O(je,no),O(je,Em),O(je,cr),mt(cr,r[1].cancelledDate),O(je,km),O(je,gi),O(gi,Sm),O(gi,Om),so.m(r[13],gi),O(t,Dm),O(t,hs),O(hs,Ln),O(Ln,xm),O(hs,Rm),O(hs,yi),fl||(Mm=[it(a,"input",r[37]),it(a,"keydown",r[30]),it(a,"paste",r[31]),it(a,"drop",r[31]),it(l,"keyup",r[28]),it(I,"input",r[41]),it(N,"input",r[42]),it(_,"input",r[43]),it(ve,"input",r[44]),it(Me,"change",r[45]),it(Et,"change",r[46]),it(ur,"input",r[47]),it(lr,"input",r[48]),it(cr,"input",r[49]),it(yi,"click",r[29]),it(t,"submit",m_(r[32]))],fl=!0)},p(q,re){if(re[0]&524288&&o!==(o=q[19]("t"))&&A(a,"accesskey",o),re[0]&3&&mt(a,q[1].description),re[0]&3&&m!==(m="priority-"+q[1].priority)&&A(c,"for",m),re[0]&134742018){gs=q[27];let me;for(me=0;me<gs.length;me+=1){let bi=v_(q,gs,me);kt[me]?kt[me].p(bi,re):(kt[me]=w_(bi),kt[me].c(),kt[me].m(l,null))}for(;me<kt.length;me+=1)kt[me].d(1);kt.length=gs.length}if(re[0]&524288&&F!==(F=q[19]("r"))&&A(I,"accesskey",F),re[0]&3&&I.value!==q[1].recurrenceRule&&mt(I,q[1].recurrenceRule),re[0]&1024&&ht(I,"tasks-modal-error",!q[10]),re[0]&131072&&G.p(q[17]),re[0]&524288&&w!==(w=q[19]("d"))&&A(N,"accesskey",w),re[0]&3&&N.value!==q[1].dueDate&&mt(N,q[1].dueDate),re[0]&512&&ht(N,"tasks-modal-error",!q[9]),re[0]&256&&p.p(q[8]),re[0]&524288&&S!==(S=q[19]("s"))&&A(_,"accesskey",S),re[0]&3&&_.value!==q[1].scheduledDate&&mt(_,q[1].scheduledDate),re[0]&128&&ht(_,"tasks-modal-error",!q[7]),re[0]&64&&ge.p(q[6]),re[0]&524288&&wr!==(wr=q[19]("a"))&&A(ve,"accesskey",wr),re[0]&3&&ve.value!==q[1].startDate&&mt(ve,q[1].startDate),re[0]&32&&ht(ve,"tasks-modal-error",!q[5]),re[0]&16&&qe.p(q[4]),re[0]&524288&&Fe!==(Fe=q[19]("f"))&&A(Me,"accesskey",Fe),re[0]&3&&(Me.checked=q[1].forwardOnly),re[0]&1){ys=q[0];let me;for(me=0;me<ys.length;me+=1){let bi=__(q,ys,me);St[me]?St[me].p(bi,re):(St[me]=E_(bi),St[me].c(),St[me].m(Et,null))}for(;me<St.length;me+=1)St[me].d(1);St.length=ys.length}re[0]&524288&&Vt!==(Vt=q[19]("u"))&&A(Et,"accesskey",Vt),re[0]&3&&Rp(Et,q[1].status),re[0]&3&&Za!==(Za=q[1].status.isCompleted())&&(fn.checked=Za),re[0]&3&&ur.value!==q[1].createdDate&&mt(ur,q[1].createdDate),re[0]&8&&ht(ur,"tasks-modal-error",!q[3]),re[0]&4&&eo.p(q[2]),re[0]&3&&lr.value!==q[1].doneDate&&mt(lr,q[1].doneDate),re[0]&4096&&ht(lr,"tasks-modal-error",!q[12]),re[0]&2048&&ro.p(q[11]),re[0]&3&&cr.value!==q[1].cancelledDate&&mt(cr,q[1].cancelledDate),re[0]&16384&&ht(cr,"tasks-modal-error",!q[14]),re[0]&8192&&so.p(q[13]),re[0]&262144&&io!==(io=!q[18])&&(Ln.disabled=io),re[0]&32768&&ht(t,"with-accesskeys",q[15])},i:an,o:an,d(q){q&&ns(e),r[38](null),Dp(kt,q),Dp(St,q),fl=!1,rs(Mm)}}}var Bs="Try 'Monday' or 'tomorrow', or [td|tm|yd|tw|nw|we] then space.";function _A(r,e,t){let n;var s;let{task:i}=e,{onSubmit:a}=e,{statusOptions:o}=e,{prioritySymbols:u,recurrenceSymbol:l,startDateSymbol:c,scheduledDateSymbol:f,dueDateSymbol:m,cancelledDateSymbol:y,createdDateSymbol:k,doneDateSymbol:E}=rn.tasksPluginEmoji.taskSerializer.symbols,x,v={description:"",status:Q.TODO,priority:"none",recurrenceRule:"",createdDate:"",startDate:"",scheduledDate:"",dueDate:"",doneDate:"",cancelledDate:"",forwardOnly:!0},I=!0,F="",le=!0,B="",ie=!0,W="",G=!0,ce="",Ie=!0,$="",N=!0,w="",H=!0,C="",X=!0,d=!1,p=!0,h=!0,g=[{value:"lowest",label:"Lowest",symbol:u.Lowest,accessKey:"o",accessKeyIndex:1},{value:"low",label:"Low",symbol:u.Low,accessKey:"l",accessKeyIndex:0},{value:"none",label:"Normal",symbol:u.None,accessKey:"n",accessKeyIndex:0},{value:"medium",label:"Medium",symbol:u.Medium,accessKey:"m",accessKeyIndex:0},{value:"high",label:"High",symbol:u.High,accessKey:"h",accessKeyIndex:0},{value:"highest",label:"Highest",symbol:u.Highest,accessKey:"i",accessKeyIndex:1}];function b(oe,Me,Fe=void 0){if(!Me)return`<i>no ${oe} date</i>`;let dn=Cp.parseDate(Me,Fe,{forwardDate:Fe!=null});return dn!==null?window.moment(dn).format("YYYY-MM-DD"):`<i>invalid ${oe} date</i>`}function _(oe,Me){return b(oe,Me,v.forwardOnly?new Date:void 0)}function S(oe){let Me=null,Fe=Cp.parseDate(oe,new Date,{forwardDate:v.forwardOnly});return Fe!==null&&(Me=window.moment(Fe)),Me}Mp(()=>{let{provideAccessKeys:oe}=K();t(15,p=oe);let Me=ye.getInstance().removeAsWordFrom(i.description);(Me!=i.description||!ye.getInstance().includedIn(i.description))&&(d=!0);let Fe="none";i.priority==="5"?Fe="lowest":i.priority==="4"?Fe="low":i.priority==="2"?Fe="medium":i.priority==="1"?Fe="high":i.priority==="0"&&(Fe="highest"),t(1,v={description:Me,status:i.status,priority:Fe,recurrenceRule:i.recurrence?i.recurrence.toText():"",createdDate:new Ye(i.createdDate).formatAsDate(),startDate:new Ye(i.startDate).formatAsDate(),scheduledDate:new Ye(i.scheduledDate).formatAsDate(),dueDate:new Ye(i.dueDate).formatAsDate(),doneDate:new Ye(i.doneDate).formatAsDate(),cancelledDate:new Ye(i.cancelledDate).formatAsDate(),forwardOnly:!0}),setTimeout(()=>{x.focus()},10)});let M=oe=>{if(oe.key&&!oe.altKey&&!oe.ctrlKey){let Me=g.find(Fe=>Fe.label.charAt(0).toLowerCase()==oe.key);Me&&t(1,v.priority=Me.value,v)}},D=()=>{a([])},R=oe=>{oe.key==="Enter"&&(oe.preventDefault(),h&&ge())},U=()=>{setTimeout(()=>{t(1,v.description=v.description.replace(/[\r\n]+/g," "),v)},0)},ge=()=>{let oe=v.description.trim();d&&(oe=ye.getInstance().prependTo(oe));let Me=S(v.startDate),Fe=S(v.scheduledDate),dn=S(v.dueDate),Er=S(v.cancelledDate),ms=S(v.createdDate),za=S(v.doneDate),Et=null;v.recurrenceRule&&(Et=st.fromText({recurrenceRuleText:v.recurrenceRule,startDate:Me,scheduledDate:Fe,dueDate:dn}));let Vt;switch(v.priority){case"lowest":Vt="5";break;case"low":Vt="4";break;case"medium":Vt="2";break;case"high":Vt="1";break;case"highest":Vt="0";break;default:Vt="3"}let Va=new fe(Object.assign(Object.assign({},i),{description:oe,status:v.status,priority:Vt,recurrence:Et,startDate:Me,scheduledDate:Fe,dueDate:dn,doneDate:za,createdDate:ms,cancelledDate:Er}));a([Va])},ae=[[]];function te(){v.description=this.value,t(1,v),t(8,ce),t(4,B),t(6,W),t(11,w),t(2,F),t(13,C),t(0,o)}function Re(oe){gu[oe?"unshift":"push"](()=>{x=oe,t(16,x)})}function ve(){v.priority=this.__value,t(1,v),t(8,ce),t(4,B),t(6,W),t(11,w),t(2,F),t(13,C),t(0,o)}function wr(){v.recurrenceRule=this.value,t(1,v),t(8,ce),t(4,B),t(6,W),t(11,w),t(2,F),t(13,C),t(0,o)}function ln(){v.dueDate=this.value,t(1,v),t(8,ce),t(4,B),t(6,W),t(11,w),t(2,F),t(13,C),t(0,o)}function Ft(){v.scheduledDate=this.value,t(1,v),t(8,ce),t(4,B),t(6,W),t(11,w),t(2,F),t(13,C),t(0,o)}function cn(){v.startDate=this.value,t(1,v),t(8,ce),t(4,B),t(6,W),t(11,w),t(2,F),t(13,C),t(0,o)}function Ct(){v.forwardOnly=this.checked,t(1,v),t(8,ce),t(4,B),t(6,W),t(11,w),t(2,F),t(13,C),t(0,o)}function qe(){v.status=g_(this),t(1,v),t(8,ce),t(4,B),t(6,W),t(11,w),t(2,F),t(13,C),t(0,o)}function Ha(){v.createdDate=this.value,t(1,v),t(8,ce),t(4,B),t(6,W),t(11,w),t(2,F),t(13,C),t(0,o)}function Fn(){v.doneDate=this.value,t(1,v),t(8,ce),t(4,B),t(6,W),t(11,w),t(2,F),t(13,C),t(0,o)}function ps(){v.cancelledDate=this.value,t(1,v),t(8,ce),t(4,B),t(6,W),t(11,w),t(2,F),t(13,C),t(0,o)}return r.$$set=oe=>{"task"in oe&&t(33,i=oe.task),"onSubmit"in oe&&t(34,a=oe.onSubmit),"statusOptions"in oe&&t(0,o=oe.statusOptions)},r.$$.update=()=>{if(r.$$.dirty[0]&32768){e:t(19,n=oe=>p?oe:null)}if(r.$$.dirty[0]&258){e:t(1,v.dueDate=Qr(v.dueDate),v),t(8,ce=_("due",v.dueDate)),t(9,Ie=!ce.includes("invalid"))}if(r.$$.dirty[0]&18){e:t(1,v.startDate=Qr(v.startDate),v),t(4,B=_("start",v.startDate)),t(5,ie=!B.includes("invalid"))}if(r.$$.dirty[0]&66){e:t(1,v.scheduledDate=Qr(v.scheduledDate),v),t(6,W=_("scheduled",v.scheduledDate)),t(7,G=!W.includes("invalid"))}if(r.$$.dirty[0]&2050){e:t(1,v.doneDate=Qr(v.doneDate),v),t(11,w=_("done",v.doneDate)),t(12,H=!w.includes("invalid"))}if(r.$$.dirty[0]&6){e:t(1,v.createdDate=Qr(v.createdDate),v),t(2,F=_("created",v.createdDate)),t(3,le=!F.includes("invalid"))}if(r.$$.dirty[0]&8194){e:t(1,v.cancelledDate=Qr(v.cancelledDate),v),t(13,C=_("cancelled",v.cancelledDate)),t(14,X=!C.includes("invalid"))}if(r.$$.dirty[0]&2|r.$$.dirty[1]&16){e:if(t(10,N=!0),!v.recurrenceRule)t(17,$="<i>not recurring</>");else{let oe=t(35,s=st.fromText({recurrenceRuleText:v.recurrenceRule,startDate:null,scheduledDate:null,dueDate:null}))===null||s===void 0?void 0:s.toText();oe?!v.startDate&&!v.scheduledDate&&!v.dueDate?(t(17,$="<i>due, scheduled or start date required</i>"),t(10,N=!1)):t(17,$=oe):(t(17,$="<i>invalid recurrence rule</i>"),t(10,N=!1))}}if(r.$$.dirty[0]&2){e:t(36,I=v.description.trim()!=="")}if(r.$$.dirty[0]&22184|r.$$.dirty[1]&32){e:t(18,h=Ie&&N&&G&&ie&&I&&X&&le&&H)}},[o,v,F,le,B,ie,W,G,ce,Ie,N,w,H,C,X,p,x,$,h,n,l,c,f,m,y,k,E,g,M,D,R,U,ge,i,a,s,I,te,Re,ve,ae,wr,ln,Ft,cn,Ct,qe,Ha,Fn,ps]}var Ap=class extends yu{constructor(e){super(),T_(this,e,_A,TA,c_,{task:33,onSubmit:34,statusOptions:0},null,[-1,-1,-1])}},k_=Ap;var On=class extends S_.Modal{constructor({app:t,task:n,onSubmit:s}){super(t);this.task=n,this.onSubmit=i=>{i.length&&s(i),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 k_({target:t,props:{task:this.task,statusOptions:n,onSubmit:this.onSubmit}})}getKnownStatusesAndCurrentTaskStatusIfNotKnown(){let t=Ee.getInstance().registeredStatuses;return Ee.getInstance().bySymbol(this.task.status.symbol)===Q.EMPTY&&t.push(this.task.status),t}onClose(){let{contentEl:t}=this;t.empty()}};function vA(){let{setCreatedDate:r}=K();return r?window.moment():null}function wA(r){let{setCreatedDate:e}=K();if(!e||r.createdDate!==null)return!1;let t=r.description==="",n=!ye.getInstance().isEmpty(),s=!ye.getInstance().includedIn(r.description);return t||n&&s}var bu=({line:r,path:e})=>{var m,y;let t=fe.parseTaskSignifiers(r,pt.fromUnknownPosition(e),Tt.fromPath(e)),n=vA();if(t!==null)return wA(t)?new fe(ot(Se({},t),{createdDate:n})):t;let s=r.match(z.nonTaskRegex);if(s===null)return console.error("Tasks: Cannot create task on line:",r),new fe({status:Q.TODO,description:"",taskLocation:pt.fromUnknownPosition(e),indentation:"",listMarker:"-",priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,cancelledDate:null,recurrence:null,blockLink:"",tags:[],originalMarkdown:"",scheduledDateIsInferred:!1});let i=s[1],a=(m=s[2])!=null?m:"-",o=(y=s[4])!=null?y:" ",u=Ee.getInstance().bySymbolOrCreate(o),l=s[5],c=r.match(z.blockLinkRegex),f=c!==null?c[0]:"";return f!==""&&(l=l.replace(z.blockLinkRegex,"")),new fe({status:u,description:l,taskLocation:pt.fromUnknownPosition(e),indentation:i,listMarker:a,blockLink:f,priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,cancelledDate:null,recurrence:null,tags:[],originalMarkdown:"",scheduledDateIsInferred:!1})};var O_=(r,e,t,n)=>{var f;if(r)return t instanceof Pp.MarkdownView;if(!(t instanceof Pp.MarkdownView))return;let s=(f=t.file)==null?void 0:f.path;if(s===void 0)return;let a=e.getCursor().line,o=e.getLine(a),u=bu({line:o,path:s}),l=m=>{let y=Tt.removeInferredStatusIfNeeded(u,m).map(k=>k.toFileLineString()).join(`
`);e.setLine(a,y)};new On({app:n,task:u,onSubmit:l}).open()};var Np=require("obsidian");var D_=(r,e,t)=>{var u;if(r)return t instanceof Np.MarkdownView;if(!(t instanceof Np.MarkdownView))return;let n=(u=t.file)==null?void 0:u.path;if(n===void 0)return;let s=e.getCursor(),i=s.line,a=e.getLine(i),o=EA(a,n);e.setLine(i,o.text),e.setCursor(kA(s,o))},EA=(r,e)=>{let t=fe.fromLine({line:r,taskLocation:pt.fromUnknownPosition(e),fallbackDate:null});if(t!==null){let n=t.toggleWithRecurrenceInUsersOrder().map(s=>s.toFileLineString());return{text:n.join(`
`),moveTo:{line:n.length-1}}}else{let n=r.match(z.taskRegex);if(n!==null){let s=n[3],a=Ee.getInstance().bySymbol(s).nextStatusSymbol;return{text:r.replace(z.taskRegex,`$1- [${a}] $4`)}}else if(z.listItemRegex.test(r)){let s=r.replace(z.listItemRegex,"$1$2 [ ]");return{text:s,moveTo:{ch:s.length}}}else{let s=r.replace(z.indentationRegex,"$1- ");return{text:s,moveTo:{ch:s.length}}}}},kA=(r,e)=>{var i;let t={line:0,ch:r.ch},n=Se(Se({},t),(i=e.moveTo)!=null?i:{}),s=e.text.split(`
`)[n.line].length;return{line:r.line+n.line,ch:Math.min(n.ch,s)}};var Tu=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,s)=>O_(t,n,s,this.app)}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:D_})}};var SA=Object.prototype.toString,zs=Array.isArray||function(e){return SA.call(e)==="[object Array]"};function Fp(r){return typeof r=="function"}function OA(r){return zs(r)?"array":typeof r}function Ip(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function x_(r,e){return r!=null&&typeof r=="object"&&e in r}function DA(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var xA=RegExp.prototype.test;function RA(r,e){return xA.call(r,e)}var MA=/\S/;function CA(r){return!RA(MA,r)}var AA={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function PA(r){return String(r).replace(/[&<>"'`=\/]/g,function(t){return AA[t]})}var NA=/\s*/,IA=/\s+/,R_=/\s*=/,FA=/\s*\}/,LA=/#|\^|\/|>|\{|&|=|!/;function UA(r,e){if(!r)return[];var t=!1,n=[],s=[],i=[],a=!1,o=!1,u="",l=0;function c(){if(a&&!o)for(;i.length;)delete s[i.pop()];else i=[];a=!1,o=!1}var f,m,y;function k(G){if(typeof G=="string"&&(G=G.split(IA,2)),!zs(G)||G.length!==2)throw new Error("Invalid tags: "+G);f=new RegExp(Ip(G[0])+"\\s*"),m=new RegExp("\\s*"+Ip(G[1])),y=new RegExp("\\s*"+Ip("}"+G[1]))}k(e||ir.tags);for(var E=new Ua(r),x,v,I,F,le,B;!E.eos();){if(x=E.pos,I=E.scanUntil(f),I)for(var ie=0,W=I.length;ie<W;++ie)F=I.charAt(ie),CA(F)?(i.push(s.length),u+=F):(o=!0,t=!0,u+=" "),s.push(["text",F,x,x+1]),x+=1,F===`
`&&(c(),u="",l=0,t=!1);if(!E.scan(f))break;if(a=!0,v=E.scan(LA)||"name",E.scan(NA),v==="="?(I=E.scanUntil(R_),E.scan(R_),E.scanUntil(m)):v==="{"?(I=E.scanUntil(y),E.scan(FA),E.scanUntil(m),v="&"):I=E.scanUntil(m),!E.scan(m))throw new Error("Unclosed tag at "+E.pos);if(v==">"?le=[v,I,x,E.pos,u,l,t]:le=[v,I,x,E.pos],l++,s.push(le),v==="#"||v==="^")n.push(le);else if(v==="/"){if(B=n.pop(),!B)throw new Error('Unopened section "'+I+'" at '+x);if(B[1]!==I)throw new Error('Unclosed section "'+B[1]+'" at '+x)}else v==="name"||v==="{"||v==="&"?o=!0:v==="="&&k(I)}if(c(),B=n.pop(),B)throw new Error('Unclosed section "'+B[1]+'" at '+E.pos);return WA(qA(s))}function qA(r){for(var e=[],t,n,s=0,i=r.length;s<i;++s)t=r[s],t&&(t[0]==="text"&&n&&n[0]==="text"?(n[1]+=t[1],n[3]=t[3]):(e.push(t),n=t));return e}function WA(r){for(var e=[],t=e,n=[],s,i,a=0,o=r.length;a<o;++a)switch(s=r[a],s[0]){case"#":case"^":t.push(s),n.push(s),t=s[4]=[];break;case"/":i=n.pop(),i[5]=s[2],t=n.length>0?n[n.length-1][4]:e;break;default:t.push(s)}return e}function Ua(r){this.string=r,this.tail=r,this.pos=0}Ua.prototype.eos=function(){return this.tail===""};Ua.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};Ua.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 Hs(r,e){this.view=r,this.cache={".":this.view},this.parent=e}Hs.prototype.push=function(e){return new Hs(e,this)};Hs.prototype.lookup=function(e){var t=this.cache,n;if(t.hasOwnProperty(e))n=t[e];else{for(var s=this,i,a,o,u=!1;s;){if(e.indexOf(".")>0)for(i=s.view,a=e.split("."),o=0;i!=null&&o<a.length;)o===a.length-1&&(u=x_(i,a[o])||DA(i,a[o])),i=i[a[o++]];else i=s.view[e],u=x_(s.view,e);if(u){n=i;break}s=s.parent}t[e]=n}return Fp(n)&&(n=n.call(this.view)),n};function Mt(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}Mt.prototype.clearCache=function(){typeof this.templateCache!="undefined"&&this.templateCache.clear()};Mt.prototype.parse=function(e,t){var n=this.templateCache,s=e+":"+(t||ir.tags).join(":"),i=typeof n!="undefined",a=i?n.get(s):void 0;return a==null&&(a=UA(e,t),i&&n.set(s,a)),a};Mt.prototype.render=function(e,t,n,s){var i=this.getConfigTags(s),a=this.parse(e,i),o=t instanceof Hs?t:new Hs(t,void 0);return this.renderTokens(a,o,n,e,s)};Mt.prototype.renderTokens=function(e,t,n,s,i){for(var a="",o,u,l,c=0,f=e.length;c<f;++c)l=void 0,o=e[c],u=o[0],u==="#"?l=this.renderSection(o,t,n,s,i):u==="^"?l=this.renderInverted(o,t,n,s,i):u===">"?l=this.renderPartial(o,t,n,i):u==="&"?l=this.unescapedValue(o,t):u==="name"?l=this.escapedValue(o,t,i):u==="text"&&(l=this.rawValue(o)),l!==void 0&&(a+=l);return a};Mt.prototype.renderSection=function(e,t,n,s,i){var a=this,o="",u=t.lookup(e[1]);function l(m){return a.render(m,t,n,i)}if(!!u){if(zs(u))for(var c=0,f=u.length;c<f;++c)o+=this.renderTokens(e[4],t.push(u[c]),n,s,i);else if(typeof u=="object"||typeof u=="string"||typeof u=="number")o+=this.renderTokens(e[4],t.push(u),n,s,i);else if(Fp(u)){if(typeof s!="string")throw new Error("Cannot use higher-order sections without the original template");u=u.call(t.view,s.slice(e[3],e[5]),l),u!=null&&(o+=u)}else o+=this.renderTokens(e[4],t,n,s,i);return o}};Mt.prototype.renderInverted=function(e,t,n,s,i){var a=t.lookup(e[1]);if(!a||zs(a)&&a.length===0)return this.renderTokens(e[4],t,n,s,i)};Mt.prototype.indentPartial=function(e,t,n){for(var s=t.replace(/[^ \t]/g,""),i=e.split(`
`),a=0;a<i.length;a++)i[a].length&&(a>0||!n)&&(i[a]=s+i[a]);return i.join(`
`)};Mt.prototype.renderPartial=function(e,t,n,s){if(!!n){var i=this.getConfigTags(s),a=Fp(n)?n(e[1]):n[e[1]];if(a!=null){var o=e[6],u=e[5],l=e[4],c=a;u==0&&l&&(c=this.indentPartial(a,l,o));var f=this.parse(c,i);return this.renderTokens(f,t,n,c,s)}}};Mt.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(n!=null)return n};Mt.prototype.escapedValue=function(e,t,n){var s=this.getConfigEscape(n)||ir.escape,i=t.lookup(e[1]);if(i!=null)return typeof i=="number"&&s===ir.escape?String(i):s(i)};Mt.prototype.rawValue=function(e){return e[1]};Mt.prototype.getConfigTags=function(e){return zs(e)?e:e&&typeof e=="object"?e.tags:void 0};Mt.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!zs(e))return e.escape};var ir={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){La.templateCache=r},get templateCache(){return La.templateCache}},La=new Mt;ir.clearCache=function(){return La.clearCache()};ir.parse=function(e,t){return La.parse(e,t)};ir.render=function(e,t,n,s){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+OA(e)+'" was given as the first argument for mustache#render(template, view, partials)');return La.render(e,t,n,s)};ir.escape=PA;ir.Scanner=Ua;ir.Context=Hs;ir.Writer=Mt;var Lp=ir;var N_=_i(P_());function I_(r,e){Lp.escape=function(t){return t};try{return Lp.render(r,(0,N_.default)(e))}catch(t){let n="";throw t instanceof Error?n=`There was an error expanding one or more placeholders.
The error message was:
${t.message.replace(/ > /g,".").replace("Missing Mustache data property","Unknown property")}`:n="Unknown error expanding placeholders.",n+=`
The problem is in:
${r}`,Error(n)}}function _u(r){return{query:{file:new qs(r)}}}function ss(r,e){let t=`Error: ${r}.
The error message was:
`,n="";return e instanceof Error?n+=e:n+="Unknown error",`${t}"${n}"`}var De=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 De("None of",e,"NOT")}static booleanXor(e){return new De("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 s=0;s<this.children.length;s++)t+=`
${this.children[s].asString(n)}`;return t}static combineOrCreateExplanation(e,t,n){if(t.length===2){let s=t[0],i=t[1];if(s.symbol===n&&i.symbol==="")return s.children.push(i),s}return new De(e,t,n)}};var Tr=class{constructor(e,t,n,s){this.instruction=e,this.property=t,this.comparator=Tr.maybeReverse(s,n)}static maybeReverse(e,t){return e?Tr.makeReversedComparator(t):t}static makeReversedComparator(e){return(t,n,s)=>e(t,n,s)*-1}};var Dn=class{constructor(e,t,n,s){this.instruction=e,this.property=t,this.grouper=n,this.reverse=s}};var ke=class{canCreateFilterForLine(e){return ke.lineMatchesFilter(this.filterRegExp(),e)}static lineMatchesFilter(e,t){return e?e.test(t):!1}static getMatch(e,t){return e?t.match(e):null}fieldNameSingular(){return this.fieldName()}fieldNameSingularEscaped(){return uu(this.fieldNameSingular())}supportsSorting(){return!1}createSorterFromLine(e){if(!this.supportsSorting())return null;let t=ke.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createSorter(n)}sorterRegExp(){if(!this.supportsSorting())throw Error(`sorterRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)?`,"i")}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 Tr(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=ke.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createGrouper(n)}grouperRegExp(){if(!this.supportsGrouping())throw Error(`grouperRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)?$`,"i")}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 Dn(this.grouperInstruction(e),this.fieldNameSingular(),this.grouper(),e)}createNormalGrouper(){return this.createGrouper(!1)}createReverseGrouper(){return this.createGrouper(!0)}};var _t=class{constructor(e,t,n){this.instruction=e,this.explanation=n,this.filterFunction=t}explainFilterIndented(e){let t=this.explanation;return t.asString()===this.instruction?`${e}${this.instruction}
`:`${e}${this.instruction} =>
${t.asString(e+" ")}
`}};var Nr=class{constructor(e){this.instruction=e}get queryComponent(){return this._queryComponent}set queryComponent(e){this._queryComponent=e}get error(){return this._error}set error(e){this._error=e}static fromObject(e,t){let n=new Nr(e);return n._queryComponent=t,n}static fromError(e,t){let n=new Nr(e);return n._error=t,n}};var J=class{constructor(e){this.object=e}get instruction(){return this.object.instruction}get filter(){return this.object.queryComponent}get error(){return this.object.error}get filterFunction(){if(this.filter)return this.filter.filterFunction}static fromFilter(e){return new J(Nr.fromObject(e.instruction,e))}static fromError(e,t){return new J(Nr.fromError(e,t))}};var Ir=class extends ke{canCreateFilterForLine(e){let t=new RegExp(`^(?:${this.fieldNameSingularEscaped()})`,"i");return ke.lineMatchesFilter(t,e)}createFilterOrErrorMessage(e){let t=ke.getMatch(this.filterRegExp(),e);if(t===null)return this.helpMessage(e);let n=t[1].toLowerCase(),s=t[2],i=Gt[s.toUpperCase()];if(!i)return this.helpMessage(e);let a;switch(n){case"is":a=o=>o.status.type===i;break;case"is not":a=o=>o.status.type!==i;break;default:return this.helpMessage(e)}return J.fromFilter(new _t(e,a,new De(e)))}filterRegExp(){return new RegExp(`^(?:${this.fieldNameSingularEscaped()}) (is|is not) ([^ ]+)$`,"i")}helpMessage(e){let t=Object.values(Gt).filter(s=>s!=="EMPTY").join(" "),n=`Invalid ${this.fieldNameSingular()} instruction: '${e}'.
Allowed options: 'is' and 'is not' (without quotes).
Allowed values: ${t}
Note: values are case-insensitive,
so 'in_progress' works too, for example.
Example: ${this.fieldNameSingular()} is not NON_TASK`;return J.fromError(e,n)}fieldName(){return"status.type"}value(e){return e.status.type}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Ir.groupName(e),s=Ir.groupName(t);return n.localeCompare(s,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return e=>[Ir.groupName(e)]}static groupName(e){return e.status.typeGroupText}};var vu=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 wu=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e.toLocaleLowerCase()===this._instruction.toLocaleLowerCase()}createFilterOrErrorMessage(e){return this.canCreateFilterForLine(e)?J.fromFilter(new _t(e,this._filter,new De(e))):J.fromError(e,`do not understand filter: ${e}`)}};var Fr=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new wu(e,t))}canCreateFilterForLine(e){for(let t of this._filters)if(t.canCreateFilterForLine(e))return!0;return!1}createFilterOrErrorMessage(e){for(let t of this._filters){let n=t.createFilterOrErrorMessage(e);if(n.error===void 0)return n}return J.fromError(e,`do not understand filter: ${e}`)}};var at=class extends ke{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new Fr,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 s=this.date(n);return s!==null&&!s.isValid()}))}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){var m;let n=this.checkForUnexpandedTemplateText(t);if(n)return J.fromError(t,n);let s=this.filterInstructions.createFilterOrErrorMessage(t);if(s.filter!==void 0)return s;let i=ke.getMatch(this.filterRegExp(),t);if(i===null)return J.fromError(t,"do not understand query filter ("+this.fieldName()+" date)");let a=i[1],o=(m=i[2])==null?void 0:m.toLowerCase(),u=i[3],l=Wt.parseDateRange(u);if(!l.isValid()){let y=Wt.parseDate(a);y.isValid()&&(l=new Dt(y,y))}if(!l.isValid())return J.fromError(t,"do not understand "+this.fieldName()+" date");let c=this.buildFilterFunction(o,l),f=at.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),l);return J.fromFilter(new _t(t,c,f))}buildFilterFunction(t,n){let s;switch(t){case"before":s=i=>i?i.isBefore(n.start):this.filterResultIfFieldMissing();break;case"after":s=i=>i?i.isAfter(n.end):this.filterResultIfFieldMissing();break;case"on or before":case"in or before":s=i=>i?i.isSameOrBefore(n.end):this.filterResultIfFieldMissing();break;case"on or after":case"in or after":s=i=>i?i.isSameOrAfter(n.start):this.filterResultIfFieldMissing();break;default:s=i=>i?i.isSameOrAfter(n.start)&&i.isSameOrBefore(n.end):this.filterResultIfFieldMissing()}return this.getFilter(s)}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,s,i){let a=n,o="YYYY-MM-DD (dddd Do MMMM YYYY)",u;switch(n){case"before":case"on or after":u=i.start.format(o);break;case"after":case"on or before":u=i.end.format(o);break;case"in or before":a="on or before",u=i.end.format(o);break;case"in or after":a="on or after",u=i.start.format(o);break;default:if(!i.start.isSame(i.end)){let c=`${t} date is between:`,f=[new De(`${i.start.format(o)} and`),new De(`${i.end.format(o)} inclusive`)];return s&&f.push(new De(`OR no ${t} date`)),new De(c,f)}a="on",u=i.start.format(o);break}let l=`${t} date is ${a} ${u}`;return s&&(l+=` OR no ${t} date`),new De(l)}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(t,n)=>sr(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 vu().findUnexpandedDateText(t)}};var Vs=class extends at{fieldName(){return"due"}date(e){return e.dueDate}filterResultIfFieldMissing(){return!1}};var qp=class extends ke{createFilterOrErrorMessage(e){var n;let t=ke.getMatch(this.filterRegExp(),e);if(t!==null){let s=t[5],i=null;switch(s.toLowerCase()){case"lowest":i="5";break;case"low":i="4";break;case"none":i="3";break;case"medium":i="2";break;case"high":i="1";break;case"highest":i="0";break}if(i===null)return J.fromError(e,"do not understand priority");let a=e,o;switch((n=t[3])==null?void 0:n.toLowerCase()){case"above":o=u=>u.priority.localeCompare(i)<0;break;case"below":o=u=>u.priority.localeCompare(i)>0;break;case"not":o=u=>u.priority!==i;break;default:o=u=>u.priority===i,a=`${this.fieldName()} is ${s}`}return J.fromFilter(new _t(e,o,new De(a)))}else return J.fromError(e,"do not understand query filter (priority)")}fieldName(){return"priority"}filterRegExp(){return qp.priorityRegexp}supportsSorting(){return!0}comparator(){return(e,t)=>e.priority.localeCompare(t.priority)}supportsGrouping(){return!0}grouper(){return e=>[e.priorityNameGroupText]}},is=qp;is.priorityRegexp=/^priority(\s+is)?(\s+(above|below|not))?(\s+(lowest|low|none|medium|high|highest))$/i;var Ks=class{matchesAnyOf(e){return e.some(t=>this.matches(t))}};var Qs=class extends Ks{constructor(t){super();this.stringToFind=t}matches(t){return Qs.stringIncludesCaseInsensitive(t,this.stringToFind)}static stringIncludesCaseInsensitive(t,n){return t.toLocaleLowerCase().includes(n.toLocaleLowerCase())}explanation(t){return new De(t)}};var xn=class extends Ks{constructor(t){super();this.regex=t}static validateAndConstruct(t){let n=/^\/(.+)\/([^/]*)$/,s=t.match(n);if(s!==null){let i=new RegExp(s[1],s[2]);return new xn(i)}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 s=YA(t,"using regex: ",this.regexAsString());return new De(s)}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 YA(r,e,t){var o;let n=r.match(/\//);if(!n)return"Error explaining instruction. Could not find a slash character";let s=2,i=((o=n.index)!=null?o:s)-s;return`${e.padEnd(i)}${t}`}var Pe=class extends ke{createFilterOrErrorMessage(e){let t=ke.getMatch(this.filterRegExp(),e);if(t===null)return J.fromError(e,`do not understand query filter (${this.fieldName()})`);let n=t[1].toLowerCase(),s=t[2],i=null;if(n.includes("include"))i=new Qs(s);else if(n.includes("regex")){try{i=xn.validateAndConstruct(s)}catch(u){let l=ss("Parsing regular expression",u)+`
${xn.helpMessage()}`;return J.fromError(e,l)}if(i===null)return J.fromError(e,`Invalid instruction: '${e}'
${xn.helpMessage()}`)}if(i===null)return J.fromError(e,`do not understand query filter (${this.fieldName()})`);let a=n.match(/not/)!==null,o=new _t(e,this.getFilter(i,a),i.explanation(e));return J.fromFilter(o)}fieldPattern(){return this.fieldNameSingularEscaped()}filterOperatorPattern(){return"includes|does not include|regex matches|regex does not match"}filterRegExp(){return new RegExp(`^(?:${this.fieldPattern()}) (${this.filterOperatorPattern()}) (.*)`,"i")}getFilter(e,t){return n=>{let s=e.matches(this.value(n));return t?!s:s}}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 Xs=class extends Pe{fieldName(){return"path"}value(e){return e.path}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>[Pe.escapeMarkdownCharacters(e.path.replace(".md",""))]}};var Zs=class extends ke{canCreateFilterForLine(e){return!1}createFilterOrErrorMessage(e){return J.fromError(e,"Filtering by urgency is not yet supported")}fieldName(){return"urgency"}filterRegExp(){throw Error(`filterRegExp() unimplemented for ${this.fieldName()}`)}supportsSorting(){return!0}comparator(){return(e,t)=>t.urgency-e.urgency}supportsGrouping(){return!0}grouper(){return e=>[`${e.urgency.toFixed(2)}`]}createGrouper(e){return super.createGrouper(!e)}grouperInstruction(e){return super.grouperInstruction(!e)}};var Js=class{static by(e,t,n){let s=this.defaultSorters().map(a=>a.comparator),i=[];for(let a of e)i.push(a.comparator);return t.sort(Js.makeCompositeComparator([...i,...s],n))}static defaultSorters(){return[new Ir().createNormalSorter(),new Zs().createNormalSorter(),new Vs().createNormalSorter(),new is().createNormalSorter(),new Xs().createNormalSorter()]}static makeCompositeComparator(e,t){return(n,s)=>{for(let i of e){let a=i(n,s,t);if(a!==0)return a}return 0}}};var Eu=class{constructor(e,t,n){this.nestingLevel=e,this.displayName=t,this.property=n}};var ku=class{constructor(e,t){this.lastHeadingAtLevel=new Array;this.groupers=t;let s=e.keys().next().value.length;for(let i=0;i<s;i++)this.lastHeadingAtLevel.push("")}getHeadingsForTaskGroup(e){let t=new Array;for(let n=0;n<e.length;n++){let s=e[n];if(s!=this.lastHeadingAtLevel[n]){t.push(new Eu(n,s,this.groupers[n].property));for(let i=n;i<e.length;i++)this.lastHeadingAtLevel[i]="";this.lastHeadingAtLevel[n]=s}}return t}};var Su=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,s]of this.children)e.push(n),s.generateAllPaths(e).forEach((a,o)=>t.set(o,a)),e.pop();return t}};var Ou=class extends Su{},Du=class{constructor(e,t,n){this.root=new Ou(t),this.buildGroupingTree(e,n)}buildGroupingTree(e,t){let n=[this.root];for(let s of e){let i=[];for(let a of n)for(let o of a.values){let u=s.grouper(o,t);u.length===0&&u.push("");for(let l of u){let c=a.children.get(l);c===void 0&&(c=new Ou([]),a.children.set(l,c),i.push(c)),c.values.push(o)}}n=i}}generateTaskTreeStorage(){return this.root.generateAllPaths()}};var xu=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 ei=class{constructor(e,t,n){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length,this._groupers=e;let i=new Du(e,t,n).generateTaskTreeStorage();this.addTaskGroups(i),this.sortTaskGroups(),this.setGroupsHeadings(i)}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 s=n.reverse?" reverse":"";e+=`- ${n.property}${s}
`}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 s=new xu(t,n);this.addTaskGroup(s)}}addTaskGroup(e){this._groups.push(e)}sortTaskGroups(){let e=(t,n)=>{let s=t.groups,i=n.groups;for(let a=0;a<s.length;a++){let o=this._groupers[a],u=s[a].localeCompare(i[a],void 0,{numeric:!0});if(u!==0)return o.reverse?-u:u}return 0};this._groups.sort(e)}setGroupsHeadings(e){let t=new ku(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 as=class extends Pe{fieldName(){return"description"}value(e){return ye.getInstance().removeAsSubstringFrom(e.description)}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=as.cleanDescription(e.description),s=as.cleanDescription(t.description);return n.localeCompare(s,void 0,{numeric:!0})}}static cleanDescription(e){e=ye.getInstance().removeAsSubstringFrom(e);let t=/^\[\[?([^\]]*)]]?/,n=e.match(t);if(n!==null){let s=n[1];e=s.substring(s.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 Ru=class extends at{fieldName(){return"created"}date(e){return e.createdDate}filterResultIfFieldMissing(){return!1}};var Mu=class extends at{fieldName(){return"done"}date(e){return e.doneDate}filterResultIfFieldMissing(){return!1}};var Rn=class extends ke{constructor(){super(...arguments);this._filters=new Fr}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var Cu=class extends Rn{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 qa=class extends Nr{};function Wp(r,e){let t=r.map(([n])=>n);try{let n=e.includes("return")?e:`return ${e}`,s=e&&new Function(...t,n);return s instanceof Function?qa.fromObject(e,s):qa.fromError(e,"Error parsing group function")}catch(n){return qa.fromError(e,ss(`Failed parsing expression "${e}"`,n))}}function Yp(r,e){let t=e.map(([n,s])=>s);return r(...t)}function jp(r,e,t){try{return Yp(r,e)}catch(n){return ss(`Failed calculating expression "${t}"`,n)}}function Au(r,e){return[["task",r],["query",e?e.query:null]]}function F_(r,e,t){let n=Au(r,t||null),s=Wp(n,e);return s.error?s.error:jp(s.queryComponent,n,e)}var Wa=class{constructor(e){this.line=e,this.functionOrError=Wp(Au(null,null),e)}isValid(){return this.functionOrError.error===void 0}get parseError(){return this.functionOrError.error}evaluate(e,t){if(!this.isValid())throw Error(`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`);return Yp(this.functionOrError.queryComponent,Au(e,t||null))}evaluateOrCatch(e,t){return this.isValid()?jp(this.functionOrError.queryComponent,Au(e,t),this.line):`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`}};function Gp(r){if(r===null)return"null";let e=typeof r;return e==="object"?r.constructor.name:e}var Pu=class extends ke{createFilterOrErrorMessage(e){let t=ke.getMatch(this.filterRegExp(),e);if(t===null)return J.fromError(e,"Unable to parse line");let n=t[1],s=new Wa(n);return s.isValid()?J.fromFilter(new _t(e,jA(s),new De(e))):J.fromError(e,s.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=ke.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1],s=t[2],i=new Wa(s);if(!i.isValid())throw new Error(i.parseError);let a=(o,u,l)=>{try{let c=l.queryContext(),f=this.validateTaskSortKey(i.evaluate(o,c)),m=this.validateTaskSortKey(i.evaluate(u,c));return this.compareTaskSortKeys(f,m)}catch(c){throw c instanceof Error&&(c.message+=`: while evaluating instruction '${e}'`),c}};return new Tr(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=Gp(e),s=Gp(t),i=this.compareTaskSortKeysIfOptionalMoment(e,t,n,s);if(i!==void 0)return i;let a=this.compareTaskSortKeysIfEitherIsNull(e,t);if(a!==void 0)return a;if(n!==s)throw new Error(`Unable to compare two different sort key types '${n}' and '${s}' order`);if(n==="string")return e.localeCompare(t,void 0,{numeric:!0});if(n==="TasksDate")return sr(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 '${s}'`);return o}compareTaskSortKeysIfOptionalMoment(e,t,n,s){let i=n==="Moment",a=s==="Moment";if(i&&a||i&&t===null||a&&e===null)return sr(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=ke.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1],s=t[2];return new Dn(e,"function",$A(s),n)}grouperRegExp(){return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)? (.*)`,"i")}grouper(){throw Error("grouper() function not valid for FunctionField. Use createGrouperFromLine() instead.")}};function jA(r){return(e,t)=>{let n=t.queryContext();return GA(r,e,n)}}function GA(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 $A(r){return(e,t)=>{let n=t.queryContext();return BA(e,r,n)}}function BA(r,e,t){try{let n=F_(r,e,t);return Array.isArray(n)?n.map(i=>i.toString()):n===null?[]:[n.toString()]}catch(n){let s=`Error: Failed calculating expression "${e}". The error message was: `;return n instanceof Error?[s+n.message]:[s+"Unknown error"]}}var Nu=class extends Pe{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 Iu=class extends at{fieldName(){return"scheduled"}date(e){return e.scheduledDate}filterResultIfFieldMissing(){return!1}};var Fu=class extends at{fieldName(){return"start"}fieldNameForFilterInstruction(){return"starts"}date(e){return e.startDate}filterResultIfFieldMissing(){return!0}};var Lu=class extends at{constructor(){let e=new Fr;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 Uu=class extends Rn{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 Mn=class extends Rn{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=Mn.oldStatusName(e),s=Mn.oldStatusName(t);return n<s?1:n>s?-1:0}}static oldStatusName(e){return e.status.symbol===" "?"Todo":"Done"}supportsGrouping(){return!0}grouper(){return e=>[Mn.oldStatusName(e)]}};var qu=class extends Pe{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 s=e.matchesAnyOf(this.values(n));return t?!s:s}}createGrouper(e){return new Dn(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 os=class extends qu{constructor(){super();this.filterInstructions=new Fr,this.filterInstructions.add(`has ${this.fieldNameSingular()}`,t=>this.values(t).length>0),this.filterInstructions.add(`has ${this.fieldNamePlural()}`,t=>this.values(t).length>0),this.filterInstructions.add(`no ${this.fieldNameSingular()}`,t=>this.values(t).length===0),this.filterInstructions.add(`no ${this.fieldNamePlural()}`,t=>this.values(t).length===0)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.filter!==void 0?n:super.createFilterOrErrorMessage(t)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}fieldNameSingular(){return"tag"}values(t){return t.tags}supportsSorting(){return!0}createSorterFromLine(t){let n=t.match(this.sorterRegExp());if(n===null)return null;let s=!!n[1],i=isNaN(+n[2])?1:+n[2],a=os.makeCompareByTagComparator(i);return new Tr(t,this.fieldNameSingular(),a,s)}sorterRegExp(){return/^sort by tag( reverse)?[\s]*(\d+)?/i}comparator(){return os.makeCompareByTagComparator(1)}static makeCompareByTagComparator(t){return(n,s)=>{if(n.tags.length===0&&s.tags.length===0)return 0;if(n.tags.length===0)return 1;if(s.tags.length===0)return-1;let i=t-1;if(n.tags.length<t&&s.tags.length>=t)return 1;if(s.tags.length<t&&n.tags.length>=t)return-1;if(n.tags.length<t&&s.tags.length<t)return 0;let a=n.tags[i],o=s.tags[i];return a.localeCompare(o,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return t=>t.tags.length==0?["(No tags)"]:t.tags}};var Q_=_i(K_());var $u=class extends ke{constructor(){super(...arguments);this.basicBooleanRegexp=/(.*(AND|OR|XOR|NOT)\s*[("].*|\(.+\))/g;this.supportedOperators=["AND","OR","XOR","NOT"];this.subFields={}}filterRegExp(){return this.basicBooleanRegexp}createFilterOrErrorMessage(t){return this.parseLine(t)}fieldName(){return"boolean query"}parseLine(t){if(t.length===0)return J.fromError(t,"empty line");let n=this.preprocessExpression(t);try{let s=(0,Q_.parse)(n);for(let o of s)if(o.name==="IDENTIFIER"&&o.value){let u=o.value.trim();if(!(u in this.subFields)){let l=Bu(u);if(l===null)return J.fromError(t,`couldn't parse sub-expression '${u}'`);if(l.error)return J.fromError(t,`couldn't parse sub-expression '${u}': ${l.error}`);l.filter&&(this.subFields[u]=l.filter)}}else if(o.name==="OPERATOR"){if(o.value==null)return J.fromError(t,"empty operator in boolean query");if(!this.supportedOperators.includes(o.value))return J.fromError(t,`unknown boolean operator '${o.value}'`)}let i=(o,u)=>this.filterTaskWithParsedQuery(o,s,u),a=this.constructExplanation(s);return J.fromFilter(new _t(t,i,a))}catch(s){let i=s instanceof Error?s.message:"unknown error type";return J.fromError(t,`malformed boolean query -- ${i} (check the documentation for guidelines)`)}}preprocessExpression(t){return t.replace(/\(([^()]+)\)/g,'("$1")')}filterTaskWithParsedQuery(t,n,s){let i=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,s);o.push(a(c))}else if(u.name==="OPERATOR")if(u.value==="NOT"){let l=i(o.pop());o.push(a(!l))}else if(u.value==="OR"){let l=i(o.pop()),c=i(o.pop());o.push(a(l||c))}else if(u.value==="AND"){let l=i(o.pop()),c=i(o.pop());o.push(a(l&&c))}else if(u.value==="XOR"){let l=i(o.pop()),c=i(o.pop());o.push(a(l&&!c||!l&&c))}else throw Error("Unsupported operator: "+u.value);else throw Error("Unsupported token type: "+u);return i(o[0])}constructExplanation(t){let n=[];for(let s of t)if(s.name==="IDENTIFIER"){if(s.value==null)throw Error("null token value");let i=this.subFields[s.value.trim()];n.push(i.explanation)}else if(s.name==="OPERATOR")if(s.value==="NOT"){let i=n.pop();n.push(De.booleanNot([i]))}else if(s.value==="OR"){let i=n.pop(),a=n.pop();n.push(De.booleanOr([a,i]))}else if(s.value==="AND"){let i=n.pop(),a=n.pop();n.push(De.booleanAnd([a,i]))}else if(s.value==="XOR"){let i=n.pop(),a=n.pop();n.push(De.booleanXor([a,i]))}else throw Error("Unsupported operator: "+s.value);else throw Error("Unsupported token type: "+s.name);return n[0]}};var Hu=class extends Pe{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 zu=class extends Pe{constructor(){super()}fieldName(){return"status.name"}value(e){return e.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};var Vu=class extends Pe{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 Ku=class extends Pe{fieldName(){return"folder"}value(e){return e.file.folder}supportsGrouping(){return!0}grouper(){return e=>[Pe.escapeMarkdownCharacters(this.value(e))]}};var Qu=class extends Pe{fieldName(){return"root"}value(e){return e.file.root}supportsGrouping(){return!0}grouper(){return e=>[Pe.escapeMarkdownCharacters(this.value(e))]}};var Xu=class extends Pe{fieldName(){return"backlink"}value(e){let t=e.getLinkText({isFilenameUnique:!0});return t===null?"Unknown Location":t}createFilterOrErrorMessage(e){return J.fromError(e,"backlink field does not support filtering")}canCreateFilterForLine(e){return!1}supportsGrouping(){return!0}grouper(){return e=>{let t=e.filename;if(t===null)return["Unknown Location"];let n=e.precedingHeader;return n===null?["[["+t+"]]"]:[`[[${t}#${n}|${t} > ${n}]]`]}}};var Zu=class extends at{fieldName(){return"cancelled"}date(e){return e.cancelledDate}filterResultIfFieldMissing(){return!1}};var Jp=[()=>new zu,()=>new Ir,()=>new Mn,()=>new Uu,()=>new is,()=>new Lu,()=>new Zu,()=>new Ru,()=>new Fu,()=>new Iu,()=>new Vs,()=>new Mu,()=>new Xs,()=>new Ku,()=>new Qu,()=>new Xu,()=>new as,()=>new os,()=>new Nu,()=>new Cu,()=>new Hu,()=>new Zs,()=>new Vu,()=>new Pu,()=>new $u];function Bu(r){for(let e of Jp){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function X_(r){let e=/^sort by /i;if(r.match(e)===null)return null;for(let t of Jp){let s=t().createSorterFromLine(r);if(s)return s}return null}function Z_(r){let e=/^group by /i;if(r.match(e)===null)return null;for(let t of Jp){let s=t().createGrouperFromLine(r);if(s)return s}return null}var Cn=class{constructor(e,t){this.queryPath=e,this.allTasks=[...t]}static fromAllTasks(e){return new Cn(void 0,e)}queryContext(){return this.queryPath?_u(this.queryPath):void 0}};function J_(r){return`task${r!==1?"s":""}`}var cs=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} ${J_(e)}`:`${e} of ${t} ${J_(t)}`}get groups(){return this.taskGroups.groups}static fromError(e){let t=new cs(new ei([],[],Cn.fromAllTasks([])),0);return t._searchErrorMessage=e,t}};function ev(r){return r.endsWith("\\")}function tv(r){return r.endsWith("\\\\")}function bP(r){return r.replace(/^[ \t]*/,"")}function TP(r){return r.replace(/[ \t]*\\$/,"")}function _P(r,e){let t=r;return e&&(t=bP(r)),tv(t)?t=t.slice(0,-1):ev(r)&&(t=TP(t)),t}function vP(r,e,t){e?r[r.length-1]+=" "+t:r.push(t)}function wP(r){let e=[],t=!1;for(let n of r.split(`
`)){let s=_P(n,t);vP(e,t,s),tv(n)?t=!1:t=ev(n)}return e.join(`
`)}function rv(r){return wP(r).split(`
`).map(e=>e.trim()).filter(e=>e!=="")}var ui=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 s=0;s<t;s++)n+=this.indentation+e.grouping[s].instruction+`
`;return n}explainSorters(e){let t=e.sorting.length;if(t===0)return this.indent(`No sorting instructions supplied.
`);let n="";for(let s=0;s<t;s++)n+=this.indentation+e.sorting[s].instruction+`
`;return n}explainQueryLimits(e){function t(s){let i=`At most ${s} task`;return s!==1&&(i+="s"),i}let n=[];if(e.limit!==void 0){let s=t(e.limit)+`.
`;n.push(this.indent(s))}if(e.taskGroupLimit!==void 0){let s=t(e.taskGroupLimit)+` per group (if any "group by" options are supplied).
`;n.push(this.indent(s))}return n.join(`
`)}explainDebugSettings(){let e="",{debugSettings:t}=K();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 un=class{constructor(e,t=void 0){this._limit=void 0;this._taskGroupLimit=void 0;this._taskLayoutOptions=new Cr;this._queryLayoutOptions=new En;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)/i;this.shortModeRegexp=/^short/i;this.fullModeRegexp=/^full/i;this.explainQueryRegexp=/^explain/i;this.ignoreGlobalQueryRegexp=/^ignore global query/i;this.logger=Rt.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()}`),rv(e).forEach(n=>{let s=this.expandPlaceholders(n,t);if(this.error===void 0)try{this.parseLine(s)}catch(i){let a;i instanceof Error?a=i.message:a="Unknown error",this.setError(a,s);return}})}parseLine(e){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):break;default:this.setError("do not understand query",e)}}formatQueryForLogging(){return`[${this.source.split(`
`).join(" ; ")}]`}expandPlaceholders(e,t){if(e.includes("{{")&&e.includes("}}")&&this.filePath===void 0)return this._error=`The query looks like it contains a placeholder, with "{{" and "}}"
but no file path has been supplied, so cannot expand placeholder values.
The query is:
${e}`,e;let n=e;if(t){let s=_u(t);try{n=I_(e,s)}catch(i){return i instanceof Error?this._error=i.message:this._error="Internal error. expandPlaceholders() threw something other than Error.",e}}return n}append(e){return this.source===""?e:e.source===""?this:new un(`${this.source}
${e.source}`,this.filePath)}explainQuery(){return new ui().explainQuery(this)}get limit(){return this._limit}get taskGroupLimit(){return this._taskGroupLimit}get taskLayoutOptions(){return this._taskLayoutOptions}get queryLayoutOptions(){return this._queryLayoutOptions}get filters(){return this._filters}addFilter(e){this._filters.push(e)}get sorting(){return this._sorting}get grouping(){return this._grouping}get error(){return this._error}setError(e,t){this._error=`${e}
Problem line: "${t}"`}get ignoreGlobalQuery(){return this._ignoreGlobalQuery}applyQueryToTasks(e){this.debug(`Executing query: ${this.formatQueryForLogging()}`);let t=new Cn(this.filePath,e);try{this.filters.forEach(o=>{e=e.filter(u=>o.filterFunction(u,t))});let{debugSettings:n}=K(),s=n.ignoreSortInstructions?e:Js.by(this.sorting,e,t),i=s.slice(0,this.limit),a=new ei(this.grouping,i,t);return this._taskGroupLimit!==void 0&&a.applyTaskLimit(this._taskGroupLimit),new cs(a,s.length)}catch(n){let s="Search failed";return cs.fromError(ss(s,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;default:this.setError("do not understand hide/show option",e)}}}parseFilter(e){var n;let t=Bu(e);return t!=null?(t.filter?this._filters.push(t.filter):this.setError((n=t.error)!=null?n:"Unknown error",e),!0):!1}parseLimit(e){let t=e.match(this.limitRegexp);if(t===null){this.setError("do not understand query limit",e);return}let n=Number.parseInt(t[3],10);t[1]!==void 0?this._taskGroupLimit=n:this._limit=n}parseSortBy(e){let t=X_(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy(e){let t=Z_(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 An=class{constructor(e=An.empty){this._source=e}static getInstance(){return An.instance||(An.instance=new An),An.instance}set(e){this._source=e}query(e=void 0){return new un(this._source,e)}hasInstructions(){return this._source.trim()!==An.empty}},or=An;or.empty="";var Ju=class{constructor({obsidianEvents:e}){this.logger=Rt.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 Ga=require("obsidian");var ja,em,tm,EP=["md"];function rl(){return Rt.getLogger("tasks.File")}var nv=({metadataCache:r,vault:e,workspace:t})=>{ja=r,em=e,tm=t},li=t=>L(void 0,[t],function*({originalTask:r,newTasks:e}){if(em===void 0||ja===void 0||tm===void 0){el("Tasks: cannot use File before initializing it.");return}Array.isArray(e)||(e=[e]);let n=rl(),s="replaceTaskWithTasks()";pu(n,s,r),mu(n,s,e),iv({originalTask:r,newTasks:e,vault:em,metadataCache:ja,workspace:tm,previousTries:0})});function el(r){console.error(r),new Ga.Notice(r,15e3)}function sv(r){console.warn(r),new Ga.Notice(r,1e4)}function kP(r){rl().debug(r)}var Pn=class extends Error{},tl=class extends Error{},iv=a=>L(void 0,[a],function*({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:s,previousTries:i}){let o=rl();o.debug(`tryRepetitive after ${i} previous tries`);let u=()=>{if(i>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.
`;el(c);return}let l=Math.min(Math.pow(10,i),100);o.debug(`timeout = ${l}`),setTimeout(()=>{iv({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:s,previousTries:i+1})},l)};try{let[l,c,f]=yield av(r,t),m=[...f.slice(0,l),...e.map(y=>y.toFileLineString()),...f.slice(l+1)];yield t.modify(c,m.join(`
`))}catch(l){if(l instanceof Pn)return l.message&&sv(l.message),u();if(l instanceof tl)return u();l instanceof Error&&el(l.message)}});function av(r,e){return L(this,null,function*(){if(ja===void 0)throw new Pn;let t=e.getAbstractFileByPath(r.path);if(!(t instanceof Ga.TFile))throw new Pn(`Tasks: No file found for task ${r.description}. Retrying ...`);if(!EP.includes(t.extension))throw new Error(`Tasks: Does not support files with the ${t.extension} file extension.`);let n=ja.getFileCache(t);if(n==null||n===null)throw new Pn(`Tasks: No file cache found for file ${t.path}. Retrying ...`);let s=n.listItems;if(s===void 0||s.length===0)throw new Pn(`Tasks: No list items found in file cache of ${t.path}. Retrying ...`);let a=(yield e.read(t)).split(`
`),o=SP(r,a,s,kP);if(o===void 0)throw new tl;return[o,t,a]})}function rm(r,e){return L(this,null,function*(){try{let[t,n,s]=yield av(r,e);return[t,n]}catch(t){t instanceof Pn?t.message&&sv(t.message):t instanceof Error&&el(t.message)}})}function ov(r,e){return r<e.length}function SP(r,e,t,n){let s=OP(r,e);return s!==void 0||(s=DP(r,e),s!==void 0)?s:xP(r,e,t,n)}function OP(r,e){let t=r.taskLocation.lineNumber;if(ov(t,e)&&e[t]===r.originalMarkdown)return rl().debug(`Found original markdown at original line number ${t}`),t}function DP(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 xP(r,e,t,n){let s,i=0;for(let a of t){let o=a.position.start.line;if(!ov(o,e))return;if(o<r.taskLocation.sectionStart||a.task===void 0)continue;let u=e[o];if(ye.getInstance().includedIn(u)){if(i===r.taskLocation.sectionIndex){if(u===r.originalMarkdown)s=o;else{n(`Tasks: Unable to find task in file ${r.taskLocation.path}.
Expected task:
${r.originalMarkdown}
Found task:
${u}`);return}break}i++}}return s}var dv=require("obsidian");var cv=require("obsidian");var nl=class{constructor(){this.data=RP}addDataAttribute(e,t,n){this.data[n].addDataAttribute(e,t,n)}addClassName(e,t){let n=this.data[t].className;e.classList.add(n)}},nm=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===nm.noAttributeName)return;let s=this.attributeValueCalculator(n,t);s!==""&&(e.dataset[this.attributeName]=s)}},Ce=nm;Ce.noAttributeName="",Ce.noAttributeValueCalculator=()=>"",Ce.dateAttributeCalculator=(e,t)=>{let s="far";function i(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+=s,l)}let a=t[e];if(a instanceof window.moment){let o=i(a);if(o)return o}return""};var RP={createdDate:new Ce("task-created","taskCreated",Ce.dateAttributeCalculator),dueDate:new Ce("task-due","taskDue",Ce.dateAttributeCalculator),startDate:new Ce("task-start","taskStart",Ce.dateAttributeCalculator),scheduledDate:new Ce("task-scheduled","taskScheduled",Ce.dateAttributeCalculator),doneDate:new Ce("task-done","taskDone",Ce.dateAttributeCalculator),cancelledDate:new Ce("task-cancelled","taskCancelled",Ce.dateAttributeCalculator),description:new Ce("task-description",Ce.noAttributeName,Ce.noAttributeValueCalculator),recurrenceRule:new Ce("task-recurring",Ce.noAttributeName,Ce.noAttributeValueCalculator),priority:new Ce("task-priority","taskPriority",(r,e)=>sn.priorityNameUsingNormal(e.priority).toLocaleLowerCase()),blockLink:new Ce("task-block-link",Ce.noAttributeName,Ce.noAttributeValueCalculator)};var sm=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 uv(r){let e=[],t=new Ne().coreStatuses.map(n=>n.symbol);for(let n of[!0,!1])for(let s of r.registeredStatuses)t.includes(s.symbol)===n&&e.push(new sm(s));return e}var lv=require("obsidian");function $a(r,e){return L(this,null,function*(){yield li({originalTask:r,newTasks:e})})}var ci=class extends lv.Menu{constructor(t){super();this.taskSaver=t}addItemsForInstructions(t,n){for(let s of t)this.addItemForInstruction(n,s)}addItemForInstruction(t,n){this.addItem(s=>this.getMenuItemCallback(t,s,n))}getMenuItemCallback(t,n,s){n.setTitle(s.instructionDisplayName()).setChecked(s.isCheckedForTask(t)).onClick(()=>L(this,null,function*(){let i=s.apply(t);(i.length!==1||!Object.is(i[0],t))&&(yield this.taskSaver(t,i))}))}};var sl=class extends ci{constructor(e,t,n=$a){super(n);let s=uv(e);this.addItemsForInstructions(s,t)}};var Nn=class{static obsidianMarkdownRenderer(e,t,n,s){return L(this,null,function*(){if(!s)throw new Error("Must call the Obsidian renderer with an Obsidian Component object");yield cv.MarkdownRenderer.renderMarkdown(e,t,n,s)})}constructor({textRenderer:e=Nn.obsidianMarkdownRenderer,obsidianComponent:t,parentUlElement:n,taskLayoutOptions:s,queryLayoutOptions:i}){this.textRenderer=e,this.obsidianComponent=t,this.parentUlElement=n,this.taskLayoutOptions=s,this.queryLayoutOptions=i}renderTaskLine(e,t,n){return L(this,null,function*(){let s=document.createElement("li");this.parentUlElement.appendChild(s),s.classList.add("task-list-item","plugin-tasks-list-item");let i=document.createElement("span");s.appendChild(i),i.classList.add("tasks-list-text"),yield this.taskToHtml(e,i,s);let a=document.createElement("input");return s.appendChild(a),a.classList.add("task-list-item-checkbox"),a.type="checkbox",e.status.symbol!==" "&&(a.checked=!0,s.classList.add("is-checked")),a.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),a.disabled=!0;let u=e.toggleWithRecurrenceInUsersOrder();li({originalTask:e,newTasks:u})}),a.addEventListener("contextmenu",o=>{new sl(Ee.getInstance(),e).showAtPosition({x:o.clientX,y:o.clientY})}),a.setAttribute("title","Right-click for options"),s.prepend(a),s.setAttribute("data-task",e.status.symbol.trim()),s.setAttribute("data-line",t.toString()),s.setAttribute("data-task-status-name",e.status.name),s.setAttribute("data-task-status-type",e.status.type),a.setAttribute("data-line",t.toString()),this.queryLayoutOptions.shortMode&&this.addTooltip(e,i,n),s})}taskToHtml(e,t,n){return L(this,null,function*(){let s=new nl,i=rn.tasksPluginEmoji.taskSerializer;for(let a of this.taskLayoutOptions.shownComponents){let o=i.componentToString(e,this.queryLayoutOptions.shortMode,a);if(o){let u=document.createElement("span");t.appendChild(u);let l=document.createElement("span");u.appendChild(l),yield this.renderComponentText(l,o,a,e),this.addInternalClasses(a,l),s.addClassName(u,a),s.addDataAttribute(u,e,a),s.addDataAttribute(n,e,a)}}for(let a of this.taskLayoutOptions.hiddenComponents)s.addDataAttribute(n,e,a);n.dataset.taskPriority===void 0&&s.addDataAttribute(n,e,"priority")})}renderComponentText(e,t,n,s){return L(this,null,function*(){if(n==="description"){t=ye.getInstance().removeAsWordFromDependingOnSettings(t);let{debugSettings:i}=K();i.showTaskHiddenData&&(t+=`<br>\u{1F41B} <b>${s.lineNumber}</b> . ${s.sectionStart} . ${s.sectionIndex} . '<code>${s.originalMarkdown}</code>'<br>'<code>${s.path}</code>' > '<code>${s.precedingHeader}</code>'<br>`),yield this.textRenderer(t,e,s.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(s){let i=/["&\x00\r\n]/g,a=s.replace(i,"-");return a=a.replace(/^[-_]+/,""),a.length>0?a:null}if(e==="description"){let s=t.getElementsByClassName("tag");for(let i=0;i<s.length;i++){let a=s[i].textContent;if(a){let o=n(a),u=s[i];o&&(u.dataset.tagName=o)}}}}addTooltip(e,t,n){let{recurrenceSymbol:s,startDateSymbol:i,createdDateSymbol:a,scheduledDateSymbol:o,dueDateSymbol:u,cancelledDateSymbol:l,doneDateSymbol:c}=rn.tasksPluginEmoji.taskSerializer.symbols;t.addEventListener("mouseenter",()=>{function f(E,x,v){x&&E.createDiv().setText(m({signifier:v,date:x}))}function m({signifier:E,date:x}){return`${E} ${x.format(z.dateFormat)} (${x.from(window.moment().startOf("day"))})`}let y=t.createDiv();y.addClasses(["tooltip","pop-up"]),e.recurrence&&y.createDiv().setText(`${s} ${e.recurrence.toText()}`),f(y,e.createdDate,a),f(y,e.startDate,i),f(y,e.scheduledDate,o),f(y,e.dueDate,u),f(y,e.cancelledDate,l),f(y,e.doneDate,c);let k=e.getLinkText({isFilenameUnique:n});k&&y.createDiv().setText(`\u{1F517} ${k}`),t.addEventListener("mouseleave",()=>{y.remove()})})}};var il=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return L(this,null,function*(){var f;let n=new dv.MarkdownRenderChild(e);t.addChild(n);let s=e.findAll(".task-list-item").filter(m=>{var E;let y=(E=m.textContent)==null?void 0:E.split(`
`);if(y===void 0)return!1;let k=null;for(let x=0;x<y.length;x=x+1)if(y[x]!==""){k=y[x];break}return k===null?!1:ye.getInstance().includedIn(k)});if(s.length===0)return;let i=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 y=o[m];if(y===void 0)continue;let k=null,E=fe.fromLine({line:y,taskLocation:new pt(i,m,a.lineStart,u,k),fallbackDate:null});E!==null&&(l.push(E),u++)}let c=new Nn({obsidianComponent:n,parentUlElement:e,taskLayoutOptions:new Cr,queryLayoutOptions:new En});for(let m=0;m<s.length;m++){let y=l[m],k=s[m];if(y===void 0||k===void 0)continue;let E=(f=k.getAttr("data-line"))!=null?f:"0",x=Number.parseInt(E,10),v=yield c.renderTaskLine(y,x),I=k.childNodes;for(let B=0;B<I.length;B=B+1){let ie=I[B];ie.nodeName.toLowerCase()==="div"?v.prepend(ie):ie.nodeName.toLowerCase()==="ul"&&v.append(ie)}let F=k.querySelectorAll("[data-footnote-id]"),le=v.querySelectorAll("[data-footnote-id]");if(F.length===le.length)for(let B=0;B<F.length;B++)le[B].replaceWith(F[B]);k.replaceWith(v)}})}};var fv=require("@codemirror/view"),pv=require("obsidian");var mv=()=>fv.ViewPlugin.fromClass(im),im=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 pv.Notice(m,45e3)}return!1}let{state:s}=this.view,i=this.view.posAtDOM(t),a=s.doc.lineAt(i),o=fe.fromLine({line:a.text,taskLocation:pt.fromUnknownPosition(""),fallbackDate:null});if(o===null)return!1;e.preventDefault();let l=o.toggleWithRecurrenceInUsersOrder().map(m=>m.toFileLineString()).join(s.lineBreak),c=s.update({changes:{from:a.from,to:a.to,insert:l}});this.view.dispatch(c);let f=t.checked;return setTimeout(()=>{t.checked=f},1),!0}};var di=require("obsidian");function hv(r,e,t,n=void 0){let s="";e.isEmpty()||(s+=`Only tasks containing the global filter '${e.get()}'.
`);let i=new ui(" "),a=new un(r,n);if(!a.ignoreGlobalQuery&&t.hasInstructions()){let o=t.query(n);s+=`Explanation of the global query:
${i.explainQuery(o)}
`}return s+=`Explanation of this Tasks code block query:
${i.explainQuery(a)}`,s}function al(r,e,t){let n=new un(r,t);return n.ignoreGlobalQuery?n:e.query(t).append(n)}function gv(r){for(let t of fe.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 ol(r){return r.dueDate?"dueDate":r.scheduledDate?"scheduledDate":r.startDate?"startDate":null}function am(r,e,t,n){let s=r[e];return bv(s,r,e,t,n)}function yv(r,e,t,n){let s=window.moment();return bv(s,r,e,t,n)}function bv(r,e,t,n,s){let i=new Ye(r).postpone(n,s),a=Tt.removeInferredStatusIfNeeded(e,[new fe(ot(Se({},e),{[t]:i}))])[0];return{postponedDate:i,postponedTask:a}}function Tv(r,e){let t=r==null?void 0:r.format("DD MMM YYYY");return`Task's ${e} changed to ${t}`}function _v(r,e,t){return`\u2139\uFE0F ${om(r,e,t)} (right-click for more options)`}function MP(r){return r.charAt(0).toUpperCase()+r.slice(1)}function om(r,e,t){let n=ol(r),s=r[n];return wv(n,s,e,t)}function vv(r,e,t){let n=ol(r),s=window.moment().startOf("day");return wv(n,s,e,t)}function wv(r,e,t,n){let i=new Ye(e).postpone(n,t).format("ddd Do MMM"),a=t!=1?t:"a";return e.isSameOrBefore(window.moment(),"day")?`${MP(r.replace("Date",""))} in ${a} ${n}, on ${i}`.replace(" in 0 days"," today").replace("in a day","tomorrow"):`Postpone ${r.replace("Date"," date")} by ${a} ${n}, to ${i}`}var um=require("obsidian");var In=class extends ci{constructor(e,t,n=$a){super(n);let s=(l,c,f,m,y,k)=>{let E=y(t,m,f);c.setTitle(E).onClick(()=>In.postponeOnClickCallback(l,t,m,f,k,n))},i=vv,a=yv;this.addItem(l=>s(e,l,"days",0,i,a)),this.addItem(l=>s(e,l,"day",1,i,a)),this.addSeparator();let o=om,u=am;this.addItem(l=>s(e,l,"days",2,o,u)),this.addItem(l=>s(e,l,"days",3,o,u)),this.addItem(l=>s(e,l,"days",4,o,u)),this.addItem(l=>s(e,l,"days",5,o,u)),this.addItem(l=>s(e,l,"days",6,o,u)),this.addSeparator(),this.addItem(l=>s(e,l,"week",1,o,u)),this.addItem(l=>s(e,l,"weeks",2,o,u)),this.addItem(l=>s(e,l,"weeks",3,o,u)),this.addItem(l=>s(e,l,"month",1,o,u))}static postponeOnClickCallback(o,u,l,c){return L(this,arguments,function*(e,t,n,s,i=am,a=$a){let f=ol(t);if(f===null){let k="\u26A0\uFE0F Postponement requires a date: due, scheduled or start.";return new um.Notice(k,1e4)}let{postponedDate:m,postponedTask:y}=i(t,f,s,n);yield a(t,y),In.postponeSuccessCallback(e,f,m)})}static postponeSuccessCallback(e,t,n){e.style.pointerEvents="none";let s=Tv(n,t);new um.Notice(s,2e3)}};var ul=class{constructor({plugin:e,events:t}){this.addQueryRenderChild=this._addQueryRenderChild.bind(this);this.app=e.app,this.events=t,e.registerMarkdownCodeBlockProcessor("tasks",this._addQueryRenderChild.bind(this))}_addQueryRenderChild(e,t,n){return L(this,null,function*(){n.addChild(new lm({app:this.app,events:this.events,container:t,source:e,filePath:n.sourcePath}))})}},lm=class extends di.MarkdownRenderChild{constructor({app:t,events:n,container:s,source:i,filePath:a}){super(s);switch(this.app=t,this.events=n,this.source=i,this.filePath=a,this.containerEl.className){case"block-language-tasks":this.query=al(this.source,or.getInstance(),this.filePath),this.queryType="tasks";break;default:this.query=al(this.source,or.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,s=t.getTime()-n.getTime();this.queryReloadTimeout=setTimeout(()=>{this.query=al(this.source,or.getInstance(),this.filePath),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},s+1e3)}render(s){return L(this,arguments,function*({tasks:t,state:n}){var a;let i=this.containerEl.createEl("div");n==="Warm"&&this.query.error===void 0?yield this.renderQuerySearchResults(t,n,i):this.query.error!==void 0?this.renderErrorMessage(i,this.query.error):this.renderLoadingMessage(i),(a=this.containerEl.firstChild)==null||a.replaceWith(i)})}renderQuerySearchResults(t,n,s){return L(this,null,function*(){this.query.debug(`[render] Render called: plugin state: ${n}; searching ${t.length} tasks`),this.query.queryLayoutOptions.explainQuery&&this.createExplanation(s);let i=this.query.applyQueryToTasks(t);if(i.searchErrorMessage!==void 0){this.renderErrorMessage(s,i.searchErrorMessage);return}yield this.addAllTaskGroups(i.taskGroups,s);let a=i.totalTasksCount;this.addTaskCount(s,i),this.query.debug(`[render] ${a} tasks displayed`)})}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=hv(this.source,ye.getInstance(),or.getInstance(),this.filePath),s=t.createEl("pre");s.addClasses(["plugin-tasks-query-explanation"]),s.setText(n),t.appendChild(s)}createTaskList(t,n){return L(this,null,function*(){let s=new lu(this.query.taskLayoutOptions,this.query.queryLayoutOptions),i=n.createEl("ul");i.addClasses(["contains-task-list","plugin-tasks-query-result"]),i.addClasses(s.taskListHiddenClasses());let a=this.getGroupingAttribute();a&&a.length>0&&(i.dataset.taskGroupBy=a);let o=new Nn({obsidianComponent:this,parentUlElement:i,taskLayoutOptions:this.query.taskLayoutOptions,queryLayoutOptions:this.query.queryLayoutOptions});for(let[u,l]of t.entries()){let c=this.isFilenameUnique({task:l}),f=yield o.renderTaskLine(l,u,c);f.querySelectorAll("[data-footnote-id]").forEach(E=>E.remove());let y=f.createSpan("task-extras");this.query.queryLayoutOptions.hideUrgency||this.addUrgency(y,l);let k=this.query.queryLayoutOptions.shortMode;this.query.queryLayoutOptions.hideBacklinks||this.addBacklinks(y,l,k,c),this.query.queryLayoutOptions.hideEditButton||this.addEditButton(y,l),!this.query.queryLayoutOptions.hidePostponeButton&&gv(l)&&this.addPostponeButton(y,l,k),i.appendChild(f)}n.appendChild(i)})}addEditButton(t,n){t.createEl("a",{cls:"tasks-edit",href:"#",title:"Edit task"}).onClickEvent(i=>{i.preventDefault();let a=u=>L(this,null,function*(){yield li({originalTask:n,newTasks:Tt.removeInferredStatusIfNeeded(n,u)})});new On({app:this.app,task:n,onSubmit:a}).open()})}addUrgency(t,n){let s=new Intl.NumberFormat().format(n.urgency);t.createSpan({text:s,cls:"tasks-urgency"})}addAllTaskGroups(t,n){return L(this,null,function*(){for(let s of t.groups)yield this.addGroupHeadings(n,s.groupHeadings),yield this.createTaskList(s.tasks,n)})}addGroupHeadings(t,n){return L(this,null,function*(){for(let s of n)yield this.addGroupHeading(t,s)})}addGroupHeading(t,n){return L(this,null,function*(){let s="h6";n.nestingLevel===0?s="h4":n.nestingLevel===1&&(s="h5");let i=t.createEl(s,{cls:"tasks-group-heading"});yield di.MarkdownRenderer.renderMarkdown(n.displayName,i,this.filePath,this)})}addBacklinks(t,n,s,i){var c;let a=t.createSpan({cls:"tasks-backlink"});s||a.append(" (");let o=a.createEl("a");o.rel="noopener",o.target="_blank",o.addClass("internal-link"),s&&o.addClass("internal-link-short-mode");let u;s?u=" \u{1F517}":u=(c=n.getLinkText({isFilenameUnique:i}))!=null?c:"",o.setText(u);let l=this.app.vault;o.addEventListener("click",f=>L(this,null,function*(){let m=yield rm(n,l);if(m){let[y,k]=m,E=this.app.workspace.getLeaf(di.Keymap.isModEvent(f));f.preventDefault(),yield E.openFile(k,{eState:{line:y}})}})),o.addEventListener("mousedown",f=>L(this,null,function*(){if(f.button===1){let m=yield rm(n,l);if(m){let[y,k]=m,E=this.app.workspace.getLeaf("tab");f.preventDefault(),yield E.openFile(k,{eState:{line:y}})}}})),s||a.append(")")}addPostponeButton(t,n,s){let a="day",o=_v(n,1,a),u=t.createEl("a",{cls:"tasks-postpone"+(s?" tasks-postpone-short-mode":""),href:"#",title:o});u.addEventListener("click",l=>{l.preventDefault(),In.postponeOnClickCallback(u,n,1,a)}),u.addEventListener("contextmenu",l=>L(this,null,function*(){l.stopPropagation(),new In(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 s=n[1];return this.app.vault.getMarkdownFiles().filter(a=>{if(a.basename===s)return!0}).length<2}getGroupingAttribute(){let t=[];for(let n of this.query.grouping)t.push(n.property);return t.join(",")}};var _e=require("obsidian");var ll=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 Ev(r,e){return r.findIndex(t=>t.symbol===e)}function CP(r,e){let t=Q.getTypeForUnknownSymbol(r.symbol);r.type!==t&&(t==="TODO"&&r.symbol!==" "||e.push(`For information, the conventional type for status symbol ${Wr(r.symbol)} is ${Wr(t)}: you may wish to review this type.`))}function AP(r,e,t){let n=Ev(r,e.nextStatusSymbol);if(n===-1){t.push(`Next symbol ${Wr(e.nextStatusSymbol)} is unknown: create a status with symbol ${Wr(e.nextStatusSymbol)}.`);return}if(e.type!=="DONE")return;let s=r[n];if(s){if(s.type!=="TODO"&&s.type!=="IN_PROGRESS"){let i="https://publish.obsidian.md/tasks/Getting+Started/Statuses/Recurring+Tasks+and+Custom+Statuses",a=[`This \`DONE\` status is followed by ${Wr(s.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](${i}).`].join("<br>");t.push(a)}}else t.push("Unexpected failure to find the next status.")}function PP(r,e,t){let n=[];return e.symbol===Q.EMPTY.symbol?(n.push("Empty symbol: this status will be ignored."),n):Ev(r,e.symbol)!=t?(n.push(`Duplicate symbol '${Wr(e.symbol)}': this status will be ignored.`),n):(CP(e,n),AP(r,e,n),n)}function kv(r){let e=new ll(["Status Symbol","Next Status Symbol","Status Name","Status Type","Problems (if any)"]),t=Ne.allStatuses(r);return t.forEach((n,s)=>{e.addRow([Wr(n.symbol),Wr(n.nextStatusSymbol),n.name,Wr(n.type),PP(t,n,s).join("<br>")])}),e.markdown}function Sv(r,e,t,n){let i=kv(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.
${i}
## Loaded Settings
<!-- Switch to Live Preview or Reading Mode to see the diagram. -->
These are the settings actually used by Tasks.
${a}`}function Wr(r){return r===""?r:"`"+(r!==" "?r:"space")+"`"}function Ov(){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 Dv(){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 xv(){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 Rv(){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 Mv(){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 Cv(){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 Av(){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 Pv=[{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 vr=require("obsidian");var ds=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,s,i]=e,a=[];if(a.push(...this.validateType(i)),t===s&&i!=="NON_TASK"&&a.push(`Status symbol '${t}' toggles to itself`),a.length>0)return a;let o=Q.createFromImportedValue(e).configuration;return a.push(...this.validateSymbolTypeConventions(o)),a.push(...this.validate(o)),a}validateSymbol(e){return ds.validateOneSymbol(e.symbol,"Task Status Symbol")}validateNextSymbol(e){return ds.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=Gt[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,s=new Ee,i=n==="X"?"x":n,a=s.bySymbol(i);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 fs=new ds,zt=class extends vr.Modal{constructor(t,n,s){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=s}statusConfiguration(){return new Ve(this.statusSymbol,this.statusName,this.statusNextSymbol,this.statusAvailableAsCommand,this.type)}display(){return L(this,null,function*(){let{contentEl:t}=this;t.empty();let n=t.createDiv(),s;new vr.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=>{s=l,l.setValue(this.statusSymbol).onChange(c=>{this.statusSymbol=c,zt.setValid(l,fs.validateSymbol(this.statusConfiguration()))})}).setDisabled(this.isCoreStatus).then(l=>{zt.setValid(s,fs.validateSymbol(this.statusConfiguration()))});let i;new vr.Setting(n).setName("Task Status Name").setDesc("This is the friendly name of the task status.").addText(l=>{i=l,l.setValue(this.statusName).onChange(c=>{this.statusName=c,zt.setValid(l,fs.validateName(this.statusConfiguration()))})}).then(l=>{zt.setValid(i,fs.validateName(this.statusConfiguration()))});let a;new vr.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,zt.setValid(l,fs.validateNextSymbol(this.statusConfiguration()))})}).then(l=>{zt.setValid(a,fs.validateNextSymbol(this.statusConfiguration()))}),new vr.Setting(n).setName("Task Status Type").setDesc("Control how the status behaves for searching and toggling.").addDropdown(l=>{["TODO","IN_PROGRESS","DONE","CANCELLED","NON_TASK"].forEach(f=>{l.addOption(f,f)}),l.setValue(this.type).onChange(f=>{this.type=Q.getTypeFromStatusTypeString(f)})}),Q.tasksPluginCanCreateCommandsForStatuses()&&new vr.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=>L(this,null,function*(){this.statusAvailableAsCommand=c}))});let o=t.createDiv(),u=new vr.Setting(o);u.addButton(l=>(l.setTooltip("Save").setIcon("checkmark").onClick(()=>L(this,null,function*(){let c=fs.validate(this.statusConfiguration());if(c.length>0){let f=c.join(`
`)+`
Fix errors before saving.`;new vr.Notice(f);return}this.saved=!0,this.close()})),l)),u.addExtraButton(l=>(l.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.saved=!1,this.close()}),l))})}onOpen(){this.display()}static setValidationError(t){t.inputEl.addClass("tasks-settings-is-invalid")}static removeValidationError(t){t.inputEl.removeClass("tasks-settings-is-invalid")}static setValid(t,n){n.length===0?zt.removeValidationError(t):zt.setValidationError(t)}};var It=class extends _e.PluginSettingTab{constructor({plugin:t}){super(t.app,t);this.customFunctions={insertTaskCoreStatusSettings:this.insertTaskCoreStatusSettings.bind(this),insertCustomTaskStatusSettings:this.insertCustomTaskStatusSettings.bind(this)};this.plugin=t}saveSettings(t){return L(this,null,function*(){yield this.plugin.saveSettings(),t&&this.display()})}display(){let{containerEl:t}=this;t.empty(),this.containerEl.addClass("tasks-settings"),t.createEl("h3",{text:"Tasks Settings"}),t.createEl("p",{cls:"tasks-setting-important",text:"Changing any settings requires a restart of obsidian."}),t.createEl("h4",{text:"Task Format Settings"}),new _e.Setting(t).setName("Task Format").setDesc(It.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(s=>{for(let i of Object.keys(rn))s.addOption(i,rn[i].displayName);s.setValue(K().taskFormat).onChange(i=>L(this,null,function*(){Ke({taskFormat:i}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global filter Settings"}),new _e.Setting(t).setName("Global task filter").setDesc(It.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(s=>{s.setPlaceholder("e.g. #task or TODO").setValue(ye.getInstance().get()).onChange(i=>L(this,null,function*(){Ke({globalFilter:i}),ye.getInstance().set(i),yield this.plugin.saveSettings()}))}),new _e.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(s=>{let i=K();s.setValue(i.removeGlobalFilter).onChange(a=>L(this,null,function*(){Ke({removeGlobalFilter:a}),ye.getInstance().setRemoveGlobalFilter(a),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global Query"}),LP(new _e.Setting(t).setDesc(It.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(s=>{let i=K();s.inputEl.rows=4,s.setPlaceholder(`# For example...
path does not include _templates/
limit 300
show urgency`).setValue(i.globalQuery).onChange(a=>L(this,null,function*(){Ke({globalQuery:a}),or.getInstance().set(a),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=K();Pv.forEach(s=>{this.addOneSettingsBlock(t,s,n)}),t.createEl("h4",{text:"Date Settings"}),new _e.Setting(t).setName("Set created date on every added task").setDesc(It.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(s=>{let i=K();s.setValue(i.setCreatedDate).onChange(a=>L(this,null,function*(){Ke({setCreatedDate:a}),yield this.plugin.saveSettings()}))}),new _e.Setting(t).setName("Set done date on every completed task").setDesc(It.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(s=>{let i=K();s.setValue(i.setDoneDate).onChange(a=>L(this,null,function*(){Ke({setDoneDate:a}),yield this.plugin.saveSettings()}))}),new _e.Setting(t).setName("Set cancelled date on every cancelled task").setDesc(It.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(s=>{let i=K();s.setValue(i.setCancelledDate).onChange(a=>L(this,null,function*(){Ke({setCancelledDate:a}),yield this.plugin.saveSettings()}))}),new _e.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(It.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(s=>{let i=K();s.setValue(i.useFilenameAsScheduledDate).onChange(a=>L(this,null,function*(){Ke({useFilenameAsScheduledDate:a}),yield this.plugin.saveSettings()}))}),new _e.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(s=>L(this,null,function*(){let i=K();yield this.plugin.saveSettings(),s.setValue(It.renderFolderArray(i.filenameAsDateFolders)).onChange(a=>L(this,null,function*(){let o=It.parseCommaSeparatedFolders(a);Ke({filenameAsDateFolders:o}),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Recurring task Settings"}),new _e.Setting(t).setName("Next recurrence appears on the line below").setDesc(It.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(s=>{let{recurrenceOnNextLine:i}=K();s.setValue(i).onChange(a=>L(this,null,function*(){Ke({recurrenceOnNextLine:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Auto-suggest Settings"}),new _e.Setting(t).setName("Auto-suggest task content").setDesc(It.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(s=>{let i=K();s.setValue(i.autoSuggestInEditor).onChange(a=>L(this,null,function*(){Ke({autoSuggestInEditor:a}),yield this.plugin.saveSettings()}))}),new _e.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(s=>{let i=K();s.setLimits(0,3,1).setValue(i.autoSuggestMinMatch).setDynamicTooltip().onChange(a=>L(this,null,function*(){Ke({autoSuggestMinMatch:a}),yield this.plugin.saveSettings()}))}),new _e.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(s=>{let i=K();s.setLimits(3,12,1).setValue(i.autoSuggestMaxItems).setDynamicTooltip().onChange(a=>L(this,null,function*(){Ke({autoSuggestMaxItems:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Dialog Settings"}),new _e.Setting(t).setName("Provide access keys in dialogs").setDesc(It.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(s=>{let i=K();s.setValue(i.provideAccessKeys).onChange(a=>L(this,null,function*(){Ke({provideAccessKeys:a}),yield this.plugin.saveSettings()}))})}addOneSettingsBlock(t,n,s){let i=t.createEl("details",{cls:"tasks-nested-settings",attr:Se({},n.open||s[n.text]?{open:!0}:{})});i.empty(),i.ontoggle=()=>{s[n.text]=i.open,Ke({headingOpened:s}),this.plugin.saveSettings()};let a=i.createEl("summary");if(new _e.Setting(a).setHeading().setName(n.text),a.createDiv("collapser").createDiv("handle"),n.notice!==null){let o=i.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!==""&&!t_(o.featureFlag))&&(o.type==="checkbox"?new _e.Setting(i).setName(o.name).setDesc(o.description).addToggle(u=>{let l=K();l.generalSettings[o.settingName]||es(o.settingName,o.initialValue),u.setValue(l.generalSettings[o.settingName]).onChange(c=>L(this,null,function*(){es(o.settingName,c),yield this.plugin.saveSettings()}))}):o.type==="text"?new _e.Setting(i).setName(o.name).setDesc(o.description).addText(u=>{let l=K();l.generalSettings[o.settingName]||es(o.settingName,o.initialValue);let c=f=>L(this,null,function*(){es(o.settingName,f),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,_e.debounce)(c,500,!0))}):o.type==="textarea"?new _e.Setting(i).setName(o.name).setDesc(o.description).addTextArea(u=>{let l=K();l.generalSettings[o.settingName]||es(o.settingName,o.initialValue);let c=f=>L(this,null,function*(){es(o.settingName,f),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,_e.debounce)(c,500,!0)),u.inputEl.rows=8,u.inputEl.cols=40}):o.type==="function"&&this.customFunctions[o.settingName](i,this),o.notice!==null)){let u=i.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:s}=K();s.coreStatuses.forEach(a=>{Nv(t,a,s.coreStatuses,s,n,n.plugin,!0)}),new _e.Setting(t).addButton(a=>{let o="Review and check your Statuses";a.setButtonText(o).setCta().onClick(()=>L(this,null,function*(){let l=window.moment().format("YYYY-MM-DD HH-mm-ss"),c=`Tasks Plugin - ${o} ${l}.md`,f=this.plugin.manifest.version,m=Ee.getInstance(),y=Sv(s,m,o,f),k=yield app.vault.create(c,y);yield this.app.workspace.getLeaf(!0).openFile(k)})),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:s}=K();s.customStatuses.forEach(l=>{Nv(t,l,s.customStatuses,s,n,n.plugin,!1)}),t.createEl("div"),new _e.Setting(t).addButton(l=>{l.setButtonText("Add New Task Status").setCta().onClick(()=>L(this,null,function*(){Ne.addStatus(s.customStatuses,new Ve("","","",!1,"TODO")),yield fi(s,n)}))}).infoEl.remove();let a=[["AnuPpuccin Theme",Ov()],["Aura Theme",Dv()],["Ebullientworks Theme",xv()],["ITS Theme & SlRvb Checkboxes",Rv()],["Minimal Theme",Cv()],["Things Theme",Av()],["LYT Mode Theme (Dark mode only)",Mv()]];for(let[l,c]of a)new _e.Setting(t).addButton(m=>{let y=`${l}: Add ${c.length} supported Statuses`;m.setButtonText(y).onClick(()=>L(this,null,function*(){yield FP(c,s,n)}))}).infoEl.remove();new _e.Setting(t).addButton(l=>{l.setButtonText("Add All Unknown Status Types").setCta().onClick(()=>L(this,null,function*(){let f=this.plugin.getTasks().map(y=>y.status),m=Ee.getInstance().findUnknownStatuses(f);m.length!==0&&(m.forEach(y=>{Ne.addStatus(s.customStatuses,y)}),yield fi(s,n))}))}).infoEl.remove(),new _e.Setting(t).addButton(l=>{l.setButtonText("Reset Custom Status Types to Defaults").setWarning().onClick(()=>L(this,null,function*(){Ne.resetAllCustomStatuses(s),yield fi(s,n)}))}).infoEl.remove()}},Ba=It;Ba.createFragmentWithHTML=t=>createFragment(n=>n.createDiv().innerHTML=t);function Nv(r,e,t,n,s,i,a){let o=r.createEl("pre");o.addClass("row-for-status"),o.textContent=new Q(e).previewText();let u=new _e.Setting(r);u.infoEl.replaceWith(o),a||u.addExtraButton(l=>{l.setIcon("cross").setTooltip("Delete").onClick(()=>L(this,null,function*(){Ne.deleteStatus(t,e)&&(yield fi(n,s))}))}),u.addExtraButton(l=>{l.setIcon("pencil").setTooltip("Edit").onClick(()=>L(this,null,function*(){let c=new zt(i,e,a);c.onClose=()=>L(this,null,function*(){c.saved&&Ne.replaceStatus(t,e,c.statusConfiguration())&&(yield fi(n,s))}),c.open()}))}),u.infoEl.remove()}function FP(r,e,t){return L(this,null,function*(){Ne.bulkAddStatusCollection(e,r).forEach(s=>{new _e.Notice(s)}),yield fi(e,t)})}function fi(r,e){return L(this,null,function*(){Ke({statusSettings:r}),Ne.applyToStatusRegistry(r,Ee.getInstance()),yield e.saveSettings(!0)})}function LP(r){let{settingEl:e,infoEl:t,controlEl:n}=r,s=n.querySelector("textarea");s!==null&&(e.style.display="block",t.style.marginRight="0px",s.style.minWidth="-webkit-fill-available")}var Iv=require("obsidian");var cl=class extends Iv.EditorSuggest{constructor(t,n){super(t);this.settings=n,t.scope.register([],"Tab",()=>{var i;let s=(i=this.context)==null?void 0:i.editor;return s?(s.exec("indentMore"),!1):!0})}onTrigger(t,n,s){if(!this.settings.autoSuggestInEditor)return null;let i=n.getLine(t.line);return XT(i,t.ch)?{start:{line:t.line,ch:0},end:{line:t.line,ch:i.length},query:i}:null}getSuggestions(t){var a,o,u;let n=t.query,s=t.editor.getCursor();return((u=(o=(a=Ca()).buildSuggestions)==null?void 0:o.call(a,n,s.ch,this.settings))!=null?u:[]).map(l=>ot(Se({},l),{context:t}))}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){var u,l,c;let s=t.context.editor;if(t.suggestionType==="empty"){this.close();let f=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(l=(u=s==null?void 0:s.cm)==null?void 0:u.contentDOM)==null||l.dispatchEvent(f);return}let i=t.context.editor.getCursor(),a={line:i.line,ch:(c=t.insertAt)!=null?c:i.ch},o=t.insertSkip?{line:i.line,ch:a.ch+t.insertSkip}:void 0;t.context.editor.replaceRange(t.appendText,a,o),t.context.editor.setCursor({line:i.line,ch:a.ch+t.appendText.length})}};var Fv=(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 Lv=(r,e)=>{let t=bu({line:"",path:""});return new On({app:r,task:t,onSubmit:e})};var Uv=r=>({createTaskLineModal:()=>Fv(r,Lv)});var dl=class extends qv.Plugin{get apiV1(){return Uv(app)}onload(){return L(this,null,function*(){Rt.registerConsoleLogger(),Ep("info",`loading plugin "${this.manifest.name}" v${this.manifest.version}`),yield this.loadSettings();let{loggingOptions:t}=K();Rt.configure(t),this.addSettingTab(new Ba({plugin:this})),nv({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let n=new Ju({obsidianEvents:this.app.workspace});this.cache=new ts({metadataCache:this.app.metadataCache,vault:this.app.vault,events:n}),this.inlineRenderer=new il({plugin:this}),this.queryRenderer=new ul({plugin:this,events:n}),this.registerEditorExtension(mv()),this.registerEditorSuggest(new cl(this.app,K())),new Tu({plugin:this})})}loadTaskStatuses(){return L(this,null,function*(){let{statusSettings:t}=K();Ne.applyToStatusRegistry(t,Ee.getInstance())})}onunload(){var t;Ep("info",`unloading plugin "${this.manifest.name}" v${this.manifest.version}`),(t=this.cache)==null||t.unload()}loadSettings(){return L(this,null,function*(){let t=yield this.loadData();Ke(t),t=K(),ye.getInstance().set(t.globalFilter),ye.getInstance().setRemoveGlobalFilter(t.removeGlobalFilter),or.getInstance().set(t.globalQuery),yield this.loadTaskStatuses()})}saveSettings(){return L(this,null,function*(){yield this.saveData(K())})}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
*/