/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ "use strict";var Js=Object.create;var zt=Object.defineProperty;var Ks=Object.getOwnPropertyDescriptor;var Xs=Object.getOwnPropertyNames;var ei=Object.getPrototypeOf,ti=Object.prototype.hasOwnProperty;var ri=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ni=(t,e)=>{for(var r in e)zt(t,r,{get:e[r],enumerable:!0})},Mn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of Xs(e))!ti.call(t,u)&&u!==r&&zt(t,u,{get:()=>e[u],enumerable:!(n=Ks(e,u))||n.enumerable});return t};var An=(t,e,r)=>(r=t!=null?Js(ei(t)):{},Mn(e||!t||!t.__esModule?zt(r,"default",{value:t,enumerable:!0}):r,t)),ui=t=>Mn(zt({},"__esModule",{value:!0}),t);var _s=ri(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});require("obsidian");var ve=class extends Error{},jr=class extends ve{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},Zr=class extends ve{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},qr=class extends ve{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},Ze=class extends ve{},ar=class extends ve{constructor(e){super(`Invalid unit ${e}`)}},H=class extends ve{},pe=class extends ve{constructor(){super("Zone is an abstract class")}},E="numeric",fe="short",ee="long",or={year:E,month:E,day:E},_u={year:E,month:fe,day:E},Ei={year:E,month:fe,day:E,weekday:fe},Mu={year:E,month:ee,day:E},Au={year:E,month:ee,day:E,weekday:ee},ku={hour:E,minute:E},Bu={hour:E,minute:E,second:E},Nu={hour:E,minute:E,second:E,timeZoneName:fe},Iu={hour:E,minute:E,second:E,timeZoneName:ee},Lu={hour:E,minute:E,hourCycle:"h23"},Pu={hour:E,minute:E,second:E,hourCycle:"h23"},Ru={hour:E,minute:E,second:E,hourCycle:"h23",timeZoneName:fe},Uu={hour:E,minute:E,second:E,hourCycle:"h23",timeZoneName:ee},zu={year:E,month:E,day:E,hour:E,minute:E},Vu={year:E,month:E,day:E,hour:E,minute:E,second:E},$u={year:E,month:fe,day:E,hour:E,minute:E},Wu={year:E,month:fe,day:E,hour:E,minute:E,second:E},Ci={year:E,month:fe,day:E,weekday:fe,hour:E,minute:E},ju={year:E,month:ee,day:E,hour:E,minute:E,timeZoneName:fe},Zu={year:E,month:ee,day:E,hour:E,minute:E,second:E,timeZoneName:fe},qu={year:E,month:ee,day:E,weekday:ee,hour:E,minute:E,timeZoneName:ee},Hu={year:E,month:ee,day:E,weekday:ee,hour:E,minute:E,second:E,timeZoneName:ee},Ye=class{get type(){throw new pe}get name(){throw new pe}get ianaName(){return this.name}get isUniversal(){throw new pe}offsetName(e,r){throw new pe}formatOffset(e,r){throw new pe}offset(e){throw new pe}equals(e){throw new pe}get isValid(){throw new pe}},Lr=null,lr=class t extends Ye{static get instance(){return Lr===null&&(Lr=new t),Lr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:r,locale:n}){return Gu(e,r,n)}formatOffset(e,r){return Tt(this.offset(e),r)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}},sr={};function wi(t){return sr[t]||(sr[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),sr[t]}var bi={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function vi(t,e){let r=t.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,u,s,i,l,f,d,g]=n;return[i,u,s,l,f,d,g]}function Ti(t,e){let r=t.formatToParts(e),n=[];for(let u=0;u=0?x:1e3+x,(b-C)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}},Kn={};function Si(t,e={}){let r=JSON.stringify([t,e]),n=Kn[r];return n||(n=new Intl.ListFormat(t,e),Kn[r]=n),n}var Hr={};function Yr(t,e={}){let r=JSON.stringify([t,e]),n=Hr[r];return n||(n=new Intl.DateTimeFormat(t,e),Hr[r]=n),n}var Gr={};function Oi(t,e={}){let r=JSON.stringify([t,e]),n=Gr[r];return n||(n=new Intl.NumberFormat(t,e),Gr[r]=n),n}var Qr={};function xi(t,e={}){let{base:r,...n}=e,u=JSON.stringify([t,n]),s=Qr[u];return s||(s=new Intl.RelativeTimeFormat(t,e),Qr[u]=s),s}var bt=null;function _i(){return bt||(bt=new Intl.DateTimeFormat().resolvedOptions().locale,bt)}function Mi(t){let e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));let r=t.indexOf("-u-");if(r===-1)return[t];{let n,u;try{n=Yr(t).resolvedOptions(),u=t}catch{let f=t.substring(0,r);n=Yr(f).resolvedOptions(),u=f}let{numberingSystem:s,calendar:i}=n;return[u,s,i]}}function Ai(t,e,r){return(r||e)&&(t.includes("-u-")||(t+="-u"),r&&(t+=`-ca-${r}`),e&&(t+=`-nu-${e}`)),t}function ki(t){let e=[];for(let r=1;r<=12;r++){let n=M.utc(2009,r,1);e.push(t(n))}return e}function Bi(t){let e=[];for(let r=1;r<=7;r++){let n=M.utc(2016,11,13+r);e.push(t(n))}return e}function er(t,e,r,n){let u=t.listingMode();return u==="error"?null:u==="en"?r(e):n(e)}function Ni(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}var Jr=class{constructor(e,r,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;let{padTo:u,floor:s,...i}=n;if(!r||Object.keys(i).length>0){let l={useGrouping:!1,...n};n.padTo>0&&(l.minimumIntegerDigits=n.padTo),this.inf=Oi(e,l)}}format(e){if(this.inf){let r=this.floor?Math.floor(e):e;return this.inf.format(r)}else{let r=this.floor?Math.floor(e):Dn(e,3);return V(r,this.padTo)}}},Kr=class{constructor(e,r,n){this.opts=n,this.originalZone=void 0;let u;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){let i=-1*(e.offset/60),l=i>=0?`Etc/GMT+${i}`:`Etc/GMT${i}`;e.offset!==0&&ke.create(l).valid?(u=l,this.dt=e):(u="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,u=e.zone.name):(u="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let s={...this.opts};s.timeZone=s.timeZone||u,this.dtf=Yr(r,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(r=>{if(r.type==="timeZoneName"){let n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:n}}else return r}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},Xr=class{constructor(e,r,n){this.opts={style:"long",...n},!r&&Yu()&&(this.rtf=xi(e,n))}format(e,r){return this.rtf?this.rtf.format(e,r):Qi(r,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,r){return this.rtf?this.rtf.formatToParts(e,r):[]}},P=class t{static fromOpts(e){return t.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,r,n,u=!1){let s=e||L.defaultLocale,i=s||(u?"en-US":_i()),l=r||L.defaultNumberingSystem,f=n||L.defaultOutputCalendar;return new t(i,l,f,s)}static resetCache(){bt=null,Hr={},Gr={},Qr={}}static fromObject({locale:e,numberingSystem:r,outputCalendar:n}={}){return t.create(e,r,n)}constructor(e,r,n,u){let[s,i,l]=Mi(e);this.locale=s,this.numberingSystem=r||i||null,this.outputCalendar=n||l||null,this.intl=Ai(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=u,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Ni(this)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&r?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:t.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,r=!1){return er(this,e,Ku,()=>{let n=r?{month:e,day:"numeric"}:{month:e},u=r?"format":"standalone";return this.monthsCache[u][e]||(this.monthsCache[u][e]=ki(s=>this.extract(s,n,"month"))),this.monthsCache[u][e]})}weekdays(e,r=!1){return er(this,e,ts,()=>{let n=r?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},u=r?"format":"standalone";return this.weekdaysCache[u][e]||(this.weekdaysCache[u][e]=Bi(s=>this.extract(s,n,"weekday"))),this.weekdaysCache[u][e]})}meridiems(){return er(this,void 0,()=>rs,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[M.utc(2016,11,13,9),M.utc(2016,11,13,19)].map(r=>this.extract(r,e,"dayperiod"))}return this.meridiemCache})}eras(e){return er(this,e,ns,()=>{let r={era:e};return this.eraCache[e]||(this.eraCache[e]=[M.utc(-40,1,1),M.utc(2017,1,1)].map(n=>this.extract(n,r,"era"))),this.eraCache[e]})}extract(e,r,n){let u=this.dtFormatter(e,r),s=u.formatToParts(),i=s.find(l=>l.type.toLowerCase()===n);return i?i.value:null}numberFormatter(e={}){return new Jr(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,r={}){return new Kr(e,this.intl,r)}relFormatter(e={}){return new Xr(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Si(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}},Pr=null,ne=class t extends Ye{static get utcInstance(){return Pr===null&&(Pr=new t(0)),Pr}static instance(e){return e===0?t.utcInstance:new t(e)}static parseSpecifier(e){if(e){let r=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new t(gr(r[1],r[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Tt(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Tt(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,r){return Tt(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}},en=class extends Ye{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function Ae(t,e){if(A(t)||t===null)return e;if(t instanceof Ye)return t;if(Ii(t)){let r=t.toLowerCase();return r==="default"?e:r==="local"||r==="system"?lr.instance:r==="utc"||r==="gmt"?ne.utcInstance:ne.parseSpecifier(r)||ke.create(t)}else return He(t)?ne.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new en(t)}var Xn=()=>Date.now(),eu="system",tu=null,ru=null,nu=null,uu=60,su,L=class{static get now(){return Xn}static set now(e){Xn=e}static set defaultZone(e){eu=e}static get defaultZone(){return Ae(eu,lr.instance)}static get defaultLocale(){return tu}static set defaultLocale(e){tu=e}static get defaultNumberingSystem(){return ru}static set defaultNumberingSystem(e){ru=e}static get defaultOutputCalendar(){return nu}static set defaultOutputCalendar(e){nu=e}static get twoDigitCutoffYear(){return uu}static set twoDigitCutoffYear(e){uu=e%100}static get throwOnInvalid(){return su}static set throwOnInvalid(e){su=e}static resetCaches(){P.resetCache(),ke.resetCache()}};function A(t){return typeof t>"u"}function He(t){return typeof t=="number"}function Fr(t){return typeof t=="number"&&t%1===0}function Ii(t){return typeof t=="string"}function Li(t){return Object.prototype.toString.call(t)==="[object Date]"}function Yu(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Pi(t){return Array.isArray(t)?t:[t]}function iu(t,e,r){if(t.length!==0)return t.reduce((n,u)=>{let s=[e(u),u];return n&&r(n[0],s[0])===n[0]?n:s},null)[1]}function Ri(t,e){return e.reduce((r,n)=>(r[n]=t[n],r),{})}function ot(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function be(t,e,r){return Fr(t)&&t>=e&&t<=r}function Ui(t,e){return t-e*Math.floor(t/e)}function V(t,e=2){let r=t<0,n;return r?n="-"+(""+-t).padStart(e,"0"):n=(""+t).padStart(e,"0"),n}function Me(t){if(!(A(t)||t===null||t===""))return parseInt(t,10)}function We(t){if(!(A(t)||t===null||t===""))return parseFloat(t)}function fn(t){if(!(A(t)||t===null||t==="")){let e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function Dn(t,e,r=!1){let n=10**e;return(r?Math.trunc:Math.round)(t*n)/n}function xt(t){return t%4===0&&(t%100!==0||t%400===0)}function vt(t){return xt(t)?366:365}function cr(t,e){let r=Ui(e-1,12)+1,n=t+(e-r)/12;return r===2?xt(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function yr(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function fr(t){let e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,r=t-1,n=(r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400))%7;return e===4||n===3?53:52}function tn(t){return t>99?t:t>L.twoDigitCutoffYear?1900+t:2e3+t}function Gu(t,e,r,n=null){let u=new Date(t),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(s.timeZone=n);let i={timeZoneName:e,...s},l=new Intl.DateTimeFormat(r,i).formatToParts(u).find(f=>f.type.toLowerCase()==="timezonename");return l?l.value:null}function gr(t,e){let r=parseInt(t,10);Number.isNaN(r)&&(r=0);let n=parseInt(e,10)||0,u=r<0||Object.is(r,-0)?-n:n;return r*60+u}function Qu(t){let e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new H(`Invalid unit value ${t}`);return e}function Dr(t,e){let r={};for(let n in t)if(ot(t,n)){let u=t[n];if(u==null)continue;r[e(n)]=Qu(u)}return r}function Tt(t,e){let r=Math.trunc(Math.abs(t/60)),n=Math.trunc(Math.abs(t%60)),u=t>=0?"+":"-";switch(e){case"short":return`${u}${V(r,2)}:${V(n,2)}`;case"narrow":return`${u}${r}${n>0?`:${n}`:""}`;case"techie":return`${u}${V(r,2)}${V(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Er(t){return Ri(t,["hour","minute","second","millisecond"])}var zi=["January","February","March","April","May","June","July","August","September","October","November","December"],Ju=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Vi=["J","F","M","A","M","J","J","A","S","O","N","D"];function Ku(t){switch(t){case"narrow":return[...Vi];case"short":return[...Ju];case"long":return[...zi];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var Xu=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],es=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],$i=["M","T","W","T","F","S","S"];function ts(t){switch(t){case"narrow":return[...$i];case"short":return[...es];case"long":return[...Xu];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var rs=["AM","PM"],Wi=["Before Christ","Anno Domini"],ji=["BC","AD"],Zi=["B","A"];function ns(t){switch(t){case"narrow":return[...Zi];case"short":return[...ji];case"long":return[...Wi];default:return null}}function qi(t){return rs[t.hour<12?0:1]}function Hi(t,e){return ts(e)[t.weekday-1]}function Yi(t,e){return Ku(e)[t.month-1]}function Gi(t,e){return ns(e)[t.year<0?0:1]}function Qi(t,e,r="always",n=!1){let u={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(t)===-1;if(r==="auto"&&s){let T=t==="days";switch(e){case 1:return T?"tomorrow":`next ${u[t][0]}`;case-1:return T?"yesterday":`last ${u[t][0]}`;case 0:return T?"today":`this ${u[t][0]}`}}let i=Object.is(e,-0)||e<0,l=Math.abs(e),f=l===1,d=u[t],g=n?f?d[1]:d[2]||d[1]:f?u[t][0]:t;return i?`${l} ${g} ago`:`in ${l} ${g}`}function au(t,e){let r="";for(let n of t)n.literal?r+=n.val:r+=e(n.val);return r}var Ji={D:or,DD:_u,DDD:Mu,DDDD:Au,t:ku,tt:Bu,ttt:Nu,tttt:Iu,T:Lu,TT:Pu,TTT:Ru,TTTT:Uu,f:zu,ff:$u,fff:ju,ffff:qu,F:Vu,FF:Wu,FFF:Zu,FFFF:Hu},K=class t{static create(e,r={}){return new t(e,r)}static parseFormat(e){let r=null,n="",u=!1,s=[];for(let i=0;i0&&s.push({literal:u||/^\s+$/.test(n),val:n}),r=null,n="",u=!u):u||l===r?n+=l:(n.length>0&&s.push({literal:/^\s+$/.test(n),val:n}),n=l,r=l)}return n.length>0&&s.push({literal:u||/^\s+$/.test(n),val:n}),s}static macroTokenToFormatOpts(e){return Ji[e]}constructor(e,r){this.opts=r,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...r}).format()}dtFormatter(e,r={}){return this.loc.dtFormatter(e,{...this.opts,...r})}formatDateTime(e,r){return this.dtFormatter(e,r).format()}formatDateTimeParts(e,r){return this.dtFormatter(e,r).formatToParts()}formatInterval(e,r){return this.dtFormatter(e.start,r).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,r){return this.dtFormatter(e,r).resolvedOptions()}num(e,r=0){if(this.opts.forceSimple)return V(e,r);let n={...this.opts};return r>0&&(n.padTo=r),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,r){let n=this.loc.listingMode()==="en",u=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(C,x)=>this.loc.extract(e,C,x),i=C=>e.isOffsetFixed&&e.offset===0&&C.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,C.format):"",l=()=>n?qi(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),f=(C,x)=>n?Yi(e,C):s(x?{month:C}:{month:C,day:"numeric"},"month"),d=(C,x)=>n?Hi(e,C):s(x?{weekday:C}:{weekday:C,month:"long",day:"numeric"},"weekday"),g=C=>{let x=t.macroTokenToFormatOpts(C);return x?this.formatWithSystemDefault(e,x):C},T=C=>n?Gi(e,C):s({era:C},"era"),b=C=>{switch(C){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return l();case"d":return u?s({day:"numeric"},"day"):this.num(e.day);case"dd":return u?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return d("short",!0);case"cccc":return d("long",!0);case"ccccc":return d("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return d("short",!1);case"EEEE":return d("long",!1);case"EEEEE":return d("narrow",!1);case"L":return u?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return u?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return f("short",!0);case"LLLL":return f("long",!0);case"LLLLL":return f("narrow",!0);case"M":return u?s({month:"numeric"},"month"):this.num(e.month);case"MM":return u?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return f("short",!1);case"MMMM":return f("long",!1);case"MMMMM":return f("narrow",!1);case"y":return u?s({year:"numeric"},"year"):this.num(e.year);case"yy":return u?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return u?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return u?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return T("short");case"GG":return T("long");case"GGGGG":return T("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return g(C)}};return au(t.parseFormat(r),b)}formatDurationFromString(e,r){let n=f=>{switch(f[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},u=f=>d=>{let g=n(d);return g?this.num(f.get(g),d.length):d},s=t.parseFormat(r),i=s.reduce((f,{literal:d,val:g})=>d?f:f.concat(g),[]),l=e.shiftTo(...i.map(n).filter(f=>f));return au(s,u(l))}},X=class{constructor(e,r){this.reason=e,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},us=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function lt(...t){let e=t.reduce((r,n)=>r+n.source,"");return RegExp(`^${e}$`)}function ct(...t){return e=>t.reduce(([r,n,u],s)=>{let[i,l,f]=s(e,u);return[{...r,...i},l||n,f]},[{},null,1]).slice(0,2)}function ft(t,...e){if(t==null)return[null,null];for(let[r,n]of e){let u=r.exec(t);if(u)return n(u)}return[null,null]}function ss(...t){return(e,r)=>{let n={},u;for(u=0;uC!==void 0&&(x||C&&g)?-C:C;return[{years:b(We(r)),months:b(We(n)),weeks:b(We(u)),days:b(We(s)),hours:b(We(i)),minutes:b(We(l)),seconds:b(We(f),f==="-0"),milliseconds:b(fn(d),T)}]}var ca={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function mn(t,e,r,n,u,s,i){let l={year:e.length===2?tn(Me(e)):Me(e),month:Ju.indexOf(r)+1,day:Me(n),hour:Me(u),minute:Me(s)};return i&&(l.second=Me(i)),t&&(l.weekday=t.length>3?Xu.indexOf(t)+1:es.indexOf(t)+1),l}var fa=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Da(t){let[,e,r,n,u,s,i,l,f,d,g,T]=t,b=mn(e,u,n,r,s,i,l),C;return f?C=ca[f]:d?C=0:C=gr(g,T),[b,new ne(C)]}function da(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var ha=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,ma=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,pa=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function ou(t){let[,e,r,n,u,s,i,l]=t;return[mn(e,u,n,r,s,i,l),ne.utcInstance]}function Fa(t){let[,e,r,n,u,s,i,l]=t;return[mn(e,l,r,n,u,s,i),ne.utcInstance]}var ya=lt(Xi,hn),ga=lt(ea,hn),Ea=lt(ta,hn),Ca=lt(as),ls=ct(ia,Dt,_t,Mt),wa=ct(ra,Dt,_t,Mt),ba=ct(na,Dt,_t,Mt),va=ct(Dt,_t,Mt);function Ta(t){return ft(t,[ya,ls],[ga,wa],[Ea,ba],[Ca,va])}function Sa(t){return ft(da(t),[fa,Da])}function Oa(t){return ft(t,[ha,ou],[ma,ou],[pa,Fa])}function xa(t){return ft(t,[oa,la])}var _a=ct(Dt);function Ma(t){return ft(t,[aa,_a])}var Aa=lt(ua,sa),ka=lt(os),Ba=ct(Dt,_t,Mt);function Na(t){return ft(t,[Aa,ls],[ka,Ba])}var lu="Invalid Duration",cs={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Ia={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...cs},te=146097/400,nt=146097/4800,La={years:{quarters:4,months:12,weeks:te/7,days:te,hours:te*24,minutes:te*24*60,seconds:te*24*60*60,milliseconds:te*24*60*60*1e3},quarters:{months:3,weeks:te/28,days:te/4,hours:te*24/4,minutes:te*24*60/4,seconds:te*24*60*60/4,milliseconds:te*24*60*60*1e3/4},months:{weeks:nt/7,days:nt,hours:nt*24,minutes:nt*24*60,seconds:nt*24*60*60,milliseconds:nt*24*60*60*1e3},...cs},qe=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Pa=qe.slice(0).reverse();function _e(t,e,r=!1){let n={values:r?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new v(n)}function fs(t,e){let r=e.milliseconds??0;for(let n of Pa.slice(1))e[n]&&(r+=e[n]*t[n].milliseconds);return r}function cu(t,e){let r=fs(t,e)<0?-1:1;qe.reduceRight((n,u)=>{if(A(e[u]))return n;if(n){let s=e[n]*r,i=t[u][n],l=Math.floor(s/i);e[u]+=l*r,e[n]-=l*i*r}return u},null),qe.reduce((n,u)=>{if(A(e[u]))return n;if(n){let s=e[n]%1;e[n]-=s,e[u]+=s*t[n][u]}return u},null)}function Ra(t){let e={};for(let[r,n]of Object.entries(t))n!==0&&(e[r]=n);return e}var v=class t{constructor(e){let r=e.conversionAccuracy==="longterm"||!1,n=r?La:Ia;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||P.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,r){return t.fromObject({milliseconds:e},r)}static fromObject(e,r={}){if(e==null||typeof e!="object")throw new H(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new t({values:Dr(e,t.normalizeUnit),loc:P.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(e){if(He(e))return t.fromMillis(e);if(t.isDuration(e))return e;if(typeof e=="object")return t.fromObject(e);throw new H(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,r){let[n]=xa(e);return n?t.fromObject(n,r):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,r){let[n]=Ma(e);return n?t.fromObject(n,r):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,r=null){if(!e)throw new H("need to specify a reason the Duration is invalid");let n=e instanceof X?e:new X(e,r);if(L.throwOnInvalid)throw new qr(n);return new t({invalid:n})}static normalizeUnit(e){let r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!r)throw new ar(e);return r}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,r={}){let n={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?K.create(this.loc,n).formatDurationFromString(this,e):lu}toHuman(e={}){if(!this.isValid)return lu;let r=qe.map(n=>{let u=this.values[n];return A(u)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:n.slice(0,-1)}).format(u)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Dn(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let r=this.toMillis();return r<0||r>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},M.fromMillis(r,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.isValid?fs(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let r=t.fromDurationLike(e),n={};for(let u of qe)(ot(r.values,u)||ot(this.values,u))&&(n[u]=r.get(u)+this.get(u));return _e(this,{values:n},!0)}minus(e){if(!this.isValid)return this;let r=t.fromDurationLike(e);return this.plus(r.negate())}mapUnits(e){if(!this.isValid)return this;let r={};for(let n of Object.keys(this.values))r[n]=Qu(e(this.values[n],n));return _e(this,{values:r},!0)}get(e){return this[t.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let r={...this.values,...Dr(e,t.normalizeUnit)};return _e(this,{values:r})}reconfigure({locale:e,numberingSystem:r,conversionAccuracy:n,matrix:u}={}){let i={loc:this.loc.clone({locale:e,numberingSystem:r}),matrix:u,conversionAccuracy:n};return _e(this,i)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return cu(this.matrix,e),_e(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=Ra(this.normalize().shiftToAll().toObject());return _e(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(i=>t.normalizeUnit(i));let r={},n={},u=this.toObject(),s;for(let i of qe)if(e.indexOf(i)>=0){s=i;let l=0;for(let d in n)l+=this.matrix[d][i]*n[d],n[d]=0;He(u[i])&&(l+=u[i]);let f=Math.trunc(l);r[i]=f,n[i]=(l*1e3-f*1e3)/1e3}else He(u[i])&&(n[i]=u[i]);for(let i in n)n[i]!==0&&(r[s]+=i===s?n[i]:n[i]/this.matrix[s][i]);return cu(this.matrix,r),_e(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let r of Object.keys(this.values))e[r]=this.values[r]===0?0:-this.values[r];return _e(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function r(n,u){return n===void 0||n===0?u===void 0||u===0:n===u}for(let n of qe)if(!r(this.values[n],e.values[n]))return!1;return!0}},ut="Invalid Interval";function Ua(t,e){return!t||!t.isValid?at.invalid("missing or invalid start"):!e||!e.isValid?at.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:r}={}){return this.isValid?t.fromDateTimes(e||this.s,r||this.e):this}splitAt(...e){if(!this.isValid)return[];let r=e.map(Ct).filter(i=>this.contains(i)).sort(),n=[],{s:u}=this,s=0;for(;u+this.e?this.e:i;n.push(t.fromDateTimes(u,l)),u=l,s+=1}return n}splitBy(e){let r=v.fromDurationLike(e);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:n}=this,u=1,s,i=[];for(;nf*u));s=+l>+this.e?this.e:l,i.push(t.fromDateTimes(n,s)),n=s,u+=1}return i}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let r=this.s>e.s?this.s:e.s,n=this.e=n?null:t.fromDateTimes(r,n)}union(e){if(!this.isValid)return this;let r=this.se.e?this.e:e.e;return t.fromDateTimes(r,n)}static merge(e){let[r,n]=e.sort((u,s)=>u.s-s.s).reduce(([u,s],i)=>s?s.overlaps(i)||s.abutsStart(i)?[u,s.union(i)]:[u.concat([s]),i]:[u,i],[[],null]);return n&&r.push(n),r}static xor(e){let r=null,n=0,u=[],s=e.map(f=>[{time:f.s,type:"s"},{time:f.e,type:"e"}]),i=Array.prototype.concat(...s),l=i.sort((f,d)=>f.time-d.time);for(let f of l)n+=f.type==="s"?1:-1,n===1?r=f.time:(r&&+r!=+f.time&&u.push(t.fromDateTimes(r,f.time)),r=null);return t.merge(u)}difference(...e){return t.xor([this].concat(e)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:ut}toLocaleString(e=or,r={}){return this.isValid?K.create(this.s.loc.clone(r),e).formatInterval(this):ut}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ut}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ut}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ut}toFormat(e,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${r}${this.e.toFormat(e)}`:ut}toDuration(e,r){return this.isValid?this.e.diff(this.s,e,r):v.invalid(this.invalidReason)}mapEndpoints(e){return t.fromDateTimes(e(this.s),e(this.e))}},st=class{static hasDST(e=L.defaultZone){let r=M.now().setZone(e).set({month:12});return!e.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(e){return ke.isValidZone(e)}static normalizeZone(e){return Ae(e,L.defaultZone)}static months(e="long",{locale:r=null,numberingSystem:n=null,locObj:u=null,outputCalendar:s="gregory"}={}){return(u||P.create(r,n,s)).months(e)}static monthsFormat(e="long",{locale:r=null,numberingSystem:n=null,locObj:u=null,outputCalendar:s="gregory"}={}){return(u||P.create(r,n,s)).months(e,!0)}static weekdays(e="long",{locale:r=null,numberingSystem:n=null,locObj:u=null}={}){return(u||P.create(r,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:r=null,numberingSystem:n=null,locObj:u=null}={}){return(u||P.create(r,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return P.create(e).meridiems()}static eras(e="short",{locale:r=null}={}){return P.create(r,null,"gregory").eras(e)}static features(){return{relative:Yu()}}};function fu(t,e){let r=u=>u.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(e)-r(t);return Math.floor(v.fromMillis(n).as("days"))}function za(t,e,r){let n=[["years",(f,d)=>d.year-f.year],["quarters",(f,d)=>d.quarter-f.quarter+(d.year-f.year)*4],["months",(f,d)=>d.month-f.month+(d.year-f.year)*12],["weeks",(f,d)=>{let g=fu(f,d);return(g-g%7)/7}],["days",fu]],u={},s=t,i,l;for(let[f,d]of n)r.indexOf(f)>=0&&(i=f,u[f]=d(t,e),l=s.plus(u),l>e?(u[f]--,t=s.plus(u),t>e&&(l=t,u[f]--,t=s.plus(u))):t=l);return[t,u,l,i]}function Va(t,e,r,n){let[u,s,i,l]=za(t,e,r),f=e-u,d=r.filter(T=>["hours","minutes","seconds","milliseconds"].indexOf(T)>=0);d.length===0&&(i0?v.fromMillis(f,n).shiftTo(...d).plus(g):g}var pn={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},Du={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},$a=pn.hanidec.replace(/[\[|\]]/g,"").split("");function Wa(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let r=0;r=s&&n<=i&&(e+=n-s)}}return parseInt(e,10)}else return e}function oe({numberingSystem:t},e=""){return new RegExp(`${pn[t||"latn"]}${e}`)}var ja="missing Intl.DateTimeFormat.formatToParts support";function k(t,e=r=>r){return{regex:t,deser:([r])=>e(Wa(r))}}var Za="\xA0",Ds=`[ ${Za}]`,ds=new RegExp(Ds,"g");function qa(t){return t.replace(/\./g,"\\.?").replace(ds,Ds)}function du(t){return t.replace(/\./g,"").replace(ds," ").toLowerCase()}function le(t,e){return t===null?null:{regex:RegExp(t.map(qa).join("|")),deser:([r])=>t.findIndex(n=>du(r)===du(n))+e}}function hu(t,e){return{regex:t,deser:([,r,n])=>gr(r,n),groups:e}}function tr(t){return{regex:t,deser:([e])=>e}}function Ha(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ya(t,e){let r=oe(e),n=oe(e,"{2}"),u=oe(e,"{3}"),s=oe(e,"{4}"),i=oe(e,"{6}"),l=oe(e,"{1,2}"),f=oe(e,"{1,3}"),d=oe(e,"{1,6}"),g=oe(e,"{1,9}"),T=oe(e,"{2,4}"),b=oe(e,"{4,6}"),C=U=>({regex:RegExp(Ha(U.val)),deser:([Y])=>Y,literal:!0}),R=(U=>{if(t.literal)return C(U);switch(U.val){case"G":return le(e.eras("short"),0);case"GG":return le(e.eras("long"),0);case"y":return k(d);case"yy":return k(T,tn);case"yyyy":return k(s);case"yyyyy":return k(b);case"yyyyyy":return k(i);case"M":return k(l);case"MM":return k(n);case"MMM":return le(e.months("short",!0),1);case"MMMM":return le(e.months("long",!0),1);case"L":return k(l);case"LL":return k(n);case"LLL":return le(e.months("short",!1),1);case"LLLL":return le(e.months("long",!1),1);case"d":return k(l);case"dd":return k(n);case"o":return k(f);case"ooo":return k(u);case"HH":return k(n);case"H":return k(l);case"hh":return k(n);case"h":return k(l);case"mm":return k(n);case"m":return k(l);case"q":return k(l);case"qq":return k(n);case"s":return k(l);case"ss":return k(n);case"S":return k(f);case"SSS":return k(u);case"u":return tr(g);case"uu":return tr(l);case"uuu":return k(r);case"a":return le(e.meridiems(),0);case"kkkk":return k(s);case"kk":return k(T,tn);case"W":return k(l);case"WW":return k(n);case"E":case"c":return k(r);case"EEE":return le(e.weekdays("short",!1),1);case"EEEE":return le(e.weekdays("long",!1),1);case"ccc":return le(e.weekdays("short",!0),1);case"cccc":return le(e.weekdays("long",!0),1);case"Z":case"ZZ":return hu(new RegExp(`([+-]${l.source})(?::(${n.source}))?`),2);case"ZZZ":return hu(new RegExp(`([+-]${l.source})(${n.source})?`),2);case"z":return tr(/[a-z_+-/]{1,256}?/i);case" ":return tr(/[^\S\n\r]/);default:return C(U)}})(t)||{invalidReason:ja};return R.token=t,R}var Ga={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Qa(t,e,r){let{type:n,value:u}=t;if(n==="literal"){let f=/^\s+$/.test(u);return{literal:!f,val:f?" ":u}}let s=e[n],i=n;n==="hour"&&(e.hour12!=null?i=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?i="hour12":i="hour24":i=r.hour12?"hour12":"hour24");let l=Ga[i];if(typeof l=="object"&&(l=l[s]),l)return{literal:!1,val:l}}function Ja(t){return[`^${t.map(r=>r.regex).reduce((r,n)=>`${r}(${n.source})`,"")}$`,t]}function Ka(t,e,r){let n=t.match(e);if(n){let u={},s=1;for(let i in r)if(ot(r,i)){let l=r[i],f=l.groups?l.groups+1:1;!l.literal&&l.token&&(u[l.token.val[0]]=l.deser(n.slice(s,s+f))),s+=f}return[n,u]}else return[n,{}]}function Xa(t){let e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},r=null,n;return A(t.z)||(r=ke.create(t.z)),A(t.Z)||(r||(r=new ne(t.Z)),n=t.Z),A(t.q)||(t.M=(t.q-1)*3+1),A(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),A(t.u)||(t.S=fn(t.u)),[Object.keys(t).reduce((s,i)=>{let l=e(i);return l&&(s[l]=t[i]),s},{}),r,n]}var Rr=null;function eo(){return Rr||(Rr=M.fromMillis(1555555555555)),Rr}function to(t,e){if(t.literal)return t;let r=K.macroTokenToFormatOpts(t.val),n=ps(r,e);return n==null||n.includes(void 0)?t:n}function hs(t,e){return Array.prototype.concat(...t.map(r=>to(r,e)))}function ms(t,e,r){let n=hs(K.parseFormat(r),t),u=n.map(i=>Ya(i,t)),s=u.find(i=>i.invalidReason);if(s)return{input:e,tokens:n,invalidReason:s.invalidReason};{let[i,l]=Ja(u),f=RegExp(i,"i"),[d,g]=Ka(e,f,l),[T,b,C]=g?Xa(g):[null,null,void 0];if(ot(g,"a")&&ot(g,"H"))throw new Ze("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:n,regex:f,rawMatches:d,matches:g,result:T,zone:b,specificOffset:C}}}function ro(t,e,r){let{result:n,zone:u,specificOffset:s,invalidReason:i}=ms(t,e,r);return[n,u,s,i]}function ps(t,e){if(!t)return null;let n=K.create(e,t).dtFormatter(eo()),u=n.formatToParts(),s=n.resolvedOptions();return u.map(i=>Qa(i,t,s))}var Fs=[0,31,59,90,120,151,181,212,243,273,304,334],ys=[0,31,60,91,121,152,182,213,244,274,305,335];function re(t,e){return new X("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function gs(t,e,r){let n=new Date(Date.UTC(t,e-1,r));t<100&&t>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);let u=n.getUTCDay();return u===0?7:u}function Es(t,e,r){return r+(xt(t)?ys:Fs)[e-1]}function Cs(t,e){let r=xt(t)?ys:Fs,n=r.findIndex(s=>sfr(e)?(l=e+1,i=1):l=e,{weekYear:l,weekNumber:i,weekday:s,...Er(t)}}function mu(t){let{weekYear:e,weekNumber:r,weekday:n}=t,u=gs(e,1,4),s=vt(e),i=r*7+n-u-3,l;i<1?(l=e-1,i+=vt(l)):i>s?(l=e+1,i-=vt(e)):l=e;let{month:f,day:d}=Cs(l,i);return{year:l,month:f,day:d,...Er(t)}}function Ur(t){let{year:e,month:r,day:n}=t,u=Es(e,r,n);return{year:e,ordinal:u,...Er(t)}}function pu(t){let{year:e,ordinal:r}=t,{month:n,day:u}=Cs(e,r);return{year:e,month:n,day:u,...Er(t)}}function no(t){let e=Fr(t.weekYear),r=be(t.weekNumber,1,fr(t.weekYear)),n=be(t.weekday,1,7);return e?r?n?!1:re("weekday",t.weekday):re("week",t.week):re("weekYear",t.weekYear)}function uo(t){let e=Fr(t.year),r=be(t.ordinal,1,vt(t.year));return e?r?!1:re("ordinal",t.ordinal):re("year",t.year)}function ws(t){let e=Fr(t.year),r=be(t.month,1,12),n=be(t.day,1,cr(t.year,t.month));return e?r?n?!1:re("day",t.day):re("month",t.month):re("year",t.year)}function bs(t){let{hour:e,minute:r,second:n,millisecond:u}=t,s=be(e,0,23)||e===24&&r===0&&n===0&&u===0,i=be(r,0,59),l=be(n,0,59),f=be(u,0,999);return s?i?l?f?!1:re("millisecond",u):re("second",n):re("minute",r):re("hour",e)}var zr="Invalid DateTime",Fu=864e13;function rr(t){return new X("unsupported zone",`the zone "${t.name}" is not supported`)}function Vr(t){return t.weekData===null&&(t.weekData=rn(t.c)),t.weekData}function je(t,e){let r={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new M({...r,...e,old:r})}function vs(t,e,r){let n=t-e*60*1e3,u=r.offset(n);if(e===u)return[n,e];n-=(u-e)*60*1e3;let s=r.offset(n);return u===s?[n,u]:[t-Math.min(u,s)*60*1e3,Math.max(u,s)]}function nr(t,e){t+=e*60*1e3;let r=new Date(t);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function ir(t,e,r){return vs(yr(t),e,r)}function yu(t,e){let r=t.o,n=t.c.year+Math.trunc(e.years),u=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...t.c,year:n,month:u,day:Math.min(t.c.day,cr(n,u))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},i=v.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),l=yr(s),[f,d]=vs(l,r,t.zone);return i!==0&&(f+=i,d=t.zone.offset(f)),{ts:f,o:d}}function Et(t,e,r,n,u,s){let{setZone:i,zone:l}=r;if(t&&Object.keys(t).length!==0||e){let f=e||l,d=M.fromObject(t,{...r,zone:f,specificOffset:s});return i?d:d.setZone(l)}else return M.invalid(new X("unparsable",`the input "${u}" can't be parsed as ${n}`))}function ur(t,e,r=!0){return t.isValid?K.create(P.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(t,e):null}function $r(t,e){let r=t.c.year>9999||t.c.year<0,n="";return r&&t.c.year>=0&&(n+="+"),n+=V(t.c.year,r?6:4),e?(n+="-",n+=V(t.c.month),n+="-",n+=V(t.c.day)):(n+=V(t.c.month),n+=V(t.c.day)),n}function gu(t,e,r,n,u,s){let i=V(t.c.hour);return e?(i+=":",i+=V(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!r)&&(i+=":")):i+=V(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!r)&&(i+=V(t.c.second),(t.c.millisecond!==0||!n)&&(i+=".",i+=V(t.c.millisecond,3))),u&&(t.isOffsetFixed&&t.offset===0&&!s?i+="Z":t.o<0?(i+="-",i+=V(Math.trunc(-t.o/60)),i+=":",i+=V(Math.trunc(-t.o%60))):(i+="+",i+=V(Math.trunc(t.o/60)),i+=":",i+=V(Math.trunc(t.o%60)))),s&&(i+="["+t.zone.ianaName+"]"),i}var Ts={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},so={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},io={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Ss=["year","month","day","hour","minute","second","millisecond"],ao=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],oo=["year","ordinal","hour","minute","second","millisecond"];function Eu(t){let e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new ar(t);return e}function Cu(t,e){let r=Ae(e.zone,L.defaultZone),n=P.fromObject(e),u=L.now(),s,i;if(A(t.year))s=u;else{for(let d of Ss)A(t[d])&&(t[d]=Ts[d]);let l=ws(t)||bs(t);if(l)return M.invalid(l);let f=r.offset(u);[s,i]=ir(t,f,r)}return new M({ts:s,zone:r,loc:n,o:i})}function wu(t,e,r){let n=A(r.round)?!0:r.round,u=(i,l)=>(i=Dn(i,n||r.calendary?0:2,!0),e.loc.clone(r).relFormatter(r).format(i,l)),s=i=>r.calendary?e.hasSame(t,i)?0:e.startOf(i).diff(t.startOf(i),i).get(i):e.diff(t,i).get(i);if(r.unit)return u(s(r.unit),r.unit);for(let i of r.units){let l=s(i);if(Math.abs(l)>=1)return u(l,i)}return u(t>e?-0:0,r.units[r.units.length-1])}function bu(t){let e={},r;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],r=Array.from(t).slice(0,t.length-1)):r=Array.from(t),[e,r]}var M=class t{constructor(e){let r=e.zone||L.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new X("invalid input"):null)||(r.isValid?null:rr(r));this.ts=A(e.ts)?L.now():e.ts;let u=null,s=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(r))[u,s]=[e.old.c,e.old.o];else{let l=r.offset(this.ts);u=nr(this.ts,l),n=Number.isNaN(u.year)?new X("invalid input"):null,u=n?null:u,s=n?null:l}this._zone=r,this.loc=e.loc||P.create(),this.invalid=n,this.weekData=null,this.c=u,this.o=s,this.isLuxonDateTime=!0}static now(){return new t({})}static local(){let[e,r]=bu(arguments),[n,u,s,i,l,f,d]=r;return Cu({year:n,month:u,day:s,hour:i,minute:l,second:f,millisecond:d},e)}static utc(){let[e,r]=bu(arguments),[n,u,s,i,l,f,d]=r;return e.zone=ne.utcInstance,Cu({year:n,month:u,day:s,hour:i,minute:l,second:f,millisecond:d},e)}static fromJSDate(e,r={}){let n=Li(e)?e.valueOf():NaN;if(Number.isNaN(n))return t.invalid("invalid input");let u=Ae(r.zone,L.defaultZone);return u.isValid?new t({ts:n,zone:u,loc:P.fromObject(r)}):t.invalid(rr(u))}static fromMillis(e,r={}){if(He(e))return e<-Fu||e>Fu?t.invalid("Timestamp out of range"):new t({ts:e,zone:Ae(r.zone,L.defaultZone),loc:P.fromObject(r)});throw new H(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,r={}){if(He(e))return new t({ts:e*1e3,zone:Ae(r.zone,L.defaultZone),loc:P.fromObject(r)});throw new H("fromSeconds requires a numerical input")}static fromObject(e,r={}){e=e||{};let n=Ae(r.zone,L.defaultZone);if(!n.isValid)return t.invalid(rr(n));let u=L.now(),s=A(r.specificOffset)?n.offset(u):r.specificOffset,i=Dr(e,Eu),l=!A(i.ordinal),f=!A(i.year),d=!A(i.month)||!A(i.day),g=f||d,T=i.weekYear||i.weekNumber,b=P.fromObject(r);if((g||l)&&T)throw new Ze("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&l)throw new Ze("Can't mix ordinal dates with month/day");let C=T||i.weekday&&!g,x,R,U=nr(u,s);C?(x=ao,R=so,U=rn(U)):l?(x=oo,R=io,U=Ur(U)):(x=Ss,R=Ts);let Y=!1;for(let O of x){let B=i[O];A(B)?Y?i[O]=R[O]:i[O]=U[O]:Y=!0}let De=C?no(i):l?uo(i):ws(i),de=De||bs(i);if(de)return t.invalid(de);let m=C?mu(i):l?pu(i):i,[_,z]=ir(m,s,n),w=new t({ts:_,zone:n,o:z,loc:b});return i.weekday&&g&&e.weekday!==w.weekday?t.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${w.toISO()}`):w}static fromISO(e,r={}){let[n,u]=Ta(e);return Et(n,u,r,"ISO 8601",e)}static fromRFC2822(e,r={}){let[n,u]=Sa(e);return Et(n,u,r,"RFC 2822",e)}static fromHTTP(e,r={}){let[n,u]=Oa(e);return Et(n,u,r,"HTTP",r)}static fromFormat(e,r,n={}){if(A(e)||A(r))throw new H("fromFormat requires an input string and a format");let{locale:u=null,numberingSystem:s=null}=n,i=P.fromOpts({locale:u,numberingSystem:s,defaultToEN:!0}),[l,f,d,g]=ro(i,e,r);return g?t.invalid(g):Et(l,f,n,`format ${r}`,e,d)}static fromString(e,r,n={}){return t.fromFormat(e,r,n)}static fromSQL(e,r={}){let[n,u]=Na(e);return Et(n,u,r,"SQL",e)}static invalid(e,r=null){if(!e)throw new H("need to specify a reason the DateTime is invalid");let n=e instanceof X?e:new X(e,r);if(L.throwOnInvalid)throw new jr(n);return new t({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,r={}){let n=ps(e,P.fromObject(r));return n?n.map(u=>u?u.val:null).join(""):null}static expandFormat(e,r={}){return hs(K.parseFormat(e),P.fromObject(r)).map(u=>u.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Vr(this).weekYear:NaN}get weekNumber(){return this.isValid?Vr(this).weekNumber:NaN}get weekday(){return this.isValid?Vr(this).weekday:NaN}get ordinal(){return this.isValid?Ur(this.c).ordinal:NaN}get monthShort(){return this.isValid?st.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?st.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?st.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?st.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,r=6e4,n=yr(this.c),u=this.zone.offset(n-e),s=this.zone.offset(n+e),i=this.zone.offset(n-u*r),l=this.zone.offset(n-s*r);if(i===l)return[this];let f=n-i*r,d=n-l*r,g=nr(f,i),T=nr(d,l);return g.hour===T.hour&&g.minute===T.minute&&g.second===T.second&&g.millisecond===T.millisecond?[je(this,{ts:f}),je(this,{ts:d})]:[this]}get isInLeapYear(){return xt(this.year)}get daysInMonth(){return cr(this.year,this.month)}get daysInYear(){return this.isValid?vt(this.year):NaN}get weeksInWeekYear(){return this.isValid?fr(this.weekYear):NaN}resolvedLocaleOptions(e={}){let{locale:r,numberingSystem:n,calendar:u}=K.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:r,numberingSystem:n,outputCalendar:u}}toUTC(e=0,r={}){return this.setZone(ne.instance(e),r)}toLocal(){return this.setZone(L.defaultZone)}setZone(e,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if(e=Ae(e,L.defaultZone),e.equals(this.zone))return this;if(e.isValid){let u=this.ts;if(r||n){let s=e.offset(this.ts),i=this.toObject();[u]=ir(i,s,e)}return je(this,{ts:u,zone:e})}else return t.invalid(rr(e))}reconfigure({locale:e,numberingSystem:r,outputCalendar:n}={}){let u=this.loc.clone({locale:e,numberingSystem:r,outputCalendar:n});return je(this,{loc:u})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let r=Dr(e,Eu),n=!A(r.weekYear)||!A(r.weekNumber)||!A(r.weekday),u=!A(r.ordinal),s=!A(r.year),i=!A(r.month)||!A(r.day),l=s||i,f=r.weekYear||r.weekNumber;if((l||u)&&f)throw new Ze("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(i&&u)throw new Ze("Can't mix ordinal dates with month/day");let d;n?d=mu({...rn(this.c),...r}):A(r.ordinal)?(d={...this.toObject(),...r},A(r.day)&&(d.day=Math.min(cr(d.year,d.month),d.day))):d=pu({...Ur(this.c),...r});let[g,T]=ir(d,this.o,this.zone);return je(this,{ts:g,o:T})}plus(e){if(!this.isValid)return this;let r=v.fromDurationLike(e);return je(this,yu(this,r))}minus(e){if(!this.isValid)return this;let r=v.fromDurationLike(e).negate();return je(this,yu(this,r))}startOf(e){if(!this.isValid)return this;let r={},n=v.normalizeUnit(e);switch(n){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(n==="weeks"&&(r.weekday=1),n==="quarters"){let u=Math.ceil(this.month/3);r.month=(u-1)*3+1}return this.set(r)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,r={}){return this.isValid?K.create(this.loc.redefaultToEN(r)).formatDateTimeFromString(this,e):zr}toLocaleString(e=or,r={}){return this.isValid?K.create(this.loc.clone(r),e).formatDateTime(this):zr}toLocaleParts(e={}){return this.isValid?K.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:r=!1,suppressMilliseconds:n=!1,includeOffset:u=!0,extendedZone:s=!1}={}){if(!this.isValid)return null;let i=e==="extended",l=$r(this,i);return l+="T",l+=gu(this,i,r,n,u,s),l}toISODate({format:e="extended"}={}){return this.isValid?$r(this,e==="extended"):null}toISOWeekDate(){return ur(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:r=!1,includeOffset:n=!0,includePrefix:u=!1,extendedZone:s=!1,format:i="extended"}={}){return this.isValid?(u?"T":"")+gu(this,i==="extended",r,e,n,s):null}toRFC2822(){return ur(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return ur(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?$r(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:r=!1,includeOffsetSpace:n=!0}={}){let u="HH:mm:ss.SSS";return(r||e)&&(n&&(u+=" "),r?u+="z":e&&(u+="ZZ")),ur(this,u,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():zr}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let r={...this.c};return e.includeConfig&&(r.outputCalendar=this.outputCalendar,r.numberingSystem=this.loc.numberingSystem,r.locale=this.loc.locale),r}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,r="milliseconds",n={}){if(!this.isValid||!e.isValid)return v.invalid("created by diffing an invalid DateTime");let u={locale:this.locale,numberingSystem:this.numberingSystem,...n},s=Pi(r).map(v.normalizeUnit),i=e.valueOf()>this.valueOf(),l=i?this:e,f=i?e:this,d=Va(l,f,s,u);return i?d.negate():d}diffNow(e="milliseconds",r={}){return this.diff(t.now(),e,r)}until(e){return this.isValid?at.fromDateTimes(this,e):this}hasSame(e,r){if(!this.isValid)return!1;let n=e.valueOf(),u=this.setZone(e.zone,{keepLocalTime:!0});return u.startOf(r)<=n&&n<=u.endOf(r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let r=e.base||t.fromObject({},{zone:this.zone}),n=e.padding?thisr.valueOf(),Math.min)}static max(...e){if(!e.every(t.isDateTime))throw new H("max requires all arguments be DateTimes");return iu(e,r=>r.valueOf(),Math.max)}static fromFormatExplain(e,r,n={}){let{locale:u=null,numberingSystem:s=null}=n,i=P.fromOpts({locale:u,numberingSystem:s,defaultToEN:!0});return ms(i,e,r)}static fromStringExplain(e,r,n={}){return t.fromFormatExplain(e,r,n)}static get DATE_SHORT(){return or}static get DATE_MED(){return _u}static get DATE_MED_WITH_WEEKDAY(){return Ei}static get DATE_FULL(){return Mu}static get DATE_HUGE(){return Au}static get TIME_SIMPLE(){return ku}static get TIME_WITH_SECONDS(){return Bu}static get TIME_WITH_SHORT_OFFSET(){return Nu}static get TIME_WITH_LONG_OFFSET(){return Iu}static get TIME_24_SIMPLE(){return Lu}static get TIME_24_WITH_SECONDS(){return Pu}static get TIME_24_WITH_SHORT_OFFSET(){return Ru}static get TIME_24_WITH_LONG_OFFSET(){return Uu}static get DATETIME_SHORT(){return zu}static get DATETIME_SHORT_WITH_SECONDS(){return Vu}static get DATETIME_MED(){return $u}static get DATETIME_MED_WITH_SECONDS(){return Wu}static get DATETIME_MED_WITH_WEEKDAY(){return Ci}static get DATETIME_FULL(){return ju}static get DATETIME_FULL_WITH_SECONDS(){return Zu}static get DATETIME_HUGE(){return qu}static get DATETIME_HUGE_WITH_SECONDS(){return Hu}};function Ct(t){if(M.isDateTime(t))return t;if(t&&t.valueOf&&He(t.valueOf()))return M.fromJSDate(t);if(t&&typeof t=="object")return M.fromObject(t);throw new H(`Unknown datetime argument: ${t}, of type ${typeof t}`)}var Fn={renderNullAs:"\\-",taskCompletionTracking:!1,taskCompletionUseEmojiShorthand:!1,taskCompletionText:"completion",taskCompletionDateFormat:"yyyy-MM-dd",recursiveSubTaskCompletion:!1,warnOnEmptyResult:!0,refreshEnabled:!0,refreshInterval:2500,defaultDateFormat:"MMMM dd, yyyy",defaultDateTimeFormat:"h:mm a - MMMM dd, yyyy",maxRecursiveRenderDepth:4,tableIdColumnName:"File",tableGroupColumnName:"Group",showResultCount:!0},lo={allowHtml:!0};({...Fn,...lo});var nn=class t{value;successful;constructor(e){this.value=e,this.successful=!0}map(e){return new t(e(this.value))}flatMap(e){return e(this.value)}mapErr(e){return this}bimap(e,r){return this.map(e)}orElse(e){return this.value}cast(){return this}orElseThrow(e){return this.value}},un=class t{error;successful;constructor(e){this.error=e,this.successful=!1}map(e){return this}flatMap(e){return this}mapErr(e){return new t(e(this.error))}bimap(e,r){return this.mapErr(r)}orElse(e){return e}cast(){return this}orElseThrow(e){throw e?new Error(e(this.error)):new Error(""+this.error)}},dr;(function(t){function e(s){return new nn(s)}t.success=e;function r(s){return new un(s)}t.failure=r;function n(s,i,l){return s.successful?i.successful?l(s.value,i.value):r(i.error):r(s.error)}t.flatMap2=n;function u(s,i,l){return n(s,i,(f,d)=>e(l(f,d)))}t.map2=u})(dr||(dr={}));var co=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},hr={exports:{}};hr.exports;(function(t,e){(function(r,n){t.exports=n()})(typeof self<"u"?self:co,function(){return function(r){var n={};function u(s){if(n[s])return n[s].exports;var i=n[s]={i:s,l:!1,exports:{}};return r[s].call(i.exports,i,i.exports,u),i.l=!0,i.exports}return u.m=r,u.c=n,u.d=function(s,i,l){u.o(s,i)||Object.defineProperty(s,i,{configurable:!1,enumerable:!0,get:l})},u.r=function(s){Object.defineProperty(s,"__esModule",{value:!0})},u.n=function(s){var i=s&&s.__esModule?function(){return s.default}:function(){return s};return u.d(i,"a",i),i},u.o=function(s,i){return Object.prototype.hasOwnProperty.call(s,i)},u.p="",u(u.s=0)}([function(r,n,u){function s(a){if(!(this instanceof s))return new s(a);this._=a}var i=s.prototype;function l(a,c){for(var D=0;D>7),buf:function(p){var F=f(function(y,S,N,Z){return y.concat(N===Z.length-1?Buffer.from([S,0]).readUInt16BE(0):Z.readUInt16BE(N))},[],p);return Buffer.from(d(function(y){return(y<<1&65535)>>8},F))}(D.buf)}}),D}function T(){return typeof Buffer<"u"}function b(){if(!T())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function C(a){b();var c=f(function(F,y){return F+y},0,a);if(c%8!=0)throw new Error("The bits ["+a.join(", ")+"] add up to "+c+" which is not an even number of bytes; the total should be divisible by 8");var D,h=c/8,p=(D=function(F){return F>48},f(function(F,y){return F||(D(y)?y:F)},null,a));if(p)throw new Error(p+" bit range requested exceeds 48 bit (6 byte) Number max.");return new s(function(F,y){var S=h+y;return S>F.length?O(y,h.toString()+" bytes"):w(S,f(function(N,Z){var W=g(Z,N.buf);return{coll:N.coll.concat(W.v),buf:W.buf}},{coll:[],buf:F.slice(y,S)},a).coll)})}function x(a,c){return new s(function(D,h){return b(),h+c>D.length?O(h,c+" bytes for "+a):w(h+c,D.slice(h,h+c))})}function R(a,c){if(typeof(D=c)!="number"||Math.floor(D)!==D||c<0||c>6)throw new Error(a+" requires integer length in range [0, 6].");var D}function U(a){return R("uintBE",a),x("uintBE("+a+")",a).map(function(c){return c.readUIntBE(0,a)})}function Y(a){return R("uintLE",a),x("uintLE("+a+")",a).map(function(c){return c.readUIntLE(0,a)})}function De(a){return R("intBE",a),x("intBE("+a+")",a).map(function(c){return c.readIntBE(0,a)})}function de(a){return R("intLE",a),x("intLE("+a+")",a).map(function(c){return c.readIntLE(0,a)})}function m(a){return a instanceof s}function _(a){return{}.toString.call(a)==="[object Array]"}function z(a){return T()&&Buffer.isBuffer(a)}function w(a,c){return{status:!0,index:a,value:c,furthest:-1,expected:[]}}function O(a,c){return _(c)||(c=[c]),{status:!1,index:-1,value:null,furthest:a,expected:c}}function B(a,c){if(!c||a.furthest>c.furthest)return a;var D=a.furthest===c.furthest?function(h,p){if(function(){if(s._supportsSet!==void 0)return s._supportsSet;var we=typeof Set<"u";return s._supportsSet=we,we}()&&Array.from){for(var F=new Set(h),y=0;y=0;){if(y in D){h=D[y].line,F===0&&(F=D[y].lineStart);break}(a.charAt(y)===` `||a.charAt(y)==="\r"&&a.charAt(y+1)!==` `)&&(p++,F===0&&(F=y+1)),y--}var S=h+p,N=c-F;return D[c]={line:S,lineStart:F},{offset:c,line:S+1,column:N+1}}function ge(a){if(!m(a))throw new Error("not a parser: "+a)}function Ne(a,c){return typeof a=="string"?a.charAt(c):a[c]}function he(a){if(typeof a!="number")throw new Error("not a number: "+a)}function se(a){if(typeof a!="function")throw new Error("not a function: "+a)}function Se(a){if(typeof a!="string")throw new Error("not a string: "+a)}var At=2,ht=3,ie=8,kt=5*ie,ae=4*ie,Oe=" ";function Bt(a,c){return new Array(c+1).join(a)}function Nt(a,c,D){var h=c-a.length;return h<=0?a:Bt(D,h)+a}function En(a,c,D,h){return{from:a-c>0?a-c:0,to:a+D>h?h:a+D}}function zs(a,c){var D,h,p,F,y,S=c.index,N=S.offset,Z=1;if(N===a.length)return"Got the end of the input";if(z(a)){var W=N-N%ie,Ce=N-W,G=En(W,kt,ae+ie,a.length),we=d(function($){return d(function(Je){return Nt(Je.toString(16),2,"0")},$)},function($,Je){var Ke=$.length,Pe=[],Xe=0;if(Ke<=Je)return[$.slice()];for(var et=0;et=4&&(D+=1),Z=2,p=d(function($){return $.length<=4?$.join(" "):$.slice(0,4).join(" ")+" "+$.slice(4).join(" ")},we),(y=(8*(F.to>0?F.to-1:F.to)).toString(16).length)<2&&(y=2)}else{var Qe=a.split(/\r\n|[\n\r\u2028\u2029]/);D=S.column-1,h=S.line-1,F=En(h,At,ht,Qe.length),p=Qe.slice(F.from,F.to),y=F.to.toString().length}var Qs=h-F.from;return z(a)&&(y=(8*(F.to>0?F.to-1:F.to)).toString(16).length)<2&&(y=2),f(function($,Je,Ke){var Pe,Xe=Ke===Qs,et=Xe?"> ":Oe;return Pe=z(a)?Nt((8*(F.from+Ke)).toString(16),y,"0"):Nt((F.from+Ke+1).toString(),y," "),[].concat($,[et+Pe+" | "+Je],Xe?[Oe+Bt(" ",y)+" | "+Nt("",D," ")+Bt("^",Z)]:[])},[],p).join(` `)}function Cn(a,c){return[` `,"-- PARSING FAILED "+Bt("-",50),` `,zs(a,c),` `,(D=c.expected,D.length===1?`Expected: `+D[0]:`Expected one of the following: `+D.join(", ")),` `].join("");var D}function wn(a){return a.flags!==void 0?a.flags:[a.global?"g":"",a.ignoreCase?"i":"",a.multiline?"m":"",a.unicode?"u":"",a.sticky?"y":""].join("")}function It(){for(var a=[].slice.call(arguments),c=a.length,D=0;D=2?he(c):c=0;var D=function(p){return RegExp("^(?:"+p.source+")",wn(p))}(a),h=""+a;return s(function(p,F){var y=D.exec(p.slice(F));if(y){if(0<=c&&c<=y.length){var S=y[0],N=y[c];return w(F+S.length,N)}return O(F,"valid match group (0 to "+y.length+") in "+h)}return O(F,h)})}function Le(a){return s(function(c,D){return w(D,a)})}function Pt(a){return s(function(c,D){return O(D,a)})}function Rt(a){if(m(a))return s(function(c,D){var h=a._(c,D);return h.index=D,h.value="",h});if(typeof a=="string")return Rt(mt(a));if(a instanceof RegExp)return Rt(Ee(a));throw new Error("not a string, regexp, or parser: "+a)}function vn(a){return ge(a),s(function(c,D){var h=a._(c,D),p=c.slice(D,h.index);return h.status?O(D,'not "'+p+'"'):w(D,null)})}function Ut(a){return se(a),s(function(c,D){var h=Ne(c,D);return D=a.length?O(c,"any character/byte"):w(c+1,Ne(a,c))}),$s=s(function(a,c){return w(a.length,a.slice(c))}),vr=s(function(a,c){return c=0}).desc(c)},s.optWhitespace=Hs,s.Parser=s,s.range=function(a,c){return Ut(function(D){return a<=D&&D<=c}).desc(a+"-"+c)},s.regex=Ee,s.regexp=Ee,s.sepBy=bn,s.sepBy1=wr,s.seq=It,s.seqMap=Ie,s.seqObj=function(){for(var a,c={},D=0,h=(a=arguments,Array.prototype.slice.call(a)),p=h.length,F=0;F255)throw new Error("Value specified to byte constructor ("+a+"=0x"+a.toString(16)+") is larger in value than a single byte.");var c=(a>15?"0x":"0x0")+a.toString(16);return s(function(D,h){var p=Ne(D,h);return p===a?w(h+1,p):O(h,c)})},buffer:function(a){return x("buffer",a).map(function(c){return Buffer.from(c)})},encodedString:function(a,c){return x("string",c).map(function(D){return D.toString(a)})},uintBE:U,uint8BE:U(1),uint16BE:U(2),uint32BE:U(4),uintLE:Y,uint8LE:Y(1),uint16LE:Y(2),uint32LE:Y(4),intBE:De,int8BE:De(1),int16BE:De(2),int32BE:De(4),intLE:de,int8LE:de(1),int16LE:de(2),int32LE:de(4),floatBE:x("floatBE",4).map(function(a){return a.readFloatBE(0)}),floatLE:x("floatLE",4).map(function(a){return a.readFloatLE(0)}),doubleBE:x("doubleBE",8).map(function(a){return a.readDoubleBE(0)}),doubleLE:x("doubleLE",8).map(function(a){return a.readDoubleLE(0)})},r.exports=s}])})})(hr,hr.exports);var o=hr.exports,yn=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function Os(t){return t==null?t:t.shiftToAll().normalize()}function vu(t){return t.includes("/")&&(t=t.substring(t.lastIndexOf("/")+1)),t.endsWith(".md")&&(t=t.substring(0,t.length-3)),t}o.alt(o.regex(new RegExp(yn(),"")),o.regex(/[0-9\p{Letter}_-]+/u).map(t=>t.toLocaleLowerCase()),o.whitespace.map(t=>"-"),o.any.map(t=>"")).many().map(t=>t.join(""));var fo=o.alt(o.regex(new RegExp(yn(),"")),o.regex(/[0-9\p{Letter}_-]+/u),o.whitespace.map(t=>" "),o.any.map(t=>" ")).many().map(t=>t.join("").split(/\s+/).join(" ").trim());function Do(t){return fo.tryParse(t)}function ho(t){return t=Os(t),t=v.fromObject(Object.fromEntries(Object.entries(t.toObject()).filter(([,e])=>e!=0))),t.toHuman()}var St;(function(t){function e(m,_=Fn,z=!1){let w=r(m);if(!w)return _.renderNullAs;switch(w.type){case"null":return _.renderNullAs;case"string":return w.value;case"number":case"boolean":return""+w.value;case"html":return w.value.outerHTML;case"widget":return w.value.markdown();case"link":return w.value.markdown();case"function":return"";case"array":let O="";return z&&(O+="["),O+=w.value.map(B=>e(B,_,!0)).join(", "),z&&(O+="]"),O;case"object":return"{ "+Object.entries(w.value).map(B=>B[0]+": "+e(B[1],_,!0)).join(", ")+" }";case"date":return w.value.second==0&&w.value.hour==0&&w.value.minute==0?w.value.toFormat(_.defaultDateFormat):w.value.toFormat(_.defaultDateTimeFormat);case"duration":return ho(w.value)}}t.toString=e;function r(m){return b(m)?{type:"null",value:m}:d(m)?{type:"number",value:m}:f(m)?{type:"string",value:m}:x(m)?{type:"boolean",value:m}:T(m)?{type:"duration",value:m}:g(m)?{type:"date",value:m}:U(m)?{type:"widget",value:m}:C(m)?{type:"array",value:m}:R(m)?{type:"link",value:m}:de(m)?{type:"function",value:m}:Y(m)?{type:"html",value:m}:De(m)?{type:"object",value:m}:void 0}t.wrapValue=r;function n(m,_){if(De(m)){let z={};for(let[w,O]of Object.entries(m))z[w]=n(O,_);return z}else if(C(m)){let z=[];for(let w of m)z.push(n(w,_));return z}else return _(m)}t.mapLeaves=n;function u(m,_,z){if(m===void 0&&(m=null),_===void 0&&(_=null),m===null&&_===null)return 0;if(m===null)return-1;if(_===null)return 1;let w=r(m),O=r(_);if(w===void 0&&O===void 0)return 0;if(w===void 0)return-1;if(O===void 0)return 1;if(w.type!=O.type)return w.type.localeCompare(O.type);if(w.value===O.value)return 0;switch(w.type){case"string":return w.value.localeCompare(O.value);case"number":return w.valueae),ge=dt(B.path).localeCompare(dt(ue.path));if(ge!=0)return ge;let Ne=B.type.localeCompare(ue.type);return Ne!=0?Ne:B.subpath&&!ue.subpath?1:!B.subpath&&ue.subpath?-1:!B.subpath&&!ue.subpath?0:(B.subpath??"").localeCompare(ue.subpath??"");case"date":return w.value0;case"boolean":return _.value;case"link":return!!_.value.path;case"date":return _.value.toMillis()!=0;case"duration":return _.value.as("seconds")!=0;case"object":return Object.keys(_.value).length>0;case"array":return _.value.length>0;case"null":return!1;case"html":case"widget":case"function":return!0}}t.isTruthy=i;function l(m){if(m==null)return m;if(t.isArray(m))return[].concat(m.map(_=>l(_)));if(t.isObject(m)){let _={};for(let[z,w]of Object.entries(m))_[z]=l(w);return _}else return m}t.deepCopy=l;function f(m){return typeof m=="string"}t.isString=f;function d(m){return typeof m=="number"}t.isNumber=d;function g(m){return m instanceof M}t.isDate=g;function T(m){return m instanceof v}t.isDuration=T;function b(m){return m==null}t.isNull=b;function C(m){return Array.isArray(m)}t.isArray=C;function x(m){return typeof m=="boolean"}t.isBoolean=x;function R(m){return m instanceof mr}t.isLink=R;function U(m){return m instanceof Ot}t.isWidget=U;function Y(m){return typeof HTMLElement<"u"?m instanceof HTMLElement:!1}t.isHtml=Y;function De(m){return typeof m=="object"&&!Y(m)&&!U(m)&&!C(m)&&!T(m)&&!g(m)&&!R(m)&&m!==void 0&&!b(m)}t.isObject=De;function de(m){return typeof m=="function"}t.isFunction=de})(St||(St={}));var Tu;(function(t){function e(u){return St.isObject(u)&&Object.keys(u).length==2&&"key"in u&&"rows"in u}t.isElementGroup=e;function r(u){for(let s of u)if(!e(s))return!1;return!0}t.isGrouping=r;function n(u){if(r(u)){let s=0;for(let i of u)s+=n(i.rows);return s}else return u.length}t.count=n})(Tu||(Tu={}));var mr=class t{path;display;subpath;embed;type;static file(e,r=!1,n){return new t({path:e,embed:r,display:n,subpath:void 0,type:"file"})}static infer(e,r=!1,n){if(e.includes("#^")){let u=e.split("#^");return t.block(u[0],u[1],r,n)}else if(e.includes("#")){let u=e.split("#");return t.header(u[0],u[1],r,n)}else return t.file(e,r,n)}static header(e,r,n,u){return new t({path:e,embed:n,display:u,subpath:Do(r),type:"header"})}static block(e,r,n,u){return new t({path:e,embed:n,display:u,subpath:r,type:"block"})}static fromObject(e){return new t(e)}constructor(e){Object.assign(this,e)}equals(e){return e==null||e==null?!1:this.path==e.path&&this.type==e.type&&this.subpath==e.subpath}toString(){return this.markdown()}toObject(){return{path:this.path,type:this.type,subpath:this.subpath,display:this.display,embed:this.embed}}withPath(e){return new t(Object.assign({},this,{path:e}))}withDisplay(e){return new t(Object.assign({},this,{display:e}))}withHeader(e){return t.header(this.path,e,this.embed,this.display)}toFile(){return t.file(this.path,this.embed,this.display)}toEmbed(){if(this.embed)return this;{let e=new t(this);return e.embed=!0,e}}fromEmbed(){if(this.embed){let e=new t(this);return e.embed=!1,e}else return this}markdown(){let e=(this.embed?"!":"")+"[["+this.obsidianLink();return this.display?e+="|"+this.display:(e+="|"+vu(this.path),(this.type=="header"||this.type=="block")&&(e+=" > "+this.subpath)),e+="]]",e}obsidianLink(){let e=this.path.replaceAll("|","\\|");return this.type=="header"?e+"#"+this.subpath?.replaceAll("|","\\|"):this.type=="block"?e+"#^"+this.subpath?.replaceAll("|","\\|"):e}fileName(){return vu(this.path).replace(".md","")}},Ot=class{$widget;constructor(e){this.$widget=e}},sn=class extends Ot{key;value;constructor(e,r){super("dataview:list-pair"),this.key=e,this.value=r}markdown(){return`${St.toString(this.key)}: ${St.toString(this.value)}`}},an=class extends Ot{url;display;constructor(e,r){super("dataview:external-link"),this.url=e,this.display=r}markdown(){return`[${this.display??this.url}](${this.url})`}},Su;(function(t){function e(i,l){return new sn(i,l)}t.listPair=e;function r(i,l){return new an(i,l)}t.externalLink=r;function n(i){return i.$widget==="dataview:list-pair"}t.isListPair=n;function u(i){return i.$widget==="dataview:external-link"}t.isExternalLink=u;function s(i){return n(i)||u(i)}t.isBuiltin=s})(Su||(Su={}));var I;(function(t){function e(b){return{type:"variable",name:b}}t.variable=e;function r(b){return{type:"literal",value:b}}t.literal=r;function n(b,C,x){return{type:"binaryop",left:b,op:C,right:x}}t.binaryOp=n;function u(b,C){return{type:"index",object:b,index:C}}t.index=u;function s(b){let C=b.split("."),x=t.variable(C[0]);for(let R=1;R"||b==">="||b=="!="||b=="="}t.isCompareOp=T,t.NULL=t.literal(null)})(I||(I={}));var Fe;(function(t){function e(g){return{type:"tag",tag:g}}t.tag=e;function r(g){return{type:"csv",path:g}}t.csv=r;function n(g){return{type:"folder",folder:g}}t.folder=n;function u(g,T){return{type:"link",file:g,direction:T?"incoming":"outgoing"}}t.link=u;function s(g,T,b){return{type:"binaryop",left:g,op:T,right:b}}t.binaryOp=s;function i(g,T){return{type:"binaryop",left:g,op:"&",right:T}}t.and=i;function l(g,T){return{type:"binaryop",left:g,op:"|",right:T}}t.or=l;function f(g){return{type:"negate",child:g}}t.negate=f;function d(){return{type:"empty"}}t.empty=d})(Fe||(Fe={}));var Ou=new RegExp(yn(),""),on={year:v.fromObject({years:1}),years:v.fromObject({years:1}),yr:v.fromObject({years:1}),yrs:v.fromObject({years:1}),month:v.fromObject({months:1}),months:v.fromObject({months:1}),mo:v.fromObject({months:1}),mos:v.fromObject({months:1}),week:v.fromObject({weeks:1}),weeks:v.fromObject({weeks:1}),wk:v.fromObject({weeks:1}),wks:v.fromObject({weeks:1}),w:v.fromObject({weeks:1}),day:v.fromObject({days:1}),days:v.fromObject({days:1}),d:v.fromObject({days:1}),hour:v.fromObject({hours:1}),hours:v.fromObject({hours:1}),hr:v.fromObject({hours:1}),hrs:v.fromObject({hours:1}),h:v.fromObject({hours:1}),minute:v.fromObject({minutes:1}),minutes:v.fromObject({minutes:1}),min:v.fromObject({minutes:1}),mins:v.fromObject({minutes:1}),m:v.fromObject({minutes:1}),second:v.fromObject({seconds:1}),seconds:v.fromObject({seconds:1}),sec:v.fromObject({seconds:1}),secs:v.fromObject({seconds:1}),s:v.fromObject({seconds:1})},ln={now:()=>M.local(),today:()=>M.local().startOf("day"),yesterday:()=>M.local().startOf("day").minus(v.fromObject({days:1})),tomorrow:()=>M.local().startOf("day").plus(v.fromObject({days:1})),sow:()=>M.local().startOf("week"),"start-of-week":()=>M.local().startOf("week"),eow:()=>M.local().endOf("week"),"end-of-week":()=>M.local().endOf("week"),soy:()=>M.local().startOf("year"),"start-of-year":()=>M.local().startOf("year"),eoy:()=>M.local().endOf("year"),"end-of-year":()=>M.local().endOf("year"),som:()=>M.local().startOf("month"),"start-of-month":()=>M.local().startOf("month"),eom:()=>M.local().endOf("month"),"end-of-month":()=>M.local().endOf("month")},cn=["FROM","WHERE","LIMIT","GROUP","FLATTEN"];function mo(t){let e=-1;for(;(e=t.indexOf("|",e+1))>=0;)if(!(e>0&&t[e-1]=="\\"))return[t.substring(0,e).replace(/\\\|/g,"|"),t.substring(e+1)];return[t.replace(/\\\|/g,"|"),void 0]}function po(t){let[e,r]=mo(t);return mr.infer(e,!1,r)}function wt(t,e,r){return o.seqMap(t,o.seq(o.optWhitespace,e,o.optWhitespace,t).many(),(n,u)=>{if(u.length==0)return n;let s=r(n,u[0][1],u[0][3]);for(let i=1;i(u,s)=>{let i=t._(u,s);if(!i.status)return i;for(let l of e){let f=l(i.value)._(u,i.index);if(!f.status)return i;i=f}return i})}var ce=o.createLanguage({number:t=>o.regexp(/-?[0-9]+(\.[0-9]+)?/).map(e=>Number.parseFloat(e)).desc("number"),string:t=>o.string('"').then(o.alt(t.escapeCharacter,o.noneOf('"\\')).atLeast(0).map(e=>e.join(""))).skip(o.string('"')).desc("string"),escapeCharacter:t=>o.string("\\").then(o.any).map(e=>e==='"'?'"':e==="\\"?"\\":"\\"+e),bool:t=>o.regexp(/true|false|True|False/).map(e=>e.toLowerCase()=="true").desc("boolean ('true' or 'false')"),tag:t=>o.seqMap(o.string("#"),o.alt(o.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(),(e,r)=>e+r.join("")).desc("tag ('#hello/stuff')"),identifier:t=>o.seqMap(o.alt(o.regexp(/\p{Letter}/u),o.regexp(Ou).desc("text")),o.alt(o.regexp(/[0-9\p{Letter}_-]/u),o.regexp(Ou).desc("text")).many(),(e,r)=>e+r.join("")).desc("variable identifier"),link:t=>o.regexp(/\[\[([^\[\]]*?)\]\]/u,1).map(e=>po(e)).desc("file link"),embedLink:t=>o.seqMap(o.string("!").atMost(1),t.link,(e,r)=>(e.length>0&&(r.embed=!0),r)).desc("file link"),binaryPlusMinus:t=>o.regexp(/\+|-/).map(e=>e).desc("'+' or '-'"),binaryMulDiv:t=>o.regexp(/\*|\/|%/).map(e=>e).desc("'*' or '/' or '%'"),binaryCompareOp:t=>o.regexp(/>=|<=|!=|>|<|=/).map(e=>e).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"),binaryBooleanOp:t=>o.regexp(/and|or|&|\|/i).map(e=>e.toLowerCase()=="and"?"&":e.toLowerCase()=="or"?"|":e).desc("'and' or 'or'"),rootDate:t=>o.seqMap(o.regexp(/\d{4}/),o.string("-"),o.regexp(/\d{2}/),(e,r,n)=>M.fromObject({year:Number.parseInt(e),month:Number.parseInt(n)})).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),dateShorthand:t=>o.alt(...Object.keys(ln).sort((e,r)=>r.length-e.length).map(o.string)),date:t=>Fo(t.rootDate,e=>o.seqMap(o.string("-"),o.regexp(/\d{2}/),(r,n)=>e.set({day:Number.parseInt(n)})),e=>o.seqMap(o.string("T"),o.regexp(/\d{2}/),(r,n)=>e.set({hour:Number.parseInt(n)})),e=>o.seqMap(o.string(":"),o.regexp(/\d{2}/),(r,n)=>e.set({minute:Number.parseInt(n)})),e=>o.seqMap(o.string(":"),o.regexp(/\d{2}/),(r,n)=>e.set({second:Number.parseInt(n)})),e=>o.alt(o.seqMap(o.string("."),o.regexp(/\d{3}/),(r,n)=>e.set({millisecond:Number.parseInt(n)})),o.succeed(e)),e=>o.alt(o.seqMap(o.string("+").or(o.string("-")),o.regexp(/\d{1,2}(:\d{2})?/),(r,n)=>e.setZone("UTC"+r+n,{keepLocalTime:!0})),o.seqMap(o.string("Z"),()=>e.setZone("utc",{keepLocalTime:!0})),o.seqMap(o.string("["),o.regexp(/[0-9A-Za-z+-\/]+/u),o.string("]"),(r,n,u)=>e.setZone(n,{keepLocalTime:!0})))).assert(e=>e.isValid,"valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),datePlus:t=>o.alt(t.dateShorthand.map(e=>ln[e]()),t.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"),durationType:t=>o.alt(...Object.keys(on).sort((e,r)=>r.length-e.length).map(o.string)),duration:t=>o.seqMap(t.number,o.optWhitespace,t.durationType,(e,r,n)=>on[n].mapUnits(u=>u*e)).sepBy1(o.string(",").trim(o.optWhitespace).or(o.optWhitespace)).map(e=>e.reduce((r,n)=>r.plus(n))).desc("duration like 4hr2min"),rawNull:t=>o.string("null"),tagSource:t=>t.tag.map(e=>Fe.tag(e)),csvSource:t=>o.seqMap(o.string("csv(").skip(o.optWhitespace),t.string,o.string(")"),(e,r,n)=>Fe.csv(r)),linkIncomingSource:t=>t.link.map(e=>Fe.link(e.path,!0)),linkOutgoingSource:t=>o.seqMap(o.string("outgoing(").skip(o.optWhitespace),t.link,o.string(")"),(e,r,n)=>Fe.link(r.path,!1)),folderSource:t=>t.string.map(e=>Fe.folder(e)),parensSource:t=>o.seqMap(o.string("("),o.optWhitespace,t.source,o.optWhitespace,o.string(")"),(e,r,n,u,s)=>n),negateSource:t=>o.seqMap(o.alt(o.string("-"),o.string("!")),t.atomSource,(e,r)=>Fe.negate(r)),atomSource:t=>o.alt(t.parensSource,t.negateSource,t.linkOutgoingSource,t.linkIncomingSource,t.folderSource,t.tagSource,t.csvSource),binaryOpSource:t=>wt(t.atomSource,t.binaryBooleanOp.map(e=>e),Fe.binaryOp),source:t=>t.binaryOpSource,variableField:t=>t.identifier.chain(e=>cn.includes(e.toUpperCase())?o.fail("Variable fields cannot be a keyword ("+cn.join(" or ")+")"):o.succeed(I.variable(e))).desc("variable"),numberField:t=>t.number.map(e=>I.literal(e)).desc("number"),stringField:t=>t.string.map(e=>I.literal(e)).desc("string"),boolField:t=>t.bool.map(e=>I.literal(e)).desc("boolean"),dateField:t=>o.seqMap(o.string("date("),o.optWhitespace,t.datePlus,o.optWhitespace,o.string(")"),(e,r,n,u,s)=>I.literal(n)).desc("date"),durationField:t=>o.seqMap(o.string("dur("),o.optWhitespace,t.duration,o.optWhitespace,o.string(")"),(e,r,n,u,s)=>I.literal(n)).desc("duration"),nullField:t=>t.rawNull.map(e=>I.NULL),linkField:t=>t.link.map(e=>I.literal(e)),listField:t=>t.field.sepBy(o.string(",").trim(o.optWhitespace)).wrap(o.string("[").skip(o.optWhitespace),o.optWhitespace.then(o.string("]"))).map(e=>I.list(e)).desc("list ('[1, 2, 3]')"),objectField:t=>o.seqMap(t.identifier.or(t.string),o.string(":").trim(o.optWhitespace),t.field,(e,r,n)=>({name:e,value:n})).sepBy(o.string(",").trim(o.optWhitespace)).wrap(o.string("{").skip(o.optWhitespace),o.optWhitespace.then(o.string("}"))).map(e=>{let r={};for(let n of e)r[n.name]=n.value;return I.object(r)}).desc("object ('{ a: 1, b: 2 }')"),atomInlineField:t=>o.alt(t.date,t.duration.map(e=>Os(e)),t.string,t.tag,t.embedLink,t.bool,t.number,t.rawNull),inlineFieldList:t=>t.atomInlineField.sepBy(o.string(",").trim(o.optWhitespace).lookahead(t.atomInlineField)),inlineField:t=>o.alt(o.seqMap(t.atomInlineField,o.string(",").trim(o.optWhitespace),t.inlineFieldList,(e,r,n)=>[e].concat(n)),t.atomInlineField),atomField:t=>o.alt(t.embedLink.map(e=>I.literal(e)),t.negatedField,t.linkField,t.listField,t.objectField,t.lambdaField,t.parensField,t.boolField,t.numberField,t.stringField,t.dateField,t.durationField,t.nullField,t.variableField),indexField:t=>o.seqMap(t.atomField,o.alt(t.dotPostfix,t.indexPostfix,t.functionPostfix).many(),(e,r)=>{let n=e;for(let u of r)switch(u.type){case"dot":n=I.index(n,I.literal(u.field));break;case"index":n=I.index(n,u.field);break;case"function":n=I.func(n,u.fields);break}return n}),negatedField:t=>o.seqMap(o.string("!"),t.indexField,(e,r)=>I.negate(r)).desc("negated field"),parensField:t=>o.seqMap(o.string("("),o.optWhitespace,t.field,o.optWhitespace,o.string(")"),(e,r,n,u,s)=>n),lambdaField:t=>o.seqMap(t.identifier.sepBy(o.string(",").trim(o.optWhitespace)).wrap(o.string("(").trim(o.optWhitespace),o.string(")").trim(o.optWhitespace)),o.string("=>").trim(o.optWhitespace),t.field,(e,r,n)=>({type:"lambda",arguments:e,value:n})),dotPostfix:t=>o.seqMap(o.string("."),t.identifier,(e,r)=>({type:"dot",field:r})),indexPostfix:t=>o.seqMap(o.string("["),o.optWhitespace,t.field,o.optWhitespace,o.string("]"),(e,r,n,u,s)=>({type:"index",field:n})),functionPostfix:t=>o.seqMap(o.string("("),o.optWhitespace,t.field.sepBy(o.string(",").trim(o.optWhitespace)),o.optWhitespace,o.string(")"),(e,r,n,u,s)=>({type:"function",fields:n})),binaryMulDivField:t=>wt(t.indexField,t.binaryMulDiv,I.binaryOp),binaryPlusMinusField:t=>wt(t.binaryMulDivField,t.binaryPlusMinus,I.binaryOp),binaryCompareField:t=>wt(t.binaryPlusMinusField,t.binaryCompareOp,I.binaryOp),binaryBooleanField:t=>wt(t.binaryCompareField,t.binaryBooleanOp,I.binaryOp),binaryOpField:t=>t.binaryBooleanField,field:t=>t.binaryOpField});function yo(t){try{return dr.success(ce.field.tryParse(t))}catch(e){return dr.failure(""+e)}}var pr;(function(t){function e(n,u){return{name:n,field:u}}t.named=e;function r(n,u){return{field:n,direction:u}}t.sortBy=r})(pr||(pr={}));function go(t){return o.custom((e,r)=>(n,u)=>{let s=t._(n,u);return s.status?Object.assign({},s,{value:[s.value,n.substring(u,s.index)]}):s})}function Eo(t){return t.split(/[\r\n]+/).map(e=>e.trim()).join("")}function xu(t,e){return o.eof.map(t).or(o.whitespace.then(e))}var xs=o.createLanguage({queryType:t=>o.alt(o.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map(e=>e.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"),explicitNamedField:t=>o.seqMap(ce.field.skip(o.whitespace),o.regexp(/AS/i).skip(o.whitespace),ce.identifier.or(ce.string),(e,r,n)=>pr.named(n,e)),comment:()=>o.Parser((t,e)=>{let r=t.substring(e);if(!r.startsWith("//"))return o.makeFailure(e,"Not a comment");r=r.split(` `)[0];let n=r.substring(2).trim();return o.makeSuccess(e+r.length,n)}),namedField:t=>o.alt(t.explicitNamedField,go(ce.field).map(([e,r])=>pr.named(Eo(r),e))),sortField:t=>o.seqMap(ce.field.skip(o.optWhitespace),o.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1),(e,r)=>{let n=r.length==0?"ascending":r[0].toLowerCase();return n=="desc"&&(n="descending"),n=="asc"&&(n="ascending"),{field:e,direction:n}}),headerClause:t=>t.queryType.chain(e=>{switch(e){case"table":return xu(()=>({type:e,fields:[],showId:!0}),o.seqMap(o.regexp(/WITHOUT\s+ID/i).skip(o.optWhitespace).atMost(1),o.sepBy(t.namedField,o.string(",").trim(o.optWhitespace)),(r,n)=>({type:e,fields:n,showId:r.length==0})));case"list":return xu(()=>({type:e,format:void 0,showId:!0}),o.seqMap(o.regexp(/WITHOUT\s+ID/i).skip(o.optWhitespace).atMost(1),ce.field.atMost(1),(r,n)=>({type:e,format:n.length==1?n[0]:void 0,showId:r.length==0})));case"task":return o.succeed({type:e});case"calendar":return o.whitespace.then(o.seqMap(t.namedField,r=>({type:e,showId:!0,field:r})));default:return o.fail(`Unrecognized query type '${e}'`)}}).desc("TABLE or LIST or TASK or CALENDAR"),fromClause:t=>o.seqMap(o.regexp(/FROM/i),o.whitespace,ce.source,(e,r,n)=>n),whereClause:t=>o.seqMap(o.regexp(/WHERE/i),o.whitespace,ce.field,(e,r,n)=>({type:"where",clause:n})).desc("WHERE "),sortByClause:t=>o.seqMap(o.regexp(/SORT/i),o.whitespace,t.sortField.sepBy1(o.string(",").trim(o.optWhitespace)),(e,r,n)=>({type:"sort",fields:n})).desc("SORT field [ASC/DESC]"),limitClause:t=>o.seqMap(o.regexp(/LIMIT/i),o.whitespace,ce.field,(e,r,n)=>({type:"limit",amount:n})).desc("LIMIT "),flattenClause:t=>o.seqMap(o.regexp(/FLATTEN/i).skip(o.whitespace),t.namedField,(e,r)=>({type:"flatten",field:r})).desc("FLATTEN [AS ]"),groupByClause:t=>o.seqMap(o.regexp(/GROUP BY/i).skip(o.whitespace),t.namedField,(e,r)=>({type:"group",field:r})).desc("GROUP BY [AS ]"),clause:t=>o.alt(t.fromClause,t.whereClause,t.sortByClause,t.limitClause,t.groupByClause,t.flattenClause),query:t=>o.seqMap(t.headerClause.trim(Wr),t.fromClause.trim(Wr).atMost(1),t.clause.trim(Wr).many(),(e,r,n)=>({header:e,source:r.length==0?Fe.folder(""):r[0],operations:n,settings:Fn}))}),Wr=o.alt(o.whitespace,xs.comment).many().map(t=>t.join("")),Co=t=>t?t.plugins.plugins.dataview?.api:window.DataviewAPI,wo=t=>t.plugins.enabledPlugins.has("dataview");ye.DATE_SHORTHANDS=ln;ye.DURATION_TYPES=on;ye.EXPRESSION=ce;ye.KEYWORDS=cn;ye.QUERY_LANGUAGE=xs;ye.getAPI=Co;ye.isPluginEnabled=wo;ye.parseField=yo});var To={};ni(To,{default:()=>vo});module.exports=ui(To);var Be=require("obsidian");var Ft={foldersToScan:[],ignoredFolders:[]};var xe=require("obsidian");var Pn=Symbol.for("immer-nothing"),kn=Symbol.for("immer-draftable"),Q=Symbol.for("immer-state"),si=process.env.NODE_ENV!=="production"?[function(t){return`The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`},function(t){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${t}'`},"This object has been frozen and should not be mutated",function(t){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+t},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(t){return`'current' expects a draft, got: ${t}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(t){return`'original' expects a draft, got: ${t}`}]:[];function q(t,...e){if(process.env.NODE_ENV!=="production"){let r=si[t],n=typeof r=="function"?r.apply(null,e):r;throw new Error(`[Immer] ${n}`)}throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var tt=Object.getPrototypeOf;function rt(t){return!!t&&!!t[Q]}function Ue(t){return t?Rn(t)||Array.isArray(t)||!!t[kn]||!!t.constructor?.[kn]||Zt(t)||qt(t):!1}var ii=Object.prototype.constructor.toString();function Rn(t){if(!t||typeof t!="object")return!1;let e=tt(t);if(e===null)return!0;let r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===ii}function Vt(t,e){jt(t)===0?Reflect.ownKeys(t).forEach(r=>{e(r,t[r],t)}):t.forEach((r,n)=>e(n,r,t))}function jt(t){let e=t[Q];return e?e.type_:Array.isArray(t)?1:Zt(t)?2:qt(t)?3:0}function Or(t,e){return jt(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Un(t,e,r){let n=jt(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function ai(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function Zt(t){return t instanceof Map}function qt(t){return t instanceof Set}function Re(t){return t.copy_||t.base_}function xr(t,e){if(Zt(t))return new Map(t);if(qt(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);if(!e&&Rn(t))return tt(t)?{...t}:Object.assign(Object.create(null),t);let r=Object.getOwnPropertyDescriptors(t);delete r[Q];let n=Reflect.ownKeys(r);for(let u=0;u1&&(t.set=t.add=t.clear=t.delete=oi),Object.freeze(t),e&&Object.entries(t).forEach(([r,n])=>Br(n,!0))),t}function oi(){q(2)}function Ht(t){return Object.isFrozen(t)}var li={};function ze(t){let e=li[t];return e||q(0,t),e}var yt;function zn(){return yt}function ci(t,e){return{drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Bn(t,e){e&&(ze("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function _r(t){Mr(t),t.drafts_.forEach(fi),t.drafts_=null}function Mr(t){t===yt&&(yt=t.parent_)}function Nn(t){return yt=ci(yt,t)}function fi(t){let e=t[Q];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function In(t,e){e.unfinalizedDrafts_=e.drafts_.length;let r=e.drafts_[0];return t!==void 0&&t!==r?(r[Q].modified_&&(_r(e),q(4)),Ue(t)&&(t=$t(e,t),e.parent_||Wt(e,t)),e.patches_&&ze("Patches").generateReplacementPatches_(r[Q].base_,t,e.patches_,e.inversePatches_)):t=$t(e,r,[]),_r(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==Pn?t:void 0}function $t(t,e,r){if(Ht(e))return e;let n=e[Q];if(!n)return Vt(e,(u,s)=>Ln(t,n,e,u,s,r)),e;if(n.scope_!==t)return e;if(!n.modified_)return Wt(t,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let u=n.copy_,s=u,i=!1;n.type_===3&&(s=new Set(u),u.clear(),i=!0),Vt(s,(l,f)=>Ln(t,n,u,l,f,r,i)),Wt(t,u,!1),r&&t.patches_&&ze("Patches").generatePatches_(n,r,t.patches_,t.inversePatches_)}return n.copy_}function Ln(t,e,r,n,u,s,i){if(process.env.NODE_ENV!=="production"&&u===r&&q(5),rt(u)){let l=s&&e&&e.type_!==3&&!Or(e.assigned_,n)?s.concat(n):void 0,f=$t(t,u,l);if(Un(r,n,f),rt(f))t.canAutoFreeze_=!1;else return}else i&&r.add(u);if(Ue(u)&&!Ht(u)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;$t(t,u),(!e||!e.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Wt(t,u)}}function Wt(t,e,r=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&Br(e,r)}function Di(t,e){let r=Array.isArray(t),n={type_:r?1:0,scope_:e?e.scope_:zn(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1},u=n,s=Nr;r&&(u=[n],s=gt);let{revoke:i,proxy:l}=Proxy.revocable(u,s);return n.draft_=l,n.revoke_=i,l}var Nr={get(t,e){if(e===Q)return t;let r=Re(t);if(!Or(r,e))return di(t,r,e);let n=r[e];return t.finalized_||!Ue(n)?n:n===Tr(t.base_,e)?(Sr(t),t.copy_[e]=kr(n,t)):n},has(t,e){return e in Re(t)},ownKeys(t){return Reflect.ownKeys(Re(t))},set(t,e,r){let n=Vn(Re(t),e);if(n?.set)return n.set.call(t.draft_,r),!0;if(!t.modified_){let u=Tr(Re(t),e),s=u?.[Q];if(s&&s.base_===r)return t.copy_[e]=r,t.assigned_[e]=!1,!0;if(ai(r,u)&&(r!==void 0||Or(t.base_,e)))return!0;Sr(t),Ar(t)}return t.copy_[e]===r&&(r!==void 0||e in t.copy_)||Number.isNaN(r)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=r,t.assigned_[e]=!0),!0},deleteProperty(t,e){return Tr(t.base_,e)!==void 0||e in t.base_?(t.assigned_[e]=!1,Sr(t),Ar(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){let r=Re(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.type_!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty(){q(11)},getPrototypeOf(t){return tt(t.base_)},setPrototypeOf(){q(12)}},gt={};Vt(Nr,(t,e)=>{gt[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}});gt.deleteProperty=function(t,e){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(e))&&q(13),gt.set.call(this,t,e,void 0)};gt.set=function(t,e,r){return process.env.NODE_ENV!=="production"&&e!=="length"&&isNaN(parseInt(e))&&q(14),Nr.set.call(this,t[0],e,r,t[0])};function Tr(t,e){let r=t[Q];return(r?Re(r):t)[e]}function di(t,e,r){let n=Vn(e,r);return n?"value"in n?n.value:n.get?.call(t.draft_):void 0}function Vn(t,e){if(!(e in t))return;let r=tt(t);for(;r;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=tt(r)}}function Ar(t){t.modified_||(t.modified_=!0,t.parent_&&Ar(t.parent_))}function Sr(t){t.copy_||(t.copy_=xr(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var hi=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,r,n)=>{if(typeof e=="function"&&typeof r!="function"){let s=r;r=e;let i=this;return function(f=s,...d){return i.produce(f,g=>r.call(this,g,...d))}}typeof r!="function"&&q(6),n!==void 0&&typeof n!="function"&&q(7);let u;if(Ue(e)){let s=Nn(this),i=kr(e,void 0),l=!0;try{u=r(i),l=!1}finally{l?_r(s):Mr(s)}return Bn(s,n),In(u,s)}else if(!e||typeof e!="object"){if(u=r(e),u===void 0&&(u=e),u===Pn&&(u=void 0),this.autoFreeze_&&Br(u,!0),n){let s=[],i=[];ze("Patches").generateReplacementPatches_(e,u,s,i),n(s,i)}return u}else q(1,e)},this.produceWithPatches=(e,r)=>{if(typeof e=="function")return(i,...l)=>this.produceWithPatches(i,f=>e(f,...l));let n,u;return[this.produce(e,r,(i,l)=>{n=i,u=l}),n,u]},typeof t?.autoFreeze=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof t?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){Ue(t)||q(8),rt(t)&&(t=mi(t));let e=Nn(this),r=kr(t,void 0);return r[Q].isManual_=!0,Mr(e),r}finishDraft(t,e){let r=t&&t[Q];(!r||!r.isManual_)&&q(9);let{scope_:n}=r;return Bn(n,e),In(void 0,n)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,e){let r;for(r=e.length-1;r>=0;r--){let u=e[r];if(u.path.length===0&&u.op==="replace"){t=u.value;break}}r>-1&&(e=e.slice(r+1));let n=ze("Patches").applyPatches_;return rt(t)?n(t,e):this.produce(t,u=>n(u,e))}};function kr(t,e){let r=Zt(t)?ze("MapSet").proxyMap_(t,e):qt(t)?ze("MapSet").proxySet_(t,e):Di(t,e);return(e?e.scope_:zn()).drafts_.push(r),r}function mi(t){return rt(t)||q(10,t),$n(t)}function $n(t){if(!Ue(t)||Ht(t))return t;let e=t[Q],r;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,r=xr(t,e.scope_.immer_.useStrictShallowCopy_)}else r=xr(t,!0);return Vt(r,(n,u)=>{Un(r,n,$n(u))}),e&&(e.finalized_=!1),r}var J=new hi,Ve=J.produce,xo=J.produceWithPatches.bind(J),_o=J.setAutoFreeze.bind(J),Mo=J.setUseStrictShallowCopy.bind(J),Ao=J.applyPatches.bind(J),ko=J.createDraft.bind(J),Bo=J.finishDraft.bind(J);var Wn=(t,e,r)=>r.indexOf(t)===e;var Gt=require("obsidian"),Yt=class extends Gt.AbstractInputSuggest{constructor(r,n){super(n,r);this.inputEl=r}getSuggestions(r){let n=this.app.vault.getAllLoadedFiles(),u=[],s=r.toLowerCase();return n.forEach(i=>{i instanceof Gt.TFolder&&i.path.toLowerCase().contains(s)&&u.push(i)}),u}renderSuggestion(r,n){n.setText(r.path)}selectSuggestion(r){this.inputEl.value=r.path,this.close()}};var Qt=class extends xe.PluginSettingTab{constructor(e,r){super(e,r),this.plugin=r}display(){let{containerEl:e}=this;e.empty(),this.renderFoldersToScan(),this.renderFoldersToIgnore(),this.renderFollowButton(e),this.renderSupportHeader(e)}renderFollowButton(e){new xe.Setting(e).setName("Follow me on X").setDesc("@dSebastien").addButton(r=>{r.setCta(),r.setButtonText("Follow me on X").onClick(()=>{window.open("https://x.com/dSebastien")})})}renderSupportHeader(e){new xe.Setting(e).setName("Support").setHeading();let r=new DocumentFragment;r.createDiv({text:"Buy me a coffee to support the development of this plugin \u2764\uFE0F"}),new xe.Setting(e).setDesc(r),this.renderBuyMeACoffeeBadge(e),e.createDiv().classList.add("support-header-margin")}renderFoldersToScan(){this.doSearchAndRemoveList({currentList:this.plugin.settings.foldersToScan,setValue:async e=>{this.plugin.settings=Ve(this.plugin.settings,r=>{r.foldersToScan=e})},name:"Folders to scan",description:"Folders to scan when looking for queries to serialize."})}renderFoldersToIgnore(){this.doSearchAndRemoveList({currentList:this.plugin.settings.ignoredFolders,setValue:async e=>{this.plugin.settings=Ve(this.plugin.settings,r=>{r.ignoredFolders=e})},name:"Folders to ignore",description:"Folders to ignore when processing added/modified files."})}doSearchAndRemoveList({currentList:e,setValue:r,description:n,name:u}){let s;new xe.Setting(this.containerEl).setName(u).setDesc(n).addSearch(i=>{s=i,new Yt(i.inputEl,this.app),i.setPlaceholder("Example: folder1/folder2")}).addButton(i=>{i.setIcon("plus"),i.setTooltip("Add folder"),i.onClick(async()=>{if(!s)return;let l=s.getValue();await r([...e,l].filter(Wn)),await this.plugin.saveSettings(),s.setValue(""),this.display()})}),e.forEach(i=>new xe.Setting(this.containerEl).setName(i).addButton(l=>l.setButtonText("Remove").onClick(async()=>{await r(e.filter(f=>f!==i)),await this.plugin.saveSettings(),this.display()})))}renderBuyMeACoffeeBadge(e,r=175){let u=e.createEl("a",{href:"https://www.buymeacoffee.com/dsebastien"}).createEl("img");u.src="https://github.com/dsebastien/obsidian-plugin-template/raw/main/apps/plugin/src/assets/buy-me-a-coffee.png",u.alt="Buy me a coffee",u.width=r}};var jn="Dataview Serializer";var yi=`${jn}:`,j=(t,e,...r)=>{let n=`${yi} ${t}`;switch(e){case"debug":console.debug(n,r);break;case"info":console.info(n,r);break;case"warn":console.warn(n,r);break;case"error":console.error(n,r);break;default:console.log(n,r)}};var Zn=t=>{let e=typeof ExcalidrawAutomate>"u"?void 0:ExcalidrawAutomate;return e?e.isExcalidrawFile(t):!1};var qn="Canvas.md",Hn="md",$e="",Jt="",Yn=new RegExp(`${Jt}[^\\n]*${me}\\n([\\s\\S]*?)${Kt}\\n`,"g"),Gn=5,Qn=500,gi="list",Ir="table",Jn=[gi,Ir];var Us=An(_s());function Te(t){let e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Ge(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function Ms(t,e){let r=Te(t);return isNaN(e)?Ge(t,NaN):(e&&r.setDate(r.getDate()+e),r)}function As(t,e){let r=Te(t);if(isNaN(e))return Ge(t,NaN);if(!e)return r;let n=r.getDate(),u=Ge(t,r.getTime());u.setMonth(r.getMonth()+e+1,0);let s=u.getDate();return n>=s?u:(r.setFullYear(u.getFullYear(),u.getMonth(),n),r)}function ks(t,e){let{years:r=0,months:n=0,weeks:u=0,days:s=0,hours:i=0,minutes:l=0,seconds:f=0}=e,d=Te(t),g=n||r?As(d,n+r*12):d,T=s||u?Ms(g,s+u*7):g,b=l+i*60,x=(f+b*60)*1e3;return Ge(t,T.getTime()+x)}function Bs(t,e){let r=Te(t),n=Te(e);return+r<+n}var gn=An(require("path")),Ns=async t=>{let e=app.vault.getFiles();function r(u){return e.filter(i=>i.name==u).length<=1}let n="";try{if(n=await t.dataviewApi.tryQueryMarkdown(t.query,t.originFile),t.query.toLocaleLowerCase().contains("table")){n=n.replaceAll("\\\\","\\").replaceAll(` <`,"<");let u=new RegExp(/\[\[(.+?)\\\|.+?\]\]/g),s=[...n.matchAll(u)];for(let i of s)r(gn.default.basename(i[1]))&&(n=n.replace(i[1]+"\\|",""))}else{let u=new RegExp(/\[\[(.+?)\|.+?\]\]/g),s=[...n.matchAll(u)];for(let i of s)r(gn.default.basename(i[1]))&&(n=n.replace(i[1]+"|",""))}}catch(u){j("Failed to serialize query","warn",u)}return n};var Is=t=>{let e=!1,r=t.toLowerCase();for(let n of Jn)r.startsWith(n)&&(e=!0);return e};var Ls=t=>{let e=[],r=t.split(` `);for(let n of r){let u=n.trim();if(u.startsWith($e)&&u.endsWith(me)){let s=u.replace($e,"");s=s.replace(me,""),s=s.trim(),!e.includes(s)&&Is(s)&&e.push(s)}}return e};function Ps(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}var Rs=t=>{let e=!1;return t.toLowerCase().startsWith(Ir)&&(e=!0),e};var Cr=class extends Be.Plugin{constructor(){super(...arguments);this.settings=Ve(Ft,()=>Ft);this.nextPossibleUpdates=new Map;this.recentlyUpdatedFiles=new Set;this.scheduleUpdate=(0,Be.debounce)(this.processRecentlyUpdatedFiles.bind(this),Qn,!0)}async processRecentlyUpdatedFiles(){this.recentlyUpdatedFiles.forEach(r=>{this.processFile(r)}),this.recentlyUpdatedFiles.clear()}async onload(){if(j("Initializing","debug"),this.dataviewApi=(0,Us.getAPI)(),!this.dataviewApi){let r="The Dataview plugin is not installed or enabled. Please make sure it is installed and enabled, then restart Obsidian";j(r,"error"),new Be.Notice(r,5e3);return}await this.loadSettings(),this.setupEventHandlers(),this.addSettingTab(new Qt(this.app,this)),this.addCommand({id:"serialize-all-dataview-queries",name:"Scan and serialize all Dataview queries",callback:async()=>{j("Scanning and serializing all Dataview queries","debug");let r=this.app.vault.getMarkdownFiles();for(let n of r)await this.processFile(n)}})}onunload(){}async loadSettings(){j("Loading settings","debug");let r=await this.loadData();r||(j("Using default settings","debug"),r=Ve(Ft,()=>Ft));let n=!1;this.settings=Ve(this.settings,u=>{r.foldersToScan!==void 0&&r.foldersToScan!==null&&Array.isArray(r.foldersToScan)?u.foldersToScan=r.foldersToScan:(j("The loaded settings miss the [foldersToScan] property","debug"),n=!0),r.ignoredFolders!==void 0&&r.ignoredFolders!==null&&Array.isArray(r.ignoredFolders)?u.ignoredFolders=r.ignoredFolders:(j("The loaded settings miss the [ignoredFolders] property","debug"),n=!0)}),j("Settings loaded","debug",r),n&&this.saveSettings()}async saveSettings(){j("Saving settings","debug"),await this.saveData(this.settings),j("Settings saved","debug",this.settings)}setupEventHandlers(){this.app.workspace.onLayoutReady(async()=>{this.registerEvent(this.app.vault.on("create",r=>{this.recentlyUpdatedFiles.add(r),this.scheduleUpdate()})),this.registerEvent(this.app.vault.on("rename",r=>{this.recentlyUpdatedFiles.add(r),this.scheduleUpdate()})),this.registerEvent(this.app.vault.on("modify",r=>{this.recentlyUpdatedFiles.add(r),this.scheduleUpdate()}))})}async processFile(r){if(!(r instanceof Be.TFile))return;let n=r;if(!await this.shouldFileBeIgnored(n))try{let s=await this.app.vault.cachedRead(n),i=Ls(s);if(i.length===0)return;let l=`${s}`;l=l.replace(Yn,"");for(let d of i){let g=await Ns({query:d,originFile:n.path,dataviewApi:this.dataviewApi,app:this.app});if(g!==""){let T=Ps(d),b=new RegExp(`${$e}${T}.*${me}\\n`,"gm"),C="";Rs(d)?C=`${$e}${d}${me} ${Jt}${d}${me} ${g}${Kt} `:C=`${$e}${d}${me} ${Jt}${d}${me} ${g}${Kt} `,l=l.replace(b,C)}}let f=ks(new Date(n.stat.mtime),{seconds:Gn});this.nextPossibleUpdates.set(n.path,f),l!==s&&await this.app.vault.modify(n,l)}catch(s){j("Failed to process the file","warn",s)}}async shouldFileBeIgnored(r){if(!r.path||Hn!==r.extension||qn===r.name||(await this.app.vault.read(r)).trim().length===0||Zn(r))return!0;if(this.nextPossibleUpdates.has(r.path)){let u=this.nextPossibleUpdates.get(r.path);if(Bs(r.stat.mtime,u))return j("File has been updated recently. Ignoring","debug",r.path),!0;j("File has not been updated recently. Processing","debug",r.path)}return this.settings.ignoredFolders.some(u=>!!r.path.startsWith(u))}};var vo=Cr;