gemi 0.4.91 → 0.4.92

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 (41) hide show
  1. package/dist/app/App.d.ts.map +1 -1
  2. package/dist/app/index.js +1 -1
  3. package/dist/chunk-07ad6201a5864cd0.js +2 -0
  4. package/dist/chunk-156c827bf8d5029c.js +5 -0
  5. package/dist/chunk-2c5ecf8dc0a97aba.js +2 -0
  6. package/dist/chunk-542b3c90f0ff4ded.js +2 -0
  7. package/dist/chunk-63884944ac5ce0f0.js +2 -0
  8. package/dist/{chunk-201d67e6e22cc14b.js → chunk-6a2141dd4169ce0e.js} +1 -1
  9. package/dist/chunk-6b58f7c76c2a738c.js +2 -0
  10. package/dist/chunk-83938f41a5342f87.js +2 -0
  11. package/dist/chunk-880cfc21ce7cc2c6.js +2 -0
  12. package/dist/chunk-9d5c096c43928b37.js +1 -0
  13. package/dist/chunk-9dc5c9b7a885d0bc.js +9 -0
  14. package/dist/chunk-a1ef3b11adc01140.js +6 -0
  15. package/dist/chunk-ad396345e8e74292.js +2 -0
  16. package/dist/{chunk-fcd9eb76c67113d3.js → chunk-b13ef9b23e30af91.js} +1 -1
  17. package/dist/chunk-e1a4203ece554bc3.js +2 -0
  18. package/dist/chunk-e4a19367b5596f21.js +2 -0
  19. package/dist/chunk-fe8cfc6e6c3ce826.js +16 -0
  20. package/dist/client/ServerDataProvider.d.ts +5 -1
  21. package/dist/client/ServerDataProvider.d.ts.map +1 -1
  22. package/dist/client/i18n/I18nContext.d.ts.map +1 -1
  23. package/dist/client/index.js +13 -14
  24. package/dist/kernel/index.js +1 -1
  25. package/dist/services/index.js +10 -1
  26. package/package.json +1 -1
  27. package/dist/chunk-19790c50198f1898.js +0 -2
  28. package/dist/chunk-2b9b6009ebe271d3.js +0 -2
  29. package/dist/chunk-32d1342f9f8391c0.js +0 -2
  30. package/dist/chunk-3a6838d9e6866471.js +0 -2
  31. package/dist/chunk-7085d9454a422181.js +0 -2
  32. package/dist/chunk-809308720fc22418.js +0 -2
  33. package/dist/chunk-900bf3955cb1bbab.js +0 -2
  34. package/dist/chunk-931a005d4bb28ffe.js +0 -2
  35. package/dist/chunk-967cb54562e3d29b.js +0 -3
  36. package/dist/chunk-b94896500a1345bf.js +0 -2
  37. package/dist/chunk-bce765dc10669cd0.js +0 -6
  38. package/dist/chunk-bdac4694bbb37064.js +0 -1
  39. package/dist/chunk-c3c17a7115770391.js +0 -2
  40. package/dist/chunk-d1e1b959b1124e74.js +0 -18
  41. package/dist/chunk-f6a9cd06681eb0dc.js +0 -9
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{a as xf,b as Qi,c as Gi,d as Lf,e as Sc,g as os,h as Rs,i as Fa,j as Gf,k as If,m as qf,n as Uf} from"../http/index.js";import{o as _i} from"../facades/index.js";import{p as Yf,q as zf,r as Bf,s as Kf,t as Xf} from"../services/index.js";import"../chunk-19790c50198f1898.js";import{A as jt,z as Cc} from"../chunk-9475c6ed18013dc8.js";import"../chunk-24a86f8f5ddc0cbd.js";import"../chunk-332553172e3ab961.js";import{E as _f,F as Qf} from"../chunk-7d5fe4acabfee228.js";import"../chunk-0ba2cc302113ab40.js";import"../chunk-28694e5e949df0ff.js";import"../chunk-d1e1b959b1124e74.js";import"../chunk-967cb54562e3d29b.js";import"../chunk-201d67e6e22cc14b.js";import"../chunk-931a005d4bb28ffe.js";import"../chunk-bdac4694bbb37064.js";import"../chunk-f6a9cd06681eb0dc.js";import"../chunk-fcd9eb76c67113d3.js";var xa=function(a,s,t,i,o){function r(...d){if(!(this instanceof r))throw new TypeError(Cr);gf(this,s(...d))}function c(d,u){return Object.defineProperties(function(...f){return d.call(this,l(this),...f)},ro(u))}function l(d){const u=k(d);if(!u||u.branding!==a)throw new TypeError(Cr);return u}return Object.defineProperties(r.prototype,{...Qc(ya(c,t)),...fs(ya(c,i)),...qt("Temporal."+a)}),Object.defineProperties(r,{...fs(o),...ro(a)}),[r,(d)=>{const u=Object.create(r.prototype);return gf(u,d),u},l]},bf=function(a){return a=a.concat("id").sort(),(s)=>{if(!Yc(s,a))throw new TypeError(Au);return s}},Xs=function(a){if(k(a)||a.calendar!==void 0||a.timeZone!==void 0)throw new TypeError(Zu);return a},Ai=function(a,s){const t={};for(let i in a)t[i]=({o},r)=>{const c=k(r)||{},{branding:l}=c,d=l===Ds||s.includes(l)?c:ra(r);return o[i](d)};return t},lc=function(a){const s={};for(let t in a)s[t]=(i)=>{const{calendar:o}=i;return(r=o,typeof r=="string"?Us(r):(c=r,Object.assign(Object.create(uh),{i:c})))[t](i);var r,c};return s},is=function(){throw new TypeError(Lu)},vt=function({calendar:a}){return typeof a=="string"?new Tc(a):a},pf=function(a,s){if(s=H(s),G(a)){const i=k(a);if(i&&i.branding===qs)return S(s),i;const o=Df(a);return yr(zi(o||w),!o,a,s)}const t=td(Us,a);return S(s),t},Of=function(a,s,t){return i=s.call(a,oa(q(t))),Jo(ut(i));var i},Ei=function(a,s=nf){const t=Object.keys(s).sort(),i={};for(let o of t)i[o]=D(s[o],a,Ku(a[o]));return i},F=function(a,s){return typeof a=="string"?Li(a):Ei(a,s)},J=function(a){return F(a,cc)},Ca=function(a){if(G(a)){const s=k(a);if(s)switch(s.branding){case Zi:return s;case za:return q(s.epochNanoseconds)}}return kl(a)};var mf=function(a,s,t){const i=s.l(Ca(t).epochNanoseconds,a);return i?oa(q(i)):null},M=function(a){return G(a)?(k(a)||{}).timeZone||Ph(a):((s)=>Pi(cd(L(s))))(a)},ea=function(a,s){if(G(a)){const t=k(a)||{};switch(t.branding){case Ci:return S(s),t;case ws:return S(s),Sa(t);case za:return S(s),Fr(J,t)}return $d(a,s)}return S(s),id(a)},dc=function(a){return a===void 0?void 0:ea(a)},Ys=function(a,s){if(s=H(s),G(a)){const i=k(a);return i&&i.branding===Gs?(S(s),i):Or($i(nt(a)),a,s)}const t=sd(Us,a);return S(s),t},as=function(a,s){if(s=H(s),G(a)){const i=k(a)||{};switch(i.branding){case ws:return S(s),i;case Ds:return S(s),W({...i,...Oa});case za:return S(s),vr(J,i)}return Nd(Ji(nt(a)),a,s)}const t=ad(a);return S(s),t},ra=function(a,s){if(s=H(s),G(a)){const i=k(a)||{};switch(i.branding){case Ds:return S(s),i;case ws:return S(s),N(i);case za:return S(s),nr(J,i)}return br(Ji(nt(a)),a,s)}const t=hi(a);return S(s),t},yf=function(a,s,t){return Da(s.call(a,A(N(t,a))))},La=function(a){return(s)=>typeof s=="string"?Us(s):((t,i)=>{const o=Object.keys(i).sort(),r={};for(let c of o)r[c]=D(i[c],t,t[c]);return r})(s,a)},I=function(a){if(G(a)){const s=k(a);return s&&s.branding===xi?s:Jd(a)}return od(a)},St=function(a){if(a!==void 0){if(G(a)){const s=k(a)||{};switch(s.branding){case za:case Ds:return s;case ws:return N(s)}const t=nt(a);return{...Hd(M,F,Ji(t),a),calendar:t}}return Vl(a)}},nt=function(a){return Df(a)||w},Df=function(a){const{calendar:s}=a;if(s!==void 0)return X(s)},X=function(a){return G(a)?(k(a)||{}).calendar||Zh(a):((s)=>mt(rd(L(s))))(a)},Bs=function(a,s){if(s=H(s),G(a)){const t=k(a);if(t&&t.branding===za)return ft(s),t;const i=nt(a);return Wd(M,F,Ji(i),i,a,s)}return el(a,s)},hf=function(a){return ya((s)=>(t)=>s(rc(t)),a)},rc=function(a){return ta(a,J)},Bm=function(){const a=Va.prototype,s=Object.getOwnPropertyDescriptors(a),t=Object.getOwnPropertyDescriptors(Va),i=function(o,r={}){if(!(this instanceof i))return new i(o,r);bc.set(this,((c,l={})=>{const d=new Va(c,l),u=d.resolvedOptions(),f=u.locale,p=pa(Object.keys(l),u),m=ua(km),h=(...g)=>{let P;const T=g.map((O,b)=>{const y=k(O),E=(y||{}).branding;if(b&&P&&P!==E)throw new TypeError(Wu);return P=E,y});return P?m(P)(f,p,...T):[d,...g]};return h.u=d,h})(o,r))};for(let o in s){const r=s[o],c=o.startsWith("format")&&Km(o);typeof r.value=="function"?r.value=o==="constructor"?i:c||Xm(o):c&&(r.get=function(){return c.bind(this)})}return t.prototype.value=Object.create(a,s),Object.defineProperties(i,t),i},Km=function(a){return function(...s){const t=bc.get(this),[i,...o]=t(...s);return i[a](...o)}},Xm=function(a){return function(...s){return bc.get(this).u[a](...s)}},km=function(a){const s=Vm[a];if(!s)throw new TypeError(Hu(a));return Na(s,ua(Rr))};var ca=function(a,s,t,i,o){return Pa(s,Uc(a,s),t,i,o)},Pa=function(a,s,t,i,o,r){const c=ki(s,t,i);if(o&&s!==c)throw new RangeError(ju(a,s,t,i,r));return c},Uc=function(a,s){const t=a[s];if(t===void 0)throw new TypeError(Mr(s));return t},G=function(a){return a!==null&&/object|function/.test(typeof a)},ua=function(a,s=Map){const t=new s;return(i,...o)=>{if(t.has(i))return t.get(i);const r=a(i,...o);return t.set(i,r),r}},ro=function(a){return fs({name:a},1)},fs=function(a,s){return ya((t)=>({value:t,configurable:1,writable:!s}),a)},Qc=function(a){return ya((s)=>({get:s,configurable:1}),a)},qt=function(a){return{[Symbol.toStringTag]:{value:a,configurable:1}}},Is=function(a,s){const t={};let i=a.length;for(let o of s)t[a[--i]]=o;return t},ya=function(a,s,t){const i={};for(let o in s)i[o]=a(s[o],o,t);return i},lt=function(a,s,t){const i={};for(let o=0;o<s.length;o++){const r=s[o];i[r]=a(r,o,t)}return i},ef=function(a,s,t){const i={};for(let o=0;o<a.length;o++)i[s[o]]=t[a[o]];return i},pa=function(a,s){const t={};for(let i of a)t[i]=s[i];return t},co=function(a,s){const t={};for(let i in s)a.has(i)||(t[i]=s[i]);return t},lo=function(a){a={...a};const s=Object.keys(a);for(let t of s)a[t]===void 0&&delete a[t];return a},Yc=function(a,s){for(let t of s)if(!(t in a))return 0;return 1},Bc=function(a,s,t){for(let i of a)if(s[i]!==t[i])return 0;return 1},Kc=function(a,s,t){const i={...t};for(let o=0;o<s;o++)i[a[o]]=0;return i},D=function(a,...s){return(...t)=>a(...s,...t)},Zc=function(a){return a[0].toUpperCase()+a.substring(1)},dt=function(a){return a.slice().sort()},Et=function(a,s){return String(s).padStart(a,"0")},_a=function(a,s){return Math.sign(a-s)},ki=function(a,s,t){return Math.min(Math.max(a,s),t)},Aa=function(a,s){return[Math.floor(a/s),at(a,s)]},at=function(a,s){return(a%s+s)%s},Ua=function(a,s){return[Ut(a,s),uo(a,s)]},Ut=function(a,s){return Math.trunc(a/s)||0},uo=function(a,s){return a%s||0},Ct=function(a){return Math.abs(a%1)===0.5},Xc=function(a,s,t){let i=0,o=0;for(let l=0;l<=s;l++){const d=a[t[l]],u=Ma[l],f=n/u,[p,m]=Ua(d,f);i+=m*u,o+=p}const[r,c]=Ua(i,n);return[o+r,c]},Qt=function(a,s,t){const i={};for(let o=s;o>=0;o--){const r=Ma[o];i[t[o]]=Ut(a,r),a=uo(a,r)}return i},kc=function(a){return a===w?Ri:[]},Vc=function(a){return a===w?Ot:[]},ec=function(a){return a===w?["year","day"]:[]},al=function(a){if(a!==void 0)return L(a)},sl=function(a){if(a!==void 0)return Da(a)},fo=function(a){if(a!==void 0)return ut(a)},Da=function(a){return ol(ut(a))},ut=function(a){return il(qp(a))},po=function(a){if(a==null)throw new TypeError("Cannot be null or undefined");return a},tl=function(a,s){if(s==null)throw new RangeError(Mr(a));return s},Ha=function(a){if(!G(a))throw new TypeError(Mu);return a},Yt=function(a,s,t=a){if(typeof s!==a)throw new TypeError(Pt(t,s));return s},il=function(a,s="number"){if(!Number.isInteger(a))throw new RangeError(Pp(s,a));return a||0},ol=function(a,s="number"){if(a<=0)throw new RangeError(Tp(s,a));return a},mo=function(a){if(typeof a=="symbol")throw new TypeError(Dp);return String(a)},Ht=function(a,s){return G(a)?String(a):L(a,s)},Bt=function(a){if(typeof a=="string")return BigInt(a);if(typeof a!="bigint")throw new TypeError(yp(a));return a},rl=function(a,s="number"){if(typeof a=="bigint")throw new TypeError(Op(s));if(a=Number(a),!Number.isFinite(a))throw new RangeError(bp(s,a));return a},V=function(a,s){return Math.trunc(rl(a,s))||0},cl=function(a,s){return il(rl(a,s),s)},xc=function(a,s){return ol(V(a,s),s)},ho=function(a,s){let[t,i]=Ua(s,n),o=a+t;const r=Math.sign(o);return r&&r===-Math.sign(i)&&(o-=r,i+=r*n),[o,i]},js=function(a,s,t=1){return ho(a[0]+s[0]*t,a[1]+s[1]*t)},Cs=function(a,s){return ho(a[0],a[1]+s)},ma=function(a,s){return js(s,a,-1)},aa=function(a,s){return _a(a[0],s[0])||_a(a[1],s[1])},ll=function(a,s,t){return aa(a,s)===-1||aa(a,t)===1},Kt=function(a,s=1){const t=BigInt(n/s);return[Number(a/t),Number(a%t)*s]},Zs=function(a,s=1){const t=n/s,[i,o]=Ua(a,t);return[i,o*s]},dl=function(a,s=1){const[t,i]=a,o=Math.floor(i/s),r=n/s;return BigInt(t)*BigInt(r)+BigInt(o)},ha=function(a,s=1,t){const[i,o]=a,[r,c]=Ua(o,s);return i*(n/s)+(r+(t?c/s:0))},go=function(a,s,t=Aa){const[i,o]=a,[r,c]=t(o,s);return[i*(n/s)+r,c]},Po=function(a,s){const t=a.formatToParts(s),i={};for(let o of t)i[o.type]=o.value;return i},To=function(a){return ca(a,"isoYear",ct,rt,1),a.isoYear===ct?ca(a,"isoMonth",4,12,1):a.isoYear===rt&&ca(a,"isoMonth",1,9,1),a},Ga=function(a){return Wa({...a,...Oa,isoHour:12}),a},Wa=function(a){const s=ca(a,"isoYear",ct,rt,1),t=s===ct?1:s===rt?-1:0;return t&&ga(e({...a,isoDay:a.isoDay+t,isoNanosecond:a.isoNanosecond-t})),a},ga=function(a){if(!a||ll(a,kp,Xp))throw new RangeError(Si);return a},Qa=function(a){return Xc(a,5,na)[1]},Xt=function(a){const[s,t]=Aa(a,n);return[Qt(t,5,na),s]},ul=function(a){return fl(a)[0]},fl=function(a){return go(a,ba)},sa=function(a){return As(a.isoYear,a.isoMonth,a.isoDay,a.isoHour,a.isoMinute,a.isoSecond,a.isoMillisecond)},e=function(a){const s=sa(a);if(s!==void 0){const[t,i]=Ua(s,da);return[t,i*ja+(a.isoMicrosecond||0)*ys+(a.isoNanosecond||0)]}},bo=function(a,s){const[t,i]=Xt(Qa(a)-s);return ga(e({...a,isoDay:a.isoDay+i,...t}))},Wt=function(...a){return As(...a)/$u},As=function(...a){const[s,t]=pl(...a),i=s.valueOf();if(!isNaN(i))return i-t*da},pl=function(a,s=1,t=1,i=0,o=0,r=0,c=0){const l=a===ct?1:a===rt?-1:0,d=new Date;return d.setUTCHours(i,o,r,c),d.setUTCFullYear(a,s-1,t+l),[d,l]},Ba=function(a,s){let[t,i]=Cs(a,s);i<0&&(i+=n,t-=1);const[o,r]=Aa(i,ja),[c,l]=Aa(r,ys);return kt(t*da+o,c,l)},kt=function(a,s=0,t=0){const i=Math.ceil(Math.max(0,Math.abs(a)-Kp)/da)*Math.sign(a),o=new Date(a-i*da);return Is(ji,[o.getUTCFullYear(),o.getUTCMonth()+1,o.getUTCDate()+i,o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds(),s,t])},ml=function(a){return[a.isoYear,a.isoMonth,a.isoDay]},hl=function(){return Ia},Oo=function(a,s){switch(s){case 2:return yo(a)?29:28;case 4:case 6:case 9:case 11:return 30}return 31},gl=function(a){return yo(a)?366:365},yo=function(a){return a%4==0&&(a%100!=0||a%400==0)},Pl=function(a){const[s,t]=pl(a.isoYear,a.isoMonth,a.isoDay);return at(s.getUTCDay()-t,7)||7},Tl=function({isoYear:a}){return a<1?["bce",1-a]:["ce",a]},ap=function(a){const s=sa(a);if(s<ep)return Tl(a);const t=Po(Ur(xs),s),{era:i,eraYear:o}=Md(t,xs);return[i,o]},Vt=function(a){return ps(a),et(a,1),a},ps=function(a){return bl(a,1),a},Lc=function(a){return Bc(Wr,a,bl(a))},bl=function(a,s){const{isoYear:t}=a,i=ca(a,"isoMonth",1,hl(),s);return{isoYear:t,isoMonth:i,isoDay:ca(a,"isoDay",1,Oo(t,i),s)}},et=function(a,s){return Is(na,[ca(a,"isoHour",0,23,s),ca(a,"isoMinute",0,59,s),ca(a,"isoSecond",0,59,s),ca(a,"isoMillisecond",0,999,s),ca(a,"isoMicrosecond",0,999,s),ca(a,"isoNanosecond",0,999,s)])},S=function(a){return a===void 0?0:tf(Ha(a))},ft=function(a,s=0){a=wa(a);const t=of(a),i=um(a,s);return[tf(a),i,t]},Do=function(a){return of(wa(a))},Ol=function(a){return a=wa(a),Jr(a,9,6,1)},Es=function(a,s,t,i=9,o=0,r=4){s=wa(s);let c=Jr(s,i,o),l=vo(s),d=Dt(s,r);const u=yt(s,i,o,1);return c==null?c=Math.max(t,u):Sl(c,u),l=no(l,u,1),a&&(d=((f)=>f<4?(f+2)%4:f)(d)),[c,u,l,d]},ai=function(a,s=6,t){let i=vo(a=Fo(a,Gt));const o=Dt(a,7);let r=yt(a,s);return r=tl(Gt,r),i=no(i,r,void 0,t),[r,i,o]},wo=function(a){return zr(wa(a))},yl=function(a,s){return So(wa(a),s)},So=function(a,s=4){const t=wl(a);return[Dt(a,4),...Dl(yt(a,s),t)]},Dl=function(a,s){return a!=null?[Ma[a],a<4?9-3*a:-1]:[s===void 0?1:10**(9-s),s]},vo=function(a){const s=a[st];return s===void 0?1:V(s,st)},no=function(a,s,t,i){const o=i?n:Ma[s+1];if(o){const r=Ma[s];if(o%((a=Pa(st,a,1,o/r-(i?0:1),1))*r))throw new RangeError(Pt(st,a))}else a=Pa(st,a,1,t?1e9:1,1);return a},wl=function(a){let s=a[Xi];if(s!==void 0){if(typeof s!="number"){if(mo(s)==="auto")return;throw new RangeError(Pt(Xi,s))}s=Pa(Xi,Math.floor(s),0,9,1)}return s},wa=function(a){return a===void 0?{}:Ha(a)},Fo=function(a,s){return typeof a=="string"?{[s]:a}:Ha(a)},H=function(a){if(a!==void 0){if(G(a))return Object.assign(Object.create(null),a);throw new TypeError(Mu)}},si=function(a,s){return a&&Object.assign(Object.create(null),a,{overflow:sm[s]})},Ro=function(a,s,t=9,i=0,o){let r=s[a];if(r===void 0)return o?i:void 0;if(r=mo(r),r==="auto")return o?i:null;let c=so[r];if(c===void 0&&(c=Yp[r]),c===void 0)throw new RangeError(xu(a,r,so));return Pa(a,c,i,t,1,bt),c},ms=function(a,s,t,i=0){const o=t[a];if(o===void 0)return i;const r=mo(o),c=s[r];if(c===void 0)throw new RangeError(xu(a,r,s));return c},Sl=function(a,s){if(s>a)throw new RangeError($p)},q=function(a){return{branding:Zi,epochNanoseconds:a}},B=function(a,s,t){return{branding:za,calendar:t,timeZone:s,epochNanoseconds:a}},W=function(a,s=a.calendar){return{branding:ws,calendar:s,...pa(Vu,a)}},N=function(a,s=a.calendar){return{branding:Ds,calendar:s,...pa(Nr,a)}},ds=function(a,s=a.calendar){return{branding:Gs,calendar:s,...pa(Nr,a)}},Nt=function(a,s=a.calendar){return{branding:qs,calendar:s,...pa(Nr,a)}},Sa=function(a){return{branding:Ci,...pa(ku,a)}},C=function(a){return{branding:xi,sign:Ka(a),...pa(Ar,a)}},vl=function(a){return ul(a.epochNanoseconds)},ti=function(a){return go(a.epochNanoseconds,ja)[0]},nl=function(a){return dl(a.epochNanoseconds,ys)},Fl=function(a){return dl(a.epochNanoseconds)},Rl=function(a){return a.epochNanoseconds},Q=function(a){return typeof a=="string"?a:L(a.id)},Hs=function(a,s){return a===s||Q(a)===Q(s)},Ml=function(a,s,t,i,o){const r=us(i),[c,l]=((T,O)=>{const b=O((T=Fo(T,oo))[af]);let y=dm(T);return y=tl(oo,y),[y,b]})(o,a);if(it(Math.max(c,r),l))return Ic(i,c);if(!l)throw new RangeError(vi);const[d,u,f]=di(s,t,l),p=Xo(f),m=ui(f),h=ko(f),g=m(u,d,i),P=h(u,d,g,c);return it(c,l)?Ic(P,c):((T,O,b,y,E,Z,j)=>{const x=Ka(T),[U,z]=Mo(y,Hr(b,T),b,x,E,Z,j),ks=jo(O,U,z);return T[v[b]]+ks*x})(P,p(g),c,u,d,p,m)},Ic=function(a,s){return ha(_(a),Ma[s],1)},Mo=function(a,s,t,i,o,r,c){const l=v[t],d={...s,[l]:s[l]+i},u=c(a,o,s),f=c(a,o,d);return[r(u),r(f)]},jo=function(a,s,t){const i=ha(ma(s,t));if(!i)throw new RangeError(Tt);return ha(ma(s,a))/i},jl=function(a,s){const[t,i,o]=ai(s,5,1);return q(oi(a.epochNanoseconds,t,i,o,1))},Cl=function(a,s,t){let{epochNanoseconds:i,timeZone:o,calendar:r}=s;const[c,l,d]=ai(t);if(c===0&&l===1)return s;const u=a(o);if(c===6)i=((f,p,m,h)=>{const g=ta(m,p),[P,T]=f(g),O=m.epochNanoseconds,b=fa(p,P),y=fa(p,T);if(ll(O,b,y))throw new RangeError(Tt);return Nl(jo(O,b,y),h)?y:b})(Hl,u,s,d);else{const f=u.getOffsetNanosecondsFor(i);i=gs(u,Al(Ba(i,f),c,l,d),f,2,0,1)}return B(i,o,r)},Zl=function(a,s){return W(Al(a,...ai(s)),a.calendar)},xl=function(a,s){const[t,i,o]=ai(s,5);var r;return Sa((r=o,Co(a,pt(t,i),r)[0]))},Ll=function(a,s){const t=a(s.timeZone),i=ta(s,t),[o,r]=Hl(i),c=ha(ma(fa(t,o),fa(t,r)),Fi,1);if(c<=0)throw new RangeError(Tt);return c},Il=function(a,s){const{timeZone:t,calendar:i}=s,o=((r,c,l)=>fa(c,r(ta(l,c))))(Wl,a(t),s);return B(o,t,i)},Al=function(a,s,t,i){return El(a,pt(s,t),i)},El=function(a,s,t){const[i,o]=Co(a,s,t);return Wa({...Ps(a,o),...i})},Co=function(a,s,t){return Xt(Ya(Qa(a),s,t))},$t=function(a){return Ya(a,ni,7)},pt=function(a,s){return Ma[a]*s},Hl=function(a){const s=Wl(a);return[s,Ps(s,1)]},Wl=function(a){return Bp(6,a)},sp=function(a,s,t){const i=Math.min(us(a),6);return Ns(ri(_(a,i),s,t),i)},ii=function(a,s,t,i,o,r,c,l,d,u){if(i===0&&o===1)return a;const f=it(i,l)?fi(l)&&i<6&&t>=6?ip:tp:op;let[p,m,h]=f(a,s,t,i,o,r,c,l,d,u);return h&&i!==7&&(p=((g,P,T,O,b,y,E,Z)=>{const j=Ka(g);for(let x=O+1;x<=T;x++){if(x===7&&T!==7)continue;const U=Hr(x,g);U[v[x]]+=j;const z=ha(ma(E(Z(b,y,U)),P));if(z&&Math.sign(z)!==j)break;g=U}return g})(p,m,t,Math.max(6,i),c,l,d,u)),p},oi=function(a,s,t,i,o){if(s===6){const r=((c)=>c[0]+c[1]/n)(a);return[Ya(r,t,i),0]}return ri(a,pt(s,t),i,o)},ri=function(a,s,t,i){let[o,r]=a;i&&r<0&&(r+=n,o-=1);const[c,l]=Aa(Ya(r,s,t),n);return ho(o+c,l)},Ya=function(a,s,t){return Nl(a/s,t)*s},Nl=function(a,s){return mm[s](a)},tp=function(a,s,t,i,o,r){const c=Ka(a),l=_(a),d=oi(l,i,o,r),u=ma(l,d),f=Math.sign(d[0]-l[0])===c,p=Ns(d,Math.min(t,6));return[{...a,...p},js(s,u),f]},ip=function(a,s,t,i,o,r,c,l,d,u){const f=Ka(a),p=ha(_(a,5)),m=pt(i,o);let h=Ya(p,m,r);const[g,P]=Mo(c,{...a,...Er},6,f,l,d,u),T=h-ha(ma(g,P));let O=0;T&&Math.sign(T)!==f?s=Cs(g,h):(O+=f,h=Ya(T,m,r),s=Cs(P,h));const b=mi(h);return[{...a,...b,days:a.days+O},s,Boolean(O)]},op=function(a,s,t,i,o,r,c,l,d,u){const f=Ka(a),p=v[i],m=Hr(i,a);i===7&&(a={...a,weeks:a.weeks+Math.trunc(a.days/7)});const h=Ut(a[p],o)*o;m[p]=h;const[g,P]=Mo(c,m,i,o*f,l,d,u),T=h+jo(s,g,P)*f*o,O=Ya(T,o,r),b=Math.sign(O-T)===f;return m[p]=O,[m,b?P:g,b]},Zo=function(a,s,t,i){const[o,r,c,l]=((u)=>{const f=So(u=wa(u));return[u.timeZone,...f]})(i),d=o!==void 0;return((u,f,p,m,h,g)=>{p=ri(p,h,m,1);const P=f.getOffsetNanosecondsFor(p);return Wo(Ba(p,P),g)+(u?hs($t(P)):"Z")})(d,s(d?a(o):Ss),t.epochNanoseconds,r,c,l)},xo=function(a,s,t){const[i,o,r,c,l,d]=((u)=>{u=wa(u);const f=zr(u),p=wl(u),m=pm(u),h=Dt(u,4),g=yt(u,4);return[f,fm(u),m,h,...Dl(g,p)]})(t);return((u,f,p,m,h,g,P,T,O,b)=>{m=ri(m,O,T,1);const y=u(p).getOffsetNanosecondsFor(m);return Wo(Ba(m,y),b)+hs($t(y),P)+((E,Z)=>Z!==1?"["+(Z===2?"!":"")+Q(E)+"]":"")(p,g)+No(f,h)})(a,s.calendar,s.timeZone,s.epochNanoseconds,i,o,r,c,l,d)},Lo=function(a,s){const[t,i,o,r]=((u)=>(u=wa(u),[zr(u),...So(u)]))(s);return c=a.calendar,l=t,d=r,Wo(El(a,o,i),d)+No(c,l);var c,l,d},Io=function(a,s){return t=a.calendar,i=a,o=wo(s),Jt(i)+No(t,o);var t,i,o},Ao=function(a,s){return $l(a.calendar,Jl,a,wo(s))},Eo=function(a,s){return $l(a.calendar,rp,a,wo(s))},Ho=function(a,s){const[t,i,o]=yl(s);return r=o,zl(Co(a,i,t)[0],r);var r},ci=function(a,s){const[t,i,o]=yl(s,3);return i>1&&(a={...a,...sp(a,i,t)}),((r,c)=>{const{sign:l}=r,d=l===-1?ia(r):r,{hours:u,minutes:f}=d,[p,m]=go(_(d,3),ba,Ua);Kl(p);const h=$o(m,c),g=c>=0||!l||h;return(l<0?"-":"")+"P"+Ac({Y:ls(d.years),M:ls(d.months),W:ls(d.weeks),D:ls(d.days)})+(u||f||p||g?"T"+Ac({H:ls(u),M:ls(f),S:ls(p,g)+h}):"")})(a,o)},$l=function(a,s,t,i){const o=Q(a),r=i>1||i===0&&o!==w;return i===1?o===w?s(t):Jt(t):r?Jt(t)+_l(o,i===2):s(t)},Ac=function(a){const s=[];for(let t in a){const i=a[t];i&&s.push(i,t)}return s.join("")},Wo=function(a,s){return Jt(a)+"T"+zl(a,s)},Jt=function(a){return Jl(a)+"-"+Ta(a.isoDay)},Jl=function(a){const{isoYear:s}=a;return(s<0||s>9999?Gl(s)+Et(6,Math.abs(s)):Et(4,s))+"-"+Ta(a.isoMonth)},rp=function(a){return Ta(a.isoMonth)+"-"+Ta(a.isoDay)},zl=function(a,s){const t=[Ta(a.isoHour),Ta(a.isoMinute)];return s!==-1&&t.push(Ta(a.isoSecond)+((i,o,r,c)=>$o(i*ja+o*ys+r,c))(a.isoMillisecond,a.isoMicrosecond,a.isoNanosecond,s)),t.join(":")},hs=function(a,s=0){if(s===1)return"";const[t,i]=Aa(Math.abs(a),Fi),[o,r]=Aa(i,ni),[c,l]=Aa(r,ba);return Gl(a)+Ta(t)+":"+Ta(o)+(c||l?":"+Ta(c)+$o(l):"")},No=function(a,s){if(s!==1){const t=Q(a);if(s>1||s===0&&t!==w)return _l(t,s===2)}return""},_l=function(a,s){return"["+(s?"!":"")+"u-ca="+a+"]"},$o=function(a,s){let t=Et(9,a);return t=s===void 0?t.replace(Pm,""):t.slice(0,s),t?"."+t:""},Gl=function(a){return a<0?"-":"+"},ls=function(a,s){return a||s?a.toLocaleString("fullwide",{useGrouping:0}):""},cp=function(a,s){const{epochNanoseconds:t}=a,i=(s.getOffsetNanosecondsFor?s:s(a.timeZone)).getOffsetNanosecondsFor(t),o=Ba(t,i);return{calendar:a.calendar,...o,offsetNanoseconds:i}},ql=function(a,s){const t=ta(s,a);return{calendar:s.calendar,...pa(Vu,t),offset:hs(t.offsetNanoseconds),timeZone:s.timeZone}},gs=function(a,s,t,i=0,o=0,r,c){if(t!==void 0&&i===1&&(i===1||c))return bo(s,t);const l=a.getPossibleInstantsFor(s);if(t!==void 0&&i!==3){const d=((u,f,p,m)=>{const h=e(f);m&&(p=$t(p));for(let g of u){let P=ha(ma(g,h));if(m&&(P=$t(P)),P===p)return g}})(l,s,t,r);if(d!==void 0)return d;if(i===0)throw new RangeError(Ip)}return c?e(s):fa(a,s,o,l)},fa=function(a,s,t=0,i=a.getPossibleInstantsFor(s)){if(i.length===1)return i[0];if(t===1)throw new RangeError(Ap);if(i.length)return i[t===3?1:0];const o=e(s),r=((l,d)=>{const u=l.getOffsetNanosecondsFor(Cs(d,-n));return zo(l.getOffsetNanosecondsFor(Cs(d,n))-u)})(a,o),c=r*(t===2?-1:1);return(i=a.getPossibleInstantsFor(Ba(o,c)))[t===2?0:i.length-1]},Jo=function(a){if(Math.abs(a)>=n)throw new RangeError(xp);return a},zo=function(a){if(a>n)throw new RangeError(Lp);return a},_o=function(a,s,t){return q(ga(js(s.epochNanoseconds,((i)=>{if(Xl(i))throw new RangeError(Wp);return _(i,5)})(a?ia(t):t))))},Go=function(a,s,t,i,o,r=Object.create(null)){const c=s(i.timeZone),l=a(i.calendar);return{...i,...Bo(c,l,i,t?ia(o):o,r)}},qo=function(a,s,t,i,o=Object.create(null)){const{calendar:r}=t;return W(Ko(a(r),t,s?ia(i):i,o),r)},Uo=function(a,s,t,i,o){const{calendar:r}=t;return N(li(a(r),t,s?ia(i):i,o),r)},Qo=function(a,s,t,i,o=Object.create(null)){const r=t.calendar,c=a(r);let l=tt(c,t);s&&(i=pi(i)),i.sign<0&&(l=c.dateAdd(l,{...Y,months:1}),l=Ps(l,-1));const d=c.dateAdd(l,i,o);return ds(tt(c,d),r)},Yo=function(a,s,t){return Sa(Ul(s,a?ia(t):t)[0])},Bo=function(a,s,t,i,o){const r=_(i,5);let c=t.epochNanoseconds;if(Xl(i)){const l=ta(t,a);c=js(fa(a,{...li(s,l,{...i,...Er},o),...pa(na,l)}),r)}else c=js(c,r),S(o);return{epochNanoseconds:ga(c)}},Ko=function(a,s,t,i){const[o,r]=Ul(s,t);return Wa({...li(a,s,{...t,...Er,days:t.days+r},i),...o})},li=function(a,s,t,i){if(t.years||t.months||t.weeks)return a.dateAdd(s,t,i);S(i);const o=t.days+_(t,5)[0];return o?Ga(Ps(s,o)):s},tt=function(a,s,t=1){return Ps(s,t-a.day(s))},Ul=function(a,s){const[t,i]=_(s,5),[o,r]=Xt(Qa(a)+i);return[o,t+r]},Ps=function(a,s){return s?{...a,...kt(sa(a)+s*da)}:a},di=function(a,s,t){const i=a(t.calendar);return fi(t)?[t,i,s(t.timeZone)]:[{...t,...Oa},i]},Xo=function(a){return a?Rl:e},ui=function(a){return a?D(Bo,a):Ko},ko=function(a){return a?D(dp,a):up},fi=function(a){return a&&a.epochNanoseconds},it=function(a,s){return a<=6-(fi(s)?1:0)},Vo=function(a,s,t,i,o,r,c){const l=a(wa(c).relativeTo),d=Math.max(us(o),us(r));if(it(d,l))return C(Ws(((P,T,O,b)=>{const y=js(_(P),_(T),b?-1:1);if(!Number.isFinite(y[0]))throw new RangeError(Si);return{...Y,...Ns(y,O)}})(o,r,d,i)));if(!l)throw new RangeError(vi);i&&(r=ia(r));const[u,f,p]=di(s,t,l),m=ui(p),h=ko(p),g=m(f,u,o);return C(h(f,u,m(f,g,r),d))},Ql=function(a,s,t,i,o){const r=us(i),[c,l,d,u,f]=((j,x,U)=>{j=Fo(j,Gt);let z=Jr(j);const ks=U(j[af]);let Vs=vo(j);const Vf=Dt(j,7);let cs=yt(j);if(z===void 0&&cs===void 0)throw new RangeError(Np);return cs==null&&(cs=0),z==null&&(z=Math.max(cs,x)),Sl(z,cs),Vs=no(Vs,cs,1),[z,cs,Vs,Vf,ks]})(o,r,a),p=Math.max(r,c);if(!fi(f)&&p<=6)return C(Ws(((j,x,U,z,ks)=>{const Vs=oi(_(j),U,z,ks);return{...Y,...Ns(Vs,x)}})(i,c,l,d,u)));if(!f)throw new RangeError(vi);const[m,h,g]=di(s,t,f),P=Xo(g),T=ui(g),O=ko(g),b=T(h,m,i);let y=O(h,m,b,c);const E=i.sign,Z=Ka(y);if(E&&Z&&E!==Z)throw new RangeError(Tt);return Z&&(y=ii(y,P(b),c,l,d,u,h,m,P,T)),C(y)},Yl=function(a){return a.sign===-1?pi(a):a},pi=function(a){return C(ia(a))},ia=function(a){const s={};for(let t of v)s[t]=-1*a[t]||0;return s},Bl=function(a){return!a.sign},Ka=function(a,s=v){let t=0;for(let i of s){const o=Math.sign(a[i]);if(o){if(t&&t!==o)throw new RangeError(Hp);t=o}}return t},Ws=function(a){for(let s of Qp)Pa(s,a[s],-zc,zc,1);return Kl(ha(_(a),ba)),a},Kl=function(a){if(!Number.isSafeInteger(a))throw new RangeError(Ep)},_=function(a,s=6){return Xc(a,s,v)},Ns=function(a,s=6){const[t,i]=a,o=Qt(i,s,v);if(o[v[s]]+=t*(n/Ma[s]),!Number.isFinite(o[v[s]]))throw new RangeError(Si);return o},mi=function(a,s=5){return Qt(a,s,v)},Xl=function(a){return Boolean(Ka(a,Xu))},us=function(a){let s=9;for(;s>0&&!a[v[s]];s--);return s},lp=function(a,s){return[a,s]},Ec=function(a){const s=Math.floor(a/It)*It;return[s,s+It]},kl=function(a){const s=Xa(a=Ht(a));if(!s)throw new RangeError(la(a));let t;if(s.m)t=0;else{if(!s.offset)throw new RangeError(la(a));t=$s(s.offset)}return s.timeZone&&tr(s.timeZone,1),q(bo(Vt(s),t))},Vl=function(a){const s=Xa(L(a));if(!s)throw new RangeError(la(a));if(s.timeZone)return ld(s,s.offset?$s(s.offset):void 0);if(s.m)throw new RangeError(la(a));return ud(s)},el=function(a,s){const t=Xa(L(a));if(!t||!t.timeZone)throw new RangeError(la(a));const{offset:i}=t,o=i?$s(i):void 0,[,r,c]=ft(s);return ld(t,o,r,c)},$s=function(a){const s=tr(a);if(s===void 0)throw new RangeError(la(a));return s},ad=function(a){const s=Xa(L(a));if(!s||s.m)throw new RangeError(la(a));return W(dd(s))},hi=function(a){const s=Xa(L(a));if(!s||s.m)throw new RangeError(la(a));return N(s.p?dd(s):ud(s))},sd=function(a,s){const t=ar(L(s));if(t)return eo(t),ds(To(ps(t)));const i=hi(s);return ds(tt(a(i.calendar),i))},eo=function(a){if(a.calendar!==w)throw new RangeError(Ea(a.calendar))},td=function(a,s){const t=sr(L(s));if(t)return eo(t),Nt(ps(t));const i=hi(s),{calendar:o}=i,r=a(o),[c,l,d]=r.h(i),[u,f]=r.I(c,l),[p,m]=r.N(u,f,d);return Nt(Ga(r.P(p,m,d)),o)},id=function(a){let s,t=((i)=>{const o=Dm.exec(i);return o?(gi(o[10]),md(o)):void 0})(L(a));if(!t){if(t=Xa(a),!t)throw new RangeError(la(a));if(!t.p)throw new RangeError(la(a));if(t.m)throw new RangeError(Ea("Z"));eo(t)}if((s=ar(a))&&Lc(s))throw new RangeError(la(a));if((s=sr(a))&&Lc(s))throw new RangeError(la(a));return Sa(et(t,1))},od=function(a){const s=((t)=>{const i=vm.exec(t);return i?((o)=>{function r(f,p,m){let h=0,g=0;if(m&&([h,d]=Aa(d,Ma[m])),f!==void 0){if(l)throw new RangeError(Ea(f));g=((P)=>{const T=parseInt(P);if(!Number.isFinite(T))throw new RangeError(Ea(P));return T})(f),c=1,p&&(d=ir(p)*(Ma[m]/ba),l=1)}return h+g}let c=0,l=0,d=0,u={...Is(v,[r(o[2]),r(o[3]),r(o[4]),r(o[5]),r(o[6],o[7],5),r(o[8],o[9],4),r(o[10],o[11],3)]),...Qt(d,2,v)};if(!c)throw new RangeError(Cu(v));return or(o[1])<0&&(u=ia(u)),u})(i):void 0})(L(a));if(!s)throw new RangeError(la(a));return C(Ws(s))},rd=function(a){const s=Xa(a)||ar(a)||sr(a);return s?s.calendar:a},cd=function(a){const s=Xa(a);return s&&(s.timeZone||s.m&&Ss||s.offset)||a},ld=function(a,s,t=0,i=0){const o=Pi(a.timeZone),r=Li(o);return B(gs(r,Vt(a),s,t,i,!r.v,a.m),o,mt(a.calendar))},dd=function(a){return fd(Wa(Vt(a)))},ud=function(a){return fd(Ga(ps(a)))},fd=function(a){return{...a,calendar:mt(a.calendar)}},Xa=function(a){const s=ym.exec(a);return s?((t)=>{const i=t[10],o=(i||"").toUpperCase()==="Z";return{isoYear:pd(t),isoMonth:parseInt(t[4]),isoDay:parseInt(t[5]),...md(t.slice(5)),...gi(t[16]),p:Boolean(t[6]),m:o,offset:o?void 0:i}})(s):void 0},ar=function(a){const s=bm.exec(a);return s?((t)=>({isoYear:pd(t),isoMonth:parseInt(t[4]),isoDay:1,...gi(t[5])}))(s):void 0},sr=function(a){const s=Om.exec(a);return s?((t)=>({isoYear:Ls,isoMonth:parseInt(t[1]),isoDay:parseInt(t[2]),...gi(t[3])}))(s):void 0},tr=function(a,s){const t=wm.exec(a);return t?((i,o)=>{const r=i[4]||i[5];if(o&&r)throw new RangeError(Ea(r));return Jo((Ms(i[2])*Fi+Ms(i[3])*ni+Ms(i[4])*ba+ir(i[5]||""))*or(i[1]))})(t,s):void 0},pd=function(a){const s=or(a[1]),t=parseInt(a[2]||a[3]);if(s<0&&!t)throw new RangeError(Ea(-0));return s*t},md=function(a){const s=Ms(a[3]);return{...Xt(ir(a[4]||""))[0],isoHour:Ms(a[1]),isoMinute:Ms(a[2]),isoSecond:s===60?59:s}},gi=function(a){let s,t;const i=[];if(a.replace(Sm,(o,r,c)=>{const l=Boolean(r),[d,u]=c.split("=").reverse();if(u){if(u==="u-ca")i.push(d),s||(s=l);else if(l||/[A-Z]/.test(u))throw new RangeError(Ea(o))}else{if(t)throw new RangeError(Ea(o));t=d}return""}),i.length>1&&s)throw new RangeError(Ea(a));return{timeZone:t,calendar:i[0]||w}},ir=function(a){return parseInt(a.padEnd(9,"0"))},Js=function(a){return new RegExp(`^${a}\$`,"i")},or=function(a){return a&&a!=="+"?-1:1},Ms=function(a){return a===void 0?0:parseInt(a)},hd=function(a){return Pi(L(a))},Pi=function(a){const s=rr(a);return typeof s=="number"?hs(s):s?((t)=>{if(Fm.test(t))throw new RangeError(Zp);return t.toLowerCase().split("/").map((i,o)=>(i.length<=3||/\d/.test(i))&&!/etc|yap/.test(i)?i.toUpperCase():i.replace(/baja|dumont|[a-z]+/g,(r,c)=>r.length<=2&&!o||r==="in"||r==="chat"?r.toUpperCase():r.length>2||!c?Zc(r).replace(/island|noronha|murdo|rivadavia|urville/,Zc):r)).join("/")})(a):Ss},Hc=function(a){const s=rr(a);return typeof s=="number"?s:s?s.resolvedOptions().timeZone:Ss},rr=function(a){const s=tr(a=a.toUpperCase(),1);return s!==void 0?s:a!==Ss?nm(a):void 0},cr=function(a,s){return aa(a.epochNanoseconds,s.epochNanoseconds)},lr=function(a,s){return aa(a.epochNanoseconds,s.epochNanoseconds)},gd=function(a,s,t,i,o,r){const c=a(wa(r).relativeTo),l=Math.max(us(i),us(o));if(Bc(v,i,o))return 0;if(it(l,c))return aa(_(i),_(o));if(!c)throw new RangeError(vi);const[d,u,f]=di(s,t,c),p=Xo(f),m=ui(f);return aa(p(m(u,d,i)),p(m(u,d,o)))},dr=function(a,s){return Ts(a,s)||Ti(a,s)},Ts=function(a,s){return _a(sa(a),sa(s))},Ti=function(a,s){return _a(Qa(a),Qa(s))},Pd=function(a,s){return!cr(a,s)},Td=function(a,s){return!lr(a,s)&&!!bi(a.timeZone,s.timeZone)&&Hs(a.calendar,s.calendar)},bd=function(a,s){return!dr(a,s)&&Hs(a.calendar,s.calendar)},Od=function(a,s){return!Ts(a,s)&&Hs(a.calendar,s.calendar)},yd=function(a,s){return!Ts(a,s)&&Hs(a.calendar,s.calendar)},Dd=function(a,s){return!Ts(a,s)&&Hs(a.calendar,s.calendar)},wd=function(a,s){return!Ti(a,s)},bi=function(a,s){if(a===s)return 1;const t=Q(a),i=Q(s);if(t===i)return 1;try{return Hc(t)===Hc(i)}catch(o){}},ur=function(a,s,t,i){const o=Es(a,H(i),3,5),r=Oi(s.epochNanoseconds,t.epochNanoseconds,...o);return C(a?ia(r):r)},fr=function(a,s,t,i,o,r){const c=Di(i.calendar,o.calendar),l=H(r),[d,u,f,p]=Es(t,l,5),m=i.epochNanoseconds,h=o.epochNanoseconds,g=aa(h,m);let P;if(g)if(d<6)P=Oi(m,h,d,u,f,p);else{const T=s(((b,y)=>{if(!bi(b,y))throw new RangeError(Eu);return b})(i.timeZone,o.timeZone)),O=a(c);P=vd(O,T,i,o,g,d,l),P=ii(P,h,d,u,f,p,O,i,Rl,D(Bo,T))}else P=Y;return C(t?ia(P):P)},pr=function(a,s,t,i,o){const r=Di(t.calendar,i.calendar),c=H(o),[l,d,u,f]=Es(s,c,6),p=e(t),m=e(i),h=aa(m,p);let g;if(h)if(l<=6)g=Oi(p,m,l,d,u,f);else{const P=a(r);g=nd(P,t,i,h,l,c),g=ii(g,m,l,d,u,f,P,t,e,Ko)}else g=Y;return C(s?ia(g):g)},mr=function(a,s,t,i,o){const r=Di(t.calendar,i.calendar),c=H(o);return Sd(s,()=>a(r),t,i,...Es(s,c,6,9,6),c)},hr=function(a,s,t,i,o){const r=Di(t.calendar,i.calendar),c=H(o),l=Es(s,c,9,9,8),d=a(r);return Sd(s,()=>d,tt(d,t),tt(d,i),...l,c)},Sd=function(a,s,t,i,o,r,c,l,d){const u=e(t),f=e(i);let p;if(aa(f,u))if(o===6)p=Oi(u,f,o,r,c,l);else{const m=s();p=m.dateUntil(t,i,o,d),r===6&&c===1||(p=ii(p,f,o,r,c,l,m,t,e,li))}else p=Y;return C(a?ia(p):p)},gr=function(a,s,t,i){const o=H(i),[r,c,l,d]=Es(a,o,5,5),u=Ya(Pr(s,t),pt(c,l),d),f={...Y,...mi(u,r)};return C(a?ia(f):f)},dp=function(a,s,t,i,o,r){const c=aa(i.epochNanoseconds,t.epochNanoseconds);return c?o<6?Fd(t.epochNanoseconds,i.epochNanoseconds,o):vd(s,a,t,i,c,o,r):Y},up=function(a,s,t,i,o){const r=e(s),c=e(t),l=aa(c,r);return l?i<=6?Fd(r,c,i):nd(a,s,t,l,i,o):Y},vd=function(a,s,t,i,o,r,c){const[l,d,u]=((m,h,g,P)=>{function T(){return x={...Ps(y,Z++*-P),...b},U=fa(m,x),aa(E,U)===-P}const O=ta(h,m),b=pa(na,O),y=ta(g,m),E=g.epochNanoseconds;let Z=0;const j=Pr(O,y);let x,U;if(Math.sign(j)===-P&&Z++,T()&&(P===-1||T()))throw new RangeError(Tt);const z=ha(ma(U,E));return[O,x,z]})(s,t,i,o);var f,p;return{...r===6?(f=l,p=d,{...Y,days:Rd(f,p)}):a.dateUntil(l,d,r,c),...mi(u)}},nd=function(a,s,t,i,o,r){const[c,l,d]=((u,f,p)=>{let m=f,h=Pr(u,f);return Math.sign(h)===-p&&(m=Ps(f,-p),h+=n*p),[u,m,h]})(s,t,i);return{...a.dateUntil(c,l,o,r),...mi(d)}},Oi=function(a,s,t,i,o,r){return{...Y,...Ns(oi(ma(a,s),i,o,r),t)}},Fd=function(a,s,t){return{...Y,...Ns(ma(a,s),t)}},Rd=function(a,s){return yi(sa(a),sa(s))},yi=function(a,s){return Math.trunc((s-a)/da)},Pr=function(a,s){return Qa(s)-Qa(a)},Di=function(a,s){if(!Hs(a,s))throw new RangeError(Zr);return a},fp=function(a){function s(o){return((r,c)=>({...Md(r,c),F:r.month,day:parseInt(r.day)}))(Po(t,o),i)}const t=Ur(a),i=zt(a);return{id:a,O:pp(s),B:mp(s)}},pp=function(a){return ua((s)=>{const t=sa(s);return a(t)},WeakMap)},mp=function(a){const s=a(0).year-Vp;return ua((t)=>{let i,o=As(t-s);const r=[],c=[];do o+=400*da;while((i=a(o)).year<=t);do o+=(1-i.day)*da,i.year===t&&(r.push(o),c.push(i.F)),o-=da;while((i=a(o)).year>=t);return{k:r.reverse(),C:Nu(c.reverse())}})},Md=function(a,s){let t,i,o=jd(a);if(a.era){const r=Yu[s];r!==void 0&&(t=s==="islamic"?"ah":a.era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,""),t==="bc"||t==="b"?t="bce":t!=="ad"&&t!=="a"||(t="ce"),i=o,o=Id(i,r[t]||0))}return{era:t,eraYear:i,year:o}},jd=function(a){return parseInt(a.relatedYear||a.year)},Vi=function(a){const{year:s,F:t,day:i}=this.O(a),{C:o}=this.B(s);return[s,o[t]+1,i]},ot=function(a,s=1,t=1){return this.B(a).k[s-1]+(t-1)*da},Zt=function(a){const s=Nc(this,a),t=Nc(this,a-1),i=s.length;if(i>t.length){const o=Ad(this);if(o<0)return-o;for(let r=0;r<i;r++)if(s[r]!==t[r])return r+1}},xt=function(a){return yi(ot.call(this,a),ot.call(this,a+1))},Wc=function(a,s){const{k:t}=this.B(a);let i=s+1,o=t;return i>t.length&&(i=1,o=this.B(a+1).k),yi(t[s-1],o[i-1])},Lt=function(a){return this.B(a).k.length},Nc=function(a,s){return Object.keys(a.B(s).C)},Cd=function(a){return mt(L(a))},mt=function(a){if((a=a.toLowerCase())!==w&&a!==Mi&&zt(a)!==zt(Ur(a).resolvedOptions().calendar))throw new RangeError(Cp(a));return a},zt=function(a){return a==="islamicc"&&(a="islamic"),a.split("-")[0]},Zd=function(a){return this.R(a)[0]},xd=function(a){return this.R(a)[1]},Tr=function(a){const[s]=this.h(a);return yi(this.q(s),sa(a))+1},Ld=function(a){const s=Mm.exec(a);if(!s)throw new RangeError(Mp(a));return[parseInt(s[1]),Boolean(s[2])]},_t=function(a,s,t){return a+(s||t&&a>=t?1:0)},ei=function(a,s){return a-(s&&a>=s?1:0)},Id=function(a,s){return(s+a)*(Math.sign(s)||1)||0},ao=function(a){return Yu[Ed(a)]},Ad=function(a){return Gp[Ed(a)]},Ed=function(a){return zt(a.id||w)},Hd=function(a,s,t,i){const o=ka(t,i,va,[],Gu);if(o.timeZone!==void 0){const r=t.dateFromFields(o),c=bs(o),l=a(o.timeZone);return{epochNanoseconds:gs(s(l),{...r,...c},o.offset!==void 0?$s(o.offset):void 0),timeZone:l}}return{...t.dateFromFields(o),...Oa}},Wd=function(a,s,t,i,o,r){const c=ka(t,o,va,zu,Gu),l=a(c.timeZone),[d,u,f]=ft(r),p=t.dateFromFields(c,si(r,d)),m=bs(c,d);return B(gs(s(l),{...p,...m},c.offset!==void 0?$s(c.offset):void 0,u,f),l,i)},Nd=function(a,s,t){const i=ka(a,s,va,[],Ja),o=S(t);return W(Wa({...a.dateFromFields(i,si(t,o)),...bs(i,o)}))},br=function(a,s,t,i=[]){const o=ka(a,s,va,i);return a.dateFromFields(o,t)},Or=function(a,s,t,i){const o=ka(a,s,Ir,i);return a.yearMonthFromFields(o,t)},yr=function(a,s,t,i,o=[]){const r=ka(a,t,va,o);return s&&r.month!==void 0&&r.monthCode===void 0&&r.year===void 0&&(r.year=Ls),a.monthDayFromFields(r,i)},$d=function(a,s){const t=S(s);return Sa(bs(Ra(a,to,[],1),t))},Jd=function(a){const s=Ra(a,Ar);return C(Ws({...Y,...s}))},ka=function(a,s,t,i=[],o=[]){return Ra(s,[...a.fields(t),...o].sort(),i)},Ra=function(a,s,t,i=!t){const o={};let r,c=0;for(let l of s){if(l===r)throw new RangeError(wp(l));if(l==="constructor"||l==="__proto__")throw new RangeError(jr(l));let d=a[l];if(d!==void 0)c=1,_c[l]&&(d=_c[l](d,l)),o[l]=d;else if(t){if(t.includes(l))throw new TypeError(Mr(l));o[l]=Qu[l]}r=l}if(i&&!c)throw new TypeError(Cu(s));return o},bs=function(a,s){return et(xm({...Qu,...a}),s)},zd=function(a,s,t,i,o,r){const c=H(r),{calendar:l,timeZone:d}=t;return B(((u,f,p,m,h)=>{const g=ht(u,p,m,va,_u,Ju),[P,T,O]=ft(h,2);return gs(f,{...u.dateFromFields(g,si(h,P)),...bs(g,P)},$s(g.offset),T,O)})(a(l),s(d),i,o,c),d,l)},_d=function(a,s,t,i,o){const r=H(o);return W(((c,l,d,u)=>{const f=ht(c,l,d,va,Ja),p=S(u);return Wa({...c.dateFromFields(f,si(u,p)),...bs(f,p)})})(a(s.calendar),t,i,r))},Gd=function(a,s,t,i,o){const r=H(o);return((c,l,d,u)=>{const f=ht(c,l,d,va);return c.dateFromFields(f,u)})(a(s.calendar),t,i,r)},qd=function(a,s,t,i,o){const r=H(o);return ds(((c,l,d,u)=>{const f=ht(c,l,d,Ir);return c.yearMonthFromFields(f,u)})(a(s.calendar),t,i,r))},Ud=function(a,s,t,i,o){const r=H(o);return((c,l,d,u)=>{const f=ht(c,l,d,va);return c.monthDayFromFields(f,u)})(a(s.calendar),t,i,r)},Qd=function(a,s,t){return Sa(((i,o,r)=>{const c=S(r);return bs({...pa(to,i),...Ra(o,to)},c)})(a,s,t))},Yd=function(a,s){return C((t=a,i=s,Ws({...t,...Ra(i,Ar)})));var t,i},ht=function(a,s,t,i,o=[],r=[]){const c=[...a.fields(i),...o].sort();let l=Ra(s,c,r);const d=Ra(t,c);return l=a.mergeFields(l,d),Ra(l,c,[])},Dr=function(a,s){const t=ka(a,s,Uu);return a.monthDayFromFields(t)},wr=function(a,s,t){const i=ka(a,s,qu);return a.yearMonthFromFields(i,t)},Bd=function(a,s,t,i,o){s=pa(t=a.fields(t),s),i=Ra(i,o=a.fields(o),[]);let r=a.mergeFields(s,i);return r=Ra(r,[...t,...o].sort(),[]),a.dateFromFields(r)},Yi=function(a,s){let{era:t,eraYear:i,year:o}=s;const r=ao(a);if(t!==void 0||i!==void 0){if(t===void 0||i===void 0)throw new TypeError(vp);if(!r)throw new RangeError(Sp);const c=r[t];if(c===void 0)throw new RangeError(Fp(t));const l=Id(i,c);if(o!==void 0&&o!==l)throw new RangeError(np);o=l}else if(o===void 0)throw new TypeError(Rp(r));return o},Bi=function(a,s,t,i){let{month:o,monthCode:r}=s;if(r!==void 0){const c=((l,d,u,f)=>{const p=l.U(u),[m,h]=Ld(d);let g=_t(m,h,p);if(h){const P=Ad(l);if(P===void 0)throw new RangeError(es);if(P>0){if(g>P)throw new RangeError(es);if(p===void 0){if(f===1)throw new RangeError(es);g--}}else{if(g!==-P)throw new RangeError(es);if(p===void 0&&f===1)throw new RangeError(es)}}return g})(a,r,t,i);if(o!==void 0&&o!==c)throw new RangeError(Iu);o=c,i=1}else if(o===void 0)throw new TypeError(jp);return Pa("month",o,1,a.L(t),i)},$c=function(a,s,t,i,o){return ca(s,"day",1,a.j(i,t),o)},Ki=function(a,s,t,i){let o=0;const r=[];for(let c of t)s[c]!==void 0?o=1:r.push(c);if(Object.assign(a,s),o)for(let c of i||r)delete a[c]},Kd=function(a){return q(ga(Kt(Bt(a))))},Xd=function(a,s,t,i,o=w){return B(ga(Kt(Bt(t))),s(i),a(o))},kd=function(a,s,t,i,o=0,r=0,c=0,l=0,d=0,u=0,f=w){return W(Wa(Vt(ya(V,Is(ji,[s,t,i,o,r,c,l,d,u])))),a(f))},Vd=function(a,s,t,i,o=w){return N(Ga(ps(ya(V,{isoYear:s,isoMonth:t,isoDay:i}))),a(o))},ed=function(a,s,t,i=w,o=1){const r=V(s),c=V(t),l=a(i);return ds(To(ps({isoYear:r,isoMonth:c,isoDay:V(o)})),l)},au=function(a,s,t,i=w,o=Ls){const r=V(s),c=V(t),l=a(i);return Nt(Ga(ps({isoYear:V(o),isoMonth:r,isoDay:c})),l)},su=function(a=0,s=0,t=0,i=0,o=0,r=0){return Sa(et(ya(V,Is(na,[a,s,t,i,o,r])),1))},tu=function(a=0,s=0,t=0,i=0,o=0,r=0,c=0,l=0,d=0,u=0){return C(Ws(ya(cl,Is(v,[a,s,t,i,o,r,c,l,d,u]))))},Sr=function(a,s,t=w){return B(a.epochNanoseconds,s,t)},iu=function(a){return q(a.epochNanoseconds)},vr=function(a,s){return W(ta(s,a))},nr=function(a,s){return N(ta(s,a))},ou=function(a,s,t){return wr(a(s.calendar),t)},ru=function(a,s,t){return Dr(a(s.calendar),t)},Fr=function(a,s){return Sa(ta(s,a))},cu=function(a,s,t,i){const o=((r,c,l,d)=>{const u=Do(d);return fa(r(c),l,u)})(a,t,s,i);return B(ga(o),t,s.calendar)},lu=function(a,s,t){const i=a(s.calendar);return ds({...s,...wr(i,t)})},du=function(a,s,t){return Dr(a(s.calendar),t)},uu=function(a,s,t,i,o){const r=a(o.timeZone),c=o.plainTime,l=c!==void 0?s(c):Oa;return B(fa(t(r),{...i,...l}),r,i.calendar)},fu=function(a,s=Oa){return W(Wa({...a,...s}))},pu=function(a,s,t){return wr(a(s.calendar),t)},mu=function(a,s,t){return Dr(a(s.calendar),t)},hu=function(a,s,t,i){return((o,r,c)=>Bd(o,r,qu,Ha(c),Ot))(a(s.calendar),t,i)},gu=function(a,s,t,i){return((o,r,c)=>Bd(o,r,Uu,Ha(c),Ri))(a(s.calendar),t,i)},Pu=function(a,s,t,i,o){const r=Ha(o),c=s(r.plainDate),l=a(r.timeZone);return B(fa(t(l),{...c,...i}),l,c.calendar)},Tu=function(a,s){return W(Wa({...a,...s}))},bu=function(a){return q(ga(Zs(a,ba)))},Ou=function(a){return q(ga(Zs(a,ja)))},yu=function(a){return q(ga(Kt(Bt(a),ys)))},Du=function(a){return q(ga(Kt(Bt(a))))},wu=function(a,s,t=Oa){const i=s.timeZone,o=a(i),r={...ta(s,o),...t};return B(gs(o,r,r.offsetNanoseconds,2),i,s.calendar)},Su=function(a,s,t){const i=s.timeZone,o=a(i),r={...ta(s,o),...t},c=Ru(s.calendar,t.calendar);return B(gs(o,r,r.offsetNanoseconds,2),i,c)},vu=function(a,s=Oa){return W({...a,...s})},nu=function(a,s){return W({...a,...s},Ru(a.calendar,s.calendar))},wi=function(a,s){return{...a,calendar:s}},Fu=function(a,s){return{...a,timeZone:s}},Ru=function(a,s){if(a===s)return a;const t=Q(a),i=Q(s);if(t===i||t===w)return s;if(i===w)return a;throw new RangeError(Zr)},hp=function(a,s){return(t)=>t===w?a:t===Mi||t===xs?Object.assign(Object.create(a),{id:t}):Object.assign(Object.create(s),Rm(t))},Os=function(a,s,t){const i=new Set(t);return(o)=>(((r,c)=>{for(let l of c)if(l in r)return 1;return 0})(o=co(i,o),a)||Object.assign(o,s),t&&(o.timeZone=Ss,["full","long"].includes(o.timeStyle)&&(o.timeStyle="medium")),o)},Na=function(a,s=Rr){const[t,,,i]=a;return(o,r=Ym,...c)=>{const l=s(i&&i(...c),o,r,t),d=l.resolvedOptions();return[l,...gp(a,d,c)]}},Rr=function(a,s,t,i){if(t=i(t),a){if(t.timeZone!==void 0)throw new TypeError(Jp);t.timeZone=a}return new Va(s,t)},gp=function(a,s,t){const[,i,o]=a;return t.map((r)=>(r.calendar&&((c,l,d)=>{if((d||c!==w)&&c!==l)throw new RangeError(Zr)})(Q(r.calendar),s.calendar,o),i(r,s)))},zs=function(a){const s=gt();return Ba(s,a.getOffsetNanosecondsFor(s))},gt=function(){return Zs(Date.now(),ja)},$a=function(){return qc||(qc=new Va().resolvedOptions().timeZone)},Pp=(a,s)=>`Non-integer ${a}: ${s}`,Tp=(a,s)=>`Non-positive ${a}: ${s}`,bp=(a,s)=>`Non-finite ${a}: ${s}`,Op=(a)=>`Cannot convert bigint to ${a}`,yp=(a)=>`Invalid bigint: ${a}`,Dp="Cannot convert Symbol to string",Mu="Invalid object",ju=(a,s,t,i,o)=>o?ju(a,o[s],o[t],o[i]):Pt(a,s)+`; must be between ${t}-${i}`,Pt=(a,s)=>`Invalid ${a}: ${s}`,Mr=(a)=>`Missing ${a}`,jr=(a)=>`Invalid field ${a}`,wp=(a)=>`Duplicate field ${a}`,Cu=(a)=>"No valid fields: "+a.join(),Zu="Invalid bag",xu=(a,s,t)=>Pt(a,s)+"; must be "+Object.keys(t).join(),Lu="Cannot use valueOf",Cr="Invalid calling context",Sp="Forbidden era/eraYear",vp="Mismatching era/eraYear",np="Mismatching year/eraYear",Fp=(a)=>`Invalid era: ${a}`,Rp=(a)=>"Missing year"+(a?"/era/eraYear":""),Mp=(a)=>`Invalid monthCode: ${a}`,Iu="Mismatching month/monthCode",jp="Missing month/monthCode",Jc="Cannot guess year",es="Invalid leap month",Au="Invalid protocol",Tt="Invalid protocol results",Zr="Mismatching Calendars",Cp=(a)=>`Invalid Calendar: ${a}`,Eu="Mismatching TimeZones",Zp="Forbidden ICU TimeZone",xp="Out-of-bounds offset",Lp="Out-of-bounds TimeZone gap",Ip="Invalid TimeZone offset",Ap="Ambiguous offset",Si="Out-of-bounds date",Ep="Out-of-bounds duration",Hp="Cannot mix duration signs",vi="Missing relativeTo",Wp="Cannot use large units",Np="Required smallestUnit or largestUnit",$p="smallestUnit > largestUnit",la=(a)=>`Cannot parse: ${a}`,Ea=(a)=>`Invalid substring: ${a}`,Hu=(a)=>`Cannot format ${a}`,Wu="Mismatching types for formatting",Jp="Cannot specify TimeZone",Nu=D(lt,(a,s)=>s),_s=D(lt,(a,s,t)=>t),Ta=D(Et,2),so={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},bt=Object.keys(so),da=86400000,$u=1000,ys=1000,ja=1e6,ba=1e9,ni=60000000000,Fi=3600000000000,n=86400000000000,Ma=[1,ys,ja,ba,ni,Fi,n],Ja=bt.slice(0,6),to=dt(Ja),Ju=["offset"],zu=["timeZone"],_u=Ja.concat(Ju),Gu=_u.concat(zu),io=["era","eraYear"],zp=io.concat(["year"]),Ri=["year"],xr=["monthCode"],Lr=["month"].concat(xr),Ot=["day"],Ir=Lr.concat(Ri),qu=xr.concat(Ri),va=Ot.concat(Ir),_p=Ot.concat(Lr),Uu=Ot.concat(xr),Qu=_s(Ja,0),w="iso8601",Mi="gregory",xs="japanese",Yu={[Mi]:{bce:-1,ce:0},[xs]:{bce:-1,ce:0,meiji:1867,taisho:1911,showa:1925,heisei:1988,reiwa:2018},ethioaa:{era0:0},ethiopic:{era0:0,era1:5500},coptic:{era0:-1,era1:0},roc:{beforeroc:-1,minguo:0},buddhist:{be:0},islamic:{ah:0},indian:{saka:0},persian:{ap:0}},Gp={chinese:13,dangi:13,hebrew:-6},L=D(Yt,"string"),Bu=D(Yt,"boolean"),qp=D(Yt,"number"),Ku=D(Yt,"function"),v=bt.map((a)=>a+"s"),Ar=dt(v),Up=v.slice(0,6),Xu=v.slice(6),Qp=Xu.slice(1),Yp=Nu(v),Y=_s(v,0),Er=_s(Up,0),Hr=D(Kc,v),na=["isoNanosecond","isoMicrosecond","isoMillisecond","isoSecond","isoMinute","isoHour"],Wr=["isoDay","isoMonth","isoYear"],ji=na.concat(Wr),Nr=dt(Wr),ku=dt(na),Vu=dt(ji),Oa=_s(ku,0),Bp=D(Kc,ji),Va=Intl.DateTimeFormat,eu="en-GB",$r=1e8,Kp=$r*da,Xp=[$r,0],kp=[-$r,0],rt=275760,ct=-271821,Vp=1970,Ls=1972,Ia=12,ep=As(1868,9,8),am=ua(ap,WeakMap),Gt="smallestUnit",oo="unit",st="roundingIncrement",Xi="fractionalSecondDigits",af="relativeTo",sf={constrain:0,reject:1},sm=Object.keys(sf),tm={compatible:0,reject:1,earlier:2,later:3},im={reject:0,use:1,prefer:2,ignore:3},om={auto:0,never:1,critical:2,always:3},rm={auto:0,never:1,critical:2},cm={auto:0,never:1},lm={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},yt=D(Ro,Gt),Jr=D(Ro,"largestUnit"),dm=D(Ro,oo),tf=D(ms,"overflow",sf),of=D(ms,"disambiguation",tm),um=D(ms,"offset",im),zr=D(ms,"calendarName",om),fm=D(ms,"timeZoneName",rm),pm=D(ms,"offset",cm),Dt=D(ms,"roundingMode",lm),Gs="PlainYearMonth",qs="PlainMonthDay",Ds="PlainDate",ws="PlainDateTime",Ci="PlainTime",za="ZonedDateTime",Zi="Instant",xi="Duration",mm=[Math.floor,(a)=>Ct(a)?Math.floor(a):Math.round(a),Math.ceil,(a)=>Ct(a)?Math.ceil(a):Math.round(a),Math.trunc,(a)=>Ct(a)?Math.trunc(a)||0:Math.round(a),(a)=>a<0?Math.floor(a):Math.ceil(a),(a)=>Math.sign(a)*Math.round(Math.abs(a))||0,(a)=>Ct(a)?(a=Math.trunc(a)||0)+a%2:Math.round(a)],Ss="UTC",It=5184000,hm=Wt(1847),gm=Wt((new Date()).getUTCFullYear()+10),Pm=/0+$/,ta=ua(cp,WeakMap),zc=4294967295,Li=ua((a)=>{const s=rr(a);return typeof s=="object"?new cf(s):new rf(s||0)});class rf{constructor(a){this.v=a}getOffsetNanosecondsFor(){return this.v}getPossibleInstantsFor(a){return[bo(a,this.v)]}l(){}}class cf{constructor(a){this.$=((s)=>{function t(d){const u=ki(d,c,l),[f,p]=Ec(u),m=o(f),h=o(p);return m===h?m:i(r(f,p),m,h,d)}function i(d,u,f,p){let m,h;for(;(p===void 0||(m=p<d[0]?u:p>=d[1]?f:void 0)===void 0)&&(h=d[1]-d[0]);){const g=d[0]+Math.floor(h/2);s(g)===f?d[1]=g:d[0]=g+1}return m}const o=ua(s),r=ua(lp);let c=hm,l=gm;return{G(d){const u=t(d-86400),f=t(d+86400),p=d-u,m=d-f;if(u===f)return[p];const h=t(p);return h===t(m)?[d-h]:u>f?[p,m]:[]},V:t,l(d,u){const f=ki(d,c,l);let[p,m]=Ec(f);const h=It*u,g=u<0?()=>m>c||(c=f,0):()=>p<l||(l=f,0);for(;g();){const P=o(p),T=o(m);if(P!==T){const O=r(p,m);i(O,P,T);const b=O[0];if((_a(b,d)||1)===u)return b}p+=h,m+=h}}}})(((s)=>(t)=>{const i=Po(s,t*$u);return Wt(jd(i),parseInt(i.month),parseInt(i.day),parseInt(i.hour),parseInt(i.minute),parseInt(i.second))-t})(a))}getOffsetNanosecondsFor(a){return this.$.V(ul(a))*ba}getPossibleInstantsFor(a){const[s,t]=[Wt((i=a).isoYear,i.isoMonth,i.isoDay,i.isoHour,i.isoMinute,i.isoSecond),i.isoMillisecond*ja+i.isoMicrosecond*ys+i.isoNanosecond];var i;return this.$.G(s).map((o)=>ga(Cs(Zs(o,ba),t)))}l(a,s){const[t,i]=fl(a),o=this.$.l(t+(s>0||i?1:0),s);if(o!==void 0)return Zs(o,ba)}}var _r="([+\u2212-])",At="(?:[.,](\\d{1,9}))?",lf=`(?:(?:${_r}(\\d{6}))|(\\d{4}))-?(\\d{2})`,Gr="(\\d{2})(?::?(\\d{2})(?::?(\\d{2})"+At+")?)?",qr=_r+Gr,Tm=lf+"-?(\\d{2})(?:[T ]"+Gr+"(Z|"+qr+")?)?",df="\\[(!?)([^\\]]*)\\]",Ii=`((?:${df}){0,9})`,bm=Js(lf+Ii),Om=Js("(?:--)?(\\d{2})-?(\\d{2})"+Ii),ym=Js(Tm+Ii),Dm=Js("T?"+Gr+"(?:"+qr+")?"+Ii),wm=Js(qr),Sm=new RegExp(df,"g"),vm=Js(`${_r}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${At}H)?(?:(\\d+)${At}M)?(?:(\\d+)${At}S)?)?`),nm=ua((a)=>new Va(eu,{timeZone:a,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),Fm=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,Rm=ua(fp),Ur=ua((a)=>new Va(eu,{calendar:a,timeZone:Ss,era:"short",year:"numeric",month:"short",day:"numeric"})),Mm=/^M(\d{2})(L?)$/,jm={era:Ht,eraYear:V,year:V,month:xc,monthCode:Ht,day:xc},Cm=_s(Ja,V),Zm=_s(v,cl),_c=Object.assign({},jm,Cm,Zm,{offset:Ht}),xm=D(ef,Ja,na),Gc={dateAdd(a,s,t){const i=S(t);let o,{years:r,months:c,weeks:l,days:d}=s;if(d+=_(s,5)[0],r||c)o=((u,f,p,m,h)=>{let[g,P,T]=u.h(f);if(p){const[O,b]=u.I(g,P);g+=p,P=_t(O,b,u.U(g)),P=Pa("month",P,1,u.L(g),h)}return m&&([g,P]=u._(g,P,m)),T=Pa("day",T,1,u.j(g,P),h),u.q(g,P,T)})(this,a,r,c,i);else{if(!l&&!d)return a;o=sa(a)}return o+=(7*l+d)*da,Ga(kt(o))},dateUntil(a,s,t){if(t<=7){let d=0,u=Rd({...a,...Oa},{...s,...Oa});return t===7&&([d,u]=Ua(u,7)),{...Y,weeks:d,days:u}}const i=this.h(a),o=this.h(s);let[r,c,l]=((d,u,f,p,m,h,g)=>{let P=m-u,T=h-f,O=g-p;if(P||T){const b=Math.sign(P||T);let y=d.j(m,h),E=0;if(Math.sign(O)===-b){const Z=y;[m,h]=d._(m,h,-b),P=m-u,T=h-f,y=d.j(m,h),E=b<0?-Z:y}if(O=g-Math.min(p,y)+E,P){const[Z,j]=d.I(u,f),[x,U]=d.I(m,h);if(T=x-Z||Number(U)-Number(j),Math.sign(T)===-b){const z=b<0&&-d.L(m);P=(m-=b)-u,T=h-_t(Z,j,d.U(m))+(z||d.L(m))}}}return[P,T,O]})(this,...i,...o);return t===8&&(c+=this.J(r,i[0]),r=0),{...Y,years:r,months:c,days:l}},dateFromFields(a,s){const t=S(s),i=Yi(this,a),o=Bi(this,a,i,t),r=$c(this,a,o,i,t);return N(Ga(this.P(i,o,r)),this.id||w)},yearMonthFromFields(a,s){const t=S(s),i=Yi(this,a),o=Bi(this,a,i,t);return ds(To(this.P(i,o,1)),this.id||w)},monthDayFromFields(a,s){const t=S(s),i=!this.id,{monthCode:o,year:r,month:c}=a;let l,d,u,f,p;if(o!==void 0){[l,d]=Ld(o),p=Uc(a,"day");const m=this.N(l,d,p);if(!m)throw new RangeError(Jc);if([u,f]=m,c!==void 0&&c!==f)throw new RangeError(Iu);i&&(f=Pa("month",f,1,Ia,1),p=Pa("day",p,1,Oo(r!==void 0?r:u,f),t))}else{u=r===void 0&&i?Ls:Yi(this,a),f=Bi(this,a,u,t),p=$c(this,a,f,u,t);const m=this.U(u);d=f===m,l=ei(f,m);const h=this.N(l,d,p);if(!h)throw new RangeError(Jc);[u,f]=h}return Nt(Ga(this.P(u,f,p)),this.id||w)},fields(a){return ao(this)&&a.includes("year")?[...a,...io]:a},mergeFields(a,s){const t=Object.assign(Object.create(null),a);return Ki(t,s,Lr),ao(this)&&(Ki(t,s,zp),this.id===xs&&Ki(t,s,_p,io)),t},inLeapYear(a){const[s]=this.h(a);return this.K(s)},monthsInYear(a){const[s]=this.h(a);return this.L(s)},daysInMonth(a){const[s,t]=this.h(a);return this.j(s,t)},daysInYear(a){const[s]=this.h(a);return this.X(s)},dayOfYear:Tr,era(a){return this.ee(a)[0]},eraYear(a){return this.ee(a)[1]},monthCode(a){const[s,t]=this.h(a),[i,o]=this.I(s,t);return((r,c)=>"M"+Ta(r)+(c?"L":""))(i,o)},dayOfWeek:Pl,daysInWeek(){return 7}},Lm={dayOfYear:Tr,h:ml,q:As},Im=Object.assign({},Lm,{weekOfYear:Zd,yearOfWeek:xd,R(a){function s(h){return(7-h<i?7:0)-h}function t(h){const g=gl(m+h),P=h||1,T=s(at(d+g*P,7));return f=(g+(T-u)*P)/7}const i=this.id?1:4,o=Pl(a),r=this.dayOfYear(a),c=at(o-1,7),l=r-1,d=at(c-l,7),u=s(d);let f,p=Math.floor((l-u)/7)+1,m=a.isoYear;return p?p>t(0)&&(p=1,m++):(p=t(-1),m--),[p,m,f]}}),Am={dayOfYear:Tr,h:Vi,q:ot,weekOfYear:Zd,yearOfWeek:xd,R(){return[]}},Us=hp(Object.assign({},Gc,Im,{h:ml,ee(a){return this.id===Mi?Tl(a):this.id===xs?am(a):[]},I:(a,s)=>[s,0],N(a,s){if(!s)return[Ls,a]},K:yo,U(){},L:hl,J:(a)=>a*Ia,j:Oo,X:gl,P:(a,s,t)=>({isoYear:a,isoMonth:s,isoDay:t}),q:As,_:(a,s,t)=>(a+=Ut(t,Ia),(s+=uo(t,Ia))<1?(a--,s+=Ia):s>Ia&&(a++,s-=Ia),[a,s]),year(a){return a.isoYear},month(a){return a.isoMonth},day:(a)=>a.isoDay}),Object.assign({},Gc,Am,{h:Vi,ee(a){const s=this.O(a);return[s.era,s.eraYear]},I(a,s){const t=Zt.call(this,a);return[ei(s,t),t===s]},N(a,s,t){let[i,o,r]=Vi.call(this,{isoYear:Ls,isoMonth:Ia,isoDay:31});const c=Zt.call(this,i),l=o===c;(_a(a,ei(o,c))||_a(Number(s),Number(l))||_a(t,r))===1&&i--;for(let d=0;d<100;d++){const u=i-d,f=Zt.call(this,u),p=_t(a,s,f);if(s===(p===f)&&t<=Wc.call(this,u,p))return[u,p]}},K(a){const s=xt.call(this,a);return s>xt.call(this,a-1)&&s>xt.call(this,a+1)},U:Zt,L:Lt,J(a,s){const t=s+a,i=Math.sign(a),o=i<0?-1:0;let r=0;for(let c=s;c!==t;c+=i)r+=Lt.call(this,c+o);return r},j:Wc,X:xt,P(a,s,t){return kt(ot.call(this,a,s,t))},q:ot,_(a,s,t){if(t){if(s+=t,!Number.isSafeInteger(s))throw new RangeError(Si);if(t<0)for(;s<1;)s+=Lt.call(this,--a);else{let i;for(;s>(i=Lt.call(this,a));)s-=i,a++}}return[a,s]},year(a){return this.O(a).year},month(a){const{year:s,F:t}=this.O(a),{C:i}=this.B(s);return i[t]+1},day(a){return this.O(a).day}})),qa="numeric",Qs=["timeZoneName"],uf={month:qa,day:qa},Qr={year:qa,month:qa},Yr=Object.assign({},Qr,{day:qa}),Br={hour:qa,minute:qa,second:qa},Kr=Object.assign({},Yr,Br),Em=Object.assign({},Kr,{timeZoneName:"short"}),Hm=Object.keys(Qr),Wm=Object.keys(uf),Nm=Object.keys(Yr),$m=Object.keys(Br),Xr=["dateStyle"],Jm=Hm.concat(Xr),zm=Wm.concat(Xr),kr=Nm.concat(Xr,["weekday"]),wt=$m.concat(["dayPeriod","timeStyle"]),Vr=kr.concat(wt),_m=Vr.concat(Qs),Gm=Qs.concat(wt),qm=Qs.concat(kr),Um=Qs.concat(["day","weekday"],wt),Qm=Qs.concat(["year","weekday"],wt),Ym={},er=[Os(Vr,Kr),ti],ff=[Os(_m,Em),ti,0,(a,s)=>{const t=Q(a.timeZone);if(s&&Q(s.timeZone)!==t)throw new RangeError(Eu);return t}],ac=[Os(Vr,Kr,Qs),sa],sc=[Os(kr,Yr,Gm),sa],tc=[Os(wt,Br,qm),(a)=>Qa(a)/ja],ic=[Os(Jm,Qr,Um),sa,1],oc=[Os(zm,uf,Qm),sa,1],qc;var Vm={Instant:er,PlainDateTime:ac,PlainDate:sc,PlainTime:tc,PlainYearMonth:ic,PlainMonthDay:oc},em=Na(er),ah=Na(ff),sh=Na(ac),th=Na(sc),ih=Na(tc),oh=Na(ic),rh=Na(oc),uc={era:al,eraYear:fo,year:ut,month:Da,daysInMonth:Da,daysInYear:Da,inLeapYear:Bu,monthsInYear:Da},Wi={monthCode:L},fc={day:Da},wf={dayOfWeek:Da,dayOfYear:Da,weekOfYear:sl,yearOfWeek:fo,daysInWeek:Da},Sf=Object.assign({},uc,Wi,fc,wf),Hi=new WeakMap,k=Hi.get.bind(Hi),gf=Hi.set.bind(Hi),ch={...Ai(uc,[Gs]),...Ai(wf,[]),...Ai(Wi,[Gs,qs]),...Ai(fc,[qs])},pc=lc(Sf),lh=lc({...uc,...Wi}),dh=lc({...Wi,...fc}),Ft={calendarId:(a)=>Q(a.calendar)},uh=ya((a,s)=>function(t){const{i}=this;return a(i[s](A(N(t,i))))},Sf),fh=lt((a)=>(s)=>s[a],v.concat("sign")),mc=lt((a,s)=>(t)=>t[na[s]],Ja),vf={epochSeconds:vl,epochMilliseconds:ti,epochMicroseconds:nl,epochNanoseconds:Fl},Rt=D(co,new Set(["branding"])),[ph,Ks,mh]=xa(qs,D(au,X),{...Ft,...dh},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return Ks(Ud(Mh,a,this,Xs(s),t))},equals:(a,s)=>Dd(a,pf(s)),toPlainDate(a,s){return A(gu(Mt,a,this,s))},toLocaleString(a,s,t){const[i,o]=rh(s,t,a);return i.format(o)},toString:Eo,toJSON:(a)=>Eo(a),valueOf:is},{from:(a,s)=>Ks(pf(a,s))}),nf={getOffsetNanosecondsFor:Of,getPossibleInstantsFor(a,s,t){const i=[...s.call(a,K(W(t,w)))].map((r)=>gh(r).epochNanoseconds),o=i.length;return o>1&&(i.sort(aa),zo(ha(ma(i[0],i[o-1])))),i}},cc={getOffsetNanosecondsFor:Of},[hh,oa,gh]=xa(Zi,Kd,vf,{add:(a,s)=>oa(_o(0,a,I(s))),subtract:(a,s)=>oa(_o(1,a,I(s))),until:(a,s,t)=>R(ur(0,a,Ca(s),t)),since:(a,s,t)=>R(ur(1,a,Ca(s),t)),round:(a,s)=>oa(jl(a,s)),equals:(a,s)=>Pd(a,Ca(s)),toZonedDateTime(a,s){const t=Ha(s);return $(Sr(a,M(t.timeZone),X(t.calendar)))},toZonedDateTimeISO:(a,s)=>$(Sr(a,M(s))),toLocaleString(a,s,t){const[i,o]=em(s,t,a);return i.format(o)},toString:(a,s)=>Zo(M,J,a,s),toJSON:(a)=>Zo(M,J,a),valueOf:is},{from:(a)=>oa(Ca(a)),fromEpochSeconds:(a)=>oa(bu(a)),fromEpochMilliseconds:(a)=>oa(Ou(a)),fromEpochMicroseconds:(a)=>oa(yu(a)),fromEpochNanoseconds:(a)=>oa(Du(a)),compare:(a,s)=>cr(Ca(a),Ca(s))}),[Ni,Jh]=xa("TimeZone",(a)=>{const s=hd(a);return{branding:"TimeZone",id:s,o:Li(s)}},{id:(a)=>a.id},{getPossibleInstantsFor:({o:a},s)=>a.getPossibleInstantsFor(as(s)).map((t)=>oa(q(t))),getOffsetNanosecondsFor:({o:a},s)=>a.getOffsetNanosecondsFor(Ca(s).epochNanoseconds),getOffsetStringFor(a,s){const t=Ca(s).epochNanoseconds,i=Ei(this,cc).getOffsetNanosecondsFor(t);return hs(i)},getPlainDateTimeFor(a,s,t=w){const i=Ca(s).epochNanoseconds,o=Ei(this,cc).getOffsetNanosecondsFor(i);return K(W(Ba(i,o),X(t)))},getInstantFor(a,s,t){const i=as(s),o=Do(t),r=Ei(this);return oa(q(fa(r,i,o)))},getNextTransition:({o:a},s)=>mf(1,a,s),getPreviousTransition:({o:a},s)=>mf(-1,a,s),equals(a,s){return!!bi(this,M(s))},toString:(a)=>a.id,toJSON:(a)=>a.id},{from(a){const s=M(a);return typeof s=="string"?new Ni(s):s}}),Ph=bf(Object.keys(nf)),[Th,ss]=xa(Ci,su,mc,{getISOFields:Rt,with(a,s,t){return ss(Qd(this,Xs(s),t))},add:(a,s)=>ss(Yo(0,a,I(s))),subtract:(a,s)=>ss(Yo(1,a,I(s))),until:(a,s,t)=>R(gr(0,a,ea(s),t)),since:(a,s,t)=>R(gr(1,a,ea(s),t)),round:(a,s)=>ss(xl(a,s)),equals:(a,s)=>wd(a,ea(s)),toZonedDateTime:(a,s)=>$(Pu(M,ra,F,a,s)),toPlainDateTime:(a,s)=>K(Tu(a,ra(s))),toLocaleString(a,s,t){const[i,o]=ih(s,t,a);return i.format(o)},toString:Ho,toJSON:(a)=>Ho(a),valueOf:is},{from:(a,s)=>ss(ea(a,s)),compare:(a,s)=>Ti(ea(a),ea(s))}),[bh,ts,Oh]=xa(Gs,D(ed,X),{...Ft,...lh},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return ts(qd(Rh,a,this,Xs(s),t))},add:(a,s,t)=>ts(Qo(Pf,0,a,I(s),t)),subtract:(a,s,t)=>ts(Qo(Pf,1,a,I(s),t)),until:(a,s,t)=>R(hr(Tf,0,a,Ys(s),t)),since:(a,s,t)=>R(hr(Tf,1,a,Ys(s),t)),equals:(a,s)=>yd(a,Ys(s)),toPlainDate(a,s){return A(hu(Mt,a,this,s))},toLocaleString(a,s,t){const[i,o]=oh(s,t,a);return i.format(o)},toString:Ao,toJSON:(a)=>Ao(a),valueOf:is},{from:(a,s)=>ts(Ys(a,s)),compare:(a,s)=>Ts(Ys(a),Ys(s))}),[yh,K]=xa(ws,D(kd,X),{...Ft,...pc,...mc},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return K(_d(Mt,a,this,Xs(s),t))},withCalendar:(a,s)=>K(wi(a,X(s))),withPlainDate:(a,s)=>K(nu(a,ra(s))),withPlainTime:(a,s)=>K(vu(a,dc(s))),add:(a,s,t)=>K(qo(vs,0,a,I(s),t)),subtract:(a,s,t)=>K(qo(vs,1,a,I(s),t)),until:(a,s,t)=>R(pr(Za,0,a,as(s),t)),since:(a,s,t)=>R(pr(Za,1,a,as(s),t)),round:(a,s)=>K(Zl(a,s)),equals:(a,s)=>bd(a,as(s)),toZonedDateTime:(a,s,t)=>$(cu(F,a,M(s),t)),toPlainDate:(a)=>A(N(a)),toPlainTime:(a)=>ss(Sa(a)),toPlainYearMonth(a){return ts(lu($i,a,this))},toPlainMonthDay(a){return Ks(du(zi,a,this))},toLocaleString(a,s,t){const[i,o]=sh(s,t,a);return i.format(o)},toString:Lo,toJSON:(a)=>Lo(a),valueOf:is},{from:(a,s)=>K(as(a,s)),compare:(a,s)=>dr(as(a),as(s))}),[Dh,A,Ff]=xa(Ds,D(Vd,X),{...Ft,...pc},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return A(Gd(Mt,a,this,Xs(s),t))},withCalendar:(a,s)=>A(wi(a,X(s))),add:(a,s,t)=>A(Uo(vs,0,a,I(s),t)),subtract:(a,s,t)=>A(Uo(vs,1,a,I(s),t)),until:(a,s,t)=>R(mr(Za,0,a,ra(s),t)),since:(a,s,t)=>R(mr(Za,1,a,ra(s),t)),equals:(a,s)=>Od(a,ra(s)),toZonedDateTime(a,s){const t=!G(s)||s instanceof Ni?{timeZone:s}:s;return $(uu(M,ea,F,a,t))},toPlainDateTime:(a,s)=>K(fu(a,dc(s))),toPlainYearMonth(a){return ts(pu($i,a,this))},toPlainMonthDay(a){return Ks(mu(zi,a,this))},toLocaleString(a,s,t){const[i,o]=th(s,t,a);return i.format(o)},toString:Io,toJSON:(a)=>Io(a),valueOf:is},{from:(a,s)=>A(ra(a,s)),compare:(a,s)=>Ts(ra(a),ra(s))}),hc={fields(a,s,t){return[...s.call(a,t)]}},Rf=Object.assign({dateFromFields(a,s,t,i){return Ff(s.call(a,Object.assign(Object.create(null),t),i))}},hc),Mf=Object.assign({yearMonthFromFields(a,s,t,i){return Oh(s.call(a,Object.assign(Object.create(null),t),i))}},hc),jf=Object.assign({monthDayFromFields(a,s,t,i){return mh(s.call(a,Object.assign(Object.create(null),t),i))}},hc),gc={mergeFields(a,s,t,i){return Ha(s.call(a,Object.assign(Object.create(null),t),Object.assign(Object.create(null),i)))}},wh=Object.assign({},Rf,gc),Sh=Object.assign({},Mf,gc),vh=Object.assign({},jf,gc),Pc={dateAdd(a,s,t,i,o){return Ff(s.call(a,A(N(t,a)),R(C(i)),o))}},Cf=Object.assign({},Pc,{dateUntil(a,s,t,i,o,r){return Ch(s.call(a,A(N(t,a)),A(N(i,a)),Object.assign(Object.create(null),r,{largestUnit:bt[o]})))}}),nh=Object.assign({},Pc,{day:yf}),Fh=Object.assign({},Cf,{day:yf}),$i=La(Mf),Ji=La(Rf),zi=La(jf),Rh=La(Sh),Mt=La(wh),Mh=La(vh),vs=La(Pc),Za=La(Cf),Pf=La(nh),Tf=La(Fh),[jh,R,Ch]=xa(xi,tu,{...fh,blank:Bl},{with:(a,s)=>R(Yd(a,s)),negated:(a)=>R(pi(a)),abs:(a)=>R(Yl(a)),add:(a,s,t)=>R(Vo(St,Za,F,0,a,I(s),t)),subtract:(a,s,t)=>R(Vo(St,Za,F,1,a,I(s),t)),round:(a,s)=>R(Ql(St,Za,F,a,s)),total:(a,s)=>Ml(St,Za,F,a,s),toLocaleString(a,s,t){return Intl.DurationFormat?new Intl.DurationFormat(s,t).format(this):ci(a)},toString:ci,toJSON:(a)=>ci(a),valueOf:is},{from:(a)=>R(I(a)),compare:(a,s,t)=>gd(St,vs,F,I(a),I(s),t)}),Zf={toString:(a)=>a.id,toJSON:(a)=>a.id,...ch,dateAdd:({id:a,o:s},t,i,o)=>A(N(s.dateAdd(ra(t),I(i),o),a)),dateUntil:({o:a},s,t,i)=>R(C(a.dateUntil(ra(s),ra(t),Ol(i)))),dateFromFields:({id:a,o:s},t,i)=>A(br(s,t,i,ec(a))),yearMonthFromFields:({id:a,o:s},t,i)=>ts(Or(s,t,i,kc(a))),monthDayFromFields:({id:a,o:s},t,i)=>Ks(yr(s,0,t,i,Vc(a))),fields({o:a},s){const t=new Set(va),i=[];for(let o of s){if(L(o),!t.has(o))throw new RangeError(jr(o));t.delete(o),i.push(o)}return a.fields(i)},mergeFields:({o:a},s,t)=>a.mergeFields(lo(po(s)),lo(po(t)))},[Tc]=xa("Calendar",(a)=>{const s=Cd(a);return{branding:"Calendar",id:s,o:Us(s)}},{id:(a)=>a.id},Zf,{from(a){const s=X(a);return typeof s=="string"?new Tc(s):s}}),Zh=bf(Object.keys(Zf).slice(4)),[xh,$]=xa(za,D(Xd,X,M),{...vf,...Ft,...hf(pc),...hf(mc),offset:(a)=>hs(rc(a).offsetNanoseconds),offsetNanoseconds:(a)=>rc(a).offsetNanoseconds,timeZoneId:(a)=>Q(a.timeZone),hoursInDay:(a)=>Ll(F,a)},{getISOFields:(a)=>ql(J,a),getCalendar:vt,getTimeZone:({timeZone:a})=>typeof a=="string"?new Ni(a):a,with(a,s,t){return $(zd(Mt,F,a,this,Xs(s),t))},withCalendar:(a,s)=>$(wi(a,X(s))),withTimeZone:(a,s)=>$(Fu(a,M(s))),withPlainDate:(a,s)=>$(Su(F,a,ra(s))),withPlainTime:(a,s)=>$(wu(F,a,dc(s))),add:(a,s,t)=>$(Go(vs,F,0,a,I(s),t)),subtract:(a,s,t)=>$(Go(vs,F,1,a,I(s),t)),until:(a,s,t)=>R(C(fr(Za,F,0,a,Bs(s),t))),since:(a,s,t)=>R(C(fr(Za,F,1,a,Bs(s),t))),round:(a,s)=>$(Cl(F,a,s)),startOfDay:(a)=>$(Il(F,a)),equals:(a,s)=>Td(a,Bs(s)),toInstant:(a)=>oa(iu(a)),toPlainDateTime:(a)=>K(vr(J,a)),toPlainDate:(a)=>A(nr(J,a)),toPlainTime:(a)=>ss(Fr(J,a)),toPlainYearMonth(a){return ts(ou($i,a,this))},toPlainMonthDay(a){return Ks(ru(zi,a,this))},toLocaleString(a,s,t={}){const[i,o]=ah(s,t,a);return i.format(o)},toString:(a,s)=>xo(J,a,s),toJSON:(a)=>xo(J,a),valueOf:is},{from:(a,s)=>$(Bs(a,s)),compare:(a,s)=>lr(Bs(a),Bs(s))}),Lh=Object.defineProperties({},{...qt("Temporal.Now"),...fs({timeZoneId:()=>$a(),instant:()=>oa(q(gt())),zonedDateTime:(a,s=$a())=>$(B(gt(),M(s),X(a))),zonedDateTimeISO:(a=$a())=>$(B(gt(),M(a),w)),plainDateTime:(a,s=$a())=>K(W(zs(J(M(s))),X(a))),plainDateTimeISO:(a=$a())=>K(W(zs(J(M(a))),w)),plainDate:(a,s=$a())=>A(N(zs(J(M(s))),X(a))),plainDateISO:(a=$a())=>A(N(zs(J(M(a))),w)),plainTimeISO:(a=$a())=>ss(Sa(zs(J(M(a)))))})}),ns=Object.defineProperties({},{...qt("Temporal"),...fs({PlainYearMonth:bh,PlainMonthDay:ph,PlainDate:Dh,PlainTime:Th,PlainDateTime:yh,ZonedDateTime:xh,Instant:hh,Calendar:Tc,TimeZone:Ni,Duration:jh,Now:Lh})}),Ih=Bm(),bc=new WeakMap,Ah=Object.defineProperties(Object.create(Intl),fs({DateTimeFormat:Ih}));class Fs extends Error{constructor(){super("Adapter not found");this.name="AdapterNotFound"}}class Oc{createSession(){throw new Fs}deleteSession(){throw new Fs}findSession(){throw new Fs}findUserByEmailAddress(){throw new Fs}updateSession(){throw new Fs}createUser(){throw new Fs}}class Af extends Fa{constructor(){super(...arguments)}schema={email:{required:"Email is required",string:"Invalid email",email:"Invalid email"},password:{required:"Password is required"}}}class Ef extends Fa{constructor(){super(...arguments)}schema={name:{string:"Invalid name",required:"Name is required","min:2":"Name must be at least 3 characters"},email:{string:"Invalid email",required:"Email is required",email:"Invalid email"},password:{required:"Password is required","min:8":"Password must be at least 8 characters"}}}class Hf extends Fa{constructor(){super(...arguments)}schema={email:{required:"Email is required",email:"Invalid email"}}}class Wf extends Fa{constructor(){super(...arguments)}schema={password:{required:"Password is required",password:"Invalid password"}}}class rs extends xf{constructor(){super(...arguments)}provider=jt.getStore().authenticationServiceContainer.provider;async me(){const a=await _i.user();if(!a)throw new If;return a}async signIn(a=new Af){const s=await a.input.call(a),{email:t,password:i}=s.toJSON(),o=await this.provider.adapter.findUserByEmailAddress(t);if(!o)throw new os({invalid_credentials:["Invalid credentials"]});if(!await this.provider.verifyPassword(i,o.password))throw new os({invalid_credentials:["Invalid credentials"]});const c=a.headers.get("User-Agent"),l=new Bun.CryptoHasher("sha256");l.update(`${o.email}${c}`);const d=l.digest("hex");let u=await this.provider.adapter.findSession({token:d,userAgent:"local"});if(!u)u=await this.provider.adapter.createSession({token:d,userId:o.id,userAgent:"local",expiresAt:new Date(ns.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString()),absoluteExpiresAt:new Date(ns.Now.instant().add({hours:this.provider.sessionAbsoluteExpiresInHours}).toString())});else u=await this.provider.adapter.updateSession({token:d,expiresAt:new Date(ns.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString())});return a.ctx.setCookie("access_token",u.token,{expires:u.expiresAt}),await this.provider.onSignIn(o),o}async signUp(a=new Ef){const s=await a.input(),{email:t,password:i,name:o}=s.toJSON();if(await this.provider.adapter.findUserByEmailAddress(t))throw new os({email:["Email address already exists"]});const c=await this.provider.hashPassword(i),l=await this.provider.adapter.createUser({email:t,name:o,password:c});return await this.provider.onSignUp(l),l}async signOut(a=new Fa){const s=a.cookies.get("access_token"),t=await _i.user();return await this.provider.adapter.deleteSession({token:s}),a.ctx.setCookie("access_token","",{expires:new Date(0)}),await this.provider.onSignOut(t),{}}async forgotPassword(a=new Hf){const s=await a.input(),{email:t}=s.toJSON(),i=await this.provider.adapter.findUserByEmailAddress(t);if(!i)return{};const o=await this.provider.generateForgotPasswordToken(i);return await this.provider.adapter.createPasswordResetToken({user:i,token:o}),await this.provider.onForgotPassword(i,o),{}}async resetPassword(a=new Wf){const s=await a.input(),{password:t,token:i}=s.toJSON(),o=await this.provider.adapter.findPasswordResetToken({token:i});if(!o)throw new os({token:["Invalid token"]});if(ns.Instant.from(o.createdAt.toISOString()).add({hours:24}).until(ns.Now.instant()).sign>=0)throw new os({token:["Token expired"]});await this.provider.adapter.deletePasswordResetToken({token:i});const c=await this.provider.adapter.findUserByEmailAddress(o.user.email);if(!c)throw new os({email:["User not found"]});const l=await this.provider.hashPassword(t);return await this.provider.adapter.updateUserPassword({id:c.id,password:l}),await this.provider.adapter.deleteAllUserSessions(c.id),await this.provider.onResetPassword(c),{}}async changePassword(a=new Fa){const s=await _i.user(),t=await a.input(),{oldPassword:i,newPassword:o}=t.toJSON(),{password:r}=await this.provider.adapter.findUserByEmailAddress(s.email);if(!await this.provider.verifyPassword(i,r))throw new os({oldPassword:["Incorrect password"]});const l=await this.provider.hashPassword(o);return await this.provider.adapter.updateUserPassword({id:s.id,password:l}),await this.provider.adapter.deleteAllUserSessions(s.id),{}}}class Nf extends Gi{constructor(){super(...arguments)}routes={"/sign-in":this.post(rs,"signIn"),"/sign-up":this.post(rs,"signUp"),"/sign-out":this.post(rs,"signOut"),"/forgot-password":this.post(rs,"forgotPassword"),"/reset-password":this.post(rs,"resetPassword"),"/change-password":this.post(rs,"changePassword"),"/me":this.get(rs,"me")}}class $f extends Lf{constructor(){super(...arguments)}routes={"/sign-in":this.view("auth/SignIn"),"/sign-up":this.view("auth/SignUp"),"/reset-password":this.view("auth/ResetPassword"),"/forgot-password":this.view("auth/ForgotPassword")}}class qi{basePath="/auth";routers={api:Nf,view:$f};sessionExpiresInHours=24;sessionAbsoluteExpiresInHours=672;adapter=new Oc;async verifyPassword(a,s){return await Bun.password.verify(a,s)}async hashPassword(a){return await Bun.password.hash(a)}async generateForgotPasswordToken(a){const s=new Bun.CryptoHasher("sha256");return s.update(`${a.email}${Date.now()}`),s.digest("hex")}extendSession(a){return{}}onSignUp(a){}onSignIn(a){}onSignOut(a){}onForgotPassword(a,s){}onResetPassword(a){}}class yc{a;constructor(a){this.provider=a}async getSession(a,s){const t=await this.provider.adapter.findSession({token:a,userAgent:s});let i=null;if(t?.user)i=await this.provider.extendSession(t.user);return t.user.extension=i,t}}class Jf extends Gi{constructor(){super(...arguments)}routes={"/translations":this.get(async(a=new Fa)=>{const s=await a.input(),{scope:t,locale:i}=s.toJSON(),o=i??jt.getStore().i18nServiceContainer.detectLocale(a),r=jt.getStore().i18nServiceContainer.getPageTranslations(o,t);return a.ctx.setHeaders("Cache-Control",a.ctx.user?"private, max-age=1200, must-revalidate":"public, max-age=864000, must-revalidate"),a.ctx.setCookie("i18n-locale",o,{expires:new Date(Date.now()+31536000000)}),{[o]:r}})}}class Dc{a;constructor(a){this.service=a}isEnabled=!1;translations=new Map;supportedLocales=[];routers={api:Jf};boot(){const a=new Map;for(let[t,i]of Object.entries(this.service.dictionary))for(let[o,r]of Object.entries(i))for(let[c,l]of Object.entries(r)){const d=c==="default"?this.service.defaultLocale:c;if(!a.has(`${d}.${t}`))a.set(`${d}.${t}`,new Map);a.get(`${d}.${t}`)?.set(o,l),this.isEnabled=!0}let s=new Set;for(let[t,i]of a.entries())this.translations.set(t,Object.fromEntries(i.entries())),s.add(t.split(".")[0]);this.supportedLocales=Array.from(s)}detectLocale(a){const s=this.service.detectLocale(a);if(this.supportedLocales.includes(s))return s;const i=a.cookies.get("i18n-locale")??(a.headers.get("accept-language")||"en-US"),[o]=i.split(",");if(this.supportedLocales.includes(o))return o;const r=this.service.defaultLocale??this.supportedLocales[0];if(r)return r;return"en-US"}getPageTranslations(a,s){if(!s)return{};const t=this.translations.get(`${a}.view:${s}`)??{},i={[`view:${s}`]:t};for(let[o]of this.translations.entries()){const r=o.split(".")[1];if(!r.startsWith("layout:"))continue;const c=r.split(":")[1];if(s?.startsWith(c))i[r]=this.translations.get(`${a}.${r}`)??{}}return i}}class wc{a;constructor(a){this.service=a}}class vc{a;constructor(a){this.service=a}getRouteHandlerAndParams(a){const t=new URL(a.url).pathname.replace("/api","");let i={},o;for(let[r]of Object.entries(this.service.flatRoutes))try{const c=new URLPattern({pathname:r});if(c.test({pathname:t})){o=r,i=c.exec({pathname:t})?.pathname.groups;break}}catch(c){console.error(c)}return{params:i,path:o}}async runRouteMiddleware(a){const s=Rs.getStore(),i=this.service.flatRoutes[a][s.req.rawRequest.method].middleware;try{await Ui.getContext().middlewareServiceContainer.runMiddleware(i,a)}catch(o){if(o.kind===Sc){if(s.req.rawRequest.url.includes("/api")){const{status:r=400,data:c,headers:l}=o.payload.api;return new Response(JSON.stringify(c),{status:r,headers:{"Content-Type":"application/json",...l}})}}else throw console.error(o),o}}async getRouteData(a){const s=this.service.flatRoutes[a],t=Rs.getStore(),i=s[t.req.rawRequest.method].exec??(()=>Promise.resolve({}));let o={};try{o=await i()}catch(r){if(r.kind===Sc){const{status:c=400,data:l,headers:d}=r.payload.api;return new Response(JSON.stringify(l),{status:c,headers:{"Content-Type":"application/json",...d}})}else throw console.error(r),r}return o}async handleApiRequest(a){const{params:s,path:t}=this.getRouteHandlerAndParams(a),i=this.service.flatRoutes[t];if(!i||!i[a.method])return new Response(JSON.stringify({error:{message:"Not found"}}),{status:404});const o=new Fa(a,s);return await Rs.run(o,async()=>{const r=await this.runRouteMiddleware(t);if(r instanceof Response)return r;const c=await this.getRouteData(t);if(c instanceof Response)return c;const l=Rs.getStore(),d=l.headers;if(d.append("Content-Type","application/json"),!d.get("Cache-Control"))if(l.user)d.set("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");else d.set("Cache-Control","public, no-cache, no-store, max-age=0, must-revalidate");return l.cookies.forEach((u)=>d.append("Set-Cookie",u.toString())),l.destroy(),new Response(JSON.stringify(c),{headers:d})})}}var Eh=function(a){return Qi(a)};function nc(a){const s={};for(let[t,i]of Object.entries(a))if("run"in i){const o=i;if(!s[t])s[t]={};const{method:r,middlewares:c}=o,l=o.run.bind(o);s[t][r]={exec:l,middleware:c}}else if(Eh(i)){const o=new i,r=nc(o.routes);for(let[c,l]of Object.entries(r)){const d=c==="/"?"":c,u=t==="/"?"":t,f=`${u}${d}`===""?"/":`${u}${d}`;if(!s[f])s[f]={};for(let[p,m]of Object.entries(l))s[f][p]={exec:m.exec,middleware:[o.middleware,...o.middlewares,...m.middleware]}}}else for(let o of Object.values(i)){if(!s[t])s[t]={};const{method:r,middlewares:c}=o,l=o.run.bind(o);s[t][r]={exec:l,middleware:c}}return Object.fromEntries(Object.entries(s).sort(([t],[i])=>{const o=t.split("/").length+t.split(":").length,r=i.split("/").length+i.split(":").length;return o-r}))}class Fc extends zf{constructor(){super(...arguments)}flatRoutes={};boot(a){this.flatRoutes=nc(a)}}var Hh=function(a){const s=new Map;for(let t of a)if(typeof t==="string"){const[i,o=""]=t.split(":");if(i.startsWith("-")){if(s.has(i.replace("-","")))s.delete(i.replace("-",""))}else s.set(i,o.split(","))}else s.set(t,[]);return s};class Rc{a;constructor(a){this.service=a}runMiddleware(a,s){const t=Rs.getStore().req;return Array.from(Hh(a).entries()).map(([i,o])=>{if(typeof i==="string"){const r=this.service.aliases[i];if(r){const c=new r(s);return(l)=>c.run.call(c,l,...o)}}else{if(Qi(i)){const r=new aliasOrTest(s);return r.run.bind(r)}return i}}).filter(Boolean).reduce((i,o)=>{return async(r,c)=>{return{...await i(r,c),...await o(r,c)}}},(i)=>Promise.resolve({}))(t)}}class Mc{a;constructor(a){this.service=a}}import{AsyncLocalStorage as Wh} from"async_hooks";class jc extends _f{a;name="broadcastingServiceContainer";publishCb;context=new Wh;constructor(a){super();this.service=a}onPublish(a){this.publishCb=a}publish(...a){const[s,t,i]=a;this.publishCb(s,t,i)}async handleMessage(a,s){const t=JSON.parse(s);if(t.type==="subscribe"){const i=Object.entries(this.service.channels).sort(([o],[r])=>o.length-r.length);for(let[o,r]of i){const c=new URLPattern({pathname:o});if(c.test({pathname:t.topic})){const l=c.exec({pathname:t.topic})?.pathname.groups,d=new r;if(await d.subscribe.call(d,l))a.subscribe(t.topic)}break}}if(t.type==="broadcast")a.publish(t.topic,JSON.stringify({topic:t.topic,data:t.payload}));if(t.type==="unsubscribe")a.unsubscribe(t.topic)}run(a,s){const t=a.get("Cookie"),i=new Map;if(t){const o=t.split(";");for(let r of o){const[c,l]=r.split("=");i.set(c.trim(),l.trim())}}this.context.run({headers:a,cookies:i},s)}}class Ui{emailServiceProvider=Kf;authenticationServiceProvider=qi;middlewareServiceProvider=Gf;policiesServiceProvider=qf;i18nServiceProvider=Uf;fileStorageServiceProvider=Yf;apiRouterServiceProvider=Fc;rateLimiterServiceProvider=Bf;broadcastingsServiceProvider=Xf;services;getServices=()=>{if(!this.services)this.services={emailServiceContainer:new Qf(new this.emailServiceProvider),authenticationServiceContainer:new yc(new this.authenticationServiceProvider),middlewareServiceContainer:new Rc(new this.middlewareServiceProvider),policiesServiceProvider:new this.policiesServiceProvider,i18nServiceContainer:new Dc(new this.i18nServiceProvider),fileStorageServiceContainer:new wc(new this.fileStorageServiceProvider),apiRouterServiceContainer:new vc(new this.apiRouterServiceProvider),rateLimiterServiceContainer:new Mc(new this.rateLimiterServiceProvider),broadcastingServiceContainer:new jc(new this.broadcastingsServiceProvider)};return this.services};static getContext=()=>Cc.getStore();run(a){const s=this.getServices();return Cc.run(s,a)}}class kf{a;constructor(a){this.prisma=a}async createSession(a){return await this.prisma.session.create({data:a,include:{user:!0}})}async createUser(a){return await this.prisma.user.create({data:a})}async deleteSession(a){return await this.prisma.session.deleteMany({where:{token:a.token}})}async findUserByEmailAddress(a){return await this.prisma.user.findUnique({where:{email:a}})}async findSession(a){if(!a.token)return null;try{return await this.prisma.session.findUnique({where:{token:a.token,userAgent:"local"},include:{user:{select:{password:!1,id:!0,email:!0,globalRole:!0,name:!0,publicId:!0,accounts:{select:{id:!0,publicId:!0,organization:!0,organizationRole:!0}}}}}})}catch(s){return console.log(s),null}}async updateSession(a){return await this.prisma.session.update({where:{token:a.token},data:{expiresAt:a.expiresAt},include:{user:{select:{password:!1,email:!0,globalRole:!0,name:!0,publicId:!0,accounts:{select:{id:!0,publicId:!0,organization:!0,organizationRole:!0}},organization:!0}}}})}async updateUserPassword(a){return await this.prisma.user.update({where:{id:a.id},data:{password:a.password}})}async createPasswordResetToken(a){return await this.prisma.passwordResetToken.create({data:{user:{connect:{id:a.user.id}},token:a.token}})}async findPasswordResetToken(a){const{token:s}=a;return await this.prisma.passwordResetToken.findUnique({where:{token:s},include:{user:!0}})}async deleteAllUserSessions(a){return await this.prisma.session.deleteMany({where:{userId:a}})}async deletePasswordResetToken(a){const{token:s}=a;return await this.prisma.passwordResetToken.delete({where:{token:s}})}}export{kf as PrismaAuthenticationAdapter,Ui as Kernel,qi as AuthenticationServiceProvider};
2
+ import{a as xu,b as Qi,c as Gi,d as Lu,e as wc,g as os,h as Rs,i as Fa,j as Gu,k as Iu,m as qu,n as Uu} from"../http/index.js";import{o as _i} from"../facades/index.js";import{p as Yu,q as zu,r as Bu,s as Ku,t as Xu} from"../services/index.js";import"../chunk-2c5ecf8dc0a97aba.js";import{A as jt,z as Cc} from"../chunk-9475c6ed18013dc8.js";import"../chunk-24a86f8f5ddc0cbd.js";import"../chunk-332553172e3ab961.js";import{E as _u,F as Qu} from"../chunk-7d5fe4acabfee228.js";import"../chunk-0ba2cc302113ab40.js";import"../chunk-28694e5e949df0ff.js";import"../chunk-fe8cfc6e6c3ce826.js";import"../chunk-156c827bf8d5029c.js";import"../chunk-6a2141dd4169ce0e.js";import"../chunk-9d5c096c43928b37.js";import"../chunk-880cfc21ce7cc2c6.js";import"../chunk-9dc5c9b7a885d0bc.js";import"../chunk-b13ef9b23e30af91.js";var xa=function(a,s,t,i,o){function r(...d){if(!(this instanceof r))throw new TypeError(Cr);gu(this,s(...d))}function c(d,f){return Object.defineProperties(function(...u){return d.call(this,l(this),...u)},ro(f))}function l(d){const f=k(d);if(!f||f.branding!==a)throw new TypeError(Cr);return f}return Object.defineProperties(r.prototype,{...Qc(ya(c,t)),...us(ya(c,i)),...qt("Temporal."+a)}),Object.defineProperties(r,{...us(o),...ro(a)}),[r,(d)=>{const f=Object.create(r.prototype);return gu(f,d),f},l]},bu=function(a){return a=a.concat("id").sort(),(s)=>{if(!Yc(s,a))throw new TypeError(Ef);return s}},Xs=function(a){if(k(a)||a.calendar!==void 0||a.timeZone!==void 0)throw new TypeError(xf);return a},Ai=function(a,s){const t={};for(let i in a)t[i]=({o},r)=>{const c=k(r)||{},{branding:l}=c,d=l===Ds||s.includes(l)?c:ra(r);return o[i](d)};return t},lc=function(a){const s={};for(let t in a)s[t]=(i)=>{const{calendar:o}=i;return(r=o,typeof r=="string"?Us(r):(c=r,Object.assign(Object.create(fh),{i:c})))[t](i);var r,c};return s},is=function(){throw new TypeError(If)},vt=function({calendar:a}){return typeof a=="string"?new Tc(a):a},pu=function(a,s){if(s=H(s),G(a)){const i=k(a);if(i&&i.branding===qs)return w(s),i;const o=Du(a);return yr(zi(o||S),!o,a,s)}const t=td(Us,a);return w(s),t},Ou=function(a,s,t){return i=s.call(a,oa(q(t))),Jo(ft(i));var i},Ei=function(a,s=nu){const t=Object.keys(s).sort(),i={};for(let o of t)i[o]=D(s[o],a,Xf(a[o]));return i},F=function(a,s){return typeof a=="string"?Li(a):Ei(a,s)},J=function(a){return F(a,cc)},Ca=function(a){if(G(a)){const s=k(a);if(s)switch(s.branding){case Zi:return s;case za:return q(s.epochNanoseconds)}}return kl(a)};var mu=function(a,s,t){const i=s.l(Ca(t).epochNanoseconds,a);return i?oa(q(i)):null},M=function(a){return G(a)?(k(a)||{}).timeZone||Ph(a):((s)=>Pi(cd(L(s))))(a)},ea=function(a,s){if(G(a)){const t=k(a)||{};switch(t.branding){case Ci:return w(s),t;case Ss:return w(s),wa(t);case za:return w(s),Fr(J,t)}return $d(a,s)}return w(s),id(a)},dc=function(a){return a===void 0?void 0:ea(a)},Ys=function(a,s){if(s=H(s),G(a)){const i=k(a);return i&&i.branding===Gs?(w(s),i):Or($i(nt(a)),a,s)}const t=sd(Us,a);return w(s),t},as=function(a,s){if(s=H(s),G(a)){const i=k(a)||{};switch(i.branding){case Ss:return w(s),i;case Ds:return w(s),W({...i,...Oa});case za:return w(s),vr(J,i)}return Nd(Ji(nt(a)),a,s)}const t=ad(a);return w(s),t},ra=function(a,s){if(s=H(s),G(a)){const i=k(a)||{};switch(i.branding){case Ds:return w(s),i;case Ss:return w(s),N(i);case za:return w(s),nr(J,i)}return br(Ji(nt(a)),a,s)}const t=hi(a);return w(s),t},yu=function(a,s,t){return Da(s.call(a,A(N(t,a))))},La=function(a){return(s)=>typeof s=="string"?Us(s):((t,i)=>{const o=Object.keys(i).sort(),r={};for(let c of o)r[c]=D(i[c],t,t[c]);return r})(s,a)},I=function(a){if(G(a)){const s=k(a);return s&&s.branding===xi?s:Jd(a)}return od(a)},wt=function(a){if(a!==void 0){if(G(a)){const s=k(a)||{};switch(s.branding){case za:case Ds:return s;case Ss:return N(s)}const t=nt(a);return{...Hd(M,F,Ji(t),a),calendar:t}}return Vl(a)}},nt=function(a){return Du(a)||S},Du=function(a){const{calendar:s}=a;if(s!==void 0)return X(s)},X=function(a){return G(a)?(k(a)||{}).calendar||Zh(a):((s)=>mt(rd(L(s))))(a)},Bs=function(a,s){if(s=H(s),G(a)){const t=k(a);if(t&&t.branding===za)return ut(s),t;const i=nt(a);return Wd(M,F,Ji(i),i,a,s)}return el(a,s)},hu=function(a){return ya((s)=>(t)=>s(rc(t)),a)},rc=function(a){return ta(a,J)},Bm=function(){const a=Va.prototype,s=Object.getOwnPropertyDescriptors(a),t=Object.getOwnPropertyDescriptors(Va),i=function(o,r={}){if(!(this instanceof i))return new i(o,r);bc.set(this,((c,l={})=>{const d=new Va(c,l),f=d.resolvedOptions(),u=f.locale,p=pa(Object.keys(l),f),m=fa(km),h=(...g)=>{let P;const T=g.map((O,b)=>{const y=k(O),E=(y||{}).branding;if(b&&P&&P!==E)throw new TypeError(Nf);return P=E,y});return P?m(P)(u,p,...T):[d,...g]};return h.u=d,h})(o,r))};for(let o in s){const r=s[o],c=o.startsWith("format")&&Km(o);typeof r.value=="function"?r.value=o==="constructor"?i:c||Xm(o):c&&(r.get=function(){return c.bind(this)})}return t.prototype.value=Object.create(a,s),Object.defineProperties(i,t),i},Km=function(a){return function(...s){const t=bc.get(this),[i,...o]=t(...s);return i[a](...o)}},Xm=function(a){return function(...s){return bc.get(this).u[a](...s)}},km=function(a){const s=Vm[a];if(!s)throw new TypeError(Wf(a));return Na(s,fa(Rr))};var ca=function(a,s,t,i,o){return Pa(s,Uc(a,s),t,i,o)},Pa=function(a,s,t,i,o,r){const c=ki(s,t,i);if(o&&s!==c)throw new RangeError(Cf(a,s,t,i,r));return c},Uc=function(a,s){const t=a[s];if(t===void 0)throw new TypeError(Mr(s));return t},G=function(a){return a!==null&&/object|function/.test(typeof a)},fa=function(a,s=Map){const t=new s;return(i,...o)=>{if(t.has(i))return t.get(i);const r=a(i,...o);return t.set(i,r),r}},ro=function(a){return us({name:a},1)},us=function(a,s){return ya((t)=>({value:t,configurable:1,writable:!s}),a)},Qc=function(a){return ya((s)=>({get:s,configurable:1}),a)},qt=function(a){return{[Symbol.toStringTag]:{value:a,configurable:1}}},Is=function(a,s){const t={};let i=a.length;for(let o of s)t[a[--i]]=o;return t},ya=function(a,s,t){const i={};for(let o in s)i[o]=a(s[o],o,t);return i},lt=function(a,s,t){const i={};for(let o=0;o<s.length;o++){const r=s[o];i[r]=a(r,o,t)}return i},eu=function(a,s,t){const i={};for(let o=0;o<a.length;o++)i[s[o]]=t[a[o]];return i},pa=function(a,s){const t={};for(let i of a)t[i]=s[i];return t},co=function(a,s){const t={};for(let i in s)a.has(i)||(t[i]=s[i]);return t},lo=function(a){a={...a};const s=Object.keys(a);for(let t of s)a[t]===void 0&&delete a[t];return a},Yc=function(a,s){for(let t of s)if(!(t in a))return 0;return 1},Bc=function(a,s,t){for(let i of a)if(s[i]!==t[i])return 0;return 1},Kc=function(a,s,t){const i={...t};for(let o=0;o<s;o++)i[a[o]]=0;return i},D=function(a,...s){return(...t)=>a(...s,...t)},Zc=function(a){return a[0].toUpperCase()+a.substring(1)},dt=function(a){return a.slice().sort()},Et=function(a,s){return String(s).padStart(a,"0")},_a=function(a,s){return Math.sign(a-s)},ki=function(a,s,t){return Math.min(Math.max(a,s),t)},Aa=function(a,s){return[Math.floor(a/s),at(a,s)]},at=function(a,s){return(a%s+s)%s},Ua=function(a,s){return[Ut(a,s),fo(a,s)]},Ut=function(a,s){return Math.trunc(a/s)||0},fo=function(a,s){return a%s||0},Ct=function(a){return Math.abs(a%1)===0.5},Xc=function(a,s,t){let i=0,o=0;for(let l=0;l<=s;l++){const d=a[t[l]],f=Ma[l],u=n/f,[p,m]=Ua(d,u);i+=m*f,o+=p}const[r,c]=Ua(i,n);return[o+r,c]},Qt=function(a,s,t){const i={};for(let o=s;o>=0;o--){const r=Ma[o];i[t[o]]=Ut(a,r),a=fo(a,r)}return i},kc=function(a){return a===S?Ri:[]},Vc=function(a){return a===S?Ot:[]},ec=function(a){return a===S?["year","day"]:[]},al=function(a){if(a!==void 0)return L(a)},sl=function(a){if(a!==void 0)return Da(a)},uo=function(a){if(a!==void 0)return ft(a)},Da=function(a){return ol(ft(a))},ft=function(a){return il(qp(a))},po=function(a){if(a==null)throw new TypeError("Cannot be null or undefined");return a},tl=function(a,s){if(s==null)throw new RangeError(Mr(a));return s},Ha=function(a){if(!G(a))throw new TypeError(jf);return a},Yt=function(a,s,t=a){if(typeof s!==a)throw new TypeError(Pt(t,s));return s},il=function(a,s="number"){if(!Number.isInteger(a))throw new RangeError(Pp(s,a));return a||0},ol=function(a,s="number"){if(a<=0)throw new RangeError(Tp(s,a));return a},mo=function(a){if(typeof a=="symbol")throw new TypeError(Dp);return String(a)},Ht=function(a,s){return G(a)?String(a):L(a,s)},Bt=function(a){if(typeof a=="string")return BigInt(a);if(typeof a!="bigint")throw new TypeError(yp(a));return a},rl=function(a,s="number"){if(typeof a=="bigint")throw new TypeError(Op(s));if(a=Number(a),!Number.isFinite(a))throw new RangeError(bp(s,a));return a},V=function(a,s){return Math.trunc(rl(a,s))||0},cl=function(a,s){return il(rl(a,s),s)},xc=function(a,s){return ol(V(a,s),s)},ho=function(a,s){let[t,i]=Ua(s,n),o=a+t;const r=Math.sign(o);return r&&r===-Math.sign(i)&&(o-=r,i+=r*n),[o,i]},js=function(a,s,t=1){return ho(a[0]+s[0]*t,a[1]+s[1]*t)},Cs=function(a,s){return ho(a[0],a[1]+s)},ma=function(a,s){return js(s,a,-1)},aa=function(a,s){return _a(a[0],s[0])||_a(a[1],s[1])},ll=function(a,s,t){return aa(a,s)===-1||aa(a,t)===1},Kt=function(a,s=1){const t=BigInt(n/s);return[Number(a/t),Number(a%t)*s]},Zs=function(a,s=1){const t=n/s,[i,o]=Ua(a,t);return[i,o*s]},dl=function(a,s=1){const[t,i]=a,o=Math.floor(i/s),r=n/s;return BigInt(t)*BigInt(r)+BigInt(o)},ha=function(a,s=1,t){const[i,o]=a,[r,c]=Ua(o,s);return i*(n/s)+(r+(t?c/s:0))},go=function(a,s,t=Aa){const[i,o]=a,[r,c]=t(o,s);return[i*(n/s)+r,c]},Po=function(a,s){const t=a.formatToParts(s),i={};for(let o of t)i[o.type]=o.value;return i},To=function(a){return ca(a,"isoYear",ct,rt,1),a.isoYear===ct?ca(a,"isoMonth",4,12,1):a.isoYear===rt&&ca(a,"isoMonth",1,9,1),a},Ga=function(a){return Wa({...a,...Oa,isoHour:12}),a},Wa=function(a){const s=ca(a,"isoYear",ct,rt,1),t=s===ct?1:s===rt?-1:0;return t&&ga(e({...a,isoDay:a.isoDay+t,isoNanosecond:a.isoNanosecond-t})),a},ga=function(a){if(!a||ll(a,kp,Xp))throw new RangeError(wi);return a},Qa=function(a){return Xc(a,5,na)[1]},Xt=function(a){const[s,t]=Aa(a,n);return[Qt(t,5,na),s]},fl=function(a){return ul(a)[0]},ul=function(a){return go(a,ba)},sa=function(a){return As(a.isoYear,a.isoMonth,a.isoDay,a.isoHour,a.isoMinute,a.isoSecond,a.isoMillisecond)},e=function(a){const s=sa(a);if(s!==void 0){const[t,i]=Ua(s,da);return[t,i*ja+(a.isoMicrosecond||0)*ys+(a.isoNanosecond||0)]}},bo=function(a,s){const[t,i]=Xt(Qa(a)-s);return ga(e({...a,isoDay:a.isoDay+i,...t}))},Wt=function(...a){return As(...a)/Jf},As=function(...a){const[s,t]=pl(...a),i=s.valueOf();if(!isNaN(i))return i-t*da},pl=function(a,s=1,t=1,i=0,o=0,r=0,c=0){const l=a===ct?1:a===rt?-1:0,d=new Date;return d.setUTCHours(i,o,r,c),d.setUTCFullYear(a,s-1,t+l),[d,l]},Ba=function(a,s){let[t,i]=Cs(a,s);i<0&&(i+=n,t-=1);const[o,r]=Aa(i,ja),[c,l]=Aa(r,ys);return kt(t*da+o,c,l)},kt=function(a,s=0,t=0){const i=Math.ceil(Math.max(0,Math.abs(a)-Kp)/da)*Math.sign(a),o=new Date(a-i*da);return Is(ji,[o.getUTCFullYear(),o.getUTCMonth()+1,o.getUTCDate()+i,o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds(),s,t])},ml=function(a){return[a.isoYear,a.isoMonth,a.isoDay]},hl=function(){return Ia},Oo=function(a,s){switch(s){case 2:return yo(a)?29:28;case 4:case 6:case 9:case 11:return 30}return 31},gl=function(a){return yo(a)?366:365},yo=function(a){return a%4==0&&(a%100!=0||a%400==0)},Pl=function(a){const[s,t]=pl(a.isoYear,a.isoMonth,a.isoDay);return at(s.getUTCDay()-t,7)||7},Tl=function({isoYear:a}){return a<1?["bce",1-a]:["ce",a]},ap=function(a){const s=sa(a);if(s<ep)return Tl(a);const t=Po(Ur(xs),s),{era:i,eraYear:o}=Md(t,xs);return[i,o]},Vt=function(a){return ps(a),et(a,1),a},ps=function(a){return bl(a,1),a},Lc=function(a){return Bc(Wr,a,bl(a))},bl=function(a,s){const{isoYear:t}=a,i=ca(a,"isoMonth",1,hl(),s);return{isoYear:t,isoMonth:i,isoDay:ca(a,"isoDay",1,Oo(t,i),s)}},et=function(a,s){return Is(na,[ca(a,"isoHour",0,23,s),ca(a,"isoMinute",0,59,s),ca(a,"isoSecond",0,59,s),ca(a,"isoMillisecond",0,999,s),ca(a,"isoMicrosecond",0,999,s),ca(a,"isoNanosecond",0,999,s)])},w=function(a){return a===void 0?0:iu(Ha(a))},ut=function(a,s=0){a=Sa(a);const t=ou(a),i=fm(a,s);return[iu(a),i,t]},Do=function(a){return ou(Sa(a))},Ol=function(a){return a=Sa(a),Jr(a,9,6,1)},Es=function(a,s,t,i=9,o=0,r=4){s=Sa(s);let c=Jr(s,i,o),l=vo(s),d=Dt(s,r);const f=yt(s,i,o,1);return c==null?c=Math.max(t,f):wl(c,f),l=no(l,f,1),a&&(d=((u)=>u<4?(u+2)%4:u)(d)),[c,f,l,d]},ai=function(a,s=6,t){let i=vo(a=Fo(a,Gt));const o=Dt(a,7);let r=yt(a,s);return r=tl(Gt,r),i=no(i,r,void 0,t),[r,i,o]},So=function(a){return zr(Sa(a))},yl=function(a,s){return wo(Sa(a),s)},wo=function(a,s=4){const t=Sl(a);return[Dt(a,4),...Dl(yt(a,s),t)]},Dl=function(a,s){return a!=null?[Ma[a],a<4?9-3*a:-1]:[s===void 0?1:10**(9-s),s]},vo=function(a){const s=a[st];return s===void 0?1:V(s,st)},no=function(a,s,t,i){const o=i?n:Ma[s+1];if(o){const r=Ma[s];if(o%((a=Pa(st,a,1,o/r-(i?0:1),1))*r))throw new RangeError(Pt(st,a))}else a=Pa(st,a,1,t?1e9:1,1);return a},Sl=function(a){let s=a[Xi];if(s!==void 0){if(typeof s!="number"){if(mo(s)==="auto")return;throw new RangeError(Pt(Xi,s))}s=Pa(Xi,Math.floor(s),0,9,1)}return s},Sa=function(a){return a===void 0?{}:Ha(a)},Fo=function(a,s){return typeof a=="string"?{[s]:a}:Ha(a)},H=function(a){if(a!==void 0){if(G(a))return Object.assign(Object.create(null),a);throw new TypeError(jf)}},si=function(a,s){return a&&Object.assign(Object.create(null),a,{overflow:sm[s]})},Ro=function(a,s,t=9,i=0,o){let r=s[a];if(r===void 0)return o?i:void 0;if(r=mo(r),r==="auto")return o?i:null;let c=so[r];if(c===void 0&&(c=Yp[r]),c===void 0)throw new RangeError(Lf(a,r,so));return Pa(a,c,i,t,1,bt),c},ms=function(a,s,t,i=0){const o=t[a];if(o===void 0)return i;const r=mo(o),c=s[r];if(c===void 0)throw new RangeError(Lf(a,r,s));return c},wl=function(a,s){if(s>a)throw new RangeError($p)},q=function(a){return{branding:Zi,epochNanoseconds:a}},B=function(a,s,t){return{branding:za,calendar:t,timeZone:s,epochNanoseconds:a}},W=function(a,s=a.calendar){return{branding:Ss,calendar:s,...pa(ef,a)}},N=function(a,s=a.calendar){return{branding:Ds,calendar:s,...pa(Nr,a)}},ds=function(a,s=a.calendar){return{branding:Gs,calendar:s,...pa(Nr,a)}},Nt=function(a,s=a.calendar){return{branding:qs,calendar:s,...pa(Nr,a)}},wa=function(a){return{branding:Ci,...pa(Vf,a)}},C=function(a){return{branding:xi,sign:Ka(a),...pa(Ar,a)}},vl=function(a){return fl(a.epochNanoseconds)},ti=function(a){return go(a.epochNanoseconds,ja)[0]},nl=function(a){return dl(a.epochNanoseconds,ys)},Fl=function(a){return dl(a.epochNanoseconds)},Rl=function(a){return a.epochNanoseconds},Q=function(a){return typeof a=="string"?a:L(a.id)},Hs=function(a,s){return a===s||Q(a)===Q(s)},Ml=function(a,s,t,i,o){const r=fs(i),[c,l]=((T,O)=>{const b=O((T=Fo(T,oo))[su]);let y=dm(T);return y=tl(oo,y),[y,b]})(o,a);if(it(Math.max(c,r),l))return Ic(i,c);if(!l)throw new RangeError(vi);const[d,f,u]=di(s,t,l),p=Xo(u),m=fi(u),h=ko(u),g=m(f,d,i),P=h(f,d,g,c);return it(c,l)?Ic(P,c):((T,O,b,y,E,Z,j)=>{const x=Ka(T),[U,z]=Mo(y,Hr(b,T),b,x,E,Z,j),ks=jo(O,U,z);return T[v[b]]+ks*x})(P,p(g),c,f,d,p,m)},Ic=function(a,s){return ha(_(a),Ma[s],1)},Mo=function(a,s,t,i,o,r,c){const l=v[t],d={...s,[l]:s[l]+i},f=c(a,o,s),u=c(a,o,d);return[r(f),r(u)]},jo=function(a,s,t){const i=ha(ma(s,t));if(!i)throw new RangeError(Tt);return ha(ma(s,a))/i},jl=function(a,s){const[t,i,o]=ai(s,5,1);return q(oi(a.epochNanoseconds,t,i,o,1))},Cl=function(a,s,t){let{epochNanoseconds:i,timeZone:o,calendar:r}=s;const[c,l,d]=ai(t);if(c===0&&l===1)return s;const f=a(o);if(c===6)i=((u,p,m,h)=>{const g=ta(m,p),[P,T]=u(g),O=m.epochNanoseconds,b=ua(p,P),y=ua(p,T);if(ll(O,b,y))throw new RangeError(Tt);return Nl(jo(O,b,y),h)?y:b})(Hl,f,s,d);else{const u=f.getOffsetNanosecondsFor(i);i=gs(f,Al(Ba(i,u),c,l,d),u,2,0,1)}return B(i,o,r)},Zl=function(a,s){return W(Al(a,...ai(s)),a.calendar)},xl=function(a,s){const[t,i,o]=ai(s,5);var r;return wa((r=o,Co(a,pt(t,i),r)[0]))},Ll=function(a,s){const t=a(s.timeZone),i=ta(s,t),[o,r]=Hl(i),c=ha(ma(ua(t,o),ua(t,r)),Fi,1);if(c<=0)throw new RangeError(Tt);return c},Il=function(a,s){const{timeZone:t,calendar:i}=s,o=((r,c,l)=>ua(c,r(ta(l,c))))(Wl,a(t),s);return B(o,t,i)},Al=function(a,s,t,i){return El(a,pt(s,t),i)},El=function(a,s,t){const[i,o]=Co(a,s,t);return Wa({...Ps(a,o),...i})},Co=function(a,s,t){return Xt(Ya(Qa(a),s,t))},$t=function(a){return Ya(a,ni,7)},pt=function(a,s){return Ma[a]*s},Hl=function(a){const s=Wl(a);return[s,Ps(s,1)]},Wl=function(a){return Bp(6,a)},sp=function(a,s,t){const i=Math.min(fs(a),6);return Ns(ri(_(a,i),s,t),i)},ii=function(a,s,t,i,o,r,c,l,d,f){if(i===0&&o===1)return a;const u=it(i,l)?ui(l)&&i<6&&t>=6?ip:tp:op;let[p,m,h]=u(a,s,t,i,o,r,c,l,d,f);return h&&i!==7&&(p=((g,P,T,O,b,y,E,Z)=>{const j=Ka(g);for(let x=O+1;x<=T;x++){if(x===7&&T!==7)continue;const U=Hr(x,g);U[v[x]]+=j;const z=ha(ma(E(Z(b,y,U)),P));if(z&&Math.sign(z)!==j)break;g=U}return g})(p,m,t,Math.max(6,i),c,l,d,f)),p},oi=function(a,s,t,i,o){if(s===6){const r=((c)=>c[0]+c[1]/n)(a);return[Ya(r,t,i),0]}return ri(a,pt(s,t),i,o)},ri=function(a,s,t,i){let[o,r]=a;i&&r<0&&(r+=n,o-=1);const[c,l]=Aa(Ya(r,s,t),n);return ho(o+c,l)},Ya=function(a,s,t){return Nl(a/s,t)*s},Nl=function(a,s){return mm[s](a)},tp=function(a,s,t,i,o,r){const c=Ka(a),l=_(a),d=oi(l,i,o,r),f=ma(l,d),u=Math.sign(d[0]-l[0])===c,p=Ns(d,Math.min(t,6));return[{...a,...p},js(s,f),u]},ip=function(a,s,t,i,o,r,c,l,d,f){const u=Ka(a),p=ha(_(a,5)),m=pt(i,o);let h=Ya(p,m,r);const[g,P]=Mo(c,{...a,...Er},6,u,l,d,f),T=h-ha(ma(g,P));let O=0;T&&Math.sign(T)!==u?s=Cs(g,h):(O+=u,h=Ya(T,m,r),s=Cs(P,h));const b=mi(h);return[{...a,...b,days:a.days+O},s,Boolean(O)]},op=function(a,s,t,i,o,r,c,l,d,f){const u=Ka(a),p=v[i],m=Hr(i,a);i===7&&(a={...a,weeks:a.weeks+Math.trunc(a.days/7)});const h=Ut(a[p],o)*o;m[p]=h;const[g,P]=Mo(c,m,i,o*u,l,d,f),T=h+jo(s,g,P)*u*o,O=Ya(T,o,r),b=Math.sign(O-T)===u;return m[p]=O,[m,b?P:g,b]},Zo=function(a,s,t,i){const[o,r,c,l]=((f)=>{const u=wo(f=Sa(f));return[f.timeZone,...u]})(i),d=o!==void 0;return((f,u,p,m,h,g)=>{p=ri(p,h,m,1);const P=u.getOffsetNanosecondsFor(p);return Wo(Ba(p,P),g)+(f?hs($t(P)):"Z")})(d,s(d?a(o):ws),t.epochNanoseconds,r,c,l)},xo=function(a,s,t){const[i,o,r,c,l,d]=((f)=>{f=Sa(f);const u=zr(f),p=Sl(f),m=pm(f),h=Dt(f,4),g=yt(f,4);return[u,um(f),m,h,...Dl(g,p)]})(t);return((f,u,p,m,h,g,P,T,O,b)=>{m=ri(m,O,T,1);const y=f(p).getOffsetNanosecondsFor(m);return Wo(Ba(m,y),b)+hs($t(y),P)+((E,Z)=>Z!==1?"["+(Z===2?"!":"")+Q(E)+"]":"")(p,g)+No(u,h)})(a,s.calendar,s.timeZone,s.epochNanoseconds,i,o,r,c,l,d)},Lo=function(a,s){const[t,i,o,r]=((f)=>(f=Sa(f),[zr(f),...wo(f)]))(s);return c=a.calendar,l=t,d=r,Wo(El(a,o,i),d)+No(c,l);var c,l,d},Io=function(a,s){return t=a.calendar,i=a,o=So(s),Jt(i)+No(t,o);var t,i,o},Ao=function(a,s){return $l(a.calendar,Jl,a,So(s))},Eo=function(a,s){return $l(a.calendar,rp,a,So(s))},Ho=function(a,s){const[t,i,o]=yl(s);return r=o,zl(Co(a,i,t)[0],r);var r},ci=function(a,s){const[t,i,o]=yl(s,3);return i>1&&(a={...a,...sp(a,i,t)}),((r,c)=>{const{sign:l}=r,d=l===-1?ia(r):r,{hours:f,minutes:u}=d,[p,m]=go(_(d,3),ba,Ua);Kl(p);const h=$o(m,c),g=c>=0||!l||h;return(l<0?"-":"")+"P"+Ac({Y:ls(d.years),M:ls(d.months),W:ls(d.weeks),D:ls(d.days)})+(f||u||p||g?"T"+Ac({H:ls(f),M:ls(u),S:ls(p,g)+h}):"")})(a,o)},$l=function(a,s,t,i){const o=Q(a),r=i>1||i===0&&o!==S;return i===1?o===S?s(t):Jt(t):r?Jt(t)+_l(o,i===2):s(t)},Ac=function(a){const s=[];for(let t in a){const i=a[t];i&&s.push(i,t)}return s.join("")},Wo=function(a,s){return Jt(a)+"T"+zl(a,s)},Jt=function(a){return Jl(a)+"-"+Ta(a.isoDay)},Jl=function(a){const{isoYear:s}=a;return(s<0||s>9999?Gl(s)+Et(6,Math.abs(s)):Et(4,s))+"-"+Ta(a.isoMonth)},rp=function(a){return Ta(a.isoMonth)+"-"+Ta(a.isoDay)},zl=function(a,s){const t=[Ta(a.isoHour),Ta(a.isoMinute)];return s!==-1&&t.push(Ta(a.isoSecond)+((i,o,r,c)=>$o(i*ja+o*ys+r,c))(a.isoMillisecond,a.isoMicrosecond,a.isoNanosecond,s)),t.join(":")},hs=function(a,s=0){if(s===1)return"";const[t,i]=Aa(Math.abs(a),Fi),[o,r]=Aa(i,ni),[c,l]=Aa(r,ba);return Gl(a)+Ta(t)+":"+Ta(o)+(c||l?":"+Ta(c)+$o(l):"")},No=function(a,s){if(s!==1){const t=Q(a);if(s>1||s===0&&t!==S)return _l(t,s===2)}return""},_l=function(a,s){return"["+(s?"!":"")+"u-ca="+a+"]"},$o=function(a,s){let t=Et(9,a);return t=s===void 0?t.replace(Pm,""):t.slice(0,s),t?"."+t:""},Gl=function(a){return a<0?"-":"+"},ls=function(a,s){return a||s?a.toLocaleString("fullwide",{useGrouping:0}):""},cp=function(a,s){const{epochNanoseconds:t}=a,i=(s.getOffsetNanosecondsFor?s:s(a.timeZone)).getOffsetNanosecondsFor(t),o=Ba(t,i);return{calendar:a.calendar,...o,offsetNanoseconds:i}},ql=function(a,s){const t=ta(s,a);return{calendar:s.calendar,...pa(ef,t),offset:hs(t.offsetNanoseconds),timeZone:s.timeZone}},gs=function(a,s,t,i=0,o=0,r,c){if(t!==void 0&&i===1&&(i===1||c))return bo(s,t);const l=a.getPossibleInstantsFor(s);if(t!==void 0&&i!==3){const d=((f,u,p,m)=>{const h=e(u);m&&(p=$t(p));for(let g of f){let P=ha(ma(g,h));if(m&&(P=$t(P)),P===p)return g}})(l,s,t,r);if(d!==void 0)return d;if(i===0)throw new RangeError(Ip)}return c?e(s):ua(a,s,o,l)},ua=function(a,s,t=0,i=a.getPossibleInstantsFor(s)){if(i.length===1)return i[0];if(t===1)throw new RangeError(Ap);if(i.length)return i[t===3?1:0];const o=e(s),r=((l,d)=>{const f=l.getOffsetNanosecondsFor(Cs(d,-n));return zo(l.getOffsetNanosecondsFor(Cs(d,n))-f)})(a,o),c=r*(t===2?-1:1);return(i=a.getPossibleInstantsFor(Ba(o,c)))[t===2?0:i.length-1]},Jo=function(a){if(Math.abs(a)>=n)throw new RangeError(xp);return a},zo=function(a){if(a>n)throw new RangeError(Lp);return a},_o=function(a,s,t){return q(ga(js(s.epochNanoseconds,((i)=>{if(Xl(i))throw new RangeError(Wp);return _(i,5)})(a?ia(t):t))))},Go=function(a,s,t,i,o,r=Object.create(null)){const c=s(i.timeZone),l=a(i.calendar);return{...i,...Bo(c,l,i,t?ia(o):o,r)}},qo=function(a,s,t,i,o=Object.create(null)){const{calendar:r}=t;return W(Ko(a(r),t,s?ia(i):i,o),r)},Uo=function(a,s,t,i,o){const{calendar:r}=t;return N(li(a(r),t,s?ia(i):i,o),r)},Qo=function(a,s,t,i,o=Object.create(null)){const r=t.calendar,c=a(r);let l=tt(c,t);s&&(i=pi(i)),i.sign<0&&(l=c.dateAdd(l,{...Y,months:1}),l=Ps(l,-1));const d=c.dateAdd(l,i,o);return ds(tt(c,d),r)},Yo=function(a,s,t){return wa(Ul(s,a?ia(t):t)[0])},Bo=function(a,s,t,i,o){const r=_(i,5);let c=t.epochNanoseconds;if(Xl(i)){const l=ta(t,a);c=js(ua(a,{...li(s,l,{...i,...Er},o),...pa(na,l)}),r)}else c=js(c,r),w(o);return{epochNanoseconds:ga(c)}},Ko=function(a,s,t,i){const[o,r]=Ul(s,t);return Wa({...li(a,s,{...t,...Er,days:t.days+r},i),...o})},li=function(a,s,t,i){if(t.years||t.months||t.weeks)return a.dateAdd(s,t,i);w(i);const o=t.days+_(t,5)[0];return o?Ga(Ps(s,o)):s},tt=function(a,s,t=1){return Ps(s,t-a.day(s))},Ul=function(a,s){const[t,i]=_(s,5),[o,r]=Xt(Qa(a)+i);return[o,t+r]},Ps=function(a,s){return s?{...a,...kt(sa(a)+s*da)}:a},di=function(a,s,t){const i=a(t.calendar);return ui(t)?[t,i,s(t.timeZone)]:[{...t,...Oa},i]},Xo=function(a){return a?Rl:e},fi=function(a){return a?D(Bo,a):Ko},ko=function(a){return a?D(dp,a):fp},ui=function(a){return a&&a.epochNanoseconds},it=function(a,s){return a<=6-(ui(s)?1:0)},Vo=function(a,s,t,i,o,r,c){const l=a(Sa(c).relativeTo),d=Math.max(fs(o),fs(r));if(it(d,l))return C(Ws(((P,T,O,b)=>{const y=js(_(P),_(T),b?-1:1);if(!Number.isFinite(y[0]))throw new RangeError(wi);return{...Y,...Ns(y,O)}})(o,r,d,i)));if(!l)throw new RangeError(vi);i&&(r=ia(r));const[f,u,p]=di(s,t,l),m=fi(p),h=ko(p),g=m(u,f,o);return C(h(u,f,m(u,g,r),d))},Ql=function(a,s,t,i,o){const r=fs(i),[c,l,d,f,u]=((j,x,U)=>{j=Fo(j,Gt);let z=Jr(j);const ks=U(j[su]);let Vs=vo(j);const Vu=Dt(j,7);let cs=yt(j);if(z===void 0&&cs===void 0)throw new RangeError(Np);return cs==null&&(cs=0),z==null&&(z=Math.max(cs,x)),wl(z,cs),Vs=no(Vs,cs,1),[z,cs,Vs,Vu,ks]})(o,r,a),p=Math.max(r,c);if(!ui(u)&&p<=6)return C(Ws(((j,x,U,z,ks)=>{const Vs=oi(_(j),U,z,ks);return{...Y,...Ns(Vs,x)}})(i,c,l,d,f)));if(!u)throw new RangeError(vi);const[m,h,g]=di(s,t,u),P=Xo(g),T=fi(g),O=ko(g),b=T(h,m,i);let y=O(h,m,b,c);const E=i.sign,Z=Ka(y);if(E&&Z&&E!==Z)throw new RangeError(Tt);return Z&&(y=ii(y,P(b),c,l,d,f,h,m,P,T)),C(y)},Yl=function(a){return a.sign===-1?pi(a):a},pi=function(a){return C(ia(a))},ia=function(a){const s={};for(let t of v)s[t]=-1*a[t]||0;return s},Bl=function(a){return!a.sign},Ka=function(a,s=v){let t=0;for(let i of s){const o=Math.sign(a[i]);if(o){if(t&&t!==o)throw new RangeError(Hp);t=o}}return t},Ws=function(a){for(let s of Qp)Pa(s,a[s],-zc,zc,1);return Kl(ha(_(a),ba)),a},Kl=function(a){if(!Number.isSafeInteger(a))throw new RangeError(Ep)},_=function(a,s=6){return Xc(a,s,v)},Ns=function(a,s=6){const[t,i]=a,o=Qt(i,s,v);if(o[v[s]]+=t*(n/Ma[s]),!Number.isFinite(o[v[s]]))throw new RangeError(wi);return o},mi=function(a,s=5){return Qt(a,s,v)},Xl=function(a){return Boolean(Ka(a,kf))},fs=function(a){let s=9;for(;s>0&&!a[v[s]];s--);return s},lp=function(a,s){return[a,s]},Ec=function(a){const s=Math.floor(a/It)*It;return[s,s+It]},kl=function(a){const s=Xa(a=Ht(a));if(!s)throw new RangeError(la(a));let t;if(s.m)t=0;else{if(!s.offset)throw new RangeError(la(a));t=$s(s.offset)}return s.timeZone&&tr(s.timeZone,1),q(bo(Vt(s),t))},Vl=function(a){const s=Xa(L(a));if(!s)throw new RangeError(la(a));if(s.timeZone)return ld(s,s.offset?$s(s.offset):void 0);if(s.m)throw new RangeError(la(a));return fd(s)},el=function(a,s){const t=Xa(L(a));if(!t||!t.timeZone)throw new RangeError(la(a));const{offset:i}=t,o=i?$s(i):void 0,[,r,c]=ut(s);return ld(t,o,r,c)},$s=function(a){const s=tr(a);if(s===void 0)throw new RangeError(la(a));return s},ad=function(a){const s=Xa(L(a));if(!s||s.m)throw new RangeError(la(a));return W(dd(s))},hi=function(a){const s=Xa(L(a));if(!s||s.m)throw new RangeError(la(a));return N(s.p?dd(s):fd(s))},sd=function(a,s){const t=ar(L(s));if(t)return eo(t),ds(To(ps(t)));const i=hi(s);return ds(tt(a(i.calendar),i))},eo=function(a){if(a.calendar!==S)throw new RangeError(Ea(a.calendar))},td=function(a,s){const t=sr(L(s));if(t)return eo(t),Nt(ps(t));const i=hi(s),{calendar:o}=i,r=a(o),[c,l,d]=r.h(i),[f,u]=r.I(c,l),[p,m]=r.N(f,u,d);return Nt(Ga(r.P(p,m,d)),o)},id=function(a){let s,t=((i)=>{const o=Dm.exec(i);return o?(gi(o[10]),md(o)):void 0})(L(a));if(!t){if(t=Xa(a),!t)throw new RangeError(la(a));if(!t.p)throw new RangeError(la(a));if(t.m)throw new RangeError(Ea("Z"));eo(t)}if((s=ar(a))&&Lc(s))throw new RangeError(la(a));if((s=sr(a))&&Lc(s))throw new RangeError(la(a));return wa(et(t,1))},od=function(a){const s=((t)=>{const i=vm.exec(t);return i?((o)=>{function r(u,p,m){let h=0,g=0;if(m&&([h,d]=Aa(d,Ma[m])),u!==void 0){if(l)throw new RangeError(Ea(u));g=((P)=>{const T=parseInt(P);if(!Number.isFinite(T))throw new RangeError(Ea(P));return T})(u),c=1,p&&(d=ir(p)*(Ma[m]/ba),l=1)}return h+g}let c=0,l=0,d=0,f={...Is(v,[r(o[2]),r(o[3]),r(o[4]),r(o[5]),r(o[6],o[7],5),r(o[8],o[9],4),r(o[10],o[11],3)]),...Qt(d,2,v)};if(!c)throw new RangeError(Zf(v));return or(o[1])<0&&(f=ia(f)),f})(i):void 0})(L(a));if(!s)throw new RangeError(la(a));return C(Ws(s))},rd=function(a){const s=Xa(a)||ar(a)||sr(a);return s?s.calendar:a},cd=function(a){const s=Xa(a);return s&&(s.timeZone||s.m&&ws||s.offset)||a},ld=function(a,s,t=0,i=0){const o=Pi(a.timeZone),r=Li(o);return B(gs(r,Vt(a),s,t,i,!r.v,a.m),o,mt(a.calendar))},dd=function(a){return ud(Wa(Vt(a)))},fd=function(a){return ud(Ga(ps(a)))},ud=function(a){return{...a,calendar:mt(a.calendar)}},Xa=function(a){const s=ym.exec(a);return s?((t)=>{const i=t[10],o=(i||"").toUpperCase()==="Z";return{isoYear:pd(t),isoMonth:parseInt(t[4]),isoDay:parseInt(t[5]),...md(t.slice(5)),...gi(t[16]),p:Boolean(t[6]),m:o,offset:o?void 0:i}})(s):void 0},ar=function(a){const s=bm.exec(a);return s?((t)=>({isoYear:pd(t),isoMonth:parseInt(t[4]),isoDay:1,...gi(t[5])}))(s):void 0},sr=function(a){const s=Om.exec(a);return s?((t)=>({isoYear:Ls,isoMonth:parseInt(t[1]),isoDay:parseInt(t[2]),...gi(t[3])}))(s):void 0},tr=function(a,s){const t=Sm.exec(a);return t?((i,o)=>{const r=i[4]||i[5];if(o&&r)throw new RangeError(Ea(r));return Jo((Ms(i[2])*Fi+Ms(i[3])*ni+Ms(i[4])*ba+ir(i[5]||""))*or(i[1]))})(t,s):void 0},pd=function(a){const s=or(a[1]),t=parseInt(a[2]||a[3]);if(s<0&&!t)throw new RangeError(Ea(-0));return s*t},md=function(a){const s=Ms(a[3]);return{...Xt(ir(a[4]||""))[0],isoHour:Ms(a[1]),isoMinute:Ms(a[2]),isoSecond:s===60?59:s}},gi=function(a){let s,t;const i=[];if(a.replace(wm,(o,r,c)=>{const l=Boolean(r),[d,f]=c.split("=").reverse();if(f){if(f==="u-ca")i.push(d),s||(s=l);else if(l||/[A-Z]/.test(f))throw new RangeError(Ea(o))}else{if(t)throw new RangeError(Ea(o));t=d}return""}),i.length>1&&s)throw new RangeError(Ea(a));return{timeZone:t,calendar:i[0]||S}},ir=function(a){return parseInt(a.padEnd(9,"0"))},Js=function(a){return new RegExp(`^${a}\$`,"i")},or=function(a){return a&&a!=="+"?-1:1},Ms=function(a){return a===void 0?0:parseInt(a)},hd=function(a){return Pi(L(a))},Pi=function(a){const s=rr(a);return typeof s=="number"?hs(s):s?((t)=>{if(Fm.test(t))throw new RangeError(Zp);return t.toLowerCase().split("/").map((i,o)=>(i.length<=3||/\d/.test(i))&&!/etc|yap/.test(i)?i.toUpperCase():i.replace(/baja|dumont|[a-z]+/g,(r,c)=>r.length<=2&&!o||r==="in"||r==="chat"?r.toUpperCase():r.length>2||!c?Zc(r).replace(/island|noronha|murdo|rivadavia|urville/,Zc):r)).join("/")})(a):ws},Hc=function(a){const s=rr(a);return typeof s=="number"?s:s?s.resolvedOptions().timeZone:ws},rr=function(a){const s=tr(a=a.toUpperCase(),1);return s!==void 0?s:a!==ws?nm(a):void 0},cr=function(a,s){return aa(a.epochNanoseconds,s.epochNanoseconds)},lr=function(a,s){return aa(a.epochNanoseconds,s.epochNanoseconds)},gd=function(a,s,t,i,o,r){const c=a(Sa(r).relativeTo),l=Math.max(fs(i),fs(o));if(Bc(v,i,o))return 0;if(it(l,c))return aa(_(i),_(o));if(!c)throw new RangeError(vi);const[d,f,u]=di(s,t,c),p=Xo(u),m=fi(u);return aa(p(m(f,d,i)),p(m(f,d,o)))},dr=function(a,s){return Ts(a,s)||Ti(a,s)},Ts=function(a,s){return _a(sa(a),sa(s))},Ti=function(a,s){return _a(Qa(a),Qa(s))},Pd=function(a,s){return!cr(a,s)},Td=function(a,s){return!lr(a,s)&&!!bi(a.timeZone,s.timeZone)&&Hs(a.calendar,s.calendar)},bd=function(a,s){return!dr(a,s)&&Hs(a.calendar,s.calendar)},Od=function(a,s){return!Ts(a,s)&&Hs(a.calendar,s.calendar)},yd=function(a,s){return!Ts(a,s)&&Hs(a.calendar,s.calendar)},Dd=function(a,s){return!Ts(a,s)&&Hs(a.calendar,s.calendar)},Sd=function(a,s){return!Ti(a,s)},bi=function(a,s){if(a===s)return 1;const t=Q(a),i=Q(s);if(t===i)return 1;try{return Hc(t)===Hc(i)}catch(o){}},fr=function(a,s,t,i){const o=Es(a,H(i),3,5),r=Oi(s.epochNanoseconds,t.epochNanoseconds,...o);return C(a?ia(r):r)},ur=function(a,s,t,i,o,r){const c=Di(i.calendar,o.calendar),l=H(r),[d,f,u,p]=Es(t,l,5),m=i.epochNanoseconds,h=o.epochNanoseconds,g=aa(h,m);let P;if(g)if(d<6)P=Oi(m,h,d,f,u,p);else{const T=s(((b,y)=>{if(!bi(b,y))throw new RangeError(Hf);return b})(i.timeZone,o.timeZone)),O=a(c);P=vd(O,T,i,o,g,d,l),P=ii(P,h,d,f,u,p,O,i,Rl,D(Bo,T))}else P=Y;return C(t?ia(P):P)},pr=function(a,s,t,i,o){const r=Di(t.calendar,i.calendar),c=H(o),[l,d,f,u]=Es(s,c,6),p=e(t),m=e(i),h=aa(m,p);let g;if(h)if(l<=6)g=Oi(p,m,l,d,f,u);else{const P=a(r);g=nd(P,t,i,h,l,c),g=ii(g,m,l,d,f,u,P,t,e,Ko)}else g=Y;return C(s?ia(g):g)},mr=function(a,s,t,i,o){const r=Di(t.calendar,i.calendar),c=H(o);return wd(s,()=>a(r),t,i,...Es(s,c,6,9,6),c)},hr=function(a,s,t,i,o){const r=Di(t.calendar,i.calendar),c=H(o),l=Es(s,c,9,9,8),d=a(r);return wd(s,()=>d,tt(d,t),tt(d,i),...l,c)},wd=function(a,s,t,i,o,r,c,l,d){const f=e(t),u=e(i);let p;if(aa(u,f))if(o===6)p=Oi(f,u,o,r,c,l);else{const m=s();p=m.dateUntil(t,i,o,d),r===6&&c===1||(p=ii(p,u,o,r,c,l,m,t,e,li))}else p=Y;return C(a?ia(p):p)},gr=function(a,s,t,i){const o=H(i),[r,c,l,d]=Es(a,o,5,5),f=Ya(Pr(s,t),pt(c,l),d),u={...Y,...mi(f,r)};return C(a?ia(u):u)},dp=function(a,s,t,i,o,r){const c=aa(i.epochNanoseconds,t.epochNanoseconds);return c?o<6?Fd(t.epochNanoseconds,i.epochNanoseconds,o):vd(s,a,t,i,c,o,r):Y},fp=function(a,s,t,i,o){const r=e(s),c=e(t),l=aa(c,r);return l?i<=6?Fd(r,c,i):nd(a,s,t,l,i,o):Y},vd=function(a,s,t,i,o,r,c){const[l,d,f]=((m,h,g,P)=>{function T(){return x={...Ps(y,Z++*-P),...b},U=ua(m,x),aa(E,U)===-P}const O=ta(h,m),b=pa(na,O),y=ta(g,m),E=g.epochNanoseconds;let Z=0;const j=Pr(O,y);let x,U;if(Math.sign(j)===-P&&Z++,T()&&(P===-1||T()))throw new RangeError(Tt);const z=ha(ma(U,E));return[O,x,z]})(s,t,i,o);var u,p;return{...r===6?(u=l,p=d,{...Y,days:Rd(u,p)}):a.dateUntil(l,d,r,c),...mi(f)}},nd=function(a,s,t,i,o,r){const[c,l,d]=((f,u,p)=>{let m=u,h=Pr(f,u);return Math.sign(h)===-p&&(m=Ps(u,-p),h+=n*p),[f,m,h]})(s,t,i);return{...a.dateUntil(c,l,o,r),...mi(d)}},Oi=function(a,s,t,i,o,r){return{...Y,...Ns(oi(ma(a,s),i,o,r),t)}},Fd=function(a,s,t){return{...Y,...Ns(ma(a,s),t)}},Rd=function(a,s){return yi(sa(a),sa(s))},yi=function(a,s){return Math.trunc((s-a)/da)},Pr=function(a,s){return Qa(s)-Qa(a)},Di=function(a,s){if(!Hs(a,s))throw new RangeError(Zr);return a},up=function(a){function s(o){return((r,c)=>({...Md(r,c),F:r.month,day:parseInt(r.day)}))(Po(t,o),i)}const t=Ur(a),i=zt(a);return{id:a,O:pp(s),B:mp(s)}},pp=function(a){return fa((s)=>{const t=sa(s);return a(t)},WeakMap)},mp=function(a){const s=a(0).year-Vp;return fa((t)=>{let i,o=As(t-s);const r=[],c=[];do o+=400*da;while((i=a(o)).year<=t);do o+=(1-i.day)*da,i.year===t&&(r.push(o),c.push(i.F)),o-=da;while((i=a(o)).year>=t);return{k:r.reverse(),C:$f(c.reverse())}})},Md=function(a,s){let t,i,o=jd(a);if(a.era){const r=Bf[s];r!==void 0&&(t=s==="islamic"?"ah":a.era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,""),t==="bc"||t==="b"?t="bce":t!=="ad"&&t!=="a"||(t="ce"),i=o,o=Id(i,r[t]||0))}return{era:t,eraYear:i,year:o}},jd=function(a){return parseInt(a.relatedYear||a.year)},Vi=function(a){const{year:s,F:t,day:i}=this.O(a),{C:o}=this.B(s);return[s,o[t]+1,i]},ot=function(a,s=1,t=1){return this.B(a).k[s-1]+(t-1)*da},Zt=function(a){const s=Nc(this,a),t=Nc(this,a-1),i=s.length;if(i>t.length){const o=Ad(this);if(o<0)return-o;for(let r=0;r<i;r++)if(s[r]!==t[r])return r+1}},xt=function(a){return yi(ot.call(this,a),ot.call(this,a+1))},Wc=function(a,s){const{k:t}=this.B(a);let i=s+1,o=t;return i>t.length&&(i=1,o=this.B(a+1).k),yi(t[s-1],o[i-1])},Lt=function(a){return this.B(a).k.length},Nc=function(a,s){return Object.keys(a.B(s).C)},Cd=function(a){return mt(L(a))},mt=function(a){if((a=a.toLowerCase())!==S&&a!==Mi&&zt(a)!==zt(Ur(a).resolvedOptions().calendar))throw new RangeError(Cp(a));return a},zt=function(a){return a==="islamicc"&&(a="islamic"),a.split("-")[0]},Zd=function(a){return this.R(a)[0]},xd=function(a){return this.R(a)[1]},Tr=function(a){const[s]=this.h(a);return yi(this.q(s),sa(a))+1},Ld=function(a){const s=Mm.exec(a);if(!s)throw new RangeError(Mp(a));return[parseInt(s[1]),Boolean(s[2])]},_t=function(a,s,t){return a+(s||t&&a>=t?1:0)},ei=function(a,s){return a-(s&&a>=s?1:0)},Id=function(a,s){return(s+a)*(Math.sign(s)||1)||0},ao=function(a){return Bf[Ed(a)]},Ad=function(a){return Gp[Ed(a)]},Ed=function(a){return zt(a.id||S)},Hd=function(a,s,t,i){const o=ka(t,i,va,[],qf);if(o.timeZone!==void 0){const r=t.dateFromFields(o),c=bs(o),l=a(o.timeZone);return{epochNanoseconds:gs(s(l),{...r,...c},o.offset!==void 0?$s(o.offset):void 0),timeZone:l}}return{...t.dateFromFields(o),...Oa}},Wd=function(a,s,t,i,o,r){const c=ka(t,o,va,_f,qf),l=a(c.timeZone),[d,f,u]=ut(r),p=t.dateFromFields(c,si(r,d)),m=bs(c,d);return B(gs(s(l),{...p,...m},c.offset!==void 0?$s(c.offset):void 0,f,u),l,i)},Nd=function(a,s,t){const i=ka(a,s,va,[],Ja),o=w(t);return W(Wa({...a.dateFromFields(i,si(t,o)),...bs(i,o)}))},br=function(a,s,t,i=[]){const o=ka(a,s,va,i);return a.dateFromFields(o,t)},Or=function(a,s,t,i){const o=ka(a,s,Ir,i);return a.yearMonthFromFields(o,t)},yr=function(a,s,t,i,o=[]){const r=ka(a,t,va,o);return s&&r.month!==void 0&&r.monthCode===void 0&&r.year===void 0&&(r.year=Ls),a.monthDayFromFields(r,i)},$d=function(a,s){const t=w(s);return wa(bs(Ra(a,to,[],1),t))},Jd=function(a){const s=Ra(a,Ar);return C(Ws({...Y,...s}))},ka=function(a,s,t,i=[],o=[]){return Ra(s,[...a.fields(t),...o].sort(),i)},Ra=function(a,s,t,i=!t){const o={};let r,c=0;for(let l of s){if(l===r)throw new RangeError(Sp(l));if(l==="constructor"||l==="__proto__")throw new RangeError(jr(l));let d=a[l];if(d!==void 0)c=1,_c[l]&&(d=_c[l](d,l)),o[l]=d;else if(t){if(t.includes(l))throw new TypeError(Mr(l));o[l]=Yf[l]}r=l}if(i&&!c)throw new TypeError(Zf(s));return o},bs=function(a,s){return et(xm({...Yf,...a}),s)},zd=function(a,s,t,i,o,r){const c=H(r),{calendar:l,timeZone:d}=t;return B(((f,u,p,m,h)=>{const g=ht(f,p,m,va,Gf,zf),[P,T,O]=ut(h,2);return gs(u,{...f.dateFromFields(g,si(h,P)),...bs(g,P)},$s(g.offset),T,O)})(a(l),s(d),i,o,c),d,l)},_d=function(a,s,t,i,o){const r=H(o);return W(((c,l,d,f)=>{const u=ht(c,l,d,va,Ja),p=w(f);return Wa({...c.dateFromFields(u,si(f,p)),...bs(u,p)})})(a(s.calendar),t,i,r))},Gd=function(a,s,t,i,o){const r=H(o);return((c,l,d,f)=>{const u=ht(c,l,d,va);return c.dateFromFields(u,f)})(a(s.calendar),t,i,r)},qd=function(a,s,t,i,o){const r=H(o);return ds(((c,l,d,f)=>{const u=ht(c,l,d,Ir);return c.yearMonthFromFields(u,f)})(a(s.calendar),t,i,r))},Ud=function(a,s,t,i,o){const r=H(o);return((c,l,d,f)=>{const u=ht(c,l,d,va);return c.monthDayFromFields(u,f)})(a(s.calendar),t,i,r)},Qd=function(a,s,t){return wa(((i,o,r)=>{const c=w(r);return bs({...pa(to,i),...Ra(o,to)},c)})(a,s,t))},Yd=function(a,s){return C((t=a,i=s,Ws({...t,...Ra(i,Ar)})));var t,i},ht=function(a,s,t,i,o=[],r=[]){const c=[...a.fields(i),...o].sort();let l=Ra(s,c,r);const d=Ra(t,c);return l=a.mergeFields(l,d),Ra(l,c,[])},Dr=function(a,s){const t=ka(a,s,Qf);return a.monthDayFromFields(t)},Sr=function(a,s,t){const i=ka(a,s,Uf);return a.yearMonthFromFields(i,t)},Bd=function(a,s,t,i,o){s=pa(t=a.fields(t),s),i=Ra(i,o=a.fields(o),[]);let r=a.mergeFields(s,i);return r=Ra(r,[...t,...o].sort(),[]),a.dateFromFields(r)},Yi=function(a,s){let{era:t,eraYear:i,year:o}=s;const r=ao(a);if(t!==void 0||i!==void 0){if(t===void 0||i===void 0)throw new TypeError(vp);if(!r)throw new RangeError(wp);const c=r[t];if(c===void 0)throw new RangeError(Fp(t));const l=Id(i,c);if(o!==void 0&&o!==l)throw new RangeError(np);o=l}else if(o===void 0)throw new TypeError(Rp(r));return o},Bi=function(a,s,t,i){let{month:o,monthCode:r}=s;if(r!==void 0){const c=((l,d,f,u)=>{const p=l.U(f),[m,h]=Ld(d);let g=_t(m,h,p);if(h){const P=Ad(l);if(P===void 0)throw new RangeError(es);if(P>0){if(g>P)throw new RangeError(es);if(p===void 0){if(u===1)throw new RangeError(es);g--}}else{if(g!==-P)throw new RangeError(es);if(p===void 0&&u===1)throw new RangeError(es)}}return g})(a,r,t,i);if(o!==void 0&&o!==c)throw new RangeError(Af);o=c,i=1}else if(o===void 0)throw new TypeError(jp);return Pa("month",o,1,a.L(t),i)},$c=function(a,s,t,i,o){return ca(s,"day",1,a.j(i,t),o)},Ki=function(a,s,t,i){let o=0;const r=[];for(let c of t)s[c]!==void 0?o=1:r.push(c);if(Object.assign(a,s),o)for(let c of i||r)delete a[c]},Kd=function(a){return q(ga(Kt(Bt(a))))},Xd=function(a,s,t,i,o=S){return B(ga(Kt(Bt(t))),s(i),a(o))},kd=function(a,s,t,i,o=0,r=0,c=0,l=0,d=0,f=0,u=S){return W(Wa(Vt(ya(V,Is(ji,[s,t,i,o,r,c,l,d,f])))),a(u))},Vd=function(a,s,t,i,o=S){return N(Ga(ps(ya(V,{isoYear:s,isoMonth:t,isoDay:i}))),a(o))},ed=function(a,s,t,i=S,o=1){const r=V(s),c=V(t),l=a(i);return ds(To(ps({isoYear:r,isoMonth:c,isoDay:V(o)})),l)},af=function(a,s,t,i=S,o=Ls){const r=V(s),c=V(t),l=a(i);return Nt(Ga(ps({isoYear:V(o),isoMonth:r,isoDay:c})),l)},sf=function(a=0,s=0,t=0,i=0,o=0,r=0){return wa(et(ya(V,Is(na,[a,s,t,i,o,r])),1))},tf=function(a=0,s=0,t=0,i=0,o=0,r=0,c=0,l=0,d=0,f=0){return C(Ws(ya(cl,Is(v,[a,s,t,i,o,r,c,l,d,f]))))},wr=function(a,s,t=S){return B(a.epochNanoseconds,s,t)},of=function(a){return q(a.epochNanoseconds)},vr=function(a,s){return W(ta(s,a))},nr=function(a,s){return N(ta(s,a))},rf=function(a,s,t){return Sr(a(s.calendar),t)},cf=function(a,s,t){return Dr(a(s.calendar),t)},Fr=function(a,s){return wa(ta(s,a))},lf=function(a,s,t,i){const o=((r,c,l,d)=>{const f=Do(d);return ua(r(c),l,f)})(a,t,s,i);return B(ga(o),t,s.calendar)},df=function(a,s,t){const i=a(s.calendar);return ds({...s,...Sr(i,t)})},ff=function(a,s,t){return Dr(a(s.calendar),t)},uf=function(a,s,t,i,o){const r=a(o.timeZone),c=o.plainTime,l=c!==void 0?s(c):Oa;return B(ua(t(r),{...i,...l}),r,i.calendar)},pf=function(a,s=Oa){return W(Wa({...a,...s}))},mf=function(a,s,t){return Sr(a(s.calendar),t)},hf=function(a,s,t){return Dr(a(s.calendar),t)},gf=function(a,s,t,i){return((o,r,c)=>Bd(o,r,Uf,Ha(c),Ot))(a(s.calendar),t,i)},Pf=function(a,s,t,i){return((o,r,c)=>Bd(o,r,Qf,Ha(c),Ri))(a(s.calendar),t,i)},Tf=function(a,s,t,i,o){const r=Ha(o),c=s(r.plainDate),l=a(r.timeZone);return B(ua(t(l),{...c,...i}),l,c.calendar)},bf=function(a,s){return W(Wa({...a,...s}))},Of=function(a){return q(ga(Zs(a,ba)))},yf=function(a){return q(ga(Zs(a,ja)))},Df=function(a){return q(ga(Kt(Bt(a),ys)))},Sf=function(a){return q(ga(Kt(Bt(a))))},wf=function(a,s,t=Oa){const i=s.timeZone,o=a(i),r={...ta(s,o),...t};return B(gs(o,r,r.offsetNanoseconds,2),i,s.calendar)},vf=function(a,s,t){const i=s.timeZone,o=a(i),r={...ta(s,o),...t},c=Mf(s.calendar,t.calendar);return B(gs(o,r,r.offsetNanoseconds,2),i,c)},nf=function(a,s=Oa){return W({...a,...s})},Ff=function(a,s){return W({...a,...s},Mf(a.calendar,s.calendar))},Si=function(a,s){return{...a,calendar:s}},Rf=function(a,s){return{...a,timeZone:s}},Mf=function(a,s){if(a===s)return a;const t=Q(a),i=Q(s);if(t===i||t===S)return s;if(i===S)return a;throw new RangeError(Zr)},hp=function(a,s){return(t)=>t===S?a:t===Mi||t===xs?Object.assign(Object.create(a),{id:t}):Object.assign(Object.create(s),Rm(t))},Os=function(a,s,t){const i=new Set(t);return(o)=>(((r,c)=>{for(let l of c)if(l in r)return 1;return 0})(o=co(i,o),a)||Object.assign(o,s),t&&(o.timeZone=ws,["full","long"].includes(o.timeStyle)&&(o.timeStyle="medium")),o)},Na=function(a,s=Rr){const[t,,,i]=a;return(o,r=Ym,...c)=>{const l=s(i&&i(...c),o,r,t),d=l.resolvedOptions();return[l,...gp(a,d,c)]}},Rr=function(a,s,t,i){if(t=i(t),a){if(t.timeZone!==void 0)throw new TypeError(Jp);t.timeZone=a}return new Va(s,t)},gp=function(a,s,t){const[,i,o]=a;return t.map((r)=>(r.calendar&&((c,l,d)=>{if((d||c!==S)&&c!==l)throw new RangeError(Zr)})(Q(r.calendar),s.calendar,o),i(r,s)))},zs=function(a){const s=gt();return Ba(s,a.getOffsetNanosecondsFor(s))},gt=function(){return Zs(Date.now(),ja)},$a=function(){return qc||(qc=new Va().resolvedOptions().timeZone)},Pp=(a,s)=>`Non-integer ${a}: ${s}`,Tp=(a,s)=>`Non-positive ${a}: ${s}`,bp=(a,s)=>`Non-finite ${a}: ${s}`,Op=(a)=>`Cannot convert bigint to ${a}`,yp=(a)=>`Invalid bigint: ${a}`,Dp="Cannot convert Symbol to string",jf="Invalid object",Cf=(a,s,t,i,o)=>o?Cf(a,o[s],o[t],o[i]):Pt(a,s)+`; must be between ${t}-${i}`,Pt=(a,s)=>`Invalid ${a}: ${s}`,Mr=(a)=>`Missing ${a}`,jr=(a)=>`Invalid field ${a}`,Sp=(a)=>`Duplicate field ${a}`,Zf=(a)=>"No valid fields: "+a.join(),xf="Invalid bag",Lf=(a,s,t)=>Pt(a,s)+"; must be "+Object.keys(t).join(),If="Cannot use valueOf",Cr="Invalid calling context",wp="Forbidden era/eraYear",vp="Mismatching era/eraYear",np="Mismatching year/eraYear",Fp=(a)=>`Invalid era: ${a}`,Rp=(a)=>"Missing year"+(a?"/era/eraYear":""),Mp=(a)=>`Invalid monthCode: ${a}`,Af="Mismatching month/monthCode",jp="Missing month/monthCode",Jc="Cannot guess year",es="Invalid leap month",Ef="Invalid protocol",Tt="Invalid protocol results",Zr="Mismatching Calendars",Cp=(a)=>`Invalid Calendar: ${a}`,Hf="Mismatching TimeZones",Zp="Forbidden ICU TimeZone",xp="Out-of-bounds offset",Lp="Out-of-bounds TimeZone gap",Ip="Invalid TimeZone offset",Ap="Ambiguous offset",wi="Out-of-bounds date",Ep="Out-of-bounds duration",Hp="Cannot mix duration signs",vi="Missing relativeTo",Wp="Cannot use large units",Np="Required smallestUnit or largestUnit",$p="smallestUnit > largestUnit",la=(a)=>`Cannot parse: ${a}`,Ea=(a)=>`Invalid substring: ${a}`,Wf=(a)=>`Cannot format ${a}`,Nf="Mismatching types for formatting",Jp="Cannot specify TimeZone",$f=D(lt,(a,s)=>s),_s=D(lt,(a,s,t)=>t),Ta=D(Et,2),so={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},bt=Object.keys(so),da=86400000,Jf=1000,ys=1000,ja=1e6,ba=1e9,ni=60000000000,Fi=3600000000000,n=86400000000000,Ma=[1,ys,ja,ba,ni,Fi,n],Ja=bt.slice(0,6),to=dt(Ja),zf=["offset"],_f=["timeZone"],Gf=Ja.concat(zf),qf=Gf.concat(_f),io=["era","eraYear"],zp=io.concat(["year"]),Ri=["year"],xr=["monthCode"],Lr=["month"].concat(xr),Ot=["day"],Ir=Lr.concat(Ri),Uf=xr.concat(Ri),va=Ot.concat(Ir),_p=Ot.concat(Lr),Qf=Ot.concat(xr),Yf=_s(Ja,0),S="iso8601",Mi="gregory",xs="japanese",Bf={[Mi]:{bce:-1,ce:0},[xs]:{bce:-1,ce:0,meiji:1867,taisho:1911,showa:1925,heisei:1988,reiwa:2018},ethioaa:{era0:0},ethiopic:{era0:0,era1:5500},coptic:{era0:-1,era1:0},roc:{beforeroc:-1,minguo:0},buddhist:{be:0},islamic:{ah:0},indian:{saka:0},persian:{ap:0}},Gp={chinese:13,dangi:13,hebrew:-6},L=D(Yt,"string"),Kf=D(Yt,"boolean"),qp=D(Yt,"number"),Xf=D(Yt,"function"),v=bt.map((a)=>a+"s"),Ar=dt(v),Up=v.slice(0,6),kf=v.slice(6),Qp=kf.slice(1),Yp=$f(v),Y=_s(v,0),Er=_s(Up,0),Hr=D(Kc,v),na=["isoNanosecond","isoMicrosecond","isoMillisecond","isoSecond","isoMinute","isoHour"],Wr=["isoDay","isoMonth","isoYear"],ji=na.concat(Wr),Nr=dt(Wr),Vf=dt(na),ef=dt(ji),Oa=_s(Vf,0),Bp=D(Kc,ji),Va=Intl.DateTimeFormat,au="en-GB",$r=1e8,Kp=$r*da,Xp=[$r,0],kp=[-$r,0],rt=275760,ct=-271821,Vp=1970,Ls=1972,Ia=12,ep=As(1868,9,8),am=fa(ap,WeakMap),Gt="smallestUnit",oo="unit",st="roundingIncrement",Xi="fractionalSecondDigits",su="relativeTo",tu={constrain:0,reject:1},sm=Object.keys(tu),tm={compatible:0,reject:1,earlier:2,later:3},im={reject:0,use:1,prefer:2,ignore:3},om={auto:0,never:1,critical:2,always:3},rm={auto:0,never:1,critical:2},cm={auto:0,never:1},lm={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},yt=D(Ro,Gt),Jr=D(Ro,"largestUnit"),dm=D(Ro,oo),iu=D(ms,"overflow",tu),ou=D(ms,"disambiguation",tm),fm=D(ms,"offset",im),zr=D(ms,"calendarName",om),um=D(ms,"timeZoneName",rm),pm=D(ms,"offset",cm),Dt=D(ms,"roundingMode",lm),Gs="PlainYearMonth",qs="PlainMonthDay",Ds="PlainDate",Ss="PlainDateTime",Ci="PlainTime",za="ZonedDateTime",Zi="Instant",xi="Duration",mm=[Math.floor,(a)=>Ct(a)?Math.floor(a):Math.round(a),Math.ceil,(a)=>Ct(a)?Math.ceil(a):Math.round(a),Math.trunc,(a)=>Ct(a)?Math.trunc(a)||0:Math.round(a),(a)=>a<0?Math.floor(a):Math.ceil(a),(a)=>Math.sign(a)*Math.round(Math.abs(a))||0,(a)=>Ct(a)?(a=Math.trunc(a)||0)+a%2:Math.round(a)],ws="UTC",It=5184000,hm=Wt(1847),gm=Wt((new Date()).getUTCFullYear()+10),Pm=/0+$/,ta=fa(cp,WeakMap),zc=4294967295,Li=fa((a)=>{const s=rr(a);return typeof s=="object"?new cu(s):new ru(s||0)});class ru{constructor(a){this.v=a}getOffsetNanosecondsFor(){return this.v}getPossibleInstantsFor(a){return[bo(a,this.v)]}l(){}}class cu{constructor(a){this.$=((s)=>{function t(d){const f=ki(d,c,l),[u,p]=Ec(f),m=o(u),h=o(p);return m===h?m:i(r(u,p),m,h,d)}function i(d,f,u,p){let m,h;for(;(p===void 0||(m=p<d[0]?f:p>=d[1]?u:void 0)===void 0)&&(h=d[1]-d[0]);){const g=d[0]+Math.floor(h/2);s(g)===u?d[1]=g:d[0]=g+1}return m}const o=fa(s),r=fa(lp);let c=hm,l=gm;return{G(d){const f=t(d-86400),u=t(d+86400),p=d-f,m=d-u;if(f===u)return[p];const h=t(p);return h===t(m)?[d-h]:f>u?[p,m]:[]},V:t,l(d,f){const u=ki(d,c,l);let[p,m]=Ec(u);const h=It*f,g=f<0?()=>m>c||(c=u,0):()=>p<l||(l=u,0);for(;g();){const P=o(p),T=o(m);if(P!==T){const O=r(p,m);i(O,P,T);const b=O[0];if((_a(b,d)||1)===f)return b}p+=h,m+=h}}}})(((s)=>(t)=>{const i=Po(s,t*Jf);return Wt(jd(i),parseInt(i.month),parseInt(i.day),parseInt(i.hour),parseInt(i.minute),parseInt(i.second))-t})(a))}getOffsetNanosecondsFor(a){return this.$.V(fl(a))*ba}getPossibleInstantsFor(a){const[s,t]=[Wt((i=a).isoYear,i.isoMonth,i.isoDay,i.isoHour,i.isoMinute,i.isoSecond),i.isoMillisecond*ja+i.isoMicrosecond*ys+i.isoNanosecond];var i;return this.$.G(s).map((o)=>ga(Cs(Zs(o,ba),t)))}l(a,s){const[t,i]=ul(a),o=this.$.l(t+(s>0||i?1:0),s);if(o!==void 0)return Zs(o,ba)}}var _r="([+\u2212-])",At="(?:[.,](\\d{1,9}))?",lu=`(?:(?:${_r}(\\d{6}))|(\\d{4}))-?(\\d{2})`,Gr="(\\d{2})(?::?(\\d{2})(?::?(\\d{2})"+At+")?)?",qr=_r+Gr,Tm=lu+"-?(\\d{2})(?:[T ]"+Gr+"(Z|"+qr+")?)?",du="\\[(!?)([^\\]]*)\\]",Ii=`((?:${du}){0,9})`,bm=Js(lu+Ii),Om=Js("(?:--)?(\\d{2})-?(\\d{2})"+Ii),ym=Js(Tm+Ii),Dm=Js("T?"+Gr+"(?:"+qr+")?"+Ii),Sm=Js(qr),wm=new RegExp(du,"g"),vm=Js(`${_r}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${At}H)?(?:(\\d+)${At}M)?(?:(\\d+)${At}S)?)?`),nm=fa((a)=>new Va(au,{timeZone:a,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),Fm=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,Rm=fa(up),Ur=fa((a)=>new Va(au,{calendar:a,timeZone:ws,era:"short",year:"numeric",month:"short",day:"numeric"})),Mm=/^M(\d{2})(L?)$/,jm={era:Ht,eraYear:V,year:V,month:xc,monthCode:Ht,day:xc},Cm=_s(Ja,V),Zm=_s(v,cl),_c=Object.assign({},jm,Cm,Zm,{offset:Ht}),xm=D(eu,Ja,na),Gc={dateAdd(a,s,t){const i=w(t);let o,{years:r,months:c,weeks:l,days:d}=s;if(d+=_(s,5)[0],r||c)o=((f,u,p,m,h)=>{let[g,P,T]=f.h(u);if(p){const[O,b]=f.I(g,P);g+=p,P=_t(O,b,f.U(g)),P=Pa("month",P,1,f.L(g),h)}return m&&([g,P]=f._(g,P,m)),T=Pa("day",T,1,f.j(g,P),h),f.q(g,P,T)})(this,a,r,c,i);else{if(!l&&!d)return a;o=sa(a)}return o+=(7*l+d)*da,Ga(kt(o))},dateUntil(a,s,t){if(t<=7){let d=0,f=Rd({...a,...Oa},{...s,...Oa});return t===7&&([d,f]=Ua(f,7)),{...Y,weeks:d,days:f}}const i=this.h(a),o=this.h(s);let[r,c,l]=((d,f,u,p,m,h,g)=>{let P=m-f,T=h-u,O=g-p;if(P||T){const b=Math.sign(P||T);let y=d.j(m,h),E=0;if(Math.sign(O)===-b){const Z=y;[m,h]=d._(m,h,-b),P=m-f,T=h-u,y=d.j(m,h),E=b<0?-Z:y}if(O=g-Math.min(p,y)+E,P){const[Z,j]=d.I(f,u),[x,U]=d.I(m,h);if(T=x-Z||Number(U)-Number(j),Math.sign(T)===-b){const z=b<0&&-d.L(m);P=(m-=b)-f,T=h-_t(Z,j,d.U(m))+(z||d.L(m))}}}return[P,T,O]})(this,...i,...o);return t===8&&(c+=this.J(r,i[0]),r=0),{...Y,years:r,months:c,days:l}},dateFromFields(a,s){const t=w(s),i=Yi(this,a),o=Bi(this,a,i,t),r=$c(this,a,o,i,t);return N(Ga(this.P(i,o,r)),this.id||S)},yearMonthFromFields(a,s){const t=w(s),i=Yi(this,a),o=Bi(this,a,i,t);return ds(To(this.P(i,o,1)),this.id||S)},monthDayFromFields(a,s){const t=w(s),i=!this.id,{monthCode:o,year:r,month:c}=a;let l,d,f,u,p;if(o!==void 0){[l,d]=Ld(o),p=Uc(a,"day");const m=this.N(l,d,p);if(!m)throw new RangeError(Jc);if([f,u]=m,c!==void 0&&c!==u)throw new RangeError(Af);i&&(u=Pa("month",u,1,Ia,1),p=Pa("day",p,1,Oo(r!==void 0?r:f,u),t))}else{f=r===void 0&&i?Ls:Yi(this,a),u=Bi(this,a,f,t),p=$c(this,a,u,f,t);const m=this.U(f);d=u===m,l=ei(u,m);const h=this.N(l,d,p);if(!h)throw new RangeError(Jc);[f,u]=h}return Nt(Ga(this.P(f,u,p)),this.id||S)},fields(a){return ao(this)&&a.includes("year")?[...a,...io]:a},mergeFields(a,s){const t=Object.assign(Object.create(null),a);return Ki(t,s,Lr),ao(this)&&(Ki(t,s,zp),this.id===xs&&Ki(t,s,_p,io)),t},inLeapYear(a){const[s]=this.h(a);return this.K(s)},monthsInYear(a){const[s]=this.h(a);return this.L(s)},daysInMonth(a){const[s,t]=this.h(a);return this.j(s,t)},daysInYear(a){const[s]=this.h(a);return this.X(s)},dayOfYear:Tr,era(a){return this.ee(a)[0]},eraYear(a){return this.ee(a)[1]},monthCode(a){const[s,t]=this.h(a),[i,o]=this.I(s,t);return((r,c)=>"M"+Ta(r)+(c?"L":""))(i,o)},dayOfWeek:Pl,daysInWeek(){return 7}},Lm={dayOfYear:Tr,h:ml,q:As},Im=Object.assign({},Lm,{weekOfYear:Zd,yearOfWeek:xd,R(a){function s(h){return(7-h<i?7:0)-h}function t(h){const g=gl(m+h),P=h||1,T=s(at(d+g*P,7));return u=(g+(T-f)*P)/7}const i=this.id?1:4,o=Pl(a),r=this.dayOfYear(a),c=at(o-1,7),l=r-1,d=at(c-l,7),f=s(d);let u,p=Math.floor((l-f)/7)+1,m=a.isoYear;return p?p>t(0)&&(p=1,m++):(p=t(-1),m--),[p,m,u]}}),Am={dayOfYear:Tr,h:Vi,q:ot,weekOfYear:Zd,yearOfWeek:xd,R(){return[]}},Us=hp(Object.assign({},Gc,Im,{h:ml,ee(a){return this.id===Mi?Tl(a):this.id===xs?am(a):[]},I:(a,s)=>[s,0],N(a,s){if(!s)return[Ls,a]},K:yo,U(){},L:hl,J:(a)=>a*Ia,j:Oo,X:gl,P:(a,s,t)=>({isoYear:a,isoMonth:s,isoDay:t}),q:As,_:(a,s,t)=>(a+=Ut(t,Ia),(s+=fo(t,Ia))<1?(a--,s+=Ia):s>Ia&&(a++,s-=Ia),[a,s]),year(a){return a.isoYear},month(a){return a.isoMonth},day:(a)=>a.isoDay}),Object.assign({},Gc,Am,{h:Vi,ee(a){const s=this.O(a);return[s.era,s.eraYear]},I(a,s){const t=Zt.call(this,a);return[ei(s,t),t===s]},N(a,s,t){let[i,o,r]=Vi.call(this,{isoYear:Ls,isoMonth:Ia,isoDay:31});const c=Zt.call(this,i),l=o===c;(_a(a,ei(o,c))||_a(Number(s),Number(l))||_a(t,r))===1&&i--;for(let d=0;d<100;d++){const f=i-d,u=Zt.call(this,f),p=_t(a,s,u);if(s===(p===u)&&t<=Wc.call(this,f,p))return[f,p]}},K(a){const s=xt.call(this,a);return s>xt.call(this,a-1)&&s>xt.call(this,a+1)},U:Zt,L:Lt,J(a,s){const t=s+a,i=Math.sign(a),o=i<0?-1:0;let r=0;for(let c=s;c!==t;c+=i)r+=Lt.call(this,c+o);return r},j:Wc,X:xt,P(a,s,t){return kt(ot.call(this,a,s,t))},q:ot,_(a,s,t){if(t){if(s+=t,!Number.isSafeInteger(s))throw new RangeError(wi);if(t<0)for(;s<1;)s+=Lt.call(this,--a);else{let i;for(;s>(i=Lt.call(this,a));)s-=i,a++}}return[a,s]},year(a){return this.O(a).year},month(a){const{year:s,F:t}=this.O(a),{C:i}=this.B(s);return i[t]+1},day(a){return this.O(a).day}})),qa="numeric",Qs=["timeZoneName"],fu={month:qa,day:qa},Qr={year:qa,month:qa},Yr=Object.assign({},Qr,{day:qa}),Br={hour:qa,minute:qa,second:qa},Kr=Object.assign({},Yr,Br),Em=Object.assign({},Kr,{timeZoneName:"short"}),Hm=Object.keys(Qr),Wm=Object.keys(fu),Nm=Object.keys(Yr),$m=Object.keys(Br),Xr=["dateStyle"],Jm=Hm.concat(Xr),zm=Wm.concat(Xr),kr=Nm.concat(Xr,["weekday"]),St=$m.concat(["dayPeriod","timeStyle"]),Vr=kr.concat(St),_m=Vr.concat(Qs),Gm=Qs.concat(St),qm=Qs.concat(kr),Um=Qs.concat(["day","weekday"],St),Qm=Qs.concat(["year","weekday"],St),Ym={},er=[Os(Vr,Kr),ti],uu=[Os(_m,Em),ti,0,(a,s)=>{const t=Q(a.timeZone);if(s&&Q(s.timeZone)!==t)throw new RangeError(Hf);return t}],ac=[Os(Vr,Kr,Qs),sa],sc=[Os(kr,Yr,Gm),sa],tc=[Os(St,Br,qm),(a)=>Qa(a)/ja],ic=[Os(Jm,Qr,Um),sa,1],oc=[Os(zm,fu,Qm),sa,1],qc;var Vm={Instant:er,PlainDateTime:ac,PlainDate:sc,PlainTime:tc,PlainYearMonth:ic,PlainMonthDay:oc},em=Na(er),ah=Na(uu),sh=Na(ac),th=Na(sc),ih=Na(tc),oh=Na(ic),rh=Na(oc),fc={era:al,eraYear:uo,year:ft,month:Da,daysInMonth:Da,daysInYear:Da,inLeapYear:Kf,monthsInYear:Da},Wi={monthCode:L},uc={day:Da},Su={dayOfWeek:Da,dayOfYear:Da,weekOfYear:sl,yearOfWeek:uo,daysInWeek:Da},wu=Object.assign({},fc,Wi,uc,Su),Hi=new WeakMap,k=Hi.get.bind(Hi),gu=Hi.set.bind(Hi),ch={...Ai(fc,[Gs]),...Ai(Su,[]),...Ai(Wi,[Gs,qs]),...Ai(uc,[qs])},pc=lc(wu),lh=lc({...fc,...Wi}),dh=lc({...Wi,...uc}),Ft={calendarId:(a)=>Q(a.calendar)},fh=ya((a,s)=>function(t){const{i}=this;return a(i[s](A(N(t,i))))},wu),uh=lt((a)=>(s)=>s[a],v.concat("sign")),mc=lt((a,s)=>(t)=>t[na[s]],Ja),vu={epochSeconds:vl,epochMilliseconds:ti,epochMicroseconds:nl,epochNanoseconds:Fl},Rt=D(co,new Set(["branding"])),[ph,Ks,mh]=xa(qs,D(af,X),{...Ft,...dh},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return Ks(Ud(Mh,a,this,Xs(s),t))},equals:(a,s)=>Dd(a,pu(s)),toPlainDate(a,s){return A(Pf(Mt,a,this,s))},toLocaleString(a,s,t){const[i,o]=rh(s,t,a);return i.format(o)},toString:Eo,toJSON:(a)=>Eo(a),valueOf:is},{from:(a,s)=>Ks(pu(a,s))}),nu={getOffsetNanosecondsFor:Ou,getPossibleInstantsFor(a,s,t){const i=[...s.call(a,K(W(t,S)))].map((r)=>gh(r).epochNanoseconds),o=i.length;return o>1&&(i.sort(aa),zo(ha(ma(i[0],i[o-1])))),i}},cc={getOffsetNanosecondsFor:Ou},[hh,oa,gh]=xa(Zi,Kd,vu,{add:(a,s)=>oa(_o(0,a,I(s))),subtract:(a,s)=>oa(_o(1,a,I(s))),until:(a,s,t)=>R(fr(0,a,Ca(s),t)),since:(a,s,t)=>R(fr(1,a,Ca(s),t)),round:(a,s)=>oa(jl(a,s)),equals:(a,s)=>Pd(a,Ca(s)),toZonedDateTime(a,s){const t=Ha(s);return $(wr(a,M(t.timeZone),X(t.calendar)))},toZonedDateTimeISO:(a,s)=>$(wr(a,M(s))),toLocaleString(a,s,t){const[i,o]=em(s,t,a);return i.format(o)},toString:(a,s)=>Zo(M,J,a,s),toJSON:(a)=>Zo(M,J,a),valueOf:is},{from:(a)=>oa(Ca(a)),fromEpochSeconds:(a)=>oa(Of(a)),fromEpochMilliseconds:(a)=>oa(yf(a)),fromEpochMicroseconds:(a)=>oa(Df(a)),fromEpochNanoseconds:(a)=>oa(Sf(a)),compare:(a,s)=>cr(Ca(a),Ca(s))}),[Ni,Jh]=xa("TimeZone",(a)=>{const s=hd(a);return{branding:"TimeZone",id:s,o:Li(s)}},{id:(a)=>a.id},{getPossibleInstantsFor:({o:a},s)=>a.getPossibleInstantsFor(as(s)).map((t)=>oa(q(t))),getOffsetNanosecondsFor:({o:a},s)=>a.getOffsetNanosecondsFor(Ca(s).epochNanoseconds),getOffsetStringFor(a,s){const t=Ca(s).epochNanoseconds,i=Ei(this,cc).getOffsetNanosecondsFor(t);return hs(i)},getPlainDateTimeFor(a,s,t=S){const i=Ca(s).epochNanoseconds,o=Ei(this,cc).getOffsetNanosecondsFor(i);return K(W(Ba(i,o),X(t)))},getInstantFor(a,s,t){const i=as(s),o=Do(t),r=Ei(this);return oa(q(ua(r,i,o)))},getNextTransition:({o:a},s)=>mu(1,a,s),getPreviousTransition:({o:a},s)=>mu(-1,a,s),equals(a,s){return!!bi(this,M(s))},toString:(a)=>a.id,toJSON:(a)=>a.id},{from(a){const s=M(a);return typeof s=="string"?new Ni(s):s}}),Ph=bu(Object.keys(nu)),[Th,ss]=xa(Ci,sf,mc,{getISOFields:Rt,with(a,s,t){return ss(Qd(this,Xs(s),t))},add:(a,s)=>ss(Yo(0,a,I(s))),subtract:(a,s)=>ss(Yo(1,a,I(s))),until:(a,s,t)=>R(gr(0,a,ea(s),t)),since:(a,s,t)=>R(gr(1,a,ea(s),t)),round:(a,s)=>ss(xl(a,s)),equals:(a,s)=>Sd(a,ea(s)),toZonedDateTime:(a,s)=>$(Tf(M,ra,F,a,s)),toPlainDateTime:(a,s)=>K(bf(a,ra(s))),toLocaleString(a,s,t){const[i,o]=ih(s,t,a);return i.format(o)},toString:Ho,toJSON:(a)=>Ho(a),valueOf:is},{from:(a,s)=>ss(ea(a,s)),compare:(a,s)=>Ti(ea(a),ea(s))}),[bh,ts,Oh]=xa(Gs,D(ed,X),{...Ft,...lh},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return ts(qd(Rh,a,this,Xs(s),t))},add:(a,s,t)=>ts(Qo(Pu,0,a,I(s),t)),subtract:(a,s,t)=>ts(Qo(Pu,1,a,I(s),t)),until:(a,s,t)=>R(hr(Tu,0,a,Ys(s),t)),since:(a,s,t)=>R(hr(Tu,1,a,Ys(s),t)),equals:(a,s)=>yd(a,Ys(s)),toPlainDate(a,s){return A(gf(Mt,a,this,s))},toLocaleString(a,s,t){const[i,o]=oh(s,t,a);return i.format(o)},toString:Ao,toJSON:(a)=>Ao(a),valueOf:is},{from:(a,s)=>ts(Ys(a,s)),compare:(a,s)=>Ts(Ys(a),Ys(s))}),[yh,K]=xa(Ss,D(kd,X),{...Ft,...pc,...mc},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return K(_d(Mt,a,this,Xs(s),t))},withCalendar:(a,s)=>K(Si(a,X(s))),withPlainDate:(a,s)=>K(Ff(a,ra(s))),withPlainTime:(a,s)=>K(nf(a,dc(s))),add:(a,s,t)=>K(qo(vs,0,a,I(s),t)),subtract:(a,s,t)=>K(qo(vs,1,a,I(s),t)),until:(a,s,t)=>R(pr(Za,0,a,as(s),t)),since:(a,s,t)=>R(pr(Za,1,a,as(s),t)),round:(a,s)=>K(Zl(a,s)),equals:(a,s)=>bd(a,as(s)),toZonedDateTime:(a,s,t)=>$(lf(F,a,M(s),t)),toPlainDate:(a)=>A(N(a)),toPlainTime:(a)=>ss(wa(a)),toPlainYearMonth(a){return ts(df($i,a,this))},toPlainMonthDay(a){return Ks(ff(zi,a,this))},toLocaleString(a,s,t){const[i,o]=sh(s,t,a);return i.format(o)},toString:Lo,toJSON:(a)=>Lo(a),valueOf:is},{from:(a,s)=>K(as(a,s)),compare:(a,s)=>dr(as(a),as(s))}),[Dh,A,Fu]=xa(Ds,D(Vd,X),{...Ft,...pc},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return A(Gd(Mt,a,this,Xs(s),t))},withCalendar:(a,s)=>A(Si(a,X(s))),add:(a,s,t)=>A(Uo(vs,0,a,I(s),t)),subtract:(a,s,t)=>A(Uo(vs,1,a,I(s),t)),until:(a,s,t)=>R(mr(Za,0,a,ra(s),t)),since:(a,s,t)=>R(mr(Za,1,a,ra(s),t)),equals:(a,s)=>Od(a,ra(s)),toZonedDateTime(a,s){const t=!G(s)||s instanceof Ni?{timeZone:s}:s;return $(uf(M,ea,F,a,t))},toPlainDateTime:(a,s)=>K(pf(a,dc(s))),toPlainYearMonth(a){return ts(mf($i,a,this))},toPlainMonthDay(a){return Ks(hf(zi,a,this))},toLocaleString(a,s,t){const[i,o]=th(s,t,a);return i.format(o)},toString:Io,toJSON:(a)=>Io(a),valueOf:is},{from:(a,s)=>A(ra(a,s)),compare:(a,s)=>Ts(ra(a),ra(s))}),hc={fields(a,s,t){return[...s.call(a,t)]}},Ru=Object.assign({dateFromFields(a,s,t,i){return Fu(s.call(a,Object.assign(Object.create(null),t),i))}},hc),Mu=Object.assign({yearMonthFromFields(a,s,t,i){return Oh(s.call(a,Object.assign(Object.create(null),t),i))}},hc),ju=Object.assign({monthDayFromFields(a,s,t,i){return mh(s.call(a,Object.assign(Object.create(null),t),i))}},hc),gc={mergeFields(a,s,t,i){return Ha(s.call(a,Object.assign(Object.create(null),t),Object.assign(Object.create(null),i)))}},Sh=Object.assign({},Ru,gc),wh=Object.assign({},Mu,gc),vh=Object.assign({},ju,gc),Pc={dateAdd(a,s,t,i,o){return Fu(s.call(a,A(N(t,a)),R(C(i)),o))}},Cu=Object.assign({},Pc,{dateUntil(a,s,t,i,o,r){return Ch(s.call(a,A(N(t,a)),A(N(i,a)),Object.assign(Object.create(null),r,{largestUnit:bt[o]})))}}),nh=Object.assign({},Pc,{day:yu}),Fh=Object.assign({},Cu,{day:yu}),$i=La(Mu),Ji=La(Ru),zi=La(ju),Rh=La(wh),Mt=La(Sh),Mh=La(vh),vs=La(Pc),Za=La(Cu),Pu=La(nh),Tu=La(Fh),[jh,R,Ch]=xa(xi,tf,{...uh,blank:Bl},{with:(a,s)=>R(Yd(a,s)),negated:(a)=>R(pi(a)),abs:(a)=>R(Yl(a)),add:(a,s,t)=>R(Vo(wt,Za,F,0,a,I(s),t)),subtract:(a,s,t)=>R(Vo(wt,Za,F,1,a,I(s),t)),round:(a,s)=>R(Ql(wt,Za,F,a,s)),total:(a,s)=>Ml(wt,Za,F,a,s),toLocaleString(a,s,t){return Intl.DurationFormat?new Intl.DurationFormat(s,t).format(this):ci(a)},toString:ci,toJSON:(a)=>ci(a),valueOf:is},{from:(a)=>R(I(a)),compare:(a,s,t)=>gd(wt,vs,F,I(a),I(s),t)}),Zu={toString:(a)=>a.id,toJSON:(a)=>a.id,...ch,dateAdd:({id:a,o:s},t,i,o)=>A(N(s.dateAdd(ra(t),I(i),o),a)),dateUntil:({o:a},s,t,i)=>R(C(a.dateUntil(ra(s),ra(t),Ol(i)))),dateFromFields:({id:a,o:s},t,i)=>A(br(s,t,i,ec(a))),yearMonthFromFields:({id:a,o:s},t,i)=>ts(Or(s,t,i,kc(a))),monthDayFromFields:({id:a,o:s},t,i)=>Ks(yr(s,0,t,i,Vc(a))),fields({o:a},s){const t=new Set(va),i=[];for(let o of s){if(L(o),!t.has(o))throw new RangeError(jr(o));t.delete(o),i.push(o)}return a.fields(i)},mergeFields:({o:a},s,t)=>a.mergeFields(lo(po(s)),lo(po(t)))},[Tc]=xa("Calendar",(a)=>{const s=Cd(a);return{branding:"Calendar",id:s,o:Us(s)}},{id:(a)=>a.id},Zu,{from(a){const s=X(a);return typeof s=="string"?new Tc(s):s}}),Zh=bu(Object.keys(Zu).slice(4)),[xh,$]=xa(za,D(Xd,X,M),{...vu,...Ft,...hu(pc),...hu(mc),offset:(a)=>hs(rc(a).offsetNanoseconds),offsetNanoseconds:(a)=>rc(a).offsetNanoseconds,timeZoneId:(a)=>Q(a.timeZone),hoursInDay:(a)=>Ll(F,a)},{getISOFields:(a)=>ql(J,a),getCalendar:vt,getTimeZone:({timeZone:a})=>typeof a=="string"?new Ni(a):a,with(a,s,t){return $(zd(Mt,F,a,this,Xs(s),t))},withCalendar:(a,s)=>$(Si(a,X(s))),withTimeZone:(a,s)=>$(Rf(a,M(s))),withPlainDate:(a,s)=>$(vf(F,a,ra(s))),withPlainTime:(a,s)=>$(wf(F,a,dc(s))),add:(a,s,t)=>$(Go(vs,F,0,a,I(s),t)),subtract:(a,s,t)=>$(Go(vs,F,1,a,I(s),t)),until:(a,s,t)=>R(C(ur(Za,F,0,a,Bs(s),t))),since:(a,s,t)=>R(C(ur(Za,F,1,a,Bs(s),t))),round:(a,s)=>$(Cl(F,a,s)),startOfDay:(a)=>$(Il(F,a)),equals:(a,s)=>Td(a,Bs(s)),toInstant:(a)=>oa(of(a)),toPlainDateTime:(a)=>K(vr(J,a)),toPlainDate:(a)=>A(nr(J,a)),toPlainTime:(a)=>ss(Fr(J,a)),toPlainYearMonth(a){return ts(rf($i,a,this))},toPlainMonthDay(a){return Ks(cf(zi,a,this))},toLocaleString(a,s,t={}){const[i,o]=ah(s,t,a);return i.format(o)},toString:(a,s)=>xo(J,a,s),toJSON:(a)=>xo(J,a),valueOf:is},{from:(a,s)=>$(Bs(a,s)),compare:(a,s)=>lr(Bs(a),Bs(s))}),Lh=Object.defineProperties({},{...qt("Temporal.Now"),...us({timeZoneId:()=>$a(),instant:()=>oa(q(gt())),zonedDateTime:(a,s=$a())=>$(B(gt(),M(s),X(a))),zonedDateTimeISO:(a=$a())=>$(B(gt(),M(a),S)),plainDateTime:(a,s=$a())=>K(W(zs(J(M(s))),X(a))),plainDateTimeISO:(a=$a())=>K(W(zs(J(M(a))),S)),plainDate:(a,s=$a())=>A(N(zs(J(M(s))),X(a))),plainDateISO:(a=$a())=>A(N(zs(J(M(a))),S)),plainTimeISO:(a=$a())=>ss(wa(zs(J(M(a)))))})}),ns=Object.defineProperties({},{...qt("Temporal"),...us({PlainYearMonth:bh,PlainMonthDay:ph,PlainDate:Dh,PlainTime:Th,PlainDateTime:yh,ZonedDateTime:xh,Instant:hh,Calendar:Tc,TimeZone:Ni,Duration:jh,Now:Lh})}),Ih=Bm(),bc=new WeakMap,Ah=Object.defineProperties(Object.create(Intl),us({DateTimeFormat:Ih}));class Fs extends Error{constructor(){super("Adapter not found");this.name="AdapterNotFound"}}class Oc{createSession(){throw new Fs}deleteSession(){throw new Fs}findSession(){throw new Fs}findUserByEmailAddress(){throw new Fs}updateSession(){throw new Fs}createUser(){throw new Fs}}class Au extends Fa{constructor(){super(...arguments)}schema={email:{required:"Email is required",string:"Invalid email",email:"Invalid email"},password:{required:"Password is required"}}}class Eu extends Fa{constructor(){super(...arguments)}schema={name:{string:"Invalid name",required:"Name is required","min:2":"Name must be at least 3 characters"},email:{string:"Invalid email",required:"Email is required",email:"Invalid email"},password:{required:"Password is required","min:8":"Password must be at least 8 characters"}}}class Hu extends Fa{constructor(){super(...arguments)}schema={email:{required:"Email is required",email:"Invalid email"}}}class Wu extends Fa{constructor(){super(...arguments)}schema={password:{required:"Password is required",password:"Invalid password"}}}class rs extends xu{constructor(){super(...arguments)}provider=jt.getStore().authenticationServiceContainer.provider;async me(){const a=await _i.user();if(!a)throw new Iu;return a}async signIn(a=new Au){const s=await a.input.call(a),{email:t,password:i}=s.toJSON(),o=await this.provider.adapter.findUserByEmailAddress(t);if(!o)throw new os({invalid_credentials:["Invalid credentials"]});if(!await this.provider.verifyPassword(i,o.password))throw new os({invalid_credentials:["Invalid credentials"]});const c=a.headers.get("User-Agent"),l=new Bun.CryptoHasher("sha256");l.update(`${o.email}${c}`);const d=l.digest("hex");let f=await this.provider.adapter.findSession({token:d,userAgent:"local"});if(!f)f=await this.provider.adapter.createSession({token:d,userId:o.id,userAgent:"local",expiresAt:new Date(ns.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString()),absoluteExpiresAt:new Date(ns.Now.instant().add({hours:this.provider.sessionAbsoluteExpiresInHours}).toString())});else f=await this.provider.adapter.updateSession({token:d,expiresAt:new Date(ns.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString())});return a.ctx.setCookie("access_token",f.token,{expires:f.expiresAt}),await this.provider.onSignIn(o),o}async signUp(a=new Eu){const s=await a.input(),{email:t,password:i,name:o}=s.toJSON();if(await this.provider.adapter.findUserByEmailAddress(t))throw new os({email:["Email address already exists"]});const c=await this.provider.hashPassword(i),l=await this.provider.adapter.createUser({email:t,name:o,password:c});return await this.provider.onSignUp(l),l}async signOut(a=new Fa){const s=a.cookies.get("access_token"),t=await _i.user();return await this.provider.adapter.deleteSession({token:s}),a.ctx.setCookie("access_token","",{expires:new Date(0)}),await this.provider.onSignOut(t),{}}async forgotPassword(a=new Hu){const s=await a.input(),{email:t}=s.toJSON(),i=await this.provider.adapter.findUserByEmailAddress(t);if(!i)return{};const o=await this.provider.generateForgotPasswordToken(i);return await this.provider.adapter.createPasswordResetToken({user:i,token:o}),await this.provider.onForgotPassword(i,o),{}}async resetPassword(a=new Wu){const s=await a.input(),{password:t,token:i}=s.toJSON(),o=await this.provider.adapter.findPasswordResetToken({token:i});if(!o)throw new os({token:["Invalid token"]});if(ns.Instant.from(o.createdAt.toISOString()).add({hours:24}).until(ns.Now.instant()).sign>=0)throw new os({token:["Token expired"]});await this.provider.adapter.deletePasswordResetToken({token:i});const c=await this.provider.adapter.findUserByEmailAddress(o.user.email);if(!c)throw new os({email:["User not found"]});const l=await this.provider.hashPassword(t);return await this.provider.adapter.updateUserPassword({id:c.id,password:l}),await this.provider.adapter.deleteAllUserSessions(c.id),await this.provider.onResetPassword(c),{}}async changePassword(a=new Fa){const s=await _i.user(),t=await a.input(),{oldPassword:i,newPassword:o}=t.toJSON(),{password:r}=await this.provider.adapter.findUserByEmailAddress(s.email);if(!await this.provider.verifyPassword(i,r))throw new os({oldPassword:["Incorrect password"]});const l=await this.provider.hashPassword(o);return await this.provider.adapter.updateUserPassword({id:s.id,password:l}),await this.provider.adapter.deleteAllUserSessions(s.id),{}}}class Nu extends Gi{constructor(){super(...arguments)}routes={"/sign-in":this.post(rs,"signIn"),"/sign-up":this.post(rs,"signUp"),"/sign-out":this.post(rs,"signOut"),"/forgot-password":this.post(rs,"forgotPassword"),"/reset-password":this.post(rs,"resetPassword"),"/change-password":this.post(rs,"changePassword"),"/me":this.get(rs,"me")}}class $u extends Lu{constructor(){super(...arguments)}routes={"/sign-in":this.view("auth/SignIn"),"/sign-up":this.view("auth/SignUp"),"/reset-password":this.view("auth/ResetPassword"),"/forgot-password":this.view("auth/ForgotPassword")}}class qi{basePath="/auth";routers={api:Nu,view:$u};sessionExpiresInHours=24;sessionAbsoluteExpiresInHours=672;adapter=new Oc;async verifyPassword(a,s){return await Bun.password.verify(a,s)}async hashPassword(a){return await Bun.password.hash(a)}async generateForgotPasswordToken(a){const s=new Bun.CryptoHasher("sha256");return s.update(`${a.email}${Date.now()}`),s.digest("hex")}extendSession(a){return{}}onSignUp(a){}onSignIn(a){}onSignOut(a){}onForgotPassword(a,s){}onResetPassword(a){}}class yc{a;constructor(a){this.provider=a}async getSession(a,s){const t=await this.provider.adapter.findSession({token:a,userAgent:s});let i=null;if(t?.user)i=await this.provider.extendSession(t.user);return t.user.extension=i,t}}class Ju extends Gi{constructor(){super(...arguments)}routes={"/translations":this.get(async(a=new Fa)=>{const{scope:s,locale:t}=a.search.toJSON(),i=t??jt.getStore().i18nServiceContainer.detectLocale(a),o=jt.getStore().i18nServiceContainer.getPageTranslations(i,s);return a.ctx.setHeaders("Cache-Control",a.ctx.user?"private, max-age=1200, must-revalidate":"public, max-age=864000, must-revalidate"),a.ctx.setCookie("i18n-locale",i,{expires:new Date(Date.now()+31536000000)}),{[i]:o}})}}class Dc{a;constructor(a){this.service=a}isEnabled=!1;translations=new Map;supportedLocales=[];routers={api:Ju};boot(){const a=new Map;for(let[t,i]of Object.entries(this.service.dictionary))for(let[o,r]of Object.entries(i))for(let[c,l]of Object.entries(r)){const d=c==="default"?this.service.defaultLocale:c;if(!a.has(`${d}.${t}`))a.set(`${d}.${t}`,new Map);a.get(`${d}.${t}`)?.set(o,l),this.isEnabled=!0}let s=new Set;for(let[t,i]of a.entries())this.translations.set(t,Object.fromEntries(i.entries())),s.add(t.split(".")[0]);this.supportedLocales=Array.from(s)}detectLocale(a){const s=this.service.detectLocale(a);if(this.supportedLocales.includes(s))return s;const i=a.cookies.get("i18n-locale")??(a.headers.get("accept-language")||"en-US"),[o]=i.split(",");if(this.supportedLocales.includes(o))return o;const r=this.service.defaultLocale??this.supportedLocales[0];if(r)return r;return"en-US"}getPageTranslations(a,s){if(!s)return{};const t=this.translations.get(`${a}.view:${s}`)??{},i={[`view:${s}`]:t};for(let[o]of this.translations.entries()){const r=o.split(".")[1];if(!r.startsWith("layout:"))continue;const c=r.split(":")[1];if(s?.startsWith(c))i[r]=this.translations.get(`${a}.${r}`)??{}}return i}}class Sc{a;constructor(a){this.service=a}}class vc{a;constructor(a){this.service=a}getRouteHandlerAndParams(a){const t=new URL(a.url).pathname.replace("/api","");let i={},o;for(let[r]of Object.entries(this.service.flatRoutes))try{const c=new URLPattern({pathname:r});if(c.test({pathname:t})){o=r,i=c.exec({pathname:t})?.pathname.groups;break}}catch(c){console.error(c)}return{params:i,path:o}}async runRouteMiddleware(a){const s=Rs.getStore(),i=this.service.flatRoutes[a][s.req.rawRequest.method].middleware;try{await Ui.getContext().middlewareServiceContainer.runMiddleware(i,a)}catch(o){if(o.kind===wc){if(s.req.rawRequest.url.includes("/api")){const{status:r=400,data:c,headers:l}=o.payload.api;return new Response(JSON.stringify(c),{status:r,headers:{"Content-Type":"application/json",...l}})}}else throw console.error(o),o}}async getRouteData(a){const s=this.service.flatRoutes[a],t=Rs.getStore(),i=s[t.req.rawRequest.method].exec??(()=>Promise.resolve({}));let o={};try{o=await i()}catch(r){if(r.kind===wc){const{status:c=400,data:l,headers:d}=r.payload.api;return new Response(JSON.stringify(l),{status:c,headers:{"Content-Type":"application/json",...d}})}else throw console.error(r),r}return o}async handleApiRequest(a){const{params:s,path:t}=this.getRouteHandlerAndParams(a),i=this.service.flatRoutes[t];if(!i||!i[a.method])return new Response(JSON.stringify({error:{message:"Not found"}}),{status:404});const o=new Fa(a,s);return await Rs.run(o,async()=>{const r=await this.runRouteMiddleware(t);if(r instanceof Response)return r;const c=await this.getRouteData(t);if(c instanceof Response)return c;const l=Rs.getStore(),d=l.headers;if(d.append("Content-Type","application/json"),!d.get("Cache-Control"))if(l.user)d.set("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");else d.set("Cache-Control","public, no-cache, no-store, max-age=0, must-revalidate");return l.cookies.forEach((f)=>d.append("Set-Cookie",f.toString())),l.destroy(),new Response(JSON.stringify(c),{headers:d})})}}var Eh=function(a){return Qi(a)};function nc(a){const s={};for(let[t,i]of Object.entries(a))if("run"in i){const o=i;if(!s[t])s[t]={};const{method:r,middlewares:c}=o,l=o.run.bind(o);s[t][r]={exec:l,middleware:c}}else if(Eh(i)){const o=new i,r=nc(o.routes);for(let[c,l]of Object.entries(r)){const d=c==="/"?"":c,f=t==="/"?"":t,u=`${f}${d}`===""?"/":`${f}${d}`;if(!s[u])s[u]={};for(let[p,m]of Object.entries(l))s[u][p]={exec:m.exec,middleware:[o.middleware,...o.middlewares,...m.middleware]}}}else for(let o of Object.values(i)){if(!s[t])s[t]={};const{method:r,middlewares:c}=o,l=o.run.bind(o);s[t][r]={exec:l,middleware:c}}return Object.fromEntries(Object.entries(s).sort(([t],[i])=>{const o=t.split("/").length+t.split(":").length,r=i.split("/").length+i.split(":").length;return o-r}))}class Fc extends zu{constructor(){super(...arguments)}flatRoutes={};boot(a){this.flatRoutes=nc(a)}}var Hh=function(a){const s=new Map;for(let t of a)if(typeof t==="string"){const[i,o=""]=t.split(":");if(i.startsWith("-")){if(s.has(i.replace("-","")))s.delete(i.replace("-",""))}else s.set(i,o.split(","))}else s.set(t,[]);return s};class Rc{a;constructor(a){this.service=a}runMiddleware(a,s){const t=Rs.getStore().req;return Array.from(Hh(a).entries()).map(([i,o])=>{if(typeof i==="string"){const r=this.service.aliases[i];if(r){const c=new r(s);return(l)=>c.run.call(c,l,...o)}}else{if(Qi(i)){const r=new aliasOrTest(s);return r.run.bind(r)}return i}}).filter(Boolean).reduce((i,o)=>{return async(r,c)=>{return{...await i(r,c),...await o(r,c)}}},(i)=>Promise.resolve({}))(t)}}class Mc{a;constructor(a){this.service=a}}import{AsyncLocalStorage as Wh} from"async_hooks";class jc extends _u{a;name="broadcastingServiceContainer";publishCb;context=new Wh;constructor(a){super();this.service=a}onPublish(a){this.publishCb=a}publish(...a){const[s,t,i]=a;this.publishCb(s,t,i)}async handleMessage(a,s){const t=JSON.parse(s);if(t.type==="subscribe"){const i=Object.entries(this.service.channels).sort(([o],[r])=>o.length-r.length);for(let[o,r]of i){const c=new URLPattern({pathname:o});if(c.test({pathname:t.topic})){const l=c.exec({pathname:t.topic})?.pathname.groups,d=new r;if(await d.subscribe.call(d,l))a.subscribe(t.topic)}break}}if(t.type==="broadcast")a.publish(t.topic,JSON.stringify({topic:t.topic,data:t.payload}));if(t.type==="unsubscribe")a.unsubscribe(t.topic)}run(a,s){const t=a.get("Cookie"),i=new Map;if(t){const o=t.split(";");for(let r of o){const[c,l]=r.split("=");i.set(c.trim(),l.trim())}}this.context.run({headers:a,cookies:i},s)}}class Ui{emailServiceProvider=Ku;authenticationServiceProvider=qi;middlewareServiceProvider=Gu;policiesServiceProvider=qu;i18nServiceProvider=Uu;fileStorageServiceProvider=Yu;apiRouterServiceProvider=Fc;rateLimiterServiceProvider=Bu;broadcastingsServiceProvider=Xu;services;getServices=()=>{if(!this.services)this.services={emailServiceContainer:new Qu(new this.emailServiceProvider),authenticationServiceContainer:new yc(new this.authenticationServiceProvider),middlewareServiceContainer:new Rc(new this.middlewareServiceProvider),policiesServiceProvider:new this.policiesServiceProvider,i18nServiceContainer:new Dc(new this.i18nServiceProvider),fileStorageServiceContainer:new Sc(new this.fileStorageServiceProvider),apiRouterServiceContainer:new vc(new this.apiRouterServiceProvider),rateLimiterServiceContainer:new Mc(new this.rateLimiterServiceProvider),broadcastingServiceContainer:new jc(new this.broadcastingsServiceProvider)};return this.services};static getContext=()=>Cc.getStore();run(a){const s=this.getServices();return Cc.run(s,a)}}class ku{a;constructor(a){this.prisma=a}async createSession(a){return await this.prisma.session.create({data:a,include:{user:!0}})}async createUser(a){return await this.prisma.user.create({data:a})}async deleteSession(a){return await this.prisma.session.deleteMany({where:{token:a.token}})}async findUserByEmailAddress(a){return await this.prisma.user.findUnique({where:{email:a}})}async findSession(a){if(!a.token)return null;try{return await this.prisma.session.findUnique({where:{token:a.token,userAgent:"local"},include:{user:{select:{password:!1,id:!0,email:!0,globalRole:!0,name:!0,publicId:!0,accounts:{select:{id:!0,publicId:!0,organization:!0,organizationRole:!0}}}}}})}catch(s){return console.log(s),null}}async updateSession(a){return await this.prisma.session.update({where:{token:a.token},data:{expiresAt:a.expiresAt},include:{user:{select:{password:!1,email:!0,globalRole:!0,name:!0,publicId:!0,accounts:{select:{id:!0,publicId:!0,organization:!0,organizationRole:!0}},organization:!0}}}})}async updateUserPassword(a){return await this.prisma.user.update({where:{id:a.id},data:{password:a.password}})}async createPasswordResetToken(a){return await this.prisma.passwordResetToken.create({data:{user:{connect:{id:a.user.id}},token:a.token}})}async findPasswordResetToken(a){const{token:s}=a;return await this.prisma.passwordResetToken.findUnique({where:{token:s},include:{user:!0}})}async deleteAllUserSessions(a){return await this.prisma.session.deleteMany({where:{userId:a}})}async deletePasswordResetToken(a){const{token:s}=a;return await this.prisma.passwordResetToken.delete({where:{token:s}})}}export{ku as PrismaAuthenticationAdapter,Ui as Kernel,qi as AuthenticationServiceProvider};