@christtrade/depth 0.14.1 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/depth.cjs +90 -56
  2. package/depth.css +1 -1
  3. package/depth.mjs +90 -56
  4. package/depth.nopreflight.css +1 -1
  5. package/package.json +1 -1
  6. package/script-runtime.cjs +2 -2
  7. package/script-runtime.mjs +2 -2
  8. package/types/components/multi-chart/GridDividers.d.ts +3 -2
  9. package/types/components/ui/animated-panel.d.ts +5 -1
  10. package/types/components/ui/scroll-strip.d.ts +6 -0
  11. package/types/console/Console.d.ts +190 -0
  12. package/types/console/builtins/cfgedit.d.ts +2 -0
  13. package/types/console/builtins/editor.d.ts +9 -0
  14. package/types/console/builtins/js.d.ts +9 -0
  15. package/types/console/builtins/pipes.d.ts +2 -0
  16. package/types/console/builtins/plot.d.ts +9 -0
  17. package/types/console/builtins/scripts.d.ts +2 -0
  18. package/types/console/builtins/watch.d.ts +2 -0
  19. package/types/console/chart-host.d.ts +3 -0
  20. package/types/console/lex.d.ts +16 -0
  21. package/types/console/manifest.gen.d.ts +3 -0
  22. package/types/console/plugin-console.d.ts +24 -0
  23. package/types/console/tools/book.d.ts +3 -0
  24. package/types/console/tools/free.d.ts +3 -0
  25. package/types/console/tools/look.d.ts +3 -0
  26. package/types/console/tools/market.d.ts +6 -0
  27. package/types/console/tools/net.d.ts +14 -0
  28. package/types/console/tools/netgraph.d.ts +3 -0
  29. package/types/console/tools/profile.d.ts +3 -0
  30. package/types/console/tools/tape.d.ts +3 -0
  31. package/types/console/tools/top.d.ts +10 -0
  32. package/types/console/tools/trace.d.ts +3 -0
  33. package/types/console/tools/triggers.d.ts +3 -0
  34. package/types/console/tools/tui.d.ts +13 -0
  35. package/types/console/types.d.ts +62 -0
  36. package/types/console/values.d.ts +46 -0
  37. package/types/core/DepthChart.d.ts +12 -0
  38. package/types/core/ExecutionEngine.d.ts +6 -1
  39. package/types/core/RenderEngine.d.ts +13 -0
  40. package/types/core/ScriptedPlugin.d.ts +10 -0
  41. package/types/core/TypedEventBus.d.ts +9 -0
  42. package/types/core/index.d.ts +5 -1
  43. package/types/interfaces/plugins/IChartPlugin.d.ts +10 -0
  44. package/types/lib/indicator-stdlib.d.ts +17 -0
  45. package/types/lib/matchingEngine.d.ts +14 -0
  46. package/types/lib/storage.d.ts +2 -0
@@ -1,2 +1,2 @@
1
- var zr=Object.defineProperty;var $r=(t,e,n)=>e in t?zr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var b=(t,e,n)=>$r(t,typeof e!="symbol"?e+"":e,n);var Y=class extends Error{},pt=class extends Y{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},bt=class extends Y{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},wt=class extends Y{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},X=class extends Y{},$e=class extends Y{constructor(e){super(`Invalid unit ${e}`)}},C=class extends Y{},_=class extends Y{constructor(){super("Zone is an abstract class")}},h="numeric",$="short",A="long",_e={year:h,month:h,day:h},Mn={year:h,month:$,day:h},_r={year:h,month:$,day:h,weekday:$},Dn={year:h,month:A,day:h},Cn={year:h,month:A,day:h,weekday:A},En={hour:h,minute:h},In={hour:h,minute:h,second:h},Fn={hour:h,minute:h,second:h,timeZoneName:$},An={hour:h,minute:h,second:h,timeZoneName:A},Wn={hour:h,minute:h,hourCycle:"h23"},Rn={hour:h,minute:h,second:h,hourCycle:"h23"},Pn={hour:h,minute:h,second:h,hourCycle:"h23",timeZoneName:$},Ln={hour:h,minute:h,second:h,hourCycle:"h23",timeZoneName:A},qn={year:h,month:h,day:h,hour:h,minute:h},Vn={year:h,month:h,day:h,hour:h,minute:h,second:h},Bn={year:h,month:$,day:h,hour:h,minute:h},zn={year:h,month:$,day:h,hour:h,minute:h,second:h},Zr={year:h,month:$,day:h,weekday:$,hour:h,minute:h},$n={year:h,month:A,day:h,hour:h,minute:h,timeZoneName:$},_n={year:h,month:A,day:h,hour:h,minute:h,second:h,timeZoneName:$},Zn={year:h,month:A,day:h,weekday:A,hour:h,minute:h,timeZoneName:A},Un={year:h,month:A,day:h,weekday:A,hour:h,minute:h,second:h,timeZoneName:A},ie=class{get type(){throw new _}get name(){throw new _}get ianaName(){return this.name}get isUniversal(){throw new _}offsetName(e,n){throw new _}formatOffset(e,n){throw new _}offset(e){throw new _}equals(e){throw new _}get isValid(){throw new _}},lt=null,Ze=class t extends ie{static get instance(){return lt===null&&(lt=new t),lt}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return nr(e,n,r)}formatOffset(e,n){return Oe(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}},St=new Map;function Ur(t){let e=St.get(t);return e===void 0&&(e=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"}),St.set(t,e)),e}var Yr={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Hr(t,e){let n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,s,o,a,l,u,c]=r;return[o,i,s,a,l,u,c]}function Gr(t,e){let n=t.formatToParts(e),r=[];for(let i=0;i<n.length;i++){let{type:s,value:o}=n[i],a=Yr[s];s==="era"?r[a]=o:y(a)||(r[a]=parseInt(o,10))}return r}var ut=new Map,K=class t extends ie{static create(e){let n=ut.get(e);return n===void 0&&ut.set(e,n=new t(e)),n}static resetCache(){ut.clear(),St.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=t.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return nr(e,n,r,this.name)}formatOffset(e,n){return Oe(this.offset(e),n)}offset(e){if(!this.valid)return NaN;let n=new Date(e);if(isNaN(n))return NaN;let r=Ur(this.name),[i,s,o,a,l,u,c]=r.formatToParts?Gr(r,n):Hr(r,n);a==="BC"&&(i=-Math.abs(i)+1);let d=Je({year:i,month:s,day:o,hour:l===24?0:l,minute:u,second:c,millisecond:0}),f=+n,g=f%1e3;return f-=g>=0?g:1e3+g,(d-f)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}},Jt={};function jr(t,e={}){let n=JSON.stringify([t,e]),r=Jt[n];return r||(r=new Intl.ListFormat(t,e),Jt[n]=r),r}var Tt=new Map;function xt(t,e={}){let n=JSON.stringify([t,e]),r=Tt.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(t,e),Tt.set(n,r)),r}var kt=new Map;function Jr(t,e={}){let n=JSON.stringify([t,e]),r=kt.get(n);return r===void 0&&(r=new Intl.NumberFormat(t,e),kt.set(n,r)),r}var vt=new Map;function Xr(t,e={}){let{base:n,...r}=e,i=JSON.stringify([t,r]),s=vt.get(i);return s===void 0&&(s=new Intl.RelativeTimeFormat(t,e),vt.set(i,s)),s}var xe=null;function Qr(){return xe||(xe=new Intl.DateTimeFormat().resolvedOptions().locale,xe)}var Ot=new Map;function Yn(t){let e=Ot.get(t);return e===void 0&&(e=new Intl.DateTimeFormat(t).resolvedOptions(),Ot.set(t,e)),e}var Nt=new Map;function Kr(t){let e=Nt.get(t);if(!e){let n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in e||(e={...Hn,...e}),Nt.set(t,e)}return e}function ei(t){let e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));let n=t.indexOf("-u-");if(n===-1)return[t];{let r,i;try{r=xt(t).resolvedOptions(),i=t}catch{let l=t.substring(0,n);r=xt(l).resolvedOptions(),i=l}let{numberingSystem:s,calendar:o}=r;return[i,s,o]}}function ti(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function ni(t){let e=[];for(let n=1;n<=12;n++){let r=T.utc(2009,n,1);e.push(t(r))}return e}function ri(t){let e=[];for(let n=1;n<=7;n++){let r=T.utc(2016,11,13+n);e.push(t(r))}return e}function Re(t,e,n,r){let i=t.listingMode();return i==="error"?null:i==="en"?n(e):r(e)}function ii(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||Yn(t.locale).numberingSystem==="latn"}var Mt=class{constructor(e,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;let{padTo:i,floor:s,...o}=r;if(!n||Object.keys(o).length>0){let a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=Jr(e,a)}}format(e){if(this.inf){let n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{let n=this.floor?Math.floor(e):Vt(e,3);return N(n,this.padTo)}}},Dt=class{constructor(e,n,r){this.opts=r,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){let o=-1*(e.offset/60),a=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&K.create(a).valid?(i=a,this.dt=e):(i="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,i=e.zone.name):(i="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let s={...this.opts};s.timeZone=s.timeZone||i,this.dtf=xt(n,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(n=>{if(n.type==="timeZoneName"){let r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},Ct=class{constructor(e,n,r){this.opts={style:"long",...r},!n&&er()&&(this.rtf=Xr(e,r))}format(e,n){return this.rtf?this.rtf.format(e,n):Oi(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}},Hn={firstDay:1,minimalDays:4,weekend:[6,7]},S=class t{static fromOpts(e){return t.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,r,i,s=!1){let o=e||O.defaultLocale,a=o||(s?"en-US":Qr()),l=n||O.defaultNumberingSystem,u=r||O.defaultOutputCalendar,c=Ft(i)||O.defaultWeekSettings;return new t(a,l,u,c,o)}static resetCache(){xe=null,Tt.clear(),kt.clear(),vt.clear(),Ot.clear(),Nt.clear()}static fromObject({locale:e,numberingSystem:n,outputCalendar:r,weekSettings:i}={}){return t.create(e,n,r,i)}constructor(e,n,r,i,s){let[o,a,l]=ei(e);this.locale=o,this.numberingSystem=n||a||null,this.outputCalendar=r||l||null,this.weekSettings=i,this.intl=ti(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=ii(this)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"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,Ft(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return Re(this,e,sr,()=>{let r=this.intl==="ja"||this.intl.startsWith("ja-");n&=!r;let i=n?{month:e,day:"numeric"}:{month:e},s=n?"format":"standalone";if(!this.monthsCache[s][e]){let o=r?a=>this.dtFormatter(a,i).format():a=>this.extract(a,i,"month");this.monthsCache[s][e]=ni(o)}return this.monthsCache[s][e]})}weekdays(e,n=!1){return Re(this,e,lr,()=>{let r=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=n?"format":"standalone";return this.weekdaysCache[i][e]||(this.weekdaysCache[i][e]=ri(s=>this.extract(s,r,"weekday"))),this.weekdaysCache[i][e]})}meridiems(){return Re(this,void 0,()=>ur,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[T.utc(2016,11,13,9),T.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Re(this,e,cr,()=>{let n={era:e};return this.eraCache[e]||(this.eraCache[e]=[T.utc(-40,1,1),T.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[e]})}extract(e,n,r){let i=this.dtFormatter(e,n),s=i.formatToParts(),o=s.find(a=>a.type.toLowerCase()===r);return o?o.value:null}numberFormatter(e={}){return new Mt(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new Dt(e,this.intl,n)}relFormatter(e={}){return new Ct(this.intl,this.isEnglish(),e)}listFormatter(e={}){return jr(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||Yn(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:tr()?Kr(this.locale):Hn}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},ct=null,q=class t extends ie{static get utcInstance(){return ct===null&&(ct=new t(0)),ct}static instance(e){return e===0?t.utcInstance:new t(e)}static parseSpecifier(e){if(e){let n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new t(Xe(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Oe(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Oe(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return Oe(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}},Et=class extends ie{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 J(t,e){if(y(t)||t===null)return e;if(t instanceof ie)return t;if(ci(t)){let n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?Ze.instance:n==="utc"||n==="gmt"?q.utcInstance:q.parseSpecifier(n)||K.create(t)}else return Q(t)?q.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new Et(t)}var Rt={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"},Xt={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]},si=Rt.hanidec.replace(/[\[|\]]/g,"").split("");function oi(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);if(t[n].search(Rt.hanidec)!==-1)e+=si.indexOf(t[n]);else for(let i in Xt){let[s,o]=Xt[i];r>=s&&r<=o&&(e+=r-s)}}return parseInt(e,10)}else return e}var It=new Map;function ai(){It.clear()}function B({numberingSystem:t},e=""){let n=t||"latn",r=It.get(n);r===void 0&&(r=new Map,It.set(n,r));let i=r.get(e);return i===void 0&&(i=new RegExp(`${Rt[n]}${e}`),r.set(e,i)),i}var Qt=()=>Date.now(),Kt="system",en=null,tn=null,nn=null,rn=60,sn,on=null,O=class{static get now(){return Qt}static set now(e){Qt=e}static set defaultZone(e){Kt=e}static get defaultZone(){return J(Kt,Ze.instance)}static get defaultLocale(){return en}static set defaultLocale(e){en=e}static get defaultNumberingSystem(){return tn}static set defaultNumberingSystem(e){tn=e}static get defaultOutputCalendar(){return nn}static set defaultOutputCalendar(e){nn=e}static get defaultWeekSettings(){return on}static set defaultWeekSettings(e){on=Ft(e)}static get twoDigitCutoffYear(){return rn}static set twoDigitCutoffYear(e){rn=e%100}static get throwOnInvalid(){return sn}static set throwOnInvalid(e){sn=e}static resetCaches(){S.resetCache(),K.resetCache(),T.resetCache(),ai()}},F=class{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},Gn=[0,31,59,90,120,151,181,212,243,273,304,334],jn=[0,31,60,91,121,152,182,213,244,274,305,335];function P(t,e){return new F("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Pt(t,e,n){let r=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);let i=r.getUTCDay();return i===0?7:i}function Jn(t,e,n){return n+(Me(t)?jn:Gn)[e-1]}function Xn(t,e){let n=Me(t)?jn:Gn,r=n.findIndex(s=>s<e),i=e-n[r];return{month:r+1,day:i}}function Lt(t,e){return(t-e+7)%7+1}function Ue(t,e=4,n=1){let{year:r,month:i,day:s}=t,o=Jn(r,i,s),a=Lt(Pt(r,i,s),n),l=Math.floor((o-a+14-e)/7),u;return l<1?(u=r-1,l=Ne(u,e,n)):l>Ne(r,e,n)?(u=r+1,l=1):u=r,{weekYear:u,weekNumber:l,weekday:a,...Qe(t)}}function an(t,e=4,n=1){let{weekYear:r,weekNumber:i,weekday:s}=t,o=Lt(Pt(r,1,e),n),a=fe(r),l=i*7+s-o-7+e,u;l<1?(u=r-1,l+=fe(u)):l>a?(u=r+1,l-=fe(r)):u=r;let{month:c,day:m}=Xn(u,l);return{year:u,month:c,day:m,...Qe(t)}}function ft(t){let{year:e,month:n,day:r}=t,i=Jn(e,n,r);return{year:e,ordinal:i,...Qe(t)}}function ln(t){let{year:e,ordinal:n}=t,{month:r,day:i}=Xn(e,n);return{year:e,month:r,day:i,...Qe(t)}}function un(t,e){if(!y(t.localWeekday)||!y(t.localWeekNumber)||!y(t.localWeekYear)){if(!y(t.weekday)||!y(t.weekNumber)||!y(t.weekYear))throw new X("Cannot mix locale-based week fields with ISO-based week fields");return y(t.localWeekday)||(t.weekday=t.localWeekday),y(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),y(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function li(t,e=4,n=1){let r=je(t.weekYear),i=L(t.weekNumber,1,Ne(t.weekYear,e,n)),s=L(t.weekday,1,7);return r?i?s?!1:P("weekday",t.weekday):P("week",t.weekNumber):P("weekYear",t.weekYear)}function ui(t){let e=je(t.year),n=L(t.ordinal,1,fe(t.year));return e?n?!1:P("ordinal",t.ordinal):P("year",t.year)}function Qn(t){let e=je(t.year),n=L(t.month,1,12),r=L(t.day,1,Ye(t.year,t.month));return e?n?r?!1:P("day",t.day):P("month",t.month):P("year",t.year)}function Kn(t){let{hour:e,minute:n,second:r,millisecond:i}=t,s=L(e,0,23)||e===24&&n===0&&r===0&&i===0,o=L(n,0,59),a=L(r,0,59),l=L(i,0,999);return s?o?a?l?!1:P("millisecond",i):P("second",r):P("minute",n):P("hour",e)}function y(t){return typeof t>"u"}function Q(t){return typeof t=="number"}function je(t){return typeof t=="number"&&t%1===0}function ci(t){return typeof t=="string"}function fi(t){return Object.prototype.toString.call(t)==="[object Date]"}function er(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function tr(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function mi(t){return Array.isArray(t)?t:[t]}function cn(t,e,n){if(t.length!==0)return t.reduce((r,i)=>{let s=[e(i),i];return r&&n(r[0],s[0])===r[0]?r:s},null)[1]}function hi(t,e){return e.reduce((n,r)=>(n[r]=t[r],n),{})}function de(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Ft(t){if(t==null)return null;if(typeof t!="object")throw new C("Week settings must be an object");if(!L(t.firstDay,1,7)||!L(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!L(e,1,7)))throw new C("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function L(t,e,n){return je(t)&&t>=e&&t<=n}function di(t,e){return t-e*Math.floor(t/e)}function N(t,e=2){let n=t<0,r;return n?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function j(t){if(!(y(t)||t===null||t===""))return parseInt(t,10)}function te(t){if(!(y(t)||t===null||t===""))return parseFloat(t)}function qt(t){if(!(y(t)||t===null||t==="")){let e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function Vt(t,e,n="round"){let r=10**e;switch(n){case"expand":return t>0?Math.ceil(t*r)/r:Math.floor(t*r)/r;case"trunc":return Math.trunc(t*r)/r;case"round":return Math.round(t*r)/r;case"floor":return Math.floor(t*r)/r;case"ceil":return Math.ceil(t*r)/r;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function Me(t){return t%4===0&&(t%100!==0||t%400===0)}function fe(t){return Me(t)?366:365}function Ye(t,e){let n=di(e-1,12)+1,r=t+(e-n)/12;return n===2?Me(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Je(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 fn(t,e,n){return-Lt(Pt(t,1,e),n)+e-1}function Ne(t,e=4,n=1){let r=fn(t,e,n),i=fn(t+1,e,n);return(fe(t)-r+i)/7}function At(t){return t>99?t:t>O.twoDigitCutoffYear?1900+t:2e3+t}function nr(t,e,n,r=null){let i=new Date(t),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(s.timeZone=r);let o={timeZoneName:e,...s},a=new Intl.DateTimeFormat(n,o).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Xe(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);let r=parseInt(e,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function rr(t){let e=Number(t);if(typeof t=="boolean"||t===""||!Number.isFinite(e))throw new C(`Invalid unit value ${t}`);return e}function He(t,e){let n={};for(let r in t)if(de(t,r)){let i=t[r];if(i==null)continue;n[e(r)]=rr(i)}return n}function Oe(t,e){let n=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),i=t>=0?"+":"-";switch(e){case"short":return`${i}${N(n,2)}:${N(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${N(n,2)}${N(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Qe(t){return hi(t,["hour","minute","second","millisecond"])}var gi=["January","February","March","April","May","June","July","August","September","October","November","December"],ir=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],yi=["J","F","M","A","M","J","J","A","S","O","N","D"];function sr(t){switch(t){case"narrow":return[...yi];case"short":return[...ir];case"long":return[...gi];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 or=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ar=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],pi=["M","T","W","T","F","S","S"];function lr(t){switch(t){case"narrow":return[...pi];case"short":return[...ar];case"long":return[...or];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var ur=["AM","PM"],bi=["Before Christ","Anno Domini"],wi=["BC","AD"],Si=["B","A"];function cr(t){switch(t){case"narrow":return[...Si];case"short":return[...wi];case"long":return[...bi];default:return null}}function Ti(t){return ur[t.hour<12?0:1]}function xi(t,e){return lr(e)[t.weekday-1]}function ki(t,e){return sr(e)[t.month-1]}function vi(t,e){return cr(e)[t.year<0?0:1]}function Oi(t,e,n="always",r=!1){let i={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(n==="auto"&&s){let m=t==="days";switch(e){case 1:return m?"tomorrow":`next ${i[t][0]}`;case-1:return m?"yesterday":`last ${i[t][0]}`;case 0:return m?"today":`this ${i[t][0]}`}}let o=Object.is(e,-0)||e<0,a=Math.abs(e),l=a===1,u=i[t],c=r?l?u[1]:u[2]||u[1]:l?i[t][0]:t;return o?`${a} ${c} ago`:`in ${a} ${c}`}function mn(t,e){let n="";for(let r of t)r.literal?n+=r.val:n+=e(r.val);return n}var Ni={D:_e,DD:Mn,DDD:Dn,DDDD:Cn,t:En,tt:In,ttt:Fn,tttt:An,T:Wn,TT:Rn,TTT:Pn,TTTT:Ln,f:qn,ff:Bn,fff:$n,ffff:Zn,F:Vn,FF:zn,FFF:_n,FFFF:Un},I=class t{static create(e,n={}){return new t(e,n)}static parseFormat(e){let n=null,r="",i=!1,s=[];for(let o=0;o<e.length;o++){let a=e.charAt(o);a==="'"?((r.length>0||i)&&s.push({literal:i||/^\s+$/.test(r),val:r===""?"'":r}),n=null,r="",i=!i):i||a===n?r+=a:(r.length>0&&s.push({literal:/^\s+$/.test(r),val:r}),r=a,n=a)}return r.length>0&&s.push({literal:i||/^\s+$/.test(r),val:r}),s}static macroTokenToFormatOpts(e){return Ni[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0,r=void 0){if(this.opts.forceSimple)return N(e,n);let i={...this.opts};return n>0&&(i.padTo=n),r&&(i.signDisplay=r),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,n){let r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(f,g)=>this.loc.extract(e,f,g),o=f=>e.isOffsetFixed&&e.offset===0&&f.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,f.format):"",a=()=>r?Ti(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,g)=>r?ki(e,f):s(g?{month:f}:{month:f,day:"numeric"},"month"),u=(f,g)=>r?xi(e,f):s(g?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),c=f=>{let g=t.macroTokenToFormatOpts(f);return g?this.formatWithSystemDefault(e,g):f},m=f=>r?vi(e,f):s({era:f},"era"),d=f=>{switch(f){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 o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({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 a();case"d":return i?s({day:"numeric"},"day"):this.num(e.day);case"dd":return i?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return i?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return i?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?s({month:"numeric"},"month"):this.num(e.month);case"MM":return i?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?s({year:"numeric"},"year"):this.num(e.year);case"yy":return i?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return i?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return i?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return m("short");case"GG":return m("long");case"GGGGG":return m("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"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);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 c(f)}};return mn(t.parseFormat(n),d)}formatDurationFromString(e,n){let r=this.opts.signMode==="negativeLargestOnly"?-1:1,i=c=>{switch(c[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},s=(c,m)=>d=>{let f=i(d);if(f){let g=m.isNegativeDuration&&f!==m.largestUnit?r:1,p;return this.opts.signMode==="negativeLargestOnly"&&f!==m.largestUnit?p="never":this.opts.signMode==="all"?p="always":p="auto",this.num(c.get(f)*g,d.length,p)}else return d},o=t.parseFormat(n),a=o.reduce((c,{literal:m,val:d})=>m?c:c.concat(d),[]),l=e.shiftTo(...a.map(i).filter(c=>c)),u={isNegativeDuration:l<0,largestUnit:Object.keys(l.values)[0]};return mn(o,s(l,u))}},fr=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ge(...t){let e=t.reduce((n,r)=>n+r.source,"");return RegExp(`^${e}$`)}function ye(...t){return e=>t.reduce(([n,r,i],s)=>{let[o,a,l]=s(e,i);return[{...n,...o},a||r,l]},[{},null,1]).slice(0,2)}function pe(t,...e){if(t==null)return[null,null];for(let[n,r]of e){let i=n.exec(t);if(i)return r(i)}return[null,null]}function mr(...t){return(e,n)=>{let r={},i;for(i=0;i<t.length;i++)r[t[i]]=j(e[n+i]);return[r,null,n+i]}}var hr=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Mi=`(?:${hr.source}?(?:\\[(${fr.source})\\])?)?`,Bt=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,dr=RegExp(`${Bt.source}${Mi}`),zt=RegExp(`(?:[Tt]${dr.source})?`),Di=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ci=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Ei=/(\d{4})-?(\d{3})/,Ii=mr("weekYear","weekNumber","weekDay"),Fi=mr("year","ordinal"),Ai=/(\d{4})-(\d\d)-(\d\d)/,gr=RegExp(`${Bt.source} ?(?:${hr.source}|(${fr.source}))?`),Wi=RegExp(`(?: ${gr.source})?`);function me(t,e,n){let r=t[e];return y(r)?n:j(r)}function Ri(t,e){return[{year:me(t,e),month:me(t,e+1,1),day:me(t,e+2,1)},null,e+3]}function be(t,e){return[{hours:me(t,e,0),minutes:me(t,e+1,0),seconds:me(t,e+2,0),milliseconds:qt(t[e+3])},null,e+4]}function De(t,e){let n=!t[e]&&!t[e+1],r=Xe(t[e+1],t[e+2]),i=n?null:q.instance(r);return[{},i,e+3]}function Ce(t,e){let n=t[e]?K.create(t[e]):null;return[{},n,e+1]}var Pi=RegExp(`^T?${Bt.source}$`),Li=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function qi(t){let[e,n,r,i,s,o,a,l,u]=t,c=e[0]==="-",m=l&&l[0]==="-",d=(f,g=!1)=>f!==void 0&&(g||f&&c)?-f:f;return[{years:d(te(n)),months:d(te(r)),weeks:d(te(i)),days:d(te(s)),hours:d(te(o)),minutes:d(te(a)),seconds:d(te(l),l==="-0"),milliseconds:d(qt(u),m)}]}var Vi={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function $t(t,e,n,r,i,s,o){let a={year:e.length===2?At(j(e)):j(e),month:ir.indexOf(n)+1,day:j(r),hour:j(i),minute:j(s)};return o&&(a.second=j(o)),t&&(a.weekday=t.length>3?or.indexOf(t)+1:ar.indexOf(t)+1),a}var Bi=/^(?:(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 zi(t){let[,e,n,r,i,s,o,a,l,u,c,m]=t,d=$t(e,i,r,n,s,o,a),f;return l?f=Vi[l]:u?f=0:f=Xe(c,m),[d,new q(f)]}function $i(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var _i=/^(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$/,Zi=/^(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$/,Ui=/^(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 hn(t){let[,e,n,r,i,s,o,a]=t;return[$t(e,i,r,n,s,o,a),q.utcInstance]}function Yi(t){let[,e,n,r,i,s,o,a]=t;return[$t(e,a,n,r,i,s,o),q.utcInstance]}var Hi=ge(Di,zt),Gi=ge(Ci,zt),ji=ge(Ei,zt),Ji=ge(dr),yr=ye(Ri,be,De,Ce),Xi=ye(Ii,be,De,Ce),Qi=ye(Fi,be,De,Ce),Ki=ye(be,De,Ce);function es(t){return pe(t,[Hi,yr],[Gi,Xi],[ji,Qi],[Ji,Ki])}function ts(t){return pe($i(t),[Bi,zi])}function ns(t){return pe(t,[_i,hn],[Zi,hn],[Ui,Yi])}function rs(t){return pe(t,[Li,qi])}var is=ye(be);function ss(t){return pe(t,[Pi,is])}var os=ge(Ai,Wi),as=ge(gr),ls=ye(be,De,Ce);function us(t){return pe(t,[os,yr],[as,ls])}var dn="Invalid Duration",pr={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},cs={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:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...pr},R=146097/400,ae=146097/4800,fs={years:{quarters:4,months:12,weeks:R/7,days:R,hours:R*24,minutes:R*24*60,seconds:R*24*60*60,milliseconds:R*24*60*60*1e3},quarters:{months:3,weeks:R/28,days:R/4,hours:R*24/4,minutes:R*24*60/4,seconds:R*24*60*60/4,milliseconds:R*24*60*60*1e3/4},months:{weeks:ae/7,days:ae,hours:ae*24,minutes:ae*24*60,seconds:ae*24*60*60,milliseconds:ae*24*60*60*1e3},...pr},re=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],ms=re.slice(0).reverse();function U(t,e,n=!1){let r={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new E(r)}function br(t,e){let n=e.milliseconds??0;for(let r of ms.slice(1))e[r]&&(n+=e[r]*t[r].milliseconds);return n}function gn(t,e){let n=br(t,e)<0?-1:1;re.reduceRight((r,i)=>{if(y(e[i]))return r;if(r){let s=e[r]*n,o=t[i][r],a=Math.floor(s/o);e[i]+=a*n,e[r]-=a*o*n}return i},null),re.reduce((r,i)=>{if(y(e[i]))return r;if(r){let s=e[r]%1;e[r]-=s,e[i]+=s*t[r][i]}return i},null)}function yn(t){let e={};for(let[n,r]of Object.entries(t))r!==0&&(e[n]=r);return e}var E=class t{constructor(e){let n=e.conversionAccuracy==="longterm"||!1,r=n?fs:cs;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||S.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,n){return t.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new C(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new t({values:He(e,t.normalizeUnit),loc:S.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(Q(e))return t.fromMillis(e);if(t.isDuration(e))return e;if(typeof e=="object")return t.fromObject(e);throw new C(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){let[r]=rs(e);return r?t.fromObject(r,n):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){let[r]=ss(e);return r?t.fromObject(r,n):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new C("need to specify a reason the Duration is invalid");let r=e instanceof F?e:new F(e,n);if(O.throwOnInvalid)throw new wt(r);return new t({invalid:r})}static normalizeUnit(e){let n={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(!n)throw new $e(e);return n}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,n={}){let r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?I.create(this.loc,r).formatDurationFromString(this,e):dn}toHuman(e={}){if(!this.isValid)return dn;let n=e.showZeros!==!1,r=re.map(i=>{let s=this.values[i];return y(s)||s===0&&!n?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).filter(i=>i);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+=Vt(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},T.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?br(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let n=t.fromDurationLike(e),r={};for(let i of re)(de(n.values,i)||de(this.values,i))&&(r[i]=n.get(i)+this.get(i));return U(this,{values:r},!0)}minus(e){if(!this.isValid)return this;let n=t.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;let n={};for(let r of Object.keys(this.values))n[r]=rr(e(this.values[r],r));return U(this,{values:n},!0)}get(e){return this[t.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let n={...this.values,...He(e,t.normalizeUnit)};return U(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:r,matrix:i}={}){let o={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:i,conversionAccuracy:r};return U(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return gn(this.matrix,e),U(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=yn(this.normalize().shiftToAll().toObject());return U(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>t.normalizeUnit(o));let n={},r={},i=this.toObject(),s;for(let o of re)if(e.indexOf(o)>=0){s=o;let a=0;for(let u in r)a+=this.matrix[u][o]*r[u],r[u]=0;Q(i[o])&&(a+=i[o]);let l=Math.trunc(a);n[o]=l,r[o]=(a*1e3-l*1e3)/1e3}else Q(i[o])&&(r[o]=i[o]);for(let o in r)r[o]!==0&&(n[s]+=o===s?r[o]:r[o]/this.matrix[s][o]);return gn(this.matrix,n),U(this,{values:n},!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 n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return U(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;let e=yn(this.values);return U(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 n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(let r of re)if(!n(this.values[r],e.values[r]))return!1;return!0}},le="Invalid Interval";function hs(t,e){return!t||!t.isValid?he.invalid("missing or invalid start"):!e||!e.isValid?he.invalid("missing or invalid end"):e<t?he.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}var he=class t{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new C("need to specify a reason the Interval is invalid");let r=e instanceof F?e:new F(e,n);if(O.throwOnInvalid)throw new bt(r);return new t({invalid:r})}static fromDateTimes(e,n){let r=Te(e),i=Te(n),s=hs(r,i);return s??new t({start:r,end:i})}static after(e,n){let r=E.fromDurationLike(n),i=Te(e);return t.fromDateTimes(i,i.plus(r))}static before(e,n){let r=E.fromDurationLike(n),i=Te(e);return t.fromDateTimes(i.minus(r),i)}static fromISO(e,n){let[r,i]=(e||"").split("/",2);if(r&&i){let s,o;try{s=T.fromISO(r,n),o=s.isValid}catch{o=!1}let a,l;try{a=T.fromISO(i,n),l=a.isValid}catch{l=!1}if(o&&l)return t.fromDateTimes(s,a);if(o){let u=E.fromISO(i,n);if(u.isValid)return t.after(s,u)}else if(l){let u=E.fromISO(r,n);if(u.isValid)return t.before(a,u)}}return t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;let r=this.start.startOf(e,n),i;return n?.useLocaleWeeks?i=this.end.reconfigure({locale:r.locale}):i=this.end,i=i.startOf(e,n),Math.floor(i.diff(r,e).get(e))+(i.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!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:n}={}){return this.isValid?t.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];let n=e.map(Te).filter(o=>this.contains(o)).sort((o,a)=>o.toMillis()-a.toMillis()),r=[],{s:i}=this,s=0;for(;i<this.e;){let o=n[s]||this.e,a=+o>+this.e?this.e:o;r.push(t.fromDateTimes(i,a)),i=a,s+=1}return r}splitBy(e){let n=E.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,s,o=[];for(;r<this.e;){let a=this.start.plus(n.mapUnits(l=>l*i));s=+a>+this.e?this.e:a,o.push(t.fromDateTimes(r,s)),r=s,i+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=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 n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:t.fromDateTimes(n,r)}union(e){if(!this.isValid)return this;let n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return t.fromDateTimes(n,r)}static merge(e){let[n,r]=e.sort((i,s)=>i.s-s.s).reduce(([i,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[i,s.union(o)]:[i.concat([s]),o]:[i,o],[[],null]);return r&&n.push(r),n}static xor(e){let n=null,r=0,i=[],s=e.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...s),a=o.sort((l,u)=>l.time-u.time);for(let l of a)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&i.push(t.fromDateTimes(n,l.time)),n=null);return t.merge(i)}difference(...e){return t.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:le}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=_e,n={}){return this.isValid?I.create(this.s.loc.clone(n),e).formatInterval(this):le}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:le}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:le}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:le}toFormat(e,{separator:n=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:le}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):E.invalid(this.invalidReason)}mapEndpoints(e){return t.fromDateTimes(e(this.s),e(this.e))}},ce=class{static hasDST(e=O.defaultZone){let n=T.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return K.isValidZone(e)}static normalizeZone(e){return J(e,O.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||S.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||S.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||S.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:s="gregory"}={}){return(i||S.create(n,r,s)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:s="gregory"}={}){return(i||S.create(n,r,s)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||S.create(n,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||S.create(n,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return S.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return S.create(n,null,"gregory").eras(e)}static features(){return{relative:er(),localeWeek:tr()}}};function pn(t,e){let n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(E.fromMillis(r).as("days"))}function ds(t,e,n){let r=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{let c=pn(l,u);return(c-c%7)/7}],["days",pn]],i={},s=t,o,a;for(let[l,u]of r)n.indexOf(l)>=0&&(o=l,i[l]=u(t,e),a=s.plus(i),a>e?(i[l]--,t=s.plus(i),t>e&&(a=t,i[l]--,t=s.plus(i))):t=a);return[t,i,a,o]}function gs(t,e,n,r){let[i,s,o,a]=ds(t,e,n),l=e-i,u=n.filter(m=>["hours","minutes","seconds","milliseconds"].indexOf(m)>=0);u.length===0&&(o<e&&(o=i.plus({[a]:1})),o!==i&&(s[a]=(s[a]||0)+l/(o-i)));let c=E.fromObject(s,r);return u.length>0?E.fromMillis(l,r).shiftTo(...u).plus(c):c}var ys="missing Intl.DateTimeFormat.formatToParts support";function w(t,e=n=>n){return{regex:t,deser:([n])=>e(oi(n))}}var ps="\xA0",wr=`[ ${ps}]`,Sr=new RegExp(wr,"g");function bs(t){return t.replace(/\./g,"\\.?").replace(Sr,wr)}function bn(t){return t.replace(/\./g,"").replace(Sr," ").toLowerCase()}function z(t,e){return t===null?null:{regex:RegExp(t.map(bs).join("|")),deser:([n])=>t.findIndex(r=>bn(n)===bn(r))+e}}function wn(t,e){return{regex:t,deser:([,n,r])=>Xe(n,r),groups:e}}function Pe(t){return{regex:t,deser:([e])=>e}}function ws(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ss(t,e){let n=B(e),r=B(e,"{2}"),i=B(e,"{3}"),s=B(e,"{4}"),o=B(e,"{6}"),a=B(e,"{1,2}"),l=B(e,"{1,3}"),u=B(e,"{1,6}"),c=B(e,"{1,9}"),m=B(e,"{2,4}"),d=B(e,"{4,6}"),f=k=>({regex:RegExp(ws(k.val)),deser:([M])=>M,literal:!0}),p=(k=>{if(t.literal)return f(k);switch(k.val){case"G":return z(e.eras("short"),0);case"GG":return z(e.eras("long"),0);case"y":return w(u);case"yy":return w(m,At);case"yyyy":return w(s);case"yyyyy":return w(d);case"yyyyyy":return w(o);case"M":return w(a);case"MM":return w(r);case"MMM":return z(e.months("short",!0),1);case"MMMM":return z(e.months("long",!0),1);case"L":return w(a);case"LL":return w(r);case"LLL":return z(e.months("short",!1),1);case"LLLL":return z(e.months("long",!1),1);case"d":return w(a);case"dd":return w(r);case"o":return w(l);case"ooo":return w(i);case"HH":return w(r);case"H":return w(a);case"hh":return w(r);case"h":return w(a);case"mm":return w(r);case"m":return w(a);case"q":return w(a);case"qq":return w(r);case"s":return w(a);case"ss":return w(r);case"S":return w(l);case"SSS":return w(i);case"u":return Pe(c);case"uu":return Pe(a);case"uuu":return w(n);case"a":return z(e.meridiems(),0);case"kkkk":return w(s);case"kk":return w(m,At);case"W":return w(a);case"WW":return w(r);case"E":case"c":return w(n);case"EEE":return z(e.weekdays("short",!1),1);case"EEEE":return z(e.weekdays("long",!1),1);case"ccc":return z(e.weekdays("short",!0),1);case"cccc":return z(e.weekdays("long",!0),1);case"Z":case"ZZ":return wn(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return wn(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Pe(/[a-z_+-/]{1,256}?/i);case" ":return Pe(/[^\S\n\r]/);default:return f(k)}})(t)||{invalidReason:ys};return p.token=t,p}var Ts={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 xs(t,e,n){let{type:r,value:i}=t;if(r==="literal"){let l=/^\s+$/.test(i);return{literal:!l,val:l?" ":i}}let s=e[r],o=r;r==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=n.hour12?"hour12":"hour24");let a=Ts[o];if(typeof a=="object"&&(a=a[s]),a)return{literal:!1,val:a}}function ks(t){return[`^${t.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,t]}function vs(t,e,n){let r=t.match(e);if(r){let i={},s=1;for(let o in n)if(de(n,o)){let a=n[o],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(s,s+l))),s+=l}return[r,i]}else return[r,{}]}function Os(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}},n=null,r;return y(t.z)||(n=K.create(t.z)),y(t.Z)||(n||(n=new q(t.Z)),r=t.Z),y(t.q)||(t.M=(t.q-1)*3+1),y(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),y(t.u)||(t.S=qt(t.u)),[Object.keys(t).reduce((s,o)=>{let a=e(o);return a&&(s[a]=t[o]),s},{}),n,r]}var mt=null;function Ns(){return mt||(mt=T.fromMillis(1555555555555)),mt}function Ms(t,e){if(t.literal)return t;let n=I.macroTokenToFormatOpts(t.val),r=kr(n,e);return r==null||r.includes(void 0)?t:r}function Tr(t,e){return Array.prototype.concat(...t.map(n=>Ms(n,e)))}var Ge=class{constructor(e,n){if(this.locale=e,this.format=n,this.tokens=Tr(I.parseFormat(n),e),this.units=this.tokens.map(r=>Ss(r,e)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){let[r,i]=ks(this.units);this.regex=RegExp(r,"i"),this.handlers=i}}explainFromTokens(e){if(this.isValid){let[n,r]=vs(e,this.regex,this.handlers),[i,s,o]=r?Os(r):[null,null,void 0];if(de(r,"a")&&de(r,"H"))throw new X("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:i,zone:s,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function xr(t,e,n){return new Ge(t,n).explainFromTokens(e)}function Ds(t,e,n){let{result:r,zone:i,specificOffset:s,invalidReason:o}=xr(t,e,n);return[r,i,s,o]}function kr(t,e){if(!t)return null;let r=I.create(e,t).dtFormatter(Ns()),i=r.formatToParts(),s=r.resolvedOptions();return i.map(o=>xs(o,t,s))}var ht="Invalid DateTime",Sn=864e13;function ke(t){return new F("unsupported zone",`the zone "${t.name}" is not supported`)}function dt(t){return t.weekData===null&&(t.weekData=Ue(t.c)),t.weekData}function gt(t){return t.localWeekData===null&&(t.localWeekData=Ue(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function ne(t,e){let n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new T({...n,...e,old:n})}function vr(t,e,n){let r=t-e*60*1e3,i=n.offset(r);if(e===i)return[r,e];r-=(i-e)*60*1e3;let s=n.offset(r);return i===s?[r,i]:[t-Math.min(i,s)*60*1e3,Math.max(i,s)]}function Le(t,e){t+=e*60*1e3;let n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Ve(t,e,n){return vr(Je(t),e,n)}function Tn(t,e){let n=t.o,r=t.c.year+Math.trunc(e.years),i=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...t.c,year:r,month:i,day:Math.min(t.c.day,Ye(r,i))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=E.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"),a=Je(s),[l,u]=vr(a,n,t.zone);return o!==0&&(l+=o,u=t.zone.offset(l)),{ts:l,o:u}}function ue(t,e,n,r,i,s){let{setZone:o,zone:a}=n;if(t&&Object.keys(t).length!==0||e){let l=e||a,u=T.fromObject(t,{...n,zone:l,specificOffset:s});return o?u:u.setZone(a)}else return T.invalid(new F("unparsable",`the input "${i}" can't be parsed as ${r}`))}function qe(t,e,n=!0){return t.isValid?I.create(S.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function yt(t,e,n){let r=t.c.year>9999||t.c.year<0,i="";if(r&&t.c.year>=0&&(i+="+"),i+=N(t.c.year,r?6:4),n==="year")return i;if(e){if(i+="-",i+=N(t.c.month),n==="month")return i;i+="-"}else if(i+=N(t.c.month),n==="month")return i;return i+=N(t.c.day),i}function xn(t,e,n,r,i,s,o){let a=!n||t.c.millisecond!==0||t.c.second!==0,l="";switch(o){case"day":case"month":case"year":break;default:if(l+=N(t.c.hour),o==="hour")break;if(e){if(l+=":",l+=N(t.c.minute),o==="minute")break;a&&(l+=":",l+=N(t.c.second))}else{if(l+=N(t.c.minute),o==="minute")break;a&&(l+=N(t.c.second))}if(o==="second")break;a&&(!r||t.c.millisecond!==0)&&(l+=".",l+=N(t.c.millisecond,3))}return i&&(t.isOffsetFixed&&t.offset===0&&!s?l+="Z":t.o<0?(l+="-",l+=N(Math.trunc(-t.o/60)),l+=":",l+=N(Math.trunc(-t.o%60))):(l+="+",l+=N(Math.trunc(t.o/60)),l+=":",l+=N(Math.trunc(t.o%60)))),s&&(l+="["+t.zone.ianaName+"]"),l}var Or={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Cs={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Es={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Be=["year","month","day","hour","minute","second","millisecond"],Is=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Fs=["year","ordinal","hour","minute","second","millisecond"];function ze(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 $e(t);return e}function kn(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return ze(t)}}function As(t){if(ve===void 0&&(ve=O.now()),t.type!=="iana")return t.offset(ve);let e=t.name,n=Wt.get(e);return n===void 0&&(n=t.offset(ve),Wt.set(e,n)),n}function vn(t,e){let n=J(e.zone,O.defaultZone);if(!n.isValid)return T.invalid(ke(n));let r=S.fromObject(e),i,s;if(y(t.year))i=O.now();else{for(let l of Be)y(t[l])&&(t[l]=Or[l]);let o=Qn(t)||Kn(t);if(o)return T.invalid(o);let a=As(n);[i,s]=Ve(t,a,n)}return new T({ts:i,zone:n,loc:r,o:s})}function On(t,e,n){let r=y(n.round)?!0:n.round,i=y(n.rounding)?"trunc":n.rounding,s=(a,l)=>(a=Vt(a,r||n.calendary?0:2,n.calendary?"round":i),e.loc.clone(n).relFormatter(n).format(a,l)),o=a=>n.calendary?e.hasSame(t,a)?0:e.startOf(a).diff(t.startOf(a),a).get(a):e.diff(t,a).get(a);if(n.unit)return s(o(n.unit),n.unit);for(let a of n.units){let l=o(a);if(Math.abs(l)>=1)return s(l,a)}return s(t>e?-0:0,n.units[n.units.length-1])}function Nn(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}var ve,Wt=new Map,T=class t{constructor(e){let n=e.zone||O.defaultZone,r=e.invalid||(Number.isNaN(e.ts)?new F("invalid input"):null)||(n.isValid?null:ke(n));this.ts=y(e.ts)?O.now():e.ts;let i=null,s=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[i,s]=[e.old.c,e.old.o];else{let a=Q(e.o)&&!e.old?e.o:n.offset(this.ts);i=Le(this.ts,a),r=Number.isNaN(i.year)?new F("invalid input"):null,i=r?null:i,s=r?null:a}this._zone=n,this.loc=e.loc||S.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=i,this.o=s,this.isLuxonDateTime=!0}static now(){return new t({})}static local(){let[e,n]=Nn(arguments),[r,i,s,o,a,l,u]=n;return vn({year:r,month:i,day:s,hour:o,minute:a,second:l,millisecond:u},e)}static utc(){let[e,n]=Nn(arguments),[r,i,s,o,a,l,u]=n;return e.zone=q.utcInstance,vn({year:r,month:i,day:s,hour:o,minute:a,second:l,millisecond:u},e)}static fromJSDate(e,n={}){let r=fi(e)?e.valueOf():NaN;if(Number.isNaN(r))return t.invalid("invalid input");let i=J(n.zone,O.defaultZone);return i.isValid?new t({ts:r,zone:i,loc:S.fromObject(n)}):t.invalid(ke(i))}static fromMillis(e,n={}){if(Q(e))return e<-Sn||e>Sn?t.invalid("Timestamp out of range"):new t({ts:e,zone:J(n.zone,O.defaultZone),loc:S.fromObject(n)});throw new C(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(Q(e))return new t({ts:e*1e3,zone:J(n.zone,O.defaultZone),loc:S.fromObject(n)});throw new C("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};let r=J(n.zone,O.defaultZone);if(!r.isValid)return t.invalid(ke(r));let i=S.fromObject(n),s=He(e,kn),{minDaysInFirstWeek:o,startOfWeek:a}=un(s,i),l=O.now(),u=y(n.specificOffset)?r.offset(l):n.specificOffset,c=!y(s.ordinal),m=!y(s.year),d=!y(s.month)||!y(s.day),f=m||d,g=s.weekYear||s.weekNumber;if((f||c)&&g)throw new X("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&c)throw new X("Can't mix ordinal dates with month/day");let p=g||s.weekday&&!f,k,M,D=Le(l,u);p?(k=Is,M=Cs,D=Ue(D,o,a)):c?(k=Fs,M=Es,D=ft(D)):(k=Be,M=Or);let v=!1;for(let V of k){let Ae=s[V];y(Ae)?v?s[V]=M[V]:s[V]=D[V]:v=!0}let Z=p?li(s,o,a):c?ui(s):Qn(s),ee=Z||Kn(s);if(ee)return t.invalid(ee);let oe=p?an(s,o,a):c?ln(s):s,[H,G]=Ve(oe,u,r),W=new t({ts:H,zone:r,o:G,loc:i});return s.weekday&&f&&e.weekday!==W.weekday?t.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${W.toISO()}`):W.isValid?W:t.invalid(W.invalid)}static fromISO(e,n={}){let[r,i]=es(e);return ue(r,i,n,"ISO 8601",e)}static fromRFC2822(e,n={}){let[r,i]=ts(e);return ue(r,i,n,"RFC 2822",e)}static fromHTTP(e,n={}){let[r,i]=ns(e);return ue(r,i,n,"HTTP",n)}static fromFormat(e,n,r={}){if(y(e)||y(n))throw new C("fromFormat requires an input string and a format");let{locale:i=null,numberingSystem:s=null}=r,o=S.fromOpts({locale:i,numberingSystem:s,defaultToEN:!0}),[a,l,u,c]=Ds(o,e,n);return c?t.invalid(c):ue(a,l,r,`format ${n}`,e,u)}static fromString(e,n,r={}){return t.fromFormat(e,n,r)}static fromSQL(e,n={}){let[r,i]=us(e);return ue(r,i,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new C("need to specify a reason the DateTime is invalid");let r=e instanceof F?e:new F(e,n);if(O.throwOnInvalid)throw new pt(r);return new t({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){let r=kr(e,S.fromObject(n));return r?r.map(i=>i?i.val:null).join(""):null}static expandFormat(e,n={}){return Tr(I.parseFormat(e),S.fromObject(n)).map(i=>i.val).join("")}static resetCache(){ve=void 0,Wt.clear()}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?dt(this).weekYear:NaN}get weekNumber(){return this.isValid?dt(this).weekNumber:NaN}get weekday(){return this.isValid?dt(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?gt(this).weekday:NaN}get localWeekNumber(){return this.isValid?gt(this).weekNumber:NaN}get localWeekYear(){return this.isValid?gt(this).weekYear:NaN}get ordinal(){return this.isValid?ft(this.c).ordinal:NaN}get monthShort(){return this.isValid?ce.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ce.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ce.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ce.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,n=6e4,r=Je(this.c),i=this.zone.offset(r-e),s=this.zone.offset(r+e),o=this.zone.offset(r-i*n),a=this.zone.offset(r-s*n);if(o===a)return[this];let l=r-o*n,u=r-a*n,c=Le(l,o),m=Le(u,a);return c.hour===m.hour&&c.minute===m.minute&&c.second===m.second&&c.millisecond===m.millisecond?[ne(this,{ts:l}),ne(this,{ts:u})]:[this]}get isInLeapYear(){return Me(this.year)}get daysInMonth(){return Ye(this.year,this.month)}get daysInYear(){return this.isValid?fe(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ne(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ne(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:n,numberingSystem:r,calendar:i}=I.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(e=0,n={}){return this.setZone(q.instance(e),n)}toLocal(){return this.setZone(O.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(e=J(e,O.defaultZone),e.equals(this.zone))return this;if(e.isValid){let i=this.ts;if(n||r){let s=e.offset(this.ts),o=this.toObject();[i]=Ve(o,s,e)}return ne(this,{ts:i,zone:e})}else return t.invalid(ke(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:r}={}){let i=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:r});return ne(this,{loc:i})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let n=He(e,kn),{minDaysInFirstWeek:r,startOfWeek:i}=un(n,this.loc),s=!y(n.weekYear)||!y(n.weekNumber)||!y(n.weekday),o=!y(n.ordinal),a=!y(n.year),l=!y(n.month)||!y(n.day),u=a||l,c=n.weekYear||n.weekNumber;if((u||o)&&c)throw new X("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new X("Can't mix ordinal dates with month/day");let m;s?m=an({...Ue(this.c,r,i),...n},r,i):y(n.ordinal)?(m={...this.toObject(),...n},y(n.day)&&(m.day=Math.min(Ye(m.year,m.month),m.day))):m=ln({...ft(this.c),...n});let[d,f]=Ve(m,this.o,this.zone);return ne(this,{ts:d,o:f})}plus(e){if(!this.isValid)return this;let n=E.fromDurationLike(e);return ne(this,Tn(this,n))}minus(e){if(!this.isValid)return this;let n=E.fromDurationLike(e).negate();return ne(this,Tn(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;let r={},i=E.normalizeUnit(e);switch(i){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(i==="weeks")if(n){let s=this.loc.getStartOfWeek(),{weekday:o}=this;o<s&&(r.weekNumber=this.weekNumber-1),r.weekday=s}else r.weekday=1;if(i==="quarters"){let s=Math.ceil(this.month/3);r.month=(s-1)*3+1}return this.set(r)}endOf(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?I.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):ht}toLocaleString(e=_e,n={}){return this.isValid?I.create(this.loc.clone(n),e).formatDateTime(this):ht}toLocaleParts(e={}){return this.isValid?I.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:s=!1,precision:o="milliseconds"}={}){if(!this.isValid)return null;o=ze(o);let a=e==="extended",l=yt(this,a,o);return Be.indexOf(o)>=3&&(l+="T"),l+=xn(this,a,n,r,i,s,o),l}toISODate({format:e="extended",precision:n="day"}={}){return this.isValid?yt(this,e==="extended",ze(n)):null}toISOWeekDate(){return qe(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:s=!1,format:o="extended",precision:a="milliseconds"}={}){return this.isValid?(a=ze(a),(i&&Be.indexOf(a)>=3?"T":"")+xn(this,o==="extended",n,e,r,s,a)):null}toRFC2822(){return qe(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return qe(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?yt(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||e)&&(r&&(i+=" "),n?i+="z":e&&(i+="ZZ")),qe(this,i,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ht}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}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 n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",r={}){if(!this.isValid||!e.isValid)return E.invalid("created by diffing an invalid DateTime");let i={locale:this.locale,numberingSystem:this.numberingSystem,...r},s=mi(n).map(E.normalizeUnit),o=e.valueOf()>this.valueOf(),a=o?this:e,l=o?e:this,u=gs(a,l,s,i);return o?u.negate():u}diffNow(e="milliseconds",n={}){return this.diff(t.now(),e,n)}until(e){return this.isValid?he.fromDateTimes(this,e):this}hasSame(e,n,r){if(!this.isValid)return!1;let i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(n,r)<=i&&i<=s.endOf(n,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 n=e.base||t.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0,i=["years","months","days","hours","minutes","seconds"],s=e.unit;return Array.isArray(e.unit)&&(i=e.unit,s=void 0),On(n,this.plus(r),{...e,numeric:"always",units:i,unit:s})}toRelativeCalendar(e={}){return this.isValid?On(e.base||t.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(t.isDateTime))throw new C("min requires all arguments be DateTimes");return cn(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(t.isDateTime))throw new C("max requires all arguments be DateTimes");return cn(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,r={}){let{locale:i=null,numberingSystem:s=null}=r,o=S.fromOpts({locale:i,numberingSystem:s,defaultToEN:!0});return xr(o,e,n)}static fromStringExplain(e,n,r={}){return t.fromFormatExplain(e,n,r)}static buildFormatParser(e,n={}){let{locale:r=null,numberingSystem:i=null}=n,s=S.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return new Ge(s,e)}static fromFormatParser(e,n,r={}){if(y(e)||y(n))throw new C("fromFormatParser requires an input string and a format parser");let{locale:i=null,numberingSystem:s=null}=r,o=S.fromOpts({locale:i,numberingSystem:s,defaultToEN:!0});if(!o.equals(n.locale))throw new C(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`);let{result:a,zone:l,specificOffset:u,invalidReason:c}=n.explainFromTokens(e);return c?t.invalid(c):ue(a,l,r,`format ${n.format}`,e,u)}static get DATE_SHORT(){return _e}static get DATE_MED(){return Mn}static get DATE_MED_WITH_WEEKDAY(){return _r}static get DATE_FULL(){return Dn}static get DATE_HUGE(){return Cn}static get TIME_SIMPLE(){return En}static get TIME_WITH_SECONDS(){return In}static get TIME_WITH_SHORT_OFFSET(){return Fn}static get TIME_WITH_LONG_OFFSET(){return An}static get TIME_24_SIMPLE(){return Wn}static get TIME_24_WITH_SECONDS(){return Rn}static get TIME_24_WITH_SHORT_OFFSET(){return Pn}static get TIME_24_WITH_LONG_OFFSET(){return Ln}static get DATETIME_SHORT(){return qn}static get DATETIME_SHORT_WITH_SECONDS(){return Vn}static get DATETIME_MED(){return Bn}static get DATETIME_MED_WITH_SECONDS(){return zn}static get DATETIME_MED_WITH_WEEKDAY(){return Zr}static get DATETIME_FULL(){return $n}static get DATETIME_FULL_WITH_SECONDS(){return _n}static get DATETIME_HUGE(){return Zn}static get DATETIME_HUGE_WITH_SECONDS(){return Un}};function Te(t){if(T.isDateTime(t))return t;if(t&&t.valueOf&&Q(t.valueOf()))return T.fromJSDate(t);if(t&&typeof t=="object")return T.fromObject(t);throw new C(`Unknown datetime argument: ${t}, of type ${typeof t}`)}function se(t,e){return t.length?typeof t[0]=="number"?t:t.map(e??(n=>n.close)):[]}function Ke(t,e,n){let r=se(t,n),i=new Array(r.length),s=0,o=0;for(let a=0;a<r.length;a++){let l=r[a];if(isNaN(l)||(s+=l,o++),a>=e){let u=r[a-e];isNaN(u)||(s-=u,o--)}i[a]=o>=e?s/e:NaN}return i}function Ee(t,e,n){let r=se(t,n),i=2/(e+1),s=new Array(r.length),o=NaN;for(let a=0;a<r.length;a++){let l=r[a];o=isNaN(o)?l:l*i+o*(1-i),s[a]=o}return s}function et(t,e,n){let r=se(t,n),i=new Array(r.length).fill(NaN),s=e*(e+1)/2;for(let o=e-1;o<r.length;o++){let a=0;for(let l=0;l<e;l++)a+=r[o-l]*(e-l);i[o]=a/s}return i}function Ws(t,e,n){let r=se(t,n),i=Math.floor(e/2),s=Math.round(Math.sqrt(e)),o=et(r,i),a=et(r,e),l=r.map((u,c)=>2*o[c]-a[c]);return et(l,s)}function tt(t,e,n){let r=se(t,n),i=new Array(r.length).fill(NaN),s=NaN;for(let o=0;o<r.length;o++){let a=r[o];if(isNaN(s)){if(o<e-1)continue;let l=0;for(let u=o-e+1;u<=o;u++)l+=r[u];s=l/e,i[o]=s}else s=(s*(e-1)+a)/e,i[o]=s}return i}function Rs(t,e,n){let r=se(t,n),i=new Array(r.length).fill(NaN);for(let s=e-1;s<r.length;s++){let o=0,a=0,l=0,u=0;for(let d=0;d<e;d++){let f=d,g=r[s-(e-1-d)];o+=f,a+=g,l+=f*g,u+=f*f}let c=e,m=(c*l-o*a)/(c*u-o*o);i[s]=(a-m*o)/c+m*(e-1)}return i}function Ps(t,e=14){let n=t.length;if(n===0)return[];let r=new Array(n),i=new Array(n);r[0]=0,i[0]=0;for(let l=1;l<n;l++){let u=t[l].close-t[l-1].close;r[l]=u>0?u:0,i[l]=u<0?-u:0}let s=tt(r,e),o=tt(i,e),a=new Array(n);for(let l=0;l<n;l++)a[l]=isNaN(s[l])?NaN:o[l]===0?100:100-100/(1+s[l]/o[l]);return a}function Ls(t,e=14,n=3,r=3){function i(c,m){let d=new Array(c.length).fill(NaN),f=0,g=0;for(let p=0;p<c.length;p++)isNaN(c[p])||(f+=c[p],g++),p>=m&&!isNaN(c[p-m])&&(f-=c[p-m],g--),d[p]=g>0?f/g:NaN;return d}let s=t.length,o=Ie(t.map(c=>c.high),e),a=Fe(t.map(c=>c.low),e),l=new Array(s).fill(NaN);for(let c=e-1;c<s;c++){let m=o[c],d=a[c];l[c]=m===d?50:(t[c].close-d)/(m-d)*100}let u=i(l,r);return{k:u,d:i(u,n)}}function qs(t,e=12,n=26,r=9){let i=Ee(t,e),s=Ee(t,n),o=t.length,a=new Array(o);for(let c=0;c<o;c++)a[c]=i[c]-s[c];let l=Ee(a,r),u=new Array(o);for(let c=0;c<o;c++)u[c]=a[c]-l[c];return{macd:a,signal:l,histogram:u}}function _t(t,e=14){return tt(Nr(t),e)}function Nr(t){let e=t.length,n=new Array(e);for(let r=0;r<e;r++){let i=t[r];if(r===0){n[r]=i.high-i.low;continue}let s=t[r-1].close;n[r]=Math.max(i.high-i.low,Math.abs(i.high-s),Math.abs(i.low-s))}return n}function Mr(t,e){let n=Array.isArray(e)?e:new Array(t.length).fill(e);return t.map((r,i)=>i>0&&r>n[i]&&t[i-1]<=n[i-1])}function Dr(t,e){let n=Array.isArray(e)?e:new Array(t.length).fill(e);return t.map((r,i)=>i>0&&r<n[i]&&t[i-1]>=n[i-1])}function Vs(t,e){let n=Mr(t,e),r=Dr(t,e);return n.map((i,s)=>i||r[s])}function Bs(t,e=1){return t.map((n,r)=>{if(r<e)return!1;for(let i=1;i<=e;i++)if(t[r-i+1]<=t[r-i])return!1;return!0})}function zs(t,e=1){return t.map((n,r)=>{if(r<e)return!1;for(let i=1;i<=e;i++)if(t[r-i+1]>=t[r-i])return!1;return!0})}function $s(t,e=1){return t.map((n,r)=>r<e?NaN:n-t[r-e])}function _s(t){let e=NaN;return t.map((n,r)=>n?(e=r,0):isNaN(e)?NaN:r-e)}function Zs(t,e,n=0){let r=[];return t.map((i,s)=>{i&&r.push(s);let o=r.length-1-n;return o>=0?e[r[o]]:NaN})}function Cr(t,e,n){let r=t.length,i=new Array(r).fill(NaN),s=new Array(r),o=0,a=0;for(let l=0;l<r;l++){let u=t[l];if(!isNaN(u)){for(;a>o;){let c=t[s[a-1]];if(n?c<=u:c>=u)a--;else break}s[a++]=l}for(;a>o&&s[o]<=l-e;)o++;l>=e-1&&(i[l]=a>o?t[s[o]]:n?-1/0:1/0)}return i}function Ie(t,e){return Cr(t,e,!0)}function Fe(t,e){return Cr(t,e,!1)}function Us(t,e=5,n=5){let r=t.length,i=new Array(r).fill(NaN);for(let s=e;s<r-n;s++){let o=t[s].high,a=!0;for(let l=s-e;l<=s+n;l++)if(l!==s&&t[l].high>=o){a=!1;break}a&&(i[s]=o)}return i}function Ys(t,e=5,n=5){let r=t.length,i=new Array(r).fill(NaN);for(let s=e;s<r-n;s++){let o=t[s].low,a=!0;for(let l=s-e;l<=s+n;l++)if(l!==s&&t[l].low<=o){a=!1;break}a&&(i[s]=o)}return i}function Er(t,e=20,n=2,r=i=>i.close){let i=t.length,s=new Array(i).fill(NaN),o=new Array(i).fill(NaN),a=new Array(i).fill(NaN),l=new Array(i),u=0,c=0;for(let m=0;m<i;m++){let d=r(t[m]);if(l[m]=d,u+=d,c+=d*d,m>=e){let f=l[m-e];u-=f,c-=f*f}if(m>=e-1){let f=u/e,g=Math.sqrt(Math.max(0,c/e-f*f));s[m]=f,o[m]=f+n*g,a[m]=f-n*g}}return{upper:o,mid:s,lower:a}}function Hs(t,e=20,n=2){let{upper:r,mid:i,lower:s}=Er(t,e,n);return i.map((o,a)=>isNaN(o)||o===0?NaN:(r[a]-s[a])/o)}function Gs(t,e=20){let n=Ie(t.map(i=>i.high),e),r=Fe(t.map(i=>i.low),e);return{upper:n,mid:n.map((i,s)=>(i+r[s])/2),lower:r}}function js(t,e=20,n=10,r=1.5){let i=Ee(t,e),s=_t(t,n);return{upper:i.map((o,a)=>o+r*s[a]),mid:i,lower:i.map((o,a)=>o-r*s[a])}}function Js(t,e=0){let n=new Array(t.length).fill(NaN),r=864e5,i=0,s=0,o=NaN;for(let a=0;a<t.length;a++){let l=Number(t[a].ts/1000000n),u=Math.floor((l-e*36e5)/r);u!==o&&(i=0,s=0,o=u);let c=(t[a].high+t[a].low+t[a].close)/3;i+=c*t[a].volume,s+=t[a].volume,n[a]=s===0?NaN:i/s}return n}function Xs(t){let e=t.map(n=>(n.high+n.low)/2);return{jaw:Ke(e,13),teeth:Ke(e,8),lips:Ke(e,5)}}function Ir(t,e,n){let r=se(t,n),i=r.length,s=new Array(i).fill(NaN),o=0,a=0;for(let l=0;l<i;l++)if(o+=r[l],a+=r[l]*r[l],l>=e&&(o-=r[l-e],a-=r[l-e]*r[l-e]),l>=e-1){let u=o/e;s[l]=Math.sqrt(Math.max(0,a/e-u*u))}return s}function Qs(t,e,n){return Ir(t,e,n).map(r=>r*r)}function Ks(t,e){function n(i,s){let o=new Array(i.length).fill(NaN),a=0,l=0;for(let u=0;u<i.length;u++)isNaN(i[u])||(a+=i[u],l++),u>=s&&!isNaN(i[u-s])&&(a-=i[u-s],l--),o[u]=l>0?a/l:NaN;return o}let r=n(t,e);return t.map((i,s)=>Math.abs(i-r[s]))}function eo(t,e,n){let r=new Array(t.length).fill(NaN),i=0,s=0;for(let o=0;o<t.length;o++){if(i+=t[o],s+=e[o],o>=n&&(i-=t[o-n],s-=e[o-n]),o<n-1)continue;let a=i/n,l=s/n,u=0,c=0,m=0;for(let f=o-n+1;f<=o;f++){let g=t[f]-a,p=e[f]-l;u+=g*p,c+=g*g,m+=p*p}let d=Math.sqrt(c*m);r[o]=d===0?0:u/d}return r}var to=Ie,no=Fe;function ro(t,e){let n=new Array(t.length).fill(NaN);for(let r=e-1;r<t.length;r++){let i=t.slice(r-e+1,r+1).sort((o,a)=>o-a),s=Math.floor(e/2);n[r]=e%2===0?(i[s-1]+i[s])/2:i[s]}return n}function io(t,e){let n=[];for(let r=0;r<t.length&&r<e.length;r++)!isNaN(e[r])&&isFinite(e[r])&&n.push({t:t[r],price:e[r]});return n}function so(t){return t[t.length-1]}function oo(t,e=0){return t==null||isNaN(t)?e:t}function ao(t,e,n,r=[],i=!1){return{type:"line",pts:t,color:e,width:n,dash:r,connect:i}}function lo(t,e,n,r=[]){return{type:"hline",price:t,color:e,width:n,dash:r}}function uo(t,e,n=0,r=.2){return{type:"histogram",pts:t,color:e,base:n,gap:r}}function co(t,e,n,r,i=12,s=!1,o="left",a="middle",l=!1,u=99999){return{type:"label",text:t,x:e,y:n,color:r,fontSize:i,bold:s,horzAlign:o,vertAlign:a,anchored:l,maxWidth:u}}function fo(t,e,n){return{type:"fill",pts1:t,pts2:e,opts:n}}function mo(t,e,n,r,i={}){return{type:"rect",t1:t,t2:n,price1:e,price2:r,...i}}function ho(t,e,n,r={}){return{type:"circle",t,price:e,radius:n,...r}}function go(t,e,n=1,r=[]){return{type:"vline",t,color:e,width:n,dash:r}}function yo(t,e,n,r,i=10,s="",o=""){return{type:"arrow",t,price:e,direction:n,color:r,size:i,label:s,labelColor:o||r}}function po(t,e,n,r,i,s=1,o=[],a="none"){return{type:"trendline",t1:t,price1:e,t2:n,price2:r,color:i,width:s,dash:o,extend:a}}function bo(t,e,n,r="",i=1){return{type:"band",priceHigh:t,priceLow:e,fillColor:n,borderColor:r,borderWidth:i}}function wo(t,e={}){return{type:"polygon",pts:t,...e}}function So(t,e,n=3){return{type:"dots",pts:t,color:e,radius:n}}function To(t,e,n,r,i,s={}){return{type:"badge",t,price:e,text:n,textColor:r,bgColor:i,...s}}function xo(t){let e=new Array(t.length).fill(0);for(let n=1;n<t.length;n++){let r=t[n].close>t[n-1].close?t[n].volume:t[n].close<t[n-1].close?-t[n].volume:0;e[n]=e[n-1]+r}return e}function ko(t,e=14){let n=t.length,r=new Array(n).fill(NaN),i=t.map(u=>(u.high+u.low+u.close)/3),s=new Array(n).fill(0),o=new Array(n).fill(0);for(let u=1;u<n;u++){let c=i[u]*t[u].volume;i[u]>i[u-1]?s[u]=c:i[u]<i[u-1]&&(o[u]=c)}let a=0,l=0;for(let u=1;u<n;u++)a+=s[u],l+=o[u],u>e&&(a-=s[u-e],l-=o[u-e]),u>=e&&(r[u]=l===0?100:100-100/(1+a/l));return r}function vo(t,e=20){let n=t.length,r=new Array(n).fill(NaN),i=t.map(o=>(o.high+o.low+o.close)/3),s=0;for(let o=0;o<n;o++){if(s+=i[o],o>=e&&(s-=i[o-e]),o<e-1)continue;let a=s/e,l=0;for(let u=o-e+1;u<=o;u++)l+=Math.abs(i[u]-a);l/=e,r[o]=l===0?0:(i[o]-a)/(.015*l)}return r}function Oo(t,e=14){let n=t.length,r=new Array(n).fill(NaN),i=Ie(t.map(o=>o.high),e),s=Fe(t.map(o=>o.low),e);for(let o=e-1;o<n;o++){let a=i[o],l=s[o];r[o]=a===l?-50:(a-t[o].close)/(a-l)*-100}return r}function No(t,e=10,n=3){let r=t.length,i=_t(t,e),s=new Array(r).fill(NaN),o=new Array(r).fill(NaN),a=new Array(r).fill(1),l=e;if(r<=l)return{trend:a,upper:s,lower:o};s[l]=(t[l].high+t[l].low)/2+n*i[l],o[l]=(t[l].high+t[l].low)/2-n*i[l];for(let u=l+1;u<r;u++){let c=(t[u].high+t[u].low)/2,m=c+n*i[u],d=c-n*i[u],f=t[u-1].close;s[u]=m<s[u-1]||f>s[u-1]?m:s[u-1],o[u]=d>o[u-1]||f<o[u-1]?d:o[u-1],a[u-1]===-1&&t[u].close>s[u-1]?a[u]=1:a[u-1]===1&&t[u].close<o[u-1]?a[u]=-1:a[u]=a[u-1]}return{trend:a,upper:s,lower:o}}function Mo(t,e,n){if(t.length===0)return[];let r=[],i=new Array(t.length);for(let l=0;l<t.length;l++)i[l]=Number(t[l].ts/1000000n);let s=l=>{let u=0,c=i.length;for(;u<c;){let m=u+c>>>1;i[m]<l?u=m+1:c=m}return u},o=new Map,a=l=>{let u=o.get(l);if(u)return u;u=[];let c=-1/0;for(let m=0;m<i.length;m++){if(i[m]<c)continue;let d=T.fromMillis(i[m],{zone:l});u.push({year:d.year,month:d.month,day:d.day}),c=d.startOf("day").plus({days:1}).toMillis()}return o.set(l,u),u};for(let l of e){let u=l.tz??n?.tz??"UTC";for(let{year:c,month:m,day:d}of a(u)){let f=T.fromObject({year:c,month:m,day:d,hour:l.startHour,minute:l.startMinute,second:0,millisecond:0},{zone:u}),g=T.fromObject({year:c,month:m,day:d,hour:l.endHour,minute:l.endMinute,second:0,millisecond:0},{zone:u});g<=f&&(g=g.plus({days:1}));let p=f.toMillis(),k=g.toMillis(),M=-1/0,D=1/0;for(let v=s(p);v<i.length&&i[v]<k;v++)t[v].high>M&&(M=t[v].high),t[v].low<D&&(D=t[v].low);M===-1/0||D===1/0||r.push({startTs:BigInt(p)*1000000n,endTs:BigInt(k)*1000000n,high:M,low:D,label:l.label,color:l.color})}}return r.sort((l,u)=>l.startTs<u.startTs?-1:l.startTs>u.startTs?1:0),r}var we={sma:Ke,ema:Ee,wma:et,hma:Ws,rma:tt,linreg:Rs,rsi:Ps,stoch:Ls,macd:qs,atr:_t,tr:Nr,crossover:Mr,crossunder:Dr,cross:Vs,rising:Bs,falling:zs,change:$s,barssince:_s,valuewhen:Zs,highest:Ie,lowest:Fe,pivotHigh:Us,pivotLow:Ys,bb:Er,bbw:Hs,donchian:Gs,keltner:js,vwap:Js,alligator:Xs,stdev:Ir,variance:Qs,dev:Ks,correlation:eo,max:to,min:no,median:ro,toPoints:io,last:so,nz:oo,obv:xo,mfi:ko,cci:vo,williamsR:Oo,supertrend:No,sessionBoundaries:Mo,drawLine:ao,drawHLine:lo,drawHistogram:uo,drawLabel:co,fillBetween:fo,drawRect:mo,drawCircle:ho,drawVLine:go,drawArrow:yo,drawTrendLine:po,drawBand:bo,drawPolygon:wo,drawDots:So,drawBadge:To};var Fr=Object.freeze({indicator:"indicator",drawing:"drawing",chartType:"chart-type",dataSource:"data-source",extension:"extension",strategy:"strategy"}),Ar=Object.freeze({mbo:"l3",l3:"l3",l2:"l2",ohlcv:"ohlcv",tick:"tick"}),Wr=Object.freeze({overlay:"overlay",pane:"pane"}),Rr=Object.freeze({signal:"signal",stop:"stop",target:"target",reverse:"reverse",endOfData:"end-of-data"}),Pr={PluginType:Fr,DataLevel:Ar,Layout:Wr,ExitReason:Rr};var Lr={initialCapital:1e5,commission:0,slippageTicks:0,tickSize:.01,contractSize:1,pyramiding:1,allowReverse:!0,qtyStep:1};function qr(t,e,n){if(!e||e.length===0)return!1;let r=(a,l)=>Math.abs(a-l)<=n;if(!r(e[0].open,t.open)||!r(e[e.length-1].close,t.close))return!1;let i=-1/0,s=1/0,o=-1n;for(let a of e){if(a.ts<=o)return!1;o=a.ts,a.high>i&&(i=a.high),a.low<s&&(s=a.low)}return r(i,t.high)&&r(s,t.low)}function Do(t){if(!t.length)return 0;let e=[...t].sort((r,i)=>r-i),n=e.length>>1;return e.length%2?e[n]:(e[n-1]+e[n])/2}function Co(t){if(t.length<2)return 0;let e=0;for(let i of t)e+=i;e/=t.length;let n=0;for(let i of t)n+=(i-e)*(i-e);let r=Math.sqrt(n/(t.length-1));return r===0?0:Math.sqrt(t.length)*e/r}var Eo=8192,Zt=class{constructor(e={}){b(this,"cfg");b(this,"pending",[]);b(this,"pos",null);b(this,"trades",[]);b(this,"equityCurve",[]);b(this,"realized");b(this,"peak");b(this,"nextOrderId",1);b(this,"index",-1);b(this,"barsInPosition",0);b(this,"barCount",0);b(this,"markPrice",0);b(this,"closeRequested",!1);b(this,"barNs",0n);b(this,"slippagePaid",0);b(this,"usedIntrabar",!1);b(this,"intrabarBars",0);b(this,"intrabarFallbacks",0);b(this,"ambiguousExits",0);b(this,"pendingEquity",null);b(this,"equityCount",0);b(this,"firstTs",null);b(this,"lastTs",0n);b(this,"lastEquity",null);b(this,"prevEquity",null);b(this,"maxDdAbs",0);b(this,"maxDdPct",0);b(this,"ulcerSum",0);b(this,"retN",0);b(this,"retMean",0);b(this,"retM2",0);b(this,"downSum",0);b(this,"downCount",0);b(this,"curvePhase",0);b(this,"curveStride",1);b(this,"lastFolded",null);this.cfg={...Lr,...e},this.realized=this.cfg.initialCapital,this.peak=this.cfg.initialCapital}setBarNs(e){this.barNs=e}beginBar(e,n,r){this.index=n,this.markPrice=e.close;let i=r&&r.length>0?qr(e,r,Math.max(this.cfg.tickSize/2,1e-9)):!1;if(r&&r.length>0&&(i?this.intrabarBars++:this.intrabarFallbacks++),this.usedIntrabar=i,this.closeRequested&&(this.closeRequested=!1,this.pos)){let s=this.cfg.slippageTicks*this.cfg.tickSize;this.exit(e,e.open+(this.pos.side==="long"?-s:s),"signal")}if(!i){this.pending.length&&this.processPending(e),this.pos&&this.checkBrackets(e);return}for(let s of r)this.pending.length&&this.processPending(s),this.pos&&this.checkBrackets(s),this.pos&&this.trackExcursion(s)}endBar(e){this.barCount++,this.markPrice=e.close,this.pos&&(this.barsInPosition++,this.usedIntrabar||this.trackExcursion(e));let n=this.equity;n>this.peak&&(this.peak=n),this.foldPending(),this.firstTs===null&&(this.firstTs=e.ts),this.pendingEquity={ts:e.ts,equity:n,drawdown:this.peak>0?(this.peak-n)/this.peak:0}}foldPending(){let e=this.pendingEquity;if(!e)return;this.pendingEquity=null,this.equityCount++,this.lastTs=e.ts,this.lastEquity=e.equity;let r=(e.drawdown>=1?e.equity:e.equity/(1-e.drawdown))-e.equity;if(r>this.maxDdAbs&&(this.maxDdAbs=r),e.drawdown>this.maxDdPct&&(this.maxDdPct=e.drawdown),this.ulcerSum+=e.drawdown*e.drawdown,this.prevEquity!==null&&this.prevEquity>0){let i=(e.equity-this.prevEquity)/this.prevEquity;this.retN++;let s=i-this.retMean;this.retMean+=s/this.retN,this.retM2+=s*(i-this.retMean),i<0&&(this.downSum+=i*i,this.downCount++)}this.prevEquity=e.equity,this.lastFolded=e,this.keepInCurve(e)}keepInCurve(e){if(this.curvePhase===0&&(this.equityCurve.push(e),this.equityCurve.length>Eo)){let n=[];for(let r=0;r<this.equityCurve.length;r+=2)n.push(this.equityCurve[r]);this.equityCurve=n,this.curveStride*=2}this.curvePhase=(this.curvePhase+1)%this.curveStride}finish(e){if(!this.pos||!e){this.foldPending();return}this.exit(e,e.close,"end-of-data");let n=this.pendingEquity;if(n){let r=this.equity;r>this.peak&&(this.peak=r),n.equity=r,n.drawdown=this.peak>0?(this.peak-r)/this.peak:0}this.foldPending()}get equity(){return this.realized+this.unrealized()}get result(){return this.foldPending(),this.lastFolded&&this.equityCurve[this.equityCurve.length-1]!==this.lastFolded&&this.equityCurve.push(this.lastFolded),{trades:this.trades,equity:this.equityCurve,stats:this.computeStats(),position:this.pos,openOrders:this.pending}}api(){let e=this;return{buy:(n=1,r={})=>e.place("buy",n,r),sell:(n=1,r={})=>e.place("sell",n,r),close:()=>{e.pos&&(e.closeRequested=!0)},cancelAll:()=>{e.pending=[]},get position(){return e.pos},get equity(){return e.equity},get cash(){return e.realized},get openOrders(){return e.pending}}}place(e,n,r){let i=this.roundQty(n),s={id:this.nextOrderId++,side:e,qty:i,kind:r.limit!=null?"limit":r.stop!=null?"stop":"market",price:r.limit??r.stop,sl:r.sl,tp:r.tp,tag:r.tag,placedIndex:this.index};return this.pending.push(s),s.id}processPending(e){let n=[];for(let r of this.pending){if(r.placedIndex>=this.index){n.push(r);continue}let i=this.fillPrice(r,e);if(i==null){n.push(r);continue}this.execute(r,i,e)}this.pending=n}fillPrice(e,n){let r=this.cfg.slippageTicks*this.cfg.tickSize;if(e.kind==="market")return e.side==="buy"?n.open+r:n.open-r;let i=e.price;return e.kind==="limit"?e.side==="buy"&&n.low<=i||e.side==="sell"&&n.high>=i?i:null:e.side==="buy"&&n.high>=i?Math.max(i,n.open)+r:e.side==="sell"&&n.low<=i?Math.min(i,n.open)-r:null}execute(e,n,r){let i=e.side==="buy"?"long":"short";if(this.pos&&this.pos.side!==i){let s=Math.min(this.pos.qty,e.qty),o=e.qty-s,a=o>0&&this.cfg.allowReverse;this.exit(r,n,a?"reverse":"signal",s),a&&this.enter(i,o,n,r,e);return}if(this.pos&&this.pos.side===i){if(this.pos.entries>=this.maxEntries())return;let s=this.pos.qty+e.qty;this.pos.avgPrice=(this.pos.avgPrice*this.pos.qty+n*e.qty)/s,this.pos.qty=s,this.pos.entries++,e.sl!=null&&(this.pos.sl=e.sl),e.tp!=null&&(this.pos.tp=e.tp);let o=this.commissionFor(e.qty);this.pos.entryFees+=o,this.realized-=o,this.slippagePaid+=this.slippageCost(e.qty);return}this.enter(i,e.qty,n,r,e)}maxEntries(){return Math.max(1,Math.floor(this.cfg.pyramiding))}roundQty(e){let n=this.cfg.qtyStep>0?this.cfg.qtyStep:1,r=Math.abs(e),i=Math.floor(r/n)*n,s=(String(n).split(".")[1]??"").length;return i>0?Number(i.toFixed(s)):n}enter(e,n,r,i,s){let o=this.commissionFor(n);this.pos={side:e,qty:n,avgPrice:r,entryTs:i.ts,entryIndex:this.index,sl:s.sl,tp:s.tp,tag:s.tag,entryFees:o,highWatermark:r,lowWatermark:r,mfeIndex:this.index,mfeTs:i.ts,maeIndex:this.index,maeTs:i.ts,initialRiskPerUnit:s.sl!=null?Math.abs(r-s.sl):void 0,entries:1},this.barsInPosition=0,this.realized-=o,this.slippagePaid+=this.slippageCost(n)}slippageCost(e){return this.cfg.slippageTicks*this.cfg.tickSize*e*this.cfg.contractSize}exit(e,n,r,i,s=!1){let o=this.pos;if(!o)return;let a=i??o.qty,l=o.side==="long"?1:-1,u=(n-o.avgPrice)*l*a*this.cfg.contractSize,c=this.commissionFor(a),m=o.qty>0?o.entryFees*a/o.qty:0,d=m+c;o.entryFees-=m,this.realized+=u-c,this.slippagePaid+=this.slippageCost(a);let f=o.avgPrice*a*this.cfg.contractSize,g=o.side==="long",p=a*this.cfg.contractSize,k=Math.max(0,g?o.highWatermark-o.avgPrice:o.avgPrice-o.lowWatermark),M=Math.max(0,g?o.avgPrice-o.lowWatermark:o.highWatermark-o.avgPrice),D=o.initialRiskPerUnit,v=D!=null?D*p:void 0,Z=u-d,ee=v&&v>0?Z/v:void 0,oe=v&&v>0?k*p/v:void 0,H=v&&v>0?-(M*p)/v:void 0,G=k>0?Math.max(0,g?n-o.avgPrice:o.avgPrice-n)/k:void 0,W=k*p,V=Math.max(0,W-(u-d));this.trades.push({id:this.trades.length+1,side:o.side,qty:a,entryTs:o.entryTs,entryPrice:o.avgPrice,exitTs:e.ts,exitPrice:n,pnl:Z,pnlGross:u,pnlPct:f>0?Z/f:0,fees:d,commission:d,slippage:this.slippageCost(a)*2,bars:this.index-o.entryIndex,durationNs:e.ts-o.entryTs,tag:o.tag,reason:r,...s?{ambiguousExit:!0}:{},maeAbs:M,mfeAbs:k,maePnl:M*p,mfePnl:k*p,mfeTs:o.mfeTs,maeTs:o.maeTs,barsToMfe:o.mfeIndex-o.entryIndex,initialRiskPerUnit:D,initialRiskTotal:v,realizedR:ee,maxFavorableR:oe,maxAdverseR:H,efficiency:G,maxDrawdownAbs:V,maxDrawdownPct:W>0?V/W:0,sl:o.sl,tp:o.tp}),a>=o.qty?(this.pos=null,this.barsInPosition=0):o.qty-=a}checkBrackets(e){let n=this.pos;if(n.sl==null&&n.tp==null)return;let r=this.cfg.slippageTicks*this.cfg.tickSize,i=n.side==="long",s=n.sl!=null&&(i?e.low<=n.sl:e.high>=n.sl),o=n.tp!=null&&(i?e.high>=n.tp:e.low<=n.tp),a=s&&o;if(a&&this.ambiguousExits++,s){let l=i?Math.min(n.sl,e.open):Math.max(n.sl,e.open);this.exit(e,i?l-r:l+r,"stop",void 0,a);return}o&&this.exit(e,n.tp,"target")}trackExcursion(e){let n=this.pos;e.high>n.highWatermark&&(n.highWatermark=e.high,n.side==="long"?(n.mfeIndex=this.index,n.mfeTs=e.ts):(n.maeIndex=this.index,n.maeTs=e.ts)),e.low<n.lowWatermark&&(n.lowWatermark=e.low,n.side==="long"?(n.maeIndex=this.index,n.maeTs=e.ts):(n.mfeIndex=this.index,n.mfeTs=e.ts))}commissionFor(e){return this.cfg.commission*e}unrealized(){if(!this.pos)return 0;let e=this.pos.side==="long"?1:-1;return(this.markPrice-this.pos.avgPrice)*e*this.pos.qty*this.cfg.contractSize}computeStats(){let e=this.trades,n=this.cfg.initialCapital,r=0,i=0,s=0,o=0,a=0,l=0,u=0,c=0,m=0,d=0,f=0,g=0,p=0,k=0,M=0,D=0,v=0,Z=0,ee=0,oe=0,H=0,G=0,W=0,V=0,Ae=0,Yt=0,nt=0,Ht=0;for(let x of e)x.pnl>0?(r+=x.pnl,s++,c+=x.bars,f++,g=0,x.pnl>l&&(l=x.pnl)):x.pnl<0?(i+=x.pnl,o++,m+=x.bars,g++,f=0,x.pnl<u&&(u=x.pnl)):(a++,f=0,g=0),f>p&&(p=f),g>k&&(k=g),d+=x.bars,ee+=x.maeAbs,oe+=x.mfeAbs,nt+=x.commission,Ht+=x.pnlGross,x.realizedR!==void 0&&(M+=x.realizedR,D++),x.efficiency!==void 0&&(v+=x.efficiency,Z++),x.side==="long"?(H++,Ae+=x.pnl,x.pnl>0&&W++):(G++,Yt+=x.pnl,x.pnl>0&&V++);let rt=this.maxDdAbs,it=this.maxDdPct,Vr=this.ulcerSum,Gt=this.lastEquity??n,st=Gt-n,Br=n>0?st/n:0,We=s?r/s:0,Se=o?i/o:0,ot=e.length?s/e.length:0,jt=e.map(x=>x.pnl),at=this.runYears();return{netPnl:st,grossProfit:r,grossLoss:i,profitFactor:i===0?r>0?1/0:0:r/-i,totalTrades:e.length,wins:s,losses:o,winRate:ot,avgWin:We,avgLoss:Se,expectancy:e.length?(r+i)/e.length:0,maxDrawdown:rt,maxDrawdownPct:it,sharpe:this.sharpe(),returnPct:Br,exposure:this.barCount?this.barsInPositionTotal()/this.barCount:0,finalEquity:Gt,largestWin:l,largestLoss:u,medianPnl:Do(jt),payoffRatio:Se!==0?We/Math.abs(Se):We>0?1/0:0,breakEvens:a,maxWinStreak:p,maxLossStreak:k,currentStreak:f>0?f:-g,avgBarsHeld:e.length?d/e.length:0,avgWinBarsHeld:s?c/s:0,avgLossBarsHeld:o?m/o:0,totalBars:this.barCount,sortino:this.sortino(),calmar:it>0&&at>0?this.cagr(at)/it:0,recoveryFactor:rt>0?st/rt:0,ulcerIndex:this.equityCount?Math.sqrt(Vr/this.equityCount):0,sqn:Co(jt),kelly:Se!==0?ot-(1-ot)/(We/Math.abs(Se)):0,cagr:this.cagr(at),tradesWithRisk:D,avgR:D?M/D:0,totalR:M,avgEfficiency:Z?v/Z:0,avgMae:e.length?ee/e.length:0,avgMfe:e.length?oe/e.length:0,longTrades:H,shortTrades:G,longWinRate:H?W/H:0,shortWinRate:G?V/G:0,longPnl:Ae,shortPnl:Yt,totalFees:nt,totalCommission:nt,totalSlippage:this.slippagePaid,grossPnlBeforeCosts:Ht,intrabarBars:this.intrabarBars,intrabarFallbacks:this.intrabarFallbacks,ambiguousExits:this.ambiguousExits}}runYears(){if(this.equityCount<2||this.firstTs===null)return 0;let e=this.lastTs-this.firstTs;return e>0n?Number(e)/31536e12:0}cagr(e){let n=this.cfg.initialCapital;if(e<=0||n<=0)return 0;let r=this.lastEquity??n;return r<=0?-1:Math.pow(r/n,1/e)-1}sortino(){if(this.retN<2||this.barNs<=0n||!this.downCount)return 0;let e=Math.sqrt(this.downSum/this.downCount);if(e===0)return 0;let n=Number(31536000000000000n/this.barNs);return this.retMean/e*Math.sqrt(n)}barsInPositionTotal(){let e=0;for(let n of this.trades)e+=n.bars;return this.pos&&(e+=this.barsInPosition),e}sharpe(){if(this.equityCount<3||this.barNs<=0n||this.retN<2)return 0;let e=Math.sqrt(this.retM2/(this.retN-1));if(e===0)return 0;let n=Number(31536000000000000n/this.barNs);return this.retMean/e*Math.sqrt(n)}};function Ut(t){if("values"in t)return t.values;let{from:e,to:n,step:r}=t;if(!isFinite(e)||!isFinite(n))return[];let i=r>0?r:0;if(i===0||e===n)return[e];let s=Math.min(e,n),o=Math.max(e,n),a=[],l=Math.floor((o-s)/i+1e-9)+1,u=(String(i).split(".")[1]??"").length;for(let c=0;c<l;c++)a.push(Number((s+c*i).toFixed(u)));return a}function Io(t){let e=t.filter(r=>Ut(r).length>0);if(!e.length)return[{}];let n=[{}];for(let r of e){let i=Ut(r),s=[];for(let o of n)for(let a of i)s.push({...o,[r.param]:a});if(n=s,n.length>2e4)return n.slice(0,20001)}return n}function Fo(t,e){let n=t*e,r={combos:t,bars:e,iterations:n,ok:!0};return t>2e4?{...r,ok:!1,reason:`${t.toLocaleString()} combinations is past the limit of ${2e4.toLocaleString()}. Widen the step, or sweep fewer parameters at once.`}:n>2e8?{...r,ok:!1,reason:`${t.toLocaleString()} combinations over ${e.toLocaleString()} bars is ${n.toLocaleString()} bar evaluations, past what this browser will run (${2e8.toLocaleString()}). Shorten the range, widen the step, or sweep fewer parameters.`}:r}function Ao(t,e){if(!e||e<=0||e>=.9||t<100)return null;let n=Math.floor(t*(1-e));return n<50||t-n<50?null:n}function Wo(t,e){let n=0,r=t.length;for(;n<r;){let i=n+r>>>1;t[i].ts<e?n=i+1:r=i}return n}function Ro(t,e){let n=0,r=t.length;for(;n<r;){let i=n+r>>>1;t[i].ts<=e?n=i+1:r=i}return n}function Po(t,e){let n=t.length;if(!n)return{from:0,to:0,count:0,total:0,firstTs:null,lastTs:null,dataFromNs:null,dataToNs:null};let r=e?.fromNs!=null?Wo(t,e.fromNs):0,i=e?.toNs!=null?Ro(t,e.toNs):n,s=Math.min(r,n),o=Math.max(s,Math.min(i,n));return{from:s,to:o,count:o-s,total:n,firstTs:o>s?t[s]?.ts??null:null,lastTs:o>s?t[o-1]?.ts??null:null,dataFromNs:t[0]?.ts??null,dataToNs:t[n-1]?.ts??null}}function Lo(t){return!!t&&(t.fromNs!=null||t.toNs!=null)}function qo(t,e){return t.total?e?.fromNs!=null&&e?.toNs!=null&&e.fromNs>e.toNs?"The start of the range is after its end.":`No bars fall inside the selected range. The loaded data holds ${t.total.toLocaleString()} bars outside it.`:"No bars are loaded for this symbol and timeframe."}function Vo(t,e){let n=Math.floor(e.windows),r=Math.max(1,Math.floor(e.isMultiple));if(n<1||t<200)return[];let i=Math.floor(t/(n+r)),s=i*r;if(i<50||s<50)return[];let o=[];for(let a=0;a<n;a++){let l=a*i+s,u=l+i;if(u>t)break;o.push({index:a,isFrom:e.anchored?0:a*i,isTo:l,oosFrom:l,oosTo:u})}return o}function Bo(t){let e=0,n=0,r=0,i=0;for(let a of t)e+=a.inSample.netPnl,n+=a.window.isTo-a.window.isFrom,r+=a.outOfSample.netPnl,i+=a.window.oosTo-a.window.oosFrom;if(!n||!i)return 0;let s=e/n,o=r/i;return s<=0?0:o/s}function zo(t){if(!t.length)return[];let e=new Set;for(let r of t)for(let i of Object.keys(r.params))e.add(i);let n=[];for(let r of e){let i=[];for(let l of t){let u=l.params[r];typeof u=="number"&&Number.isFinite(u)&&i.push(u)}if(i.length<2)continue;let s=0;for(let l of i)s+=l;s/=i.length;let o=0;for(let l of i)o+=(l-s)*(l-s);let a=Math.sqrt(o/i.length);n.push({param:r,values:i,distinct:new Set(i).size,coefficientOfVariation:s!==0?a/Math.abs(s):a===0?0:1/0})}return n}function $o(t,e,n=!0){let r=null,i=n?-1/0:1/0;for(let s of t){let o=e(s);o===void 0||!Number.isFinite(o)||(n?o>i:o<i)&&(i=o,r=s)}return r}function _o(t){let e={...Pr,Math,console,plugin:t.plugin};for(let[n,r]of Object.entries(we))e[n]=r;if(t.shadowNetwork&&(e.fetch=void 0,e.XMLHttpRequest=void 0,e.WebSocket=void 0,e.importScripts=void 0),t.extra)for(let[n,r]of Object.entries(t.extra))e[n]=r;return e}function na(t,e){let n=_o(e),r=Object.keys(n);new Function(...r,`"use strict";
2
- ${t}`)(...r.map(i=>n[i]))}function ra(t,e){let n=t;if(!n)return[];if(e==="pane"){let s=(n.equity??[]).map(o=>({t:o.ts,price:o.equity}));return s.length?[we.drawLine(s,"#38bdf8",1.5,[],!0)]:[]}let r=[],i=n.trades??[];for(let s of i){let o=s.side==="long";r.push(we.drawArrow(s.entryTs,s.entryPrice,o?"up":"down",o?"#22c55e":"#ef4444",9)),r.push(we.drawArrow(s.exitTs,s.exitPrice,o?"down":"up",s.pnl>=0?"#22c55e":"#ef4444",7))}return r}var ia=(()=>{let t=Object.keys(we).sort().join(","),e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return(e>>>0).toString(16).padStart(8,"0")})();export{Lr as DEFAULT_STRATEGY_CONFIG,Ar as DataLevel,Rr as ExitReason,Wr as Layout,Fr as PluginType,Pr as SCRIPT_DSL,we as STDLIB,ia as STDLIB_SIGNATURE,Zt as StrategyEngine,Ut as axisValues,_o as buildScriptScope,Fo as checkSweepBudget,Po as clipRange,ra as defaultStrategyDraw,qo as emptyRangeReason,na as evalScriptInScope,Io as expandGrid,Lo as hasRange,zo as parameterStability,$o as pickBest,Vo as planWalkForward,qr as reconcileIntrabar,Ao as splitIndex,Bo as walkForwardEfficiency};
1
+ var _r=Object.defineProperty;var zr=(t,e,n)=>e in t?_r(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var b=(t,e,n)=>zr(t,typeof e!="symbol"?e+"":e,n);var U=class extends Error{},pt=class extends U{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},bt=class extends U{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},wt=class extends U{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},X=class extends U{},ze=class extends U{constructor(e){super(`Invalid unit ${e}`)}},C=class extends U{},$=class extends U{constructor(){super("Zone is an abstract class")}},h="numeric",z="short",A="long",$e={year:h,month:h,day:h},Dn={year:h,month:z,day:h},$r={year:h,month:z,day:h,weekday:z},Mn={year:h,month:A,day:h},Cn={year:h,month:A,day:h,weekday:A},En={hour:h,minute:h},In={hour:h,minute:h,second:h},Fn={hour:h,minute:h,second:h,timeZoneName:z},An={hour:h,minute:h,second:h,timeZoneName:A},Wn={hour:h,minute:h,hourCycle:"h23"},Pn={hour:h,minute:h,second:h,hourCycle:"h23"},Rn={hour:h,minute:h,second:h,hourCycle:"h23",timeZoneName:z},Ln={hour:h,minute:h,second:h,hourCycle:"h23",timeZoneName:A},qn={year:h,month:h,day:h,hour:h,minute:h},Vn={year:h,month:h,day:h,hour:h,minute:h,second:h},Bn={year:h,month:z,day:h,hour:h,minute:h},_n={year:h,month:z,day:h,hour:h,minute:h,second:h},Zr={year:h,month:z,day:h,weekday:z,hour:h,minute:h},zn={year:h,month:A,day:h,hour:h,minute:h,timeZoneName:z},$n={year:h,month:A,day:h,hour:h,minute:h,second:h,timeZoneName:z},Zn={year:h,month:A,day:h,weekday:A,hour:h,minute:h,timeZoneName:A},Yn={year:h,month:A,day:h,weekday:A,hour:h,minute:h,second:h,timeZoneName:A},ie=class{get type(){throw new $}get name(){throw new $}get ianaName(){return this.name}get isUniversal(){throw new $}offsetName(e,n){throw new $}formatOffset(e,n){throw new $}offset(e){throw new $}equals(e){throw new $}get isValid(){throw new $}},lt=null,Ze=class t extends ie{static get instance(){return lt===null&&(lt=new t),lt}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return nr(e,n,r)}formatOffset(e,n){return Oe(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}},Tt=new Map;function Yr(t){let e=Tt.get(t);return e===void 0&&(e=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"}),Tt.set(t,e)),e}var Ur={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Hr(t,e){let n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,s,o,a,l,u,c]=r;return[o,i,s,a,l,u,c]}function Gr(t,e){let n=t.formatToParts(e),r=[];for(let i=0;i<n.length;i++){let{type:s,value:o}=n[i],a=Ur[s];s==="era"?r[a]=o:y(a)||(r[a]=parseInt(o,10))}return r}var ut=new Map,K=class t extends ie{static create(e){let n=ut.get(e);return n===void 0&&ut.set(e,n=new t(e)),n}static resetCache(){ut.clear(),Tt.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=t.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return nr(e,n,r,this.name)}formatOffset(e,n){return Oe(this.offset(e),n)}offset(e){if(!this.valid)return NaN;let n=new Date(e);if(isNaN(n))return NaN;let r=Yr(this.name),[i,s,o,a,l,u,c]=r.formatToParts?Gr(r,n):Hr(r,n);a==="BC"&&(i=-Math.abs(i)+1);let d=Je({year:i,month:s,day:o,hour:l===24?0:l,minute:u,second:c,millisecond:0}),f=+n,g=f%1e3;return f-=g>=0?g:1e3+g,(d-f)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}},Jt={};function jr(t,e={}){let n=JSON.stringify([t,e]),r=Jt[n];return r||(r=new Intl.ListFormat(t,e),Jt[n]=r),r}var St=new Map;function xt(t,e={}){let n=JSON.stringify([t,e]),r=St.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(t,e),St.set(n,r)),r}var kt=new Map;function Jr(t,e={}){let n=JSON.stringify([t,e]),r=kt.get(n);return r===void 0&&(r=new Intl.NumberFormat(t,e),kt.set(n,r)),r}var Ot=new Map;function Xr(t,e={}){let{base:n,...r}=e,i=JSON.stringify([t,r]),s=Ot.get(i);return s===void 0&&(s=new Intl.RelativeTimeFormat(t,e),Ot.set(i,s)),s}var Se=null;function Qr(){return Se||(Se=new Intl.DateTimeFormat().resolvedOptions().locale,Se)}var vt=new Map;function Un(t){let e=vt.get(t);return e===void 0&&(e=new Intl.DateTimeFormat(t).resolvedOptions(),vt.set(t,e)),e}var Nt=new Map;function Kr(t){let e=Nt.get(t);if(!e){let n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in e||(e={...Hn,...e}),Nt.set(t,e)}return e}function ei(t){let e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));let n=t.indexOf("-u-");if(n===-1)return[t];{let r,i;try{r=xt(t).resolvedOptions(),i=t}catch{let l=t.substring(0,n);r=xt(l).resolvedOptions(),i=l}let{numberingSystem:s,calendar:o}=r;return[i,s,o]}}function ti(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function ni(t){let e=[];for(let n=1;n<=12;n++){let r=S.utc(2009,n,1);e.push(t(r))}return e}function ri(t){let e=[];for(let n=1;n<=7;n++){let r=S.utc(2016,11,13+n);e.push(t(r))}return e}function Pe(t,e,n,r){let i=t.listingMode();return i==="error"?null:i==="en"?n(e):r(e)}function ii(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||Un(t.locale).numberingSystem==="latn"}var Dt=class{constructor(e,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;let{padTo:i,floor:s,...o}=r;if(!n||Object.keys(o).length>0){let a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=Jr(e,a)}}format(e){if(this.inf){let n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{let n=this.floor?Math.floor(e):Vt(e,3);return N(n,this.padTo)}}},Mt=class{constructor(e,n,r){this.opts=r,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){let o=-1*(e.offset/60),a=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&K.create(a).valid?(i=a,this.dt=e):(i="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,i=e.zone.name):(i="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let s={...this.opts};s.timeZone=s.timeZone||i,this.dtf=xt(n,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(n=>{if(n.type==="timeZoneName"){let r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},Ct=class{constructor(e,n,r){this.opts={style:"long",...r},!n&&er()&&(this.rtf=Xr(e,r))}format(e,n){return this.rtf?this.rtf.format(e,n):vi(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}},Hn={firstDay:1,minimalDays:4,weekend:[6,7]},T=class t{static fromOpts(e){return t.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,r,i,s=!1){let o=e||v.defaultLocale,a=o||(s?"en-US":Qr()),l=n||v.defaultNumberingSystem,u=r||v.defaultOutputCalendar,c=Ft(i)||v.defaultWeekSettings;return new t(a,l,u,c,o)}static resetCache(){Se=null,St.clear(),kt.clear(),Ot.clear(),vt.clear(),Nt.clear()}static fromObject({locale:e,numberingSystem:n,outputCalendar:r,weekSettings:i}={}){return t.create(e,n,r,i)}constructor(e,n,r,i,s){let[o,a,l]=ei(e);this.locale=o,this.numberingSystem=n||a||null,this.outputCalendar=r||l||null,this.weekSettings=i,this.intl=ti(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=ii(this)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"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,Ft(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return Pe(this,e,sr,()=>{let r=this.intl==="ja"||this.intl.startsWith("ja-");n&=!r;let i=n?{month:e,day:"numeric"}:{month:e},s=n?"format":"standalone";if(!this.monthsCache[s][e]){let o=r?a=>this.dtFormatter(a,i).format():a=>this.extract(a,i,"month");this.monthsCache[s][e]=ni(o)}return this.monthsCache[s][e]})}weekdays(e,n=!1){return Pe(this,e,lr,()=>{let r=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=n?"format":"standalone";return this.weekdaysCache[i][e]||(this.weekdaysCache[i][e]=ri(s=>this.extract(s,r,"weekday"))),this.weekdaysCache[i][e]})}meridiems(){return Pe(this,void 0,()=>ur,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[S.utc(2016,11,13,9),S.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Pe(this,e,cr,()=>{let n={era:e};return this.eraCache[e]||(this.eraCache[e]=[S.utc(-40,1,1),S.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[e]})}extract(e,n,r){let i=this.dtFormatter(e,n),s=i.formatToParts(),o=s.find(a=>a.type.toLowerCase()===r);return o?o.value:null}numberFormatter(e={}){return new Dt(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new Mt(e,this.intl,n)}relFormatter(e={}){return new Ct(this.intl,this.isEnglish(),e)}listFormatter(e={}){return jr(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||Un(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:tr()?Kr(this.locale):Hn}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},ct=null,q=class t extends ie{static get utcInstance(){return ct===null&&(ct=new t(0)),ct}static instance(e){return e===0?t.utcInstance:new t(e)}static parseSpecifier(e){if(e){let n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new t(Xe(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Oe(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Oe(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return Oe(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}},Et=class extends ie{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 J(t,e){if(y(t)||t===null)return e;if(t instanceof ie)return t;if(ci(t)){let n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?Ze.instance:n==="utc"||n==="gmt"?q.utcInstance:q.parseSpecifier(n)||K.create(t)}else return Q(t)?q.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new Et(t)}var Pt={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"},Xt={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]},si=Pt.hanidec.replace(/[\[|\]]/g,"").split("");function oi(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);if(t[n].search(Pt.hanidec)!==-1)e+=si.indexOf(t[n]);else for(let i in Xt){let[s,o]=Xt[i];r>=s&&r<=o&&(e+=r-s)}}return parseInt(e,10)}else return e}var It=new Map;function ai(){It.clear()}function B({numberingSystem:t},e=""){let n=t||"latn",r=It.get(n);r===void 0&&(r=new Map,It.set(n,r));let i=r.get(e);return i===void 0&&(i=new RegExp(`${Pt[n]}${e}`),r.set(e,i)),i}var Qt=()=>Date.now(),Kt="system",en=null,tn=null,nn=null,rn=60,sn,on=null,v=class{static get now(){return Qt}static set now(e){Qt=e}static set defaultZone(e){Kt=e}static get defaultZone(){return J(Kt,Ze.instance)}static get defaultLocale(){return en}static set defaultLocale(e){en=e}static get defaultNumberingSystem(){return tn}static set defaultNumberingSystem(e){tn=e}static get defaultOutputCalendar(){return nn}static set defaultOutputCalendar(e){nn=e}static get defaultWeekSettings(){return on}static set defaultWeekSettings(e){on=Ft(e)}static get twoDigitCutoffYear(){return rn}static set twoDigitCutoffYear(e){rn=e%100}static get throwOnInvalid(){return sn}static set throwOnInvalid(e){sn=e}static resetCaches(){T.resetCache(),K.resetCache(),S.resetCache(),ai()}},F=class{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},Gn=[0,31,59,90,120,151,181,212,243,273,304,334],jn=[0,31,60,91,121,152,182,213,244,274,305,335];function R(t,e){return new F("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Rt(t,e,n){let r=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);let i=r.getUTCDay();return i===0?7:i}function Jn(t,e,n){return n+(Ne(t)?jn:Gn)[e-1]}function Xn(t,e){let n=Ne(t)?jn:Gn,r=n.findIndex(s=>s<e),i=e-n[r];return{month:r+1,day:i}}function Lt(t,e){return(t-e+7)%7+1}function Ye(t,e=4,n=1){let{year:r,month:i,day:s}=t,o=Jn(r,i,s),a=Lt(Rt(r,i,s),n),l=Math.floor((o-a+14-e)/7),u;return l<1?(u=r-1,l=ve(u,e,n)):l>ve(r,e,n)?(u=r+1,l=1):u=r,{weekYear:u,weekNumber:l,weekday:a,...Qe(t)}}function an(t,e=4,n=1){let{weekYear:r,weekNumber:i,weekday:s}=t,o=Lt(Rt(r,1,e),n),a=fe(r),l=i*7+s-o-7+e,u;l<1?(u=r-1,l+=fe(u)):l>a?(u=r+1,l-=fe(r)):u=r;let{month:c,day:m}=Xn(u,l);return{year:u,month:c,day:m,...Qe(t)}}function ft(t){let{year:e,month:n,day:r}=t,i=Jn(e,n,r);return{year:e,ordinal:i,...Qe(t)}}function ln(t){let{year:e,ordinal:n}=t,{month:r,day:i}=Xn(e,n);return{year:e,month:r,day:i,...Qe(t)}}function un(t,e){if(!y(t.localWeekday)||!y(t.localWeekNumber)||!y(t.localWeekYear)){if(!y(t.weekday)||!y(t.weekNumber)||!y(t.weekYear))throw new X("Cannot mix locale-based week fields with ISO-based week fields");return y(t.localWeekday)||(t.weekday=t.localWeekday),y(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),y(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function li(t,e=4,n=1){let r=je(t.weekYear),i=L(t.weekNumber,1,ve(t.weekYear,e,n)),s=L(t.weekday,1,7);return r?i?s?!1:R("weekday",t.weekday):R("week",t.weekNumber):R("weekYear",t.weekYear)}function ui(t){let e=je(t.year),n=L(t.ordinal,1,fe(t.year));return e?n?!1:R("ordinal",t.ordinal):R("year",t.year)}function Qn(t){let e=je(t.year),n=L(t.month,1,12),r=L(t.day,1,Ue(t.year,t.month));return e?n?r?!1:R("day",t.day):R("month",t.month):R("year",t.year)}function Kn(t){let{hour:e,minute:n,second:r,millisecond:i}=t,s=L(e,0,23)||e===24&&n===0&&r===0&&i===0,o=L(n,0,59),a=L(r,0,59),l=L(i,0,999);return s?o?a?l?!1:R("millisecond",i):R("second",r):R("minute",n):R("hour",e)}function y(t){return typeof t>"u"}function Q(t){return typeof t=="number"}function je(t){return typeof t=="number"&&t%1===0}function ci(t){return typeof t=="string"}function fi(t){return Object.prototype.toString.call(t)==="[object Date]"}function er(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function tr(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function mi(t){return Array.isArray(t)?t:[t]}function cn(t,e,n){if(t.length!==0)return t.reduce((r,i)=>{let s=[e(i),i];return r&&n(r[0],s[0])===r[0]?r:s},null)[1]}function hi(t,e){return e.reduce((n,r)=>(n[r]=t[r],n),{})}function de(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Ft(t){if(t==null)return null;if(typeof t!="object")throw new C("Week settings must be an object");if(!L(t.firstDay,1,7)||!L(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!L(e,1,7)))throw new C("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function L(t,e,n){return je(t)&&t>=e&&t<=n}function di(t,e){return t-e*Math.floor(t/e)}function N(t,e=2){let n=t<0,r;return n?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function j(t){if(!(y(t)||t===null||t===""))return parseInt(t,10)}function te(t){if(!(y(t)||t===null||t===""))return parseFloat(t)}function qt(t){if(!(y(t)||t===null||t==="")){let e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function Vt(t,e,n="round"){let r=10**e;switch(n){case"expand":return t>0?Math.ceil(t*r)/r:Math.floor(t*r)/r;case"trunc":return Math.trunc(t*r)/r;case"round":return Math.round(t*r)/r;case"floor":return Math.floor(t*r)/r;case"ceil":return Math.ceil(t*r)/r;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function Ne(t){return t%4===0&&(t%100!==0||t%400===0)}function fe(t){return Ne(t)?366:365}function Ue(t,e){let n=di(e-1,12)+1,r=t+(e-n)/12;return n===2?Ne(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Je(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 fn(t,e,n){return-Lt(Rt(t,1,e),n)+e-1}function ve(t,e=4,n=1){let r=fn(t,e,n),i=fn(t+1,e,n);return(fe(t)-r+i)/7}function At(t){return t>99?t:t>v.twoDigitCutoffYear?1900+t:2e3+t}function nr(t,e,n,r=null){let i=new Date(t),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(s.timeZone=r);let o={timeZoneName:e,...s},a=new Intl.DateTimeFormat(n,o).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Xe(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);let r=parseInt(e,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function rr(t){let e=Number(t);if(typeof t=="boolean"||t===""||!Number.isFinite(e))throw new C(`Invalid unit value ${t}`);return e}function He(t,e){let n={};for(let r in t)if(de(t,r)){let i=t[r];if(i==null)continue;n[e(r)]=rr(i)}return n}function Oe(t,e){let n=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),i=t>=0?"+":"-";switch(e){case"short":return`${i}${N(n,2)}:${N(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${N(n,2)}${N(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Qe(t){return hi(t,["hour","minute","second","millisecond"])}var gi=["January","February","March","April","May","June","July","August","September","October","November","December"],ir=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],yi=["J","F","M","A","M","J","J","A","S","O","N","D"];function sr(t){switch(t){case"narrow":return[...yi];case"short":return[...ir];case"long":return[...gi];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 or=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ar=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],pi=["M","T","W","T","F","S","S"];function lr(t){switch(t){case"narrow":return[...pi];case"short":return[...ar];case"long":return[...or];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var ur=["AM","PM"],bi=["Before Christ","Anno Domini"],wi=["BC","AD"],Ti=["B","A"];function cr(t){switch(t){case"narrow":return[...Ti];case"short":return[...wi];case"long":return[...bi];default:return null}}function Si(t){return ur[t.hour<12?0:1]}function xi(t,e){return lr(e)[t.weekday-1]}function ki(t,e){return sr(e)[t.month-1]}function Oi(t,e){return cr(e)[t.year<0?0:1]}function vi(t,e,n="always",r=!1){let i={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(n==="auto"&&s){let m=t==="days";switch(e){case 1:return m?"tomorrow":`next ${i[t][0]}`;case-1:return m?"yesterday":`last ${i[t][0]}`;case 0:return m?"today":`this ${i[t][0]}`}}let o=Object.is(e,-0)||e<0,a=Math.abs(e),l=a===1,u=i[t],c=r?l?u[1]:u[2]||u[1]:l?i[t][0]:t;return o?`${a} ${c} ago`:`in ${a} ${c}`}function mn(t,e){let n="";for(let r of t)r.literal?n+=r.val:n+=e(r.val);return n}var Ni={D:$e,DD:Dn,DDD:Mn,DDDD:Cn,t:En,tt:In,ttt:Fn,tttt:An,T:Wn,TT:Pn,TTT:Rn,TTTT:Ln,f:qn,ff:Bn,fff:zn,ffff:Zn,F:Vn,FF:_n,FFF:$n,FFFF:Yn},I=class t{static create(e,n={}){return new t(e,n)}static parseFormat(e){let n=null,r="",i=!1,s=[];for(let o=0;o<e.length;o++){let a=e.charAt(o);a==="'"?((r.length>0||i)&&s.push({literal:i||/^\s+$/.test(r),val:r===""?"'":r}),n=null,r="",i=!i):i||a===n?r+=a:(r.length>0&&s.push({literal:/^\s+$/.test(r),val:r}),r=a,n=a)}return r.length>0&&s.push({literal:i||/^\s+$/.test(r),val:r}),s}static macroTokenToFormatOpts(e){return Ni[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0,r=void 0){if(this.opts.forceSimple)return N(e,n);let i={...this.opts};return n>0&&(i.padTo=n),r&&(i.signDisplay=r),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,n){let r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(f,g)=>this.loc.extract(e,f,g),o=f=>e.isOffsetFixed&&e.offset===0&&f.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,f.format):"",a=()=>r?Si(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,g)=>r?ki(e,f):s(g?{month:f}:{month:f,day:"numeric"},"month"),u=(f,g)=>r?xi(e,f):s(g?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),c=f=>{let g=t.macroTokenToFormatOpts(f);return g?this.formatWithSystemDefault(e,g):f},m=f=>r?Oi(e,f):s({era:f},"era"),d=f=>{switch(f){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 o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({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 a();case"d":return i?s({day:"numeric"},"day"):this.num(e.day);case"dd":return i?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return i?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return i?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?s({month:"numeric"},"month"):this.num(e.month);case"MM":return i?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?s({year:"numeric"},"year"):this.num(e.year);case"yy":return i?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return i?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return i?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return m("short");case"GG":return m("long");case"GGGGG":return m("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"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);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 c(f)}};return mn(t.parseFormat(n),d)}formatDurationFromString(e,n){let r=this.opts.signMode==="negativeLargestOnly"?-1:1,i=c=>{switch(c[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},s=(c,m)=>d=>{let f=i(d);if(f){let g=m.isNegativeDuration&&f!==m.largestUnit?r:1,p;return this.opts.signMode==="negativeLargestOnly"&&f!==m.largestUnit?p="never":this.opts.signMode==="all"?p="always":p="auto",this.num(c.get(f)*g,d.length,p)}else return d},o=t.parseFormat(n),a=o.reduce((c,{literal:m,val:d})=>m?c:c.concat(d),[]),l=e.shiftTo(...a.map(i).filter(c=>c)),u={isNegativeDuration:l<0,largestUnit:Object.keys(l.values)[0]};return mn(o,s(l,u))}},fr=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ge(...t){let e=t.reduce((n,r)=>n+r.source,"");return RegExp(`^${e}$`)}function ye(...t){return e=>t.reduce(([n,r,i],s)=>{let[o,a,l]=s(e,i);return[{...n,...o},a||r,l]},[{},null,1]).slice(0,2)}function pe(t,...e){if(t==null)return[null,null];for(let[n,r]of e){let i=n.exec(t);if(i)return r(i)}return[null,null]}function mr(...t){return(e,n)=>{let r={},i;for(i=0;i<t.length;i++)r[t[i]]=j(e[n+i]);return[r,null,n+i]}}var hr=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Di=`(?:${hr.source}?(?:\\[(${fr.source})\\])?)?`,Bt=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,dr=RegExp(`${Bt.source}${Di}`),_t=RegExp(`(?:[Tt]${dr.source})?`),Mi=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ci=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Ei=/(\d{4})-?(\d{3})/,Ii=mr("weekYear","weekNumber","weekDay"),Fi=mr("year","ordinal"),Ai=/(\d{4})-(\d\d)-(\d\d)/,gr=RegExp(`${Bt.source} ?(?:${hr.source}|(${fr.source}))?`),Wi=RegExp(`(?: ${gr.source})?`);function me(t,e,n){let r=t[e];return y(r)?n:j(r)}function Pi(t,e){return[{year:me(t,e),month:me(t,e+1,1),day:me(t,e+2,1)},null,e+3]}function be(t,e){return[{hours:me(t,e,0),minutes:me(t,e+1,0),seconds:me(t,e+2,0),milliseconds:qt(t[e+3])},null,e+4]}function De(t,e){let n=!t[e]&&!t[e+1],r=Xe(t[e+1],t[e+2]),i=n?null:q.instance(r);return[{},i,e+3]}function Me(t,e){let n=t[e]?K.create(t[e]):null;return[{},n,e+1]}var Ri=RegExp(`^T?${Bt.source}$`),Li=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function qi(t){let[e,n,r,i,s,o,a,l,u]=t,c=e[0]==="-",m=l&&l[0]==="-",d=(f,g=!1)=>f!==void 0&&(g||f&&c)?-f:f;return[{years:d(te(n)),months:d(te(r)),weeks:d(te(i)),days:d(te(s)),hours:d(te(o)),minutes:d(te(a)),seconds:d(te(l),l==="-0"),milliseconds:d(qt(u),m)}]}var Vi={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function zt(t,e,n,r,i,s,o){let a={year:e.length===2?At(j(e)):j(e),month:ir.indexOf(n)+1,day:j(r),hour:j(i),minute:j(s)};return o&&(a.second=j(o)),t&&(a.weekday=t.length>3?or.indexOf(t)+1:ar.indexOf(t)+1),a}var Bi=/^(?:(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 _i(t){let[,e,n,r,i,s,o,a,l,u,c,m]=t,d=zt(e,i,r,n,s,o,a),f;return l?f=Vi[l]:u?f=0:f=Xe(c,m),[d,new q(f)]}function zi(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var $i=/^(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$/,Zi=/^(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$/,Yi=/^(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 hn(t){let[,e,n,r,i,s,o,a]=t;return[zt(e,i,r,n,s,o,a),q.utcInstance]}function Ui(t){let[,e,n,r,i,s,o,a]=t;return[zt(e,a,n,r,i,s,o),q.utcInstance]}var Hi=ge(Mi,_t),Gi=ge(Ci,_t),ji=ge(Ei,_t),Ji=ge(dr),yr=ye(Pi,be,De,Me),Xi=ye(Ii,be,De,Me),Qi=ye(Fi,be,De,Me),Ki=ye(be,De,Me);function es(t){return pe(t,[Hi,yr],[Gi,Xi],[ji,Qi],[Ji,Ki])}function ts(t){return pe(zi(t),[Bi,_i])}function ns(t){return pe(t,[$i,hn],[Zi,hn],[Yi,Ui])}function rs(t){return pe(t,[Li,qi])}var is=ye(be);function ss(t){return pe(t,[Ri,is])}var os=ge(Ai,Wi),as=ge(gr),ls=ye(be,De,Me);function us(t){return pe(t,[os,yr],[as,ls])}var dn="Invalid Duration",pr={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},cs={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:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...pr},P=146097/400,ae=146097/4800,fs={years:{quarters:4,months:12,weeks:P/7,days:P,hours:P*24,minutes:P*24*60,seconds:P*24*60*60,milliseconds:P*24*60*60*1e3},quarters:{months:3,weeks:P/28,days:P/4,hours:P*24/4,minutes:P*24*60/4,seconds:P*24*60*60/4,milliseconds:P*24*60*60*1e3/4},months:{weeks:ae/7,days:ae,hours:ae*24,minutes:ae*24*60,seconds:ae*24*60*60,milliseconds:ae*24*60*60*1e3},...pr},re=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],ms=re.slice(0).reverse();function Y(t,e,n=!1){let r={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new E(r)}function br(t,e){let n=e.milliseconds??0;for(let r of ms.slice(1))e[r]&&(n+=e[r]*t[r].milliseconds);return n}function gn(t,e){let n=br(t,e)<0?-1:1;re.reduceRight((r,i)=>{if(y(e[i]))return r;if(r){let s=e[r]*n,o=t[i][r],a=Math.floor(s/o);e[i]+=a*n,e[r]-=a*o*n}return i},null),re.reduce((r,i)=>{if(y(e[i]))return r;if(r){let s=e[r]%1;e[r]-=s,e[i]+=s*t[r][i]}return i},null)}function yn(t){let e={};for(let[n,r]of Object.entries(t))r!==0&&(e[n]=r);return e}var E=class t{constructor(e){let n=e.conversionAccuracy==="longterm"||!1,r=n?fs:cs;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||T.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,n){return t.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new C(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new t({values:He(e,t.normalizeUnit),loc:T.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(Q(e))return t.fromMillis(e);if(t.isDuration(e))return e;if(typeof e=="object")return t.fromObject(e);throw new C(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){let[r]=rs(e);return r?t.fromObject(r,n):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){let[r]=ss(e);return r?t.fromObject(r,n):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new C("need to specify a reason the Duration is invalid");let r=e instanceof F?e:new F(e,n);if(v.throwOnInvalid)throw new wt(r);return new t({invalid:r})}static normalizeUnit(e){let n={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(!n)throw new ze(e);return n}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,n={}){let r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?I.create(this.loc,r).formatDurationFromString(this,e):dn}toHuman(e={}){if(!this.isValid)return dn;let n=e.showZeros!==!1,r=re.map(i=>{let s=this.values[i];return y(s)||s===0&&!n?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).filter(i=>i);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+=Vt(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},S.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?br(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let n=t.fromDurationLike(e),r={};for(let i of re)(de(n.values,i)||de(this.values,i))&&(r[i]=n.get(i)+this.get(i));return Y(this,{values:r},!0)}minus(e){if(!this.isValid)return this;let n=t.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;let n={};for(let r of Object.keys(this.values))n[r]=rr(e(this.values[r],r));return Y(this,{values:n},!0)}get(e){return this[t.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let n={...this.values,...He(e,t.normalizeUnit)};return Y(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:r,matrix:i}={}){let o={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:i,conversionAccuracy:r};return Y(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return gn(this.matrix,e),Y(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=yn(this.normalize().shiftToAll().toObject());return Y(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>t.normalizeUnit(o));let n={},r={},i=this.toObject(),s;for(let o of re)if(e.indexOf(o)>=0){s=o;let a=0;for(let u in r)a+=this.matrix[u][o]*r[u],r[u]=0;Q(i[o])&&(a+=i[o]);let l=Math.trunc(a);n[o]=l,r[o]=(a*1e3-l*1e3)/1e3}else Q(i[o])&&(r[o]=i[o]);for(let o in r)r[o]!==0&&(n[s]+=o===s?r[o]:r[o]/this.matrix[s][o]);return gn(this.matrix,n),Y(this,{values:n},!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 n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return Y(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;let e=yn(this.values);return Y(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 n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(let r of re)if(!n(this.values[r],e.values[r]))return!1;return!0}},le="Invalid Interval";function hs(t,e){return!t||!t.isValid?he.invalid("missing or invalid start"):!e||!e.isValid?he.invalid("missing or invalid end"):e<t?he.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}var he=class t{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new C("need to specify a reason the Interval is invalid");let r=e instanceof F?e:new F(e,n);if(v.throwOnInvalid)throw new bt(r);return new t({invalid:r})}static fromDateTimes(e,n){let r=Te(e),i=Te(n),s=hs(r,i);return s??new t({start:r,end:i})}static after(e,n){let r=E.fromDurationLike(n),i=Te(e);return t.fromDateTimes(i,i.plus(r))}static before(e,n){let r=E.fromDurationLike(n),i=Te(e);return t.fromDateTimes(i.minus(r),i)}static fromISO(e,n){let[r,i]=(e||"").split("/",2);if(r&&i){let s,o;try{s=S.fromISO(r,n),o=s.isValid}catch{o=!1}let a,l;try{a=S.fromISO(i,n),l=a.isValid}catch{l=!1}if(o&&l)return t.fromDateTimes(s,a);if(o){let u=E.fromISO(i,n);if(u.isValid)return t.after(s,u)}else if(l){let u=E.fromISO(r,n);if(u.isValid)return t.before(a,u)}}return t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;let r=this.start.startOf(e,n),i;return n?.useLocaleWeeks?i=this.end.reconfigure({locale:r.locale}):i=this.end,i=i.startOf(e,n),Math.floor(i.diff(r,e).get(e))+(i.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!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:n}={}){return this.isValid?t.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];let n=e.map(Te).filter(o=>this.contains(o)).sort((o,a)=>o.toMillis()-a.toMillis()),r=[],{s:i}=this,s=0;for(;i<this.e;){let o=n[s]||this.e,a=+o>+this.e?this.e:o;r.push(t.fromDateTimes(i,a)),i=a,s+=1}return r}splitBy(e){let n=E.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,s,o=[];for(;r<this.e;){let a=this.start.plus(n.mapUnits(l=>l*i));s=+a>+this.e?this.e:a,o.push(t.fromDateTimes(r,s)),r=s,i+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=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 n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:t.fromDateTimes(n,r)}union(e){if(!this.isValid)return this;let n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return t.fromDateTimes(n,r)}static merge(e){let[n,r]=e.sort((i,s)=>i.s-s.s).reduce(([i,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[i,s.union(o)]:[i.concat([s]),o]:[i,o],[[],null]);return r&&n.push(r),n}static xor(e){let n=null,r=0,i=[],s=e.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...s),a=o.sort((l,u)=>l.time-u.time);for(let l of a)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&i.push(t.fromDateTimes(n,l.time)),n=null);return t.merge(i)}difference(...e){return t.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:le}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=$e,n={}){return this.isValid?I.create(this.s.loc.clone(n),e).formatInterval(this):le}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:le}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:le}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:le}toFormat(e,{separator:n=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:le}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):E.invalid(this.invalidReason)}mapEndpoints(e){return t.fromDateTimes(e(this.s),e(this.e))}},ce=class{static hasDST(e=v.defaultZone){let n=S.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return K.isValidZone(e)}static normalizeZone(e){return J(e,v.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||T.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||T.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||T.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:s="gregory"}={}){return(i||T.create(n,r,s)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:s="gregory"}={}){return(i||T.create(n,r,s)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||T.create(n,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||T.create(n,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return T.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return T.create(n,null,"gregory").eras(e)}static features(){return{relative:er(),localeWeek:tr()}}};function pn(t,e){let n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(E.fromMillis(r).as("days"))}function ds(t,e,n){let r=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{let c=pn(l,u);return(c-c%7)/7}],["days",pn]],i={},s=t,o,a;for(let[l,u]of r)n.indexOf(l)>=0&&(o=l,i[l]=u(t,e),a=s.plus(i),a>e?(i[l]--,t=s.plus(i),t>e&&(a=t,i[l]--,t=s.plus(i))):t=a);return[t,i,a,o]}function gs(t,e,n,r){let[i,s,o,a]=ds(t,e,n),l=e-i,u=n.filter(m=>["hours","minutes","seconds","milliseconds"].indexOf(m)>=0);u.length===0&&(o<e&&(o=i.plus({[a]:1})),o!==i&&(s[a]=(s[a]||0)+l/(o-i)));let c=E.fromObject(s,r);return u.length>0?E.fromMillis(l,r).shiftTo(...u).plus(c):c}var ys="missing Intl.DateTimeFormat.formatToParts support";function w(t,e=n=>n){return{regex:t,deser:([n])=>e(oi(n))}}var ps="\xA0",wr=`[ ${ps}]`,Tr=new RegExp(wr,"g");function bs(t){return t.replace(/\./g,"\\.?").replace(Tr,wr)}function bn(t){return t.replace(/\./g,"").replace(Tr," ").toLowerCase()}function _(t,e){return t===null?null:{regex:RegExp(t.map(bs).join("|")),deser:([n])=>t.findIndex(r=>bn(n)===bn(r))+e}}function wn(t,e){return{regex:t,deser:([,n,r])=>Xe(n,r),groups:e}}function Re(t){return{regex:t,deser:([e])=>e}}function ws(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ts(t,e){let n=B(e),r=B(e,"{2}"),i=B(e,"{3}"),s=B(e,"{4}"),o=B(e,"{6}"),a=B(e,"{1,2}"),l=B(e,"{1,3}"),u=B(e,"{1,6}"),c=B(e,"{1,9}"),m=B(e,"{2,4}"),d=B(e,"{4,6}"),f=k=>({regex:RegExp(ws(k.val)),deser:([D])=>D,literal:!0}),p=(k=>{if(t.literal)return f(k);switch(k.val){case"G":return _(e.eras("short"),0);case"GG":return _(e.eras("long"),0);case"y":return w(u);case"yy":return w(m,At);case"yyyy":return w(s);case"yyyyy":return w(d);case"yyyyyy":return w(o);case"M":return w(a);case"MM":return w(r);case"MMM":return _(e.months("short",!0),1);case"MMMM":return _(e.months("long",!0),1);case"L":return w(a);case"LL":return w(r);case"LLL":return _(e.months("short",!1),1);case"LLLL":return _(e.months("long",!1),1);case"d":return w(a);case"dd":return w(r);case"o":return w(l);case"ooo":return w(i);case"HH":return w(r);case"H":return w(a);case"hh":return w(r);case"h":return w(a);case"mm":return w(r);case"m":return w(a);case"q":return w(a);case"qq":return w(r);case"s":return w(a);case"ss":return w(r);case"S":return w(l);case"SSS":return w(i);case"u":return Re(c);case"uu":return Re(a);case"uuu":return w(n);case"a":return _(e.meridiems(),0);case"kkkk":return w(s);case"kk":return w(m,At);case"W":return w(a);case"WW":return w(r);case"E":case"c":return w(n);case"EEE":return _(e.weekdays("short",!1),1);case"EEEE":return _(e.weekdays("long",!1),1);case"ccc":return _(e.weekdays("short",!0),1);case"cccc":return _(e.weekdays("long",!0),1);case"Z":case"ZZ":return wn(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return wn(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Re(/[a-z_+-/]{1,256}?/i);case" ":return Re(/[^\S\n\r]/);default:return f(k)}})(t)||{invalidReason:ys};return p.token=t,p}var Ss={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 xs(t,e,n){let{type:r,value:i}=t;if(r==="literal"){let l=/^\s+$/.test(i);return{literal:!l,val:l?" ":i}}let s=e[r],o=r;r==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=n.hour12?"hour12":"hour24");let a=Ss[o];if(typeof a=="object"&&(a=a[s]),a)return{literal:!1,val:a}}function ks(t){return[`^${t.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,t]}function Os(t,e,n){let r=t.match(e);if(r){let i={},s=1;for(let o in n)if(de(n,o)){let a=n[o],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(s,s+l))),s+=l}return[r,i]}else return[r,{}]}function vs(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}},n=null,r;return y(t.z)||(n=K.create(t.z)),y(t.Z)||(n||(n=new q(t.Z)),r=t.Z),y(t.q)||(t.M=(t.q-1)*3+1),y(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),y(t.u)||(t.S=qt(t.u)),[Object.keys(t).reduce((s,o)=>{let a=e(o);return a&&(s[a]=t[o]),s},{}),n,r]}var mt=null;function Ns(){return mt||(mt=S.fromMillis(1555555555555)),mt}function Ds(t,e){if(t.literal)return t;let n=I.macroTokenToFormatOpts(t.val),r=kr(n,e);return r==null||r.includes(void 0)?t:r}function Sr(t,e){return Array.prototype.concat(...t.map(n=>Ds(n,e)))}var Ge=class{constructor(e,n){if(this.locale=e,this.format=n,this.tokens=Sr(I.parseFormat(n),e),this.units=this.tokens.map(r=>Ts(r,e)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){let[r,i]=ks(this.units);this.regex=RegExp(r,"i"),this.handlers=i}}explainFromTokens(e){if(this.isValid){let[n,r]=Os(e,this.regex,this.handlers),[i,s,o]=r?vs(r):[null,null,void 0];if(de(r,"a")&&de(r,"H"))throw new X("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:i,zone:s,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function xr(t,e,n){return new Ge(t,n).explainFromTokens(e)}function Ms(t,e,n){let{result:r,zone:i,specificOffset:s,invalidReason:o}=xr(t,e,n);return[r,i,s,o]}function kr(t,e){if(!t)return null;let r=I.create(e,t).dtFormatter(Ns()),i=r.formatToParts(),s=r.resolvedOptions();return i.map(o=>xs(o,t,s))}var ht="Invalid DateTime",Tn=864e13;function xe(t){return new F("unsupported zone",`the zone "${t.name}" is not supported`)}function dt(t){return t.weekData===null&&(t.weekData=Ye(t.c)),t.weekData}function gt(t){return t.localWeekData===null&&(t.localWeekData=Ye(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function ne(t,e){let n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new S({...n,...e,old:n})}function Or(t,e,n){let r=t-e*60*1e3,i=n.offset(r);if(e===i)return[r,e];r-=(i-e)*60*1e3;let s=n.offset(r);return i===s?[r,i]:[t-Math.min(i,s)*60*1e3,Math.max(i,s)]}function Le(t,e){t+=e*60*1e3;let n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Ve(t,e,n){return Or(Je(t),e,n)}function Sn(t,e){let n=t.o,r=t.c.year+Math.trunc(e.years),i=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...t.c,year:r,month:i,day:Math.min(t.c.day,Ue(r,i))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=E.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"),a=Je(s),[l,u]=Or(a,n,t.zone);return o!==0&&(l+=o,u=t.zone.offset(l)),{ts:l,o:u}}function ue(t,e,n,r,i,s){let{setZone:o,zone:a}=n;if(t&&Object.keys(t).length!==0||e){let l=e||a,u=S.fromObject(t,{...n,zone:l,specificOffset:s});return o?u:u.setZone(a)}else return S.invalid(new F("unparsable",`the input "${i}" can't be parsed as ${r}`))}function qe(t,e,n=!0){return t.isValid?I.create(T.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function yt(t,e,n){let r=t.c.year>9999||t.c.year<0,i="";if(r&&t.c.year>=0&&(i+="+"),i+=N(t.c.year,r?6:4),n==="year")return i;if(e){if(i+="-",i+=N(t.c.month),n==="month")return i;i+="-"}else if(i+=N(t.c.month),n==="month")return i;return i+=N(t.c.day),i}function xn(t,e,n,r,i,s,o){let a=!n||t.c.millisecond!==0||t.c.second!==0,l="";switch(o){case"day":case"month":case"year":break;default:if(l+=N(t.c.hour),o==="hour")break;if(e){if(l+=":",l+=N(t.c.minute),o==="minute")break;a&&(l+=":",l+=N(t.c.second))}else{if(l+=N(t.c.minute),o==="minute")break;a&&(l+=N(t.c.second))}if(o==="second")break;a&&(!r||t.c.millisecond!==0)&&(l+=".",l+=N(t.c.millisecond,3))}return i&&(t.isOffsetFixed&&t.offset===0&&!s?l+="Z":t.o<0?(l+="-",l+=N(Math.trunc(-t.o/60)),l+=":",l+=N(Math.trunc(-t.o%60))):(l+="+",l+=N(Math.trunc(t.o/60)),l+=":",l+=N(Math.trunc(t.o%60)))),s&&(l+="["+t.zone.ianaName+"]"),l}var vr={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Cs={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Es={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Be=["year","month","day","hour","minute","second","millisecond"],Is=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Fs=["year","ordinal","hour","minute","second","millisecond"];function _e(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 ze(t);return e}function kn(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return _e(t)}}function As(t){if(ke===void 0&&(ke=v.now()),t.type!=="iana")return t.offset(ke);let e=t.name,n=Wt.get(e);return n===void 0&&(n=t.offset(ke),Wt.set(e,n)),n}function On(t,e){let n=J(e.zone,v.defaultZone);if(!n.isValid)return S.invalid(xe(n));let r=T.fromObject(e),i,s;if(y(t.year))i=v.now();else{for(let l of Be)y(t[l])&&(t[l]=vr[l]);let o=Qn(t)||Kn(t);if(o)return S.invalid(o);let a=As(n);[i,s]=Ve(t,a,n)}return new S({ts:i,zone:n,loc:r,o:s})}function vn(t,e,n){let r=y(n.round)?!0:n.round,i=y(n.rounding)?"trunc":n.rounding,s=(a,l)=>(a=Vt(a,r||n.calendary?0:2,n.calendary?"round":i),e.loc.clone(n).relFormatter(n).format(a,l)),o=a=>n.calendary?e.hasSame(t,a)?0:e.startOf(a).diff(t.startOf(a),a).get(a):e.diff(t,a).get(a);if(n.unit)return s(o(n.unit),n.unit);for(let a of n.units){let l=o(a);if(Math.abs(l)>=1)return s(l,a)}return s(t>e?-0:0,n.units[n.units.length-1])}function Nn(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}var ke,Wt=new Map,S=class t{constructor(e){let n=e.zone||v.defaultZone,r=e.invalid||(Number.isNaN(e.ts)?new F("invalid input"):null)||(n.isValid?null:xe(n));this.ts=y(e.ts)?v.now():e.ts;let i=null,s=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[i,s]=[e.old.c,e.old.o];else{let a=Q(e.o)&&!e.old?e.o:n.offset(this.ts);i=Le(this.ts,a),r=Number.isNaN(i.year)?new F("invalid input"):null,i=r?null:i,s=r?null:a}this._zone=n,this.loc=e.loc||T.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=i,this.o=s,this.isLuxonDateTime=!0}static now(){return new t({})}static local(){let[e,n]=Nn(arguments),[r,i,s,o,a,l,u]=n;return On({year:r,month:i,day:s,hour:o,minute:a,second:l,millisecond:u},e)}static utc(){let[e,n]=Nn(arguments),[r,i,s,o,a,l,u]=n;return e.zone=q.utcInstance,On({year:r,month:i,day:s,hour:o,minute:a,second:l,millisecond:u},e)}static fromJSDate(e,n={}){let r=fi(e)?e.valueOf():NaN;if(Number.isNaN(r))return t.invalid("invalid input");let i=J(n.zone,v.defaultZone);return i.isValid?new t({ts:r,zone:i,loc:T.fromObject(n)}):t.invalid(xe(i))}static fromMillis(e,n={}){if(Q(e))return e<-Tn||e>Tn?t.invalid("Timestamp out of range"):new t({ts:e,zone:J(n.zone,v.defaultZone),loc:T.fromObject(n)});throw new C(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(Q(e))return new t({ts:e*1e3,zone:J(n.zone,v.defaultZone),loc:T.fromObject(n)});throw new C("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};let r=J(n.zone,v.defaultZone);if(!r.isValid)return t.invalid(xe(r));let i=T.fromObject(n),s=He(e,kn),{minDaysInFirstWeek:o,startOfWeek:a}=un(s,i),l=v.now(),u=y(n.specificOffset)?r.offset(l):n.specificOffset,c=!y(s.ordinal),m=!y(s.year),d=!y(s.month)||!y(s.day),f=m||d,g=s.weekYear||s.weekNumber;if((f||c)&&g)throw new X("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&c)throw new X("Can't mix ordinal dates with month/day");let p=g||s.weekday&&!f,k,D,M=Le(l,u);p?(k=Is,D=Cs,M=Ye(M,o,a)):c?(k=Fs,D=Es,M=ft(M)):(k=Be,D=vr);let O=!1;for(let V of k){let Ae=s[V];y(Ae)?O?s[V]=D[V]:s[V]=M[V]:O=!0}let Z=p?li(s,o,a):c?ui(s):Qn(s),ee=Z||Kn(s);if(ee)return t.invalid(ee);let oe=p?an(s,o,a):c?ln(s):s,[H,G]=Ve(oe,u,r),W=new t({ts:H,zone:r,o:G,loc:i});return s.weekday&&f&&e.weekday!==W.weekday?t.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${W.toISO()}`):W.isValid?W:t.invalid(W.invalid)}static fromISO(e,n={}){let[r,i]=es(e);return ue(r,i,n,"ISO 8601",e)}static fromRFC2822(e,n={}){let[r,i]=ts(e);return ue(r,i,n,"RFC 2822",e)}static fromHTTP(e,n={}){let[r,i]=ns(e);return ue(r,i,n,"HTTP",n)}static fromFormat(e,n,r={}){if(y(e)||y(n))throw new C("fromFormat requires an input string and a format");let{locale:i=null,numberingSystem:s=null}=r,o=T.fromOpts({locale:i,numberingSystem:s,defaultToEN:!0}),[a,l,u,c]=Ms(o,e,n);return c?t.invalid(c):ue(a,l,r,`format ${n}`,e,u)}static fromString(e,n,r={}){return t.fromFormat(e,n,r)}static fromSQL(e,n={}){let[r,i]=us(e);return ue(r,i,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new C("need to specify a reason the DateTime is invalid");let r=e instanceof F?e:new F(e,n);if(v.throwOnInvalid)throw new pt(r);return new t({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){let r=kr(e,T.fromObject(n));return r?r.map(i=>i?i.val:null).join(""):null}static expandFormat(e,n={}){return Sr(I.parseFormat(e),T.fromObject(n)).map(i=>i.val).join("")}static resetCache(){ke=void 0,Wt.clear()}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?dt(this).weekYear:NaN}get weekNumber(){return this.isValid?dt(this).weekNumber:NaN}get weekday(){return this.isValid?dt(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?gt(this).weekday:NaN}get localWeekNumber(){return this.isValid?gt(this).weekNumber:NaN}get localWeekYear(){return this.isValid?gt(this).weekYear:NaN}get ordinal(){return this.isValid?ft(this.c).ordinal:NaN}get monthShort(){return this.isValid?ce.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ce.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ce.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ce.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,n=6e4,r=Je(this.c),i=this.zone.offset(r-e),s=this.zone.offset(r+e),o=this.zone.offset(r-i*n),a=this.zone.offset(r-s*n);if(o===a)return[this];let l=r-o*n,u=r-a*n,c=Le(l,o),m=Le(u,a);return c.hour===m.hour&&c.minute===m.minute&&c.second===m.second&&c.millisecond===m.millisecond?[ne(this,{ts:l}),ne(this,{ts:u})]:[this]}get isInLeapYear(){return Ne(this.year)}get daysInMonth(){return Ue(this.year,this.month)}get daysInYear(){return this.isValid?fe(this.year):NaN}get weeksInWeekYear(){return this.isValid?ve(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ve(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:n,numberingSystem:r,calendar:i}=I.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(e=0,n={}){return this.setZone(q.instance(e),n)}toLocal(){return this.setZone(v.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(e=J(e,v.defaultZone),e.equals(this.zone))return this;if(e.isValid){let i=this.ts;if(n||r){let s=e.offset(this.ts),o=this.toObject();[i]=Ve(o,s,e)}return ne(this,{ts:i,zone:e})}else return t.invalid(xe(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:r}={}){let i=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:r});return ne(this,{loc:i})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let n=He(e,kn),{minDaysInFirstWeek:r,startOfWeek:i}=un(n,this.loc),s=!y(n.weekYear)||!y(n.weekNumber)||!y(n.weekday),o=!y(n.ordinal),a=!y(n.year),l=!y(n.month)||!y(n.day),u=a||l,c=n.weekYear||n.weekNumber;if((u||o)&&c)throw new X("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new X("Can't mix ordinal dates with month/day");let m;s?m=an({...Ye(this.c,r,i),...n},r,i):y(n.ordinal)?(m={...this.toObject(),...n},y(n.day)&&(m.day=Math.min(Ue(m.year,m.month),m.day))):m=ln({...ft(this.c),...n});let[d,f]=Ve(m,this.o,this.zone);return ne(this,{ts:d,o:f})}plus(e){if(!this.isValid)return this;let n=E.fromDurationLike(e);return ne(this,Sn(this,n))}minus(e){if(!this.isValid)return this;let n=E.fromDurationLike(e).negate();return ne(this,Sn(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;let r={},i=E.normalizeUnit(e);switch(i){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(i==="weeks")if(n){let s=this.loc.getStartOfWeek(),{weekday:o}=this;o<s&&(r.weekNumber=this.weekNumber-1),r.weekday=s}else r.weekday=1;if(i==="quarters"){let s=Math.ceil(this.month/3);r.month=(s-1)*3+1}return this.set(r)}endOf(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?I.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):ht}toLocaleString(e=$e,n={}){return this.isValid?I.create(this.loc.clone(n),e).formatDateTime(this):ht}toLocaleParts(e={}){return this.isValid?I.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:s=!1,precision:o="milliseconds"}={}){if(!this.isValid)return null;o=_e(o);let a=e==="extended",l=yt(this,a,o);return Be.indexOf(o)>=3&&(l+="T"),l+=xn(this,a,n,r,i,s,o),l}toISODate({format:e="extended",precision:n="day"}={}){return this.isValid?yt(this,e==="extended",_e(n)):null}toISOWeekDate(){return qe(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:s=!1,format:o="extended",precision:a="milliseconds"}={}){return this.isValid?(a=_e(a),(i&&Be.indexOf(a)>=3?"T":"")+xn(this,o==="extended",n,e,r,s,a)):null}toRFC2822(){return qe(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return qe(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?yt(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||e)&&(r&&(i+=" "),n?i+="z":e&&(i+="ZZ")),qe(this,i,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ht}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}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 n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",r={}){if(!this.isValid||!e.isValid)return E.invalid("created by diffing an invalid DateTime");let i={locale:this.locale,numberingSystem:this.numberingSystem,...r},s=mi(n).map(E.normalizeUnit),o=e.valueOf()>this.valueOf(),a=o?this:e,l=o?e:this,u=gs(a,l,s,i);return o?u.negate():u}diffNow(e="milliseconds",n={}){return this.diff(t.now(),e,n)}until(e){return this.isValid?he.fromDateTimes(this,e):this}hasSame(e,n,r){if(!this.isValid)return!1;let i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(n,r)<=i&&i<=s.endOf(n,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 n=e.base||t.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0,i=["years","months","days","hours","minutes","seconds"],s=e.unit;return Array.isArray(e.unit)&&(i=e.unit,s=void 0),vn(n,this.plus(r),{...e,numeric:"always",units:i,unit:s})}toRelativeCalendar(e={}){return this.isValid?vn(e.base||t.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(t.isDateTime))throw new C("min requires all arguments be DateTimes");return cn(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(t.isDateTime))throw new C("max requires all arguments be DateTimes");return cn(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,r={}){let{locale:i=null,numberingSystem:s=null}=r,o=T.fromOpts({locale:i,numberingSystem:s,defaultToEN:!0});return xr(o,e,n)}static fromStringExplain(e,n,r={}){return t.fromFormatExplain(e,n,r)}static buildFormatParser(e,n={}){let{locale:r=null,numberingSystem:i=null}=n,s=T.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return new Ge(s,e)}static fromFormatParser(e,n,r={}){if(y(e)||y(n))throw new C("fromFormatParser requires an input string and a format parser");let{locale:i=null,numberingSystem:s=null}=r,o=T.fromOpts({locale:i,numberingSystem:s,defaultToEN:!0});if(!o.equals(n.locale))throw new C(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`);let{result:a,zone:l,specificOffset:u,invalidReason:c}=n.explainFromTokens(e);return c?t.invalid(c):ue(a,l,r,`format ${n.format}`,e,u)}static get DATE_SHORT(){return $e}static get DATE_MED(){return Dn}static get DATE_MED_WITH_WEEKDAY(){return $r}static get DATE_FULL(){return Mn}static get DATE_HUGE(){return Cn}static get TIME_SIMPLE(){return En}static get TIME_WITH_SECONDS(){return In}static get TIME_WITH_SHORT_OFFSET(){return Fn}static get TIME_WITH_LONG_OFFSET(){return An}static get TIME_24_SIMPLE(){return Wn}static get TIME_24_WITH_SECONDS(){return Pn}static get TIME_24_WITH_SHORT_OFFSET(){return Rn}static get TIME_24_WITH_LONG_OFFSET(){return Ln}static get DATETIME_SHORT(){return qn}static get DATETIME_SHORT_WITH_SECONDS(){return Vn}static get DATETIME_MED(){return Bn}static get DATETIME_MED_WITH_SECONDS(){return _n}static get DATETIME_MED_WITH_WEEKDAY(){return Zr}static get DATETIME_FULL(){return zn}static get DATETIME_FULL_WITH_SECONDS(){return $n}static get DATETIME_HUGE(){return Zn}static get DATETIME_HUGE_WITH_SECONDS(){return Yn}};function Te(t){if(S.isDateTime(t))return t;if(t&&t.valueOf&&Q(t.valueOf()))return S.fromJSDate(t);if(t&&typeof t=="object")return S.fromObject(t);throw new C(`Unknown datetime argument: ${t}, of type ${typeof t}`)}function se(t,e){return t.length?typeof t[0]=="number"?t:t.map(e??(n=>n.close)):[]}function Ke(t,e,n){let r=se(t,n),i=new Array(r.length),s=0,o=0;for(let a=0;a<r.length;a++){let l=r[a];if(isNaN(l)||(s+=l,o++),a>=e){let u=r[a-e];isNaN(u)||(s-=u,o--)}i[a]=o>=e?s/e:NaN}return i}function Ce(t,e,n){let r=se(t,n),i=2/(e+1),s=new Array(r.length),o=NaN;for(let a=0;a<r.length;a++){let l=r[a];o=isNaN(o)?l:l*i+o*(1-i),s[a]=o}return s}function et(t,e,n){let r=se(t,n),i=new Array(r.length).fill(NaN),s=e*(e+1)/2;for(let o=e-1;o<r.length;o++){let a=0;for(let l=0;l<e;l++)a+=r[o-l]*(e-l);i[o]=a/s}return i}function Ws(t,e,n){let r=se(t,n),i=Math.floor(e/2),s=Math.round(Math.sqrt(e)),o=et(r,i),a=et(r,e),l=r.map((u,c)=>2*o[c]-a[c]);return et(l,s)}function tt(t,e,n){let r=se(t,n),i=new Array(r.length).fill(NaN),s=NaN;for(let o=0;o<r.length;o++){let a=r[o];if(isNaN(s)){if(o<e-1)continue;let l=0;for(let u=o-e+1;u<=o;u++)l+=r[u];s=l/e,i[o]=s}else s=(s*(e-1)+a)/e,i[o]=s}return i}function Ps(t,e,n){let r=se(t,n),i=new Array(r.length).fill(NaN);for(let s=e-1;s<r.length;s++){let o=0,a=0,l=0,u=0;for(let d=0;d<e;d++){let f=d,g=r[s-(e-1-d)];o+=f,a+=g,l+=f*g,u+=f*f}let c=e,m=(c*l-o*a)/(c*u-o*o);i[s]=(a-m*o)/c+m*(e-1)}return i}function Rs(t,e=14){let n=t.length;if(n===0)return[];let r=new Array(n),i=new Array(n);r[0]=0,i[0]=0;for(let l=1;l<n;l++){let u=t[l].close-t[l-1].close;r[l]=u>0?u:0,i[l]=u<0?-u:0}let s=tt(r,e),o=tt(i,e),a=new Array(n);for(let l=0;l<n;l++)a[l]=isNaN(s[l])?NaN:o[l]===0?100:100-100/(1+s[l]/o[l]);return a}function Ls(t,e=14,n=3,r=3){function i(c,m){let d=new Array(c.length).fill(NaN),f=0,g=0;for(let p=0;p<c.length;p++)isNaN(c[p])||(f+=c[p],g++),p>=m&&!isNaN(c[p-m])&&(f-=c[p-m],g--),d[p]=g>0?f/g:NaN;return d}let s=t.length,o=Ee(t.map(c=>c.high),e),a=Ie(t.map(c=>c.low),e),l=new Array(s).fill(NaN);for(let c=e-1;c<s;c++){let m=o[c],d=a[c];l[c]=m===d?50:(t[c].close-d)/(m-d)*100}let u=i(l,r);return{k:u,d:i(u,n)}}function qs(t,e=12,n=26,r=9){let i=Ce(t,e),s=Ce(t,n),o=t.length,a=new Array(o);for(let c=0;c<o;c++)a[c]=i[c]-s[c];let l=Ce(a,r),u=new Array(o);for(let c=0;c<o;c++)u[c]=a[c]-l[c];return{macd:a,signal:l,histogram:u}}function $t(t,e=14){return tt(Nr(t),e)}function Nr(t){let e=t.length,n=new Array(e);for(let r=0;r<e;r++){let i=t[r];if(r===0){n[r]=i.high-i.low;continue}let s=t[r-1].close;n[r]=Math.max(i.high-i.low,Math.abs(i.high-s),Math.abs(i.low-s))}return n}function Dr(t,e){let n=Array.isArray(e)?e:new Array(t.length).fill(e);return t.map((r,i)=>i>0&&r>n[i]&&t[i-1]<=n[i-1])}function Mr(t,e){let n=Array.isArray(e)?e:new Array(t.length).fill(e);return t.map((r,i)=>i>0&&r<n[i]&&t[i-1]>=n[i-1])}function Vs(t,e){let n=Dr(t,e),r=Mr(t,e);return n.map((i,s)=>i||r[s])}function Bs(t,e=1){return t.map((n,r)=>{if(r<e)return!1;for(let i=1;i<=e;i++)if(t[r-i+1]<=t[r-i])return!1;return!0})}function _s(t,e=1){return t.map((n,r)=>{if(r<e)return!1;for(let i=1;i<=e;i++)if(t[r-i+1]>=t[r-i])return!1;return!0})}function zs(t,e=1){return t.map((n,r)=>r<e?NaN:n-t[r-e])}function $s(t){let e=NaN;return t.map((n,r)=>n?(e=r,0):isNaN(e)?NaN:r-e)}function Zs(t,e,n=0){let r=[];return t.map((i,s)=>{i&&r.push(s);let o=r.length-1-n;return o>=0?e[r[o]]:NaN})}function Cr(t,e,n){let r=t.length,i=new Array(r).fill(NaN),s=new Array(r),o=0,a=0;for(let l=0;l<r;l++){let u=t[l];if(!isNaN(u)){for(;a>o;){let c=t[s[a-1]];if(n?c<=u:c>=u)a--;else break}s[a++]=l}for(;a>o&&s[o]<=l-e;)o++;l>=e-1&&(i[l]=a>o?t[s[o]]:n?-1/0:1/0)}return i}function Ee(t,e){return Cr(t,e,!0)}function Ie(t,e){return Cr(t,e,!1)}function Ys(t,e=5,n=5){let r=t.length,i=new Array(r).fill(NaN);for(let s=e;s<r-n;s++){let o=t[s].high,a=!0;for(let l=s-e;l<=s+n;l++)if(l!==s&&t[l].high>=o){a=!1;break}a&&(i[s]=o)}return i}function Us(t,e=5,n=5){let r=t.length,i=new Array(r).fill(NaN);for(let s=e;s<r-n;s++){let o=t[s].low,a=!0;for(let l=s-e;l<=s+n;l++)if(l!==s&&t[l].low<=o){a=!1;break}a&&(i[s]=o)}return i}function Er(t,e=20,n=2,r=i=>i.close){let i=t.length,s=new Array(i).fill(NaN),o=new Array(i).fill(NaN),a=new Array(i).fill(NaN),l=new Array(i),u=0,c=0;for(let m=0;m<i;m++){let d=r(t[m]);if(l[m]=d,u+=d,c+=d*d,m>=e){let f=l[m-e];u-=f,c-=f*f}if(m>=e-1){let f=u/e,g=Math.sqrt(Math.max(0,c/e-f*f));s[m]=f,o[m]=f+n*g,a[m]=f-n*g}}return{upper:o,mid:s,lower:a}}function Hs(t,e=20,n=2){let{upper:r,mid:i,lower:s}=Er(t,e,n);return i.map((o,a)=>isNaN(o)||o===0?NaN:(r[a]-s[a])/o)}function Gs(t,e=20){let n=Ee(t.map(i=>i.high),e),r=Ie(t.map(i=>i.low),e);return{upper:n,mid:n.map((i,s)=>(i+r[s])/2),lower:r}}function js(t,e=20,n=10,r=1.5){let i=Ce(t,e),s=$t(t,n);return{upper:i.map((o,a)=>o+r*s[a]),mid:i,lower:i.map((o,a)=>o-r*s[a])}}function Js(t,e=0){let n=new Array(t.length).fill(NaN),r=864e5,i=0,s=0,o=NaN;for(let a=0;a<t.length;a++){let l=Number(t[a].ts/1000000n),u=Math.floor((l-e*36e5)/r);u!==o&&(i=0,s=0,o=u);let c=(t[a].high+t[a].low+t[a].close)/3;i+=c*t[a].volume,s+=t[a].volume,n[a]=s===0?NaN:i/s}return n}function Xs(t){let e=t.map(n=>(n.high+n.low)/2);return{jaw:Ke(e,13),teeth:Ke(e,8),lips:Ke(e,5)}}function Ir(t,e,n){let r=se(t,n),i=r.length,s=new Array(i).fill(NaN),o=0,a=0;for(let l=0;l<i;l++)if(o+=r[l],a+=r[l]*r[l],l>=e&&(o-=r[l-e],a-=r[l-e]*r[l-e]),l>=e-1){let u=o/e;s[l]=Math.sqrt(Math.max(0,a/e-u*u))}return s}function Qs(t,e,n){return Ir(t,e,n).map(r=>r*r)}function Ks(t,e){function n(i,s){let o=new Array(i.length).fill(NaN),a=0,l=0;for(let u=0;u<i.length;u++)isNaN(i[u])||(a+=i[u],l++),u>=s&&!isNaN(i[u-s])&&(a-=i[u-s],l--),o[u]=l>0?a/l:NaN;return o}let r=n(t,e);return t.map((i,s)=>Math.abs(i-r[s]))}function eo(t,e,n){let r=new Array(t.length).fill(NaN),i=0,s=0;for(let o=0;o<t.length;o++){if(i+=t[o],s+=e[o],o>=n&&(i-=t[o-n],s-=e[o-n]),o<n-1)continue;let a=i/n,l=s/n,u=0,c=0,m=0;for(let f=o-n+1;f<=o;f++){let g=t[f]-a,p=e[f]-l;u+=g*p,c+=g*g,m+=p*p}let d=Math.sqrt(c*m);r[o]=d===0?0:u/d}return r}var to=Ee,no=Ie;function ro(t,e){let n=new Array(t.length).fill(NaN);for(let r=e-1;r<t.length;r++){let i=t.slice(r-e+1,r+1).sort((o,a)=>o-a),s=Math.floor(e/2);n[r]=e%2===0?(i[s-1]+i[s])/2:i[s]}return n}function io(t,e){let n=[];for(let r=0;r<t.length&&r<e.length;r++)!isNaN(e[r])&&isFinite(e[r])&&n.push({t:t[r],price:e[r]});return n}function so(t){return t[t.length-1]}function oo(t,e=0){return t==null||isNaN(t)?e:t}function ao(t,e,n,r=[],i=!1){return{type:"line",pts:t,color:e,width:n,dash:r,connect:i}}function lo(t,e,n,r=[]){return{type:"hline",price:t,color:e,width:n,dash:r}}function uo(t,e,n=0,r=.2){return{type:"histogram",pts:t,color:e,base:n,gap:r}}function co(t,e,n,r,i=12,s=!1,o="left",a="middle",l=!1,u=99999){return{type:"label",text:t,x:e,y:n,color:r,fontSize:i,bold:s,horzAlign:o,vertAlign:a,anchored:l,maxWidth:u}}function fo(t,e,n){return{type:"fill",pts1:t,pts2:e,opts:n}}function mo(t,e,n,r,i={}){return{type:"rect",t1:t,t2:n,price1:e,price2:r,...i}}function ho(t,e,n,r={}){return{type:"circle",t,price:e,radius:n,...r}}function go(t,e,n=1,r=[]){return{type:"vline",t,color:e,width:n,dash:r}}function yo(t,e,n,r,i=10,s="",o=""){return{type:"arrow",t,price:e,direction:n,color:r,size:i,label:s,labelColor:o||r}}function po(t,e,n,r,i,s=1,o=[],a="none"){return{type:"trendline",t1:t,price1:e,t2:n,price2:r,color:i,width:s,dash:o,extend:a}}function bo(t,e,n,r="",i=1){return{type:"band",priceHigh:t,priceLow:e,fillColor:n,borderColor:r,borderWidth:i}}function wo(t,e={}){return{type:"polygon",pts:t,...e}}function To(t,e,n=3){return{type:"dots",pts:t,color:e,radius:n}}function So(t,e,n,r,i,s={}){return{type:"badge",t,price:e,text:n,textColor:r,bgColor:i,...s}}function xo(t,e,n,r,i,s){return{type:"trade",side:t,entryTs:e,entryPrice:n,exitTs:r,exitPrice:i,pnl:s}}function ko(t){let e=new Array(t.length).fill(0);for(let n=1;n<t.length;n++){let r=t[n].close>t[n-1].close?t[n].volume:t[n].close<t[n-1].close?-t[n].volume:0;e[n]=e[n-1]+r}return e}function Oo(t,e=14){let n=t.length,r=new Array(n).fill(NaN),i=t.map(u=>(u.high+u.low+u.close)/3),s=new Array(n).fill(0),o=new Array(n).fill(0);for(let u=1;u<n;u++){let c=i[u]*t[u].volume;i[u]>i[u-1]?s[u]=c:i[u]<i[u-1]&&(o[u]=c)}let a=0,l=0;for(let u=1;u<n;u++)a+=s[u],l+=o[u],u>e&&(a-=s[u-e],l-=o[u-e]),u>=e&&(r[u]=l===0?100:100-100/(1+a/l));return r}function vo(t,e=20){let n=t.length,r=new Array(n).fill(NaN),i=t.map(o=>(o.high+o.low+o.close)/3),s=0;for(let o=0;o<n;o++){if(s+=i[o],o>=e&&(s-=i[o-e]),o<e-1)continue;let a=s/e,l=0;for(let u=o-e+1;u<=o;u++)l+=Math.abs(i[u]-a);l/=e,r[o]=l===0?0:(i[o]-a)/(.015*l)}return r}function No(t,e=14){let n=t.length,r=new Array(n).fill(NaN),i=Ee(t.map(o=>o.high),e),s=Ie(t.map(o=>o.low),e);for(let o=e-1;o<n;o++){let a=i[o],l=s[o];r[o]=a===l?-50:(a-t[o].close)/(a-l)*-100}return r}function Do(t,e=10,n=3){let r=t.length,i=$t(t,e),s=new Array(r).fill(NaN),o=new Array(r).fill(NaN),a=new Array(r).fill(1),l=e;if(r<=l)return{trend:a,upper:s,lower:o};s[l]=(t[l].high+t[l].low)/2+n*i[l],o[l]=(t[l].high+t[l].low)/2-n*i[l];for(let u=l+1;u<r;u++){let c=(t[u].high+t[u].low)/2,m=c+n*i[u],d=c-n*i[u],f=t[u-1].close;s[u]=m<s[u-1]||f>s[u-1]?m:s[u-1],o[u]=d>o[u-1]||f<o[u-1]?d:o[u-1],a[u-1]===-1&&t[u].close>s[u-1]?a[u]=1:a[u-1]===1&&t[u].close<o[u-1]?a[u]=-1:a[u]=a[u-1]}return{trend:a,upper:s,lower:o}}function Mo(t,e,n){if(t.length===0)return[];let r=[],i=new Array(t.length);for(let l=0;l<t.length;l++)i[l]=Number(t[l].ts/1000000n);let s=l=>{let u=0,c=i.length;for(;u<c;){let m=u+c>>>1;i[m]<l?u=m+1:c=m}return u},o=new Map,a=l=>{let u=o.get(l);if(u)return u;u=[];let c=-1/0;for(let m=0;m<i.length;m++){if(i[m]<c)continue;let d=S.fromMillis(i[m],{zone:l});u.push({year:d.year,month:d.month,day:d.day}),c=d.startOf("day").plus({days:1}).toMillis()}return o.set(l,u),u};for(let l of e){let u=l.tz??n?.tz??"UTC";for(let{year:c,month:m,day:d}of a(u)){let f=S.fromObject({year:c,month:m,day:d,hour:l.startHour,minute:l.startMinute,second:0,millisecond:0},{zone:u}),g=S.fromObject({year:c,month:m,day:d,hour:l.endHour,minute:l.endMinute,second:0,millisecond:0},{zone:u});g<=f&&(g=g.plus({days:1}));let p=f.toMillis(),k=g.toMillis(),D=-1/0,M=1/0;for(let O=s(p);O<i.length&&i[O]<k;O++)t[O].high>D&&(D=t[O].high),t[O].low<M&&(M=t[O].low);D===-1/0||M===1/0||r.push({startTs:BigInt(p)*1000000n,endTs:BigInt(k)*1000000n,high:D,low:M,label:l.label,color:l.color})}}return r.sort((l,u)=>l.startTs<u.startTs?-1:l.startTs>u.startTs?1:0),r}var Fe={sma:Ke,ema:Ce,wma:et,hma:Ws,rma:tt,linreg:Ps,rsi:Rs,stoch:Ls,macd:qs,atr:$t,tr:Nr,crossover:Dr,crossunder:Mr,cross:Vs,rising:Bs,falling:_s,change:zs,barssince:$s,valuewhen:Zs,highest:Ee,lowest:Ie,pivotHigh:Ys,pivotLow:Us,bb:Er,bbw:Hs,donchian:Gs,keltner:js,vwap:Js,alligator:Xs,stdev:Ir,variance:Qs,dev:Ks,correlation:eo,max:to,min:no,median:ro,toPoints:io,last:so,nz:oo,obv:ko,mfi:Oo,cci:vo,williamsR:No,supertrend:Do,sessionBoundaries:Mo,drawLine:ao,drawHLine:lo,drawHistogram:uo,drawLabel:co,fillBetween:fo,drawRect:mo,drawCircle:ho,drawVLine:go,drawArrow:yo,drawTrendLine:po,drawBand:bo,drawPolygon:wo,drawDots:To,drawBadge:So,drawTrade:xo};var Fr=Object.freeze({indicator:"indicator",drawing:"drawing",chartType:"chart-type",dataSource:"data-source",extension:"extension",strategy:"strategy"}),Ar=Object.freeze({mbo:"l3",l3:"l3",l2:"l2",ohlcv:"ohlcv",tick:"tick"}),Wr=Object.freeze({overlay:"overlay",pane:"pane"}),Pr=Object.freeze({signal:"signal",stop:"stop",target:"target",reverse:"reverse",endOfData:"end-of-data"}),Rr={PluginType:Fr,DataLevel:Ar,Layout:Wr,ExitReason:Pr};var Lr={initialCapital:1e5,commission:0,slippageTicks:0,tickSize:.01,contractSize:1,pyramiding:1,allowReverse:!0,qtyStep:1};function qr(t,e,n){if(!e||e.length===0)return!1;let r=(a,l)=>Math.abs(a-l)<=n;if(!r(e[0].open,t.open)||!r(e[e.length-1].close,t.close))return!1;let i=-1/0,s=1/0,o=-1n;for(let a of e){if(a.ts<=o)return!1;o=a.ts,a.high>i&&(i=a.high),a.low<s&&(s=a.low)}return r(i,t.high)&&r(s,t.low)}function Co(t){if(!t.length)return 0;let e=[...t].sort((r,i)=>r-i),n=e.length>>1;return e.length%2?e[n]:(e[n-1]+e[n])/2}function Eo(t){if(t.length<2)return 0;let e=0;for(let i of t)e+=i;e/=t.length;let n=0;for(let i of t)n+=(i-e)*(i-e);let r=Math.sqrt(n/(t.length-1));return r===0?0:Math.sqrt(t.length)*e/r}var Io=8192,Zt=class{constructor(e={}){b(this,"cfg");b(this,"pending",[]);b(this,"pos",null);b(this,"trades",[]);b(this,"equityCurve",[]);b(this,"realized");b(this,"peak");b(this,"nextOrderId",1);b(this,"index",-1);b(this,"barsInPosition",0);b(this,"barCount",0);b(this,"markPrice",0);b(this,"closeRequested",!1);b(this,"barNs",0n);b(this,"slippagePaid",0);b(this,"usedIntrabar",!1);b(this,"intrabarBars",0);b(this,"intrabarFallbacks",0);b(this,"ambiguousExits",0);b(this,"pendingEquity",null);b(this,"equityCount",0);b(this,"firstTs",null);b(this,"lastTs",0n);b(this,"lastEquity",null);b(this,"prevEquity",null);b(this,"maxDdAbs",0);b(this,"maxDdPct",0);b(this,"ulcerSum",0);b(this,"retN",0);b(this,"retMean",0);b(this,"retM2",0);b(this,"downSum",0);b(this,"downCount",0);b(this,"curvePhase",0);b(this,"curveStride",1);b(this,"lastFolded",null);this.cfg={...Lr,...e},this.realized=this.cfg.initialCapital,this.peak=this.cfg.initialCapital}setBarNs(e){this.barNs=e}beginBar(e,n,r){this.index=n,this.markPrice=e.close;let i=r&&r.length>0?qr(e,r,Math.max(this.cfg.tickSize/2,1e-9)):!1;if(r&&r.length>0&&(i?this.intrabarBars++:this.intrabarFallbacks++),this.usedIntrabar=i,this.closeRequested&&(this.closeRequested=!1,this.pos)){let s=this.cfg.slippageTicks*this.cfg.tickSize;this.exit(e,e.open+(this.pos.side==="long"?-s:s),"signal")}if(!i){this.pending.length&&this.processPending(e),this.pos&&this.checkBrackets(e);return}for(let s of r)this.pending.length&&this.processPending(s),this.pos&&this.checkBrackets(s),this.pos&&this.trackExcursion(s)}endBar(e){this.barCount++,this.markPrice=e.close,this.pos&&(this.barsInPosition++,this.usedIntrabar||this.trackExcursion(e));let n=this.equity;n>this.peak&&(this.peak=n),this.foldPending(),this.firstTs===null&&(this.firstTs=e.ts),this.pendingEquity={ts:e.ts,equity:n,drawdown:this.peak>0?(this.peak-n)/this.peak:0}}foldPending(){let e=this.pendingEquity;if(!e)return;this.pendingEquity=null,this.equityCount++,this.lastTs=e.ts,this.lastEquity=e.equity;let r=(e.drawdown>=1?e.equity:e.equity/(1-e.drawdown))-e.equity;if(r>this.maxDdAbs&&(this.maxDdAbs=r),e.drawdown>this.maxDdPct&&(this.maxDdPct=e.drawdown),this.ulcerSum+=e.drawdown*e.drawdown,this.prevEquity!==null&&this.prevEquity>0){let i=(e.equity-this.prevEquity)/this.prevEquity;this.retN++;let s=i-this.retMean;this.retMean+=s/this.retN,this.retM2+=s*(i-this.retMean),i<0&&(this.downSum+=i*i,this.downCount++)}this.prevEquity=e.equity,this.lastFolded=e,this.keepInCurve(e)}keepInCurve(e){if(this.curvePhase===0&&(this.equityCurve.push(e),this.equityCurve.length>Io)){let n=[];for(let r=0;r<this.equityCurve.length;r+=2)n.push(this.equityCurve[r]);this.equityCurve=n,this.curveStride*=2}this.curvePhase=(this.curvePhase+1)%this.curveStride}finish(e){if(!this.pos||!e){this.foldPending();return}this.exit(e,e.close,"end-of-data");let n=this.pendingEquity;if(n){let r=this.equity;r>this.peak&&(this.peak=r),n.equity=r,n.drawdown=this.peak>0?(this.peak-r)/this.peak:0}this.foldPending()}get equity(){return this.realized+this.unrealized()}get result(){return this.foldPending(),this.lastFolded&&this.equityCurve[this.equityCurve.length-1]!==this.lastFolded&&this.equityCurve.push(this.lastFolded),{trades:this.trades,equity:this.equityCurve,stats:this.computeStats(),position:this.pos,openOrders:this.pending}}api(){let e=this;return{buy:(n=1,r={})=>e.place("buy",n,r),sell:(n=1,r={})=>e.place("sell",n,r),close:()=>{e.pos&&(e.closeRequested=!0)},cancelAll:()=>{e.pending=[]},get position(){return e.pos},get equity(){return e.equity},get cash(){return e.realized},get openOrders(){return e.pending}}}place(e,n,r){let i=this.roundQty(n),s={id:this.nextOrderId++,side:e,qty:i,kind:r.limit!=null?"limit":r.stop!=null?"stop":"market",price:r.limit??r.stop,sl:r.sl,tp:r.tp,tag:r.tag,placedIndex:this.index};return this.pending.push(s),s.id}processPending(e){let n=[];for(let r of this.pending){if(r.placedIndex>=this.index){n.push(r);continue}let i=this.fillPrice(r,e);if(i==null){n.push(r);continue}this.execute(r,i,e)}this.pending=n}fillPrice(e,n){let r=this.cfg.slippageTicks*this.cfg.tickSize;if(e.kind==="market")return e.side==="buy"?n.open+r:n.open-r;let i=e.price;return e.kind==="limit"?e.side==="buy"&&n.low<=i||e.side==="sell"&&n.high>=i?i:null:e.side==="buy"&&n.high>=i?Math.max(i,n.open)+r:e.side==="sell"&&n.low<=i?Math.min(i,n.open)-r:null}execute(e,n,r){let i=e.side==="buy"?"long":"short";if(this.pos&&this.pos.side!==i){let s=Math.min(this.pos.qty,e.qty),o=e.qty-s,a=o>0&&this.cfg.allowReverse;this.exit(r,n,a?"reverse":"signal",s),a&&this.enter(i,o,n,r,e);return}if(this.pos&&this.pos.side===i){if(this.pos.entries>=this.maxEntries())return;let s=this.pos.qty+e.qty;this.pos.avgPrice=(this.pos.avgPrice*this.pos.qty+n*e.qty)/s,this.pos.qty=s,this.pos.entries++,e.sl!=null&&(this.pos.sl=e.sl),e.tp!=null&&(this.pos.tp=e.tp);let o=this.commissionFor(e.qty);this.pos.entryFees+=o,this.realized-=o,this.slippagePaid+=this.slippageCost(e.qty);return}this.enter(i,e.qty,n,r,e)}maxEntries(){return Math.max(1,Math.floor(this.cfg.pyramiding))}roundQty(e){let n=this.cfg.qtyStep>0?this.cfg.qtyStep:1,r=Math.abs(e),i=Math.floor(r/n)*n,s=(String(n).split(".")[1]??"").length;return i>0?Number(i.toFixed(s)):n}enter(e,n,r,i,s){let o=this.commissionFor(n);this.pos={side:e,qty:n,avgPrice:r,entryTs:i.ts,entryIndex:this.index,sl:s.sl,tp:s.tp,tag:s.tag,entryFees:o,highWatermark:r,lowWatermark:r,mfeIndex:this.index,mfeTs:i.ts,maeIndex:this.index,maeTs:i.ts,initialRiskPerUnit:s.sl!=null?Math.abs(r-s.sl):void 0,entries:1},this.barsInPosition=0,this.realized-=o,this.slippagePaid+=this.slippageCost(n)}slippageCost(e){return this.cfg.slippageTicks*this.cfg.tickSize*e*this.cfg.contractSize}exit(e,n,r,i,s=!1){let o=this.pos;if(!o)return;let a=i??o.qty,l=o.side==="long"?1:-1,u=(n-o.avgPrice)*l*a*this.cfg.contractSize,c=this.commissionFor(a),m=o.qty>0?o.entryFees*a/o.qty:0,d=m+c;o.entryFees-=m,this.realized+=u-c,this.slippagePaid+=this.slippageCost(a);let f=o.avgPrice*a*this.cfg.contractSize,g=o.side==="long",p=a*this.cfg.contractSize,k=Math.max(0,g?o.highWatermark-o.avgPrice:o.avgPrice-o.lowWatermark),D=Math.max(0,g?o.avgPrice-o.lowWatermark:o.highWatermark-o.avgPrice),M=o.initialRiskPerUnit,O=M!=null?M*p:void 0,Z=u-d,ee=O&&O>0?Z/O:void 0,oe=O&&O>0?k*p/O:void 0,H=O&&O>0?-(D*p)/O:void 0,G=k>0?Math.max(0,g?n-o.avgPrice:o.avgPrice-n)/k:void 0,W=k*p,V=Math.max(0,W-(u-d));this.trades.push({id:this.trades.length+1,side:o.side,qty:a,entryTs:o.entryTs,entryPrice:o.avgPrice,exitTs:e.ts,exitPrice:n,pnl:Z,pnlGross:u,pnlPct:f>0?Z/f:0,fees:d,commission:d,slippage:this.slippageCost(a)*2,bars:this.index-o.entryIndex,durationNs:e.ts-o.entryTs,tag:o.tag,reason:r,...s?{ambiguousExit:!0}:{},maeAbs:D,mfeAbs:k,maePnl:D*p,mfePnl:k*p,mfeTs:o.mfeTs,maeTs:o.maeTs,barsToMfe:o.mfeIndex-o.entryIndex,initialRiskPerUnit:M,initialRiskTotal:O,realizedR:ee,maxFavorableR:oe,maxAdverseR:H,efficiency:G,maxDrawdownAbs:V,maxDrawdownPct:W>0?V/W:0,sl:o.sl,tp:o.tp}),a>=o.qty?(this.pos=null,this.barsInPosition=0):o.qty-=a}checkBrackets(e){let n=this.pos;if(n.sl==null&&n.tp==null)return;let r=this.cfg.slippageTicks*this.cfg.tickSize,i=n.side==="long",s=n.sl!=null&&(i?e.low<=n.sl:e.high>=n.sl),o=n.tp!=null&&(i?e.high>=n.tp:e.low<=n.tp),a=s&&o;if(a&&this.ambiguousExits++,s){let l=i?Math.min(n.sl,e.open):Math.max(n.sl,e.open);this.exit(e,i?l-r:l+r,"stop",void 0,a);return}o&&this.exit(e,n.tp,"target")}trackExcursion(e){let n=this.pos;e.high>n.highWatermark&&(n.highWatermark=e.high,n.side==="long"?(n.mfeIndex=this.index,n.mfeTs=e.ts):(n.maeIndex=this.index,n.maeTs=e.ts)),e.low<n.lowWatermark&&(n.lowWatermark=e.low,n.side==="long"?(n.maeIndex=this.index,n.maeTs=e.ts):(n.mfeIndex=this.index,n.mfeTs=e.ts))}commissionFor(e){return this.cfg.commission*e}unrealized(){if(!this.pos)return 0;let e=this.pos.side==="long"?1:-1;return(this.markPrice-this.pos.avgPrice)*e*this.pos.qty*this.cfg.contractSize}computeStats(){let e=this.trades,n=this.cfg.initialCapital,r=0,i=0,s=0,o=0,a=0,l=0,u=0,c=0,m=0,d=0,f=0,g=0,p=0,k=0,D=0,M=0,O=0,Z=0,ee=0,oe=0,H=0,G=0,W=0,V=0,Ae=0,Ut=0,nt=0,Ht=0;for(let x of e)x.pnl>0?(r+=x.pnl,s++,c+=x.bars,f++,g=0,x.pnl>l&&(l=x.pnl)):x.pnl<0?(i+=x.pnl,o++,m+=x.bars,g++,f=0,x.pnl<u&&(u=x.pnl)):(a++,f=0,g=0),f>p&&(p=f),g>k&&(k=g),d+=x.bars,ee+=x.maeAbs,oe+=x.mfeAbs,nt+=x.commission,Ht+=x.pnlGross,x.realizedR!==void 0&&(D+=x.realizedR,M++),x.efficiency!==void 0&&(O+=x.efficiency,Z++),x.side==="long"?(H++,Ae+=x.pnl,x.pnl>0&&W++):(G++,Ut+=x.pnl,x.pnl>0&&V++);let rt=this.maxDdAbs,it=this.maxDdPct,Vr=this.ulcerSum,Gt=this.lastEquity??n,st=Gt-n,Br=n>0?st/n:0,We=s?r/s:0,we=o?i/o:0,ot=e.length?s/e.length:0,jt=e.map(x=>x.pnl),at=this.runYears();return{netPnl:st,grossProfit:r,grossLoss:i,profitFactor:i===0?r>0?1/0:0:r/-i,totalTrades:e.length,wins:s,losses:o,winRate:ot,avgWin:We,avgLoss:we,expectancy:e.length?(r+i)/e.length:0,maxDrawdown:rt,maxDrawdownPct:it,sharpe:this.sharpe(),returnPct:Br,exposure:this.barCount?this.barsInPositionTotal()/this.barCount:0,finalEquity:Gt,largestWin:l,largestLoss:u,medianPnl:Co(jt),payoffRatio:we!==0?We/Math.abs(we):We>0?1/0:0,breakEvens:a,maxWinStreak:p,maxLossStreak:k,currentStreak:f>0?f:-g,avgBarsHeld:e.length?d/e.length:0,avgWinBarsHeld:s?c/s:0,avgLossBarsHeld:o?m/o:0,totalBars:this.barCount,sortino:this.sortino(),calmar:it>0&&at>0?this.cagr(at)/it:0,recoveryFactor:rt>0?st/rt:0,ulcerIndex:this.equityCount?Math.sqrt(Vr/this.equityCount):0,sqn:Eo(jt),kelly:we!==0?ot-(1-ot)/(We/Math.abs(we)):0,cagr:this.cagr(at),tradesWithRisk:M,avgR:M?D/M:0,totalR:D,avgEfficiency:Z?O/Z:0,avgMae:e.length?ee/e.length:0,avgMfe:e.length?oe/e.length:0,longTrades:H,shortTrades:G,longWinRate:H?W/H:0,shortWinRate:G?V/G:0,longPnl:Ae,shortPnl:Ut,totalFees:nt,totalCommission:nt,totalSlippage:this.slippagePaid,grossPnlBeforeCosts:Ht,intrabarBars:this.intrabarBars,intrabarFallbacks:this.intrabarFallbacks,ambiguousExits:this.ambiguousExits}}runYears(){if(this.equityCount<2||this.firstTs===null)return 0;let e=this.lastTs-this.firstTs;return e>0n?Number(e)/31536e12:0}cagr(e){let n=this.cfg.initialCapital;if(e<=0||n<=0)return 0;let r=this.lastEquity??n;return r<=0?-1:Math.pow(r/n,1/e)-1}sortino(){if(this.retN<2||this.barNs<=0n||!this.downCount)return 0;let e=Math.sqrt(this.downSum/this.downCount);if(e===0)return 0;let n=Number(31536000000000000n/this.barNs);return this.retMean/e*Math.sqrt(n)}barsInPositionTotal(){let e=0;for(let n of this.trades)e+=n.bars;return this.pos&&(e+=this.barsInPosition),e}sharpe(){if(this.equityCount<3||this.barNs<=0n||this.retN<2)return 0;let e=Math.sqrt(this.retM2/(this.retN-1));if(e===0)return 0;let n=Number(31536000000000000n/this.barNs);return this.retMean/e*Math.sqrt(n)}};function Yt(t){if("values"in t)return t.values;let{from:e,to:n,step:r}=t;if(!isFinite(e)||!isFinite(n))return[];let i=r>0?r:0;if(i===0||e===n)return[e];let s=Math.min(e,n),o=Math.max(e,n),a=[],l=Math.floor((o-s)/i+1e-9)+1,u=(String(i).split(".")[1]??"").length;for(let c=0;c<l;c++)a.push(Number((s+c*i).toFixed(u)));return a}function Fo(t){let e=t.filter(r=>Yt(r).length>0);if(!e.length)return[{}];let n=[{}];for(let r of e){let i=Yt(r),s=[];for(let o of n)for(let a of i)s.push({...o,[r.param]:a});if(n=s,n.length>2e4)return n.slice(0,20001)}return n}function Ao(t,e){let n=t*e,r={combos:t,bars:e,iterations:n,ok:!0};return t>2e4?{...r,ok:!1,reason:`${t.toLocaleString()} combinations is past the limit of ${2e4.toLocaleString()}. Widen the step, or sweep fewer parameters at once.`}:n>2e8?{...r,ok:!1,reason:`${t.toLocaleString()} combinations over ${e.toLocaleString()} bars is ${n.toLocaleString()} bar evaluations, past what this browser will run (${2e8.toLocaleString()}). Shorten the range, widen the step, or sweep fewer parameters.`}:r}function Wo(t,e){if(!e||e<=0||e>=.9||t<100)return null;let n=Math.floor(t*(1-e));return n<50||t-n<50?null:n}function Po(t,e){let n=0,r=t.length;for(;n<r;){let i=n+r>>>1;t[i].ts<e?n=i+1:r=i}return n}function Ro(t,e){let n=0,r=t.length;for(;n<r;){let i=n+r>>>1;t[i].ts<=e?n=i+1:r=i}return n}function Lo(t,e){let n=t.length;if(!n)return{from:0,to:0,count:0,total:0,firstTs:null,lastTs:null,dataFromNs:null,dataToNs:null};let r=e?.fromNs!=null?Po(t,e.fromNs):0,i=e?.toNs!=null?Ro(t,e.toNs):n,s=Math.min(r,n),o=Math.max(s,Math.min(i,n));return{from:s,to:o,count:o-s,total:n,firstTs:o>s?t[s]?.ts??null:null,lastTs:o>s?t[o-1]?.ts??null:null,dataFromNs:t[0]?.ts??null,dataToNs:t[n-1]?.ts??null}}function qo(t){return!!t&&(t.fromNs!=null||t.toNs!=null)}function Vo(t,e){return t.total?e?.fromNs!=null&&e?.toNs!=null&&e.fromNs>e.toNs?"The start of the range is after its end.":`No bars fall inside the selected range. The loaded data holds ${t.total.toLocaleString()} bars outside it.`:"No bars are loaded for this symbol and timeframe."}function Bo(t,e){let n=Math.floor(e.windows),r=Math.max(1,Math.floor(e.isMultiple));if(n<1||t<200)return[];let i=Math.floor(t/(n+r)),s=i*r;if(i<50||s<50)return[];let o=[];for(let a=0;a<n;a++){let l=a*i+s,u=l+i;if(u>t)break;o.push({index:a,isFrom:e.anchored?0:a*i,isTo:l,oosFrom:l,oosTo:u})}return o}function _o(t){let e=0,n=0,r=0,i=0;for(let a of t)e+=a.inSample.netPnl,n+=a.window.isTo-a.window.isFrom,r+=a.outOfSample.netPnl,i+=a.window.oosTo-a.window.oosFrom;if(!n||!i)return 0;let s=e/n,o=r/i;return s<=0?0:o/s}function zo(t){if(!t.length)return[];let e=new Set;for(let r of t)for(let i of Object.keys(r.params))e.add(i);let n=[];for(let r of e){let i=[];for(let l of t){let u=l.params[r];typeof u=="number"&&Number.isFinite(u)&&i.push(u)}if(i.length<2)continue;let s=0;for(let l of i)s+=l;s/=i.length;let o=0;for(let l of i)o+=(l-s)*(l-s);let a=Math.sqrt(o/i.length);n.push({param:r,values:i,distinct:new Set(i).size,coefficientOfVariation:s!==0?a/Math.abs(s):a===0?0:1/0})}return n}function $o(t,e,n=!0){let r=null,i=n?-1/0:1/0;for(let s of t){let o=e(s);o===void 0||!Number.isFinite(o)||(n?o>i:o<i)&&(i=o,r=s)}return r}function Zo(t){let e={...Rr,Math,console,plugin:t.plugin};for(let[n,r]of Object.entries(Fe))e[n]=r;if(t.shadowNetwork&&(e.fetch=void 0,e.XMLHttpRequest=void 0,e.WebSocket=void 0,e.importScripts=void 0),t.extra)for(let[n,r]of Object.entries(t.extra))e[n]=r;return e}function ra(t,e){let n=Zo(e),r=Object.keys(n);new Function(...r,`"use strict";
2
+ ${t}`)(...r.map(i=>n[i]))}function ia(t,e){let n=t;if(!n)return[];if(e==="pane"){let r=(n.equity??[]).map(i=>({t:i.ts,price:i.equity}));return r.length?[Fe.drawLine(r,"#38bdf8",1.5,[],!0)]:[]}return(n.trades??[]).map(r=>Fe.drawTrade(r.side,r.entryTs,r.entryPrice,r.exitTs,r.exitPrice,r.pnl))}var sa=(()=>{let t=Object.keys(Fe).sort().join(","),e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return(e>>>0).toString(16).padStart(8,"0")})();export{Lr as DEFAULT_STRATEGY_CONFIG,Ar as DataLevel,Pr as ExitReason,Wr as Layout,Fr as PluginType,Rr as SCRIPT_DSL,Fe as STDLIB,sa as STDLIB_SIGNATURE,Zt as StrategyEngine,Yt as axisValues,Zo as buildScriptScope,Ao as checkSweepBudget,Lo as clipRange,ia as defaultStrategyDraw,Vo as emptyRangeReason,ra as evalScriptInScope,Fo as expandGrid,qo as hasRange,zo as parameterStability,$o as pickBest,Bo as planWalkForward,qr as reconcileIntrabar,Wo as splitIndex,_o as walkForwardEfficiency};
@@ -2,11 +2,12 @@ import React from 'react';
2
2
  export declare function resizeSizes(sizes: number[], i: number, deltaPx: number, totalPx: number): number[];
3
3
  export declare function resizeSizesAbsolute(sizes: number[], i: number, targetPx: number, totalPx: number): number[];
4
4
  export declare const toFr: (s: number[]) => string;
5
- export declare function Dividers({ dir, sizes, containerRef, onDrag, areas, colSizes: colSizesProp, }: {
5
+ export declare const parseAreas: (areas: string) => string[][];
6
+ export declare function Dividers({ dir, sizes, containerRef, onDrag, areas, crossSizes, }: {
6
7
  dir: 'col' | 'row';
7
8
  sizes: number[];
8
9
  containerRef: React.RefObject<HTMLDivElement>;
9
10
  onDrag: (i: number, targetPx: number) => void;
10
11
  areas?: string;
11
- colSizes?: number[];
12
+ crossSizes?: number[];
12
13
  }): React.JSX.Element;
@@ -3,6 +3,10 @@ interface AnimatedPanelProps extends HTMLAttributes<HTMLDivElement> {
3
3
  open: boolean;
4
4
  side?: 'top' | 'bottom';
5
5
  align?: 'left' | 'right';
6
+ offset?: number;
7
+ maxHeight?: number;
8
+ matchWidth?: boolean;
6
9
  }
7
- export declare function AnimatedPanel({ open, side, align, className, onAnimationEnd, ...props }: AnimatedPanelProps): import("react").JSX.Element;
10
+ export declare function containsWithPanels(root: Element | null, target: EventTarget | null): boolean;
11
+ export declare function AnimatedPanel({ open, side, align, offset, maxHeight, matchWidth, className, style, onAnimationEnd, ...props }: AnimatedPanelProps): import("react").JSX.Element;
8
12
  export {};
@@ -0,0 +1,6 @@
1
+ import { type ReactNode } from 'react';
2
+ export declare function ScrollStrip({ className, innerClassName, children, }: {
3
+ className?: string;
4
+ innerClassName?: string;
5
+ children: ReactNode;
6
+ }): import("react").JSX.Element;