@nodeblocks/frontend-list-organization-block 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/package.json +3 -3
- package/readme.md +0 -64
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
## 🚀 Nodeblocks Frontend Blocks
|
|
2
|
+
|
|
3
|
+
Welcome to the Nodeblocks Frontend Blocks! 🎉
|
|
4
|
+
The Blocks library is a collection of common react application components. It is intended to support applications by providing customizable and reusable frontend components.
|
|
5
|
+
|
|
6
|
+
### ✨ Features [WIP]
|
|
7
|
+
|
|
8
|
+
- **🚀 Bundling with Rollup:** Get a clean, minimalistic approach to bundling your JavaScript files for smoother frontend development.
|
|
9
|
+
- **💙 TypeScript Support:** We've included a pre-configured `tsconfig.json` to ensure your TypeScript setup is strict, efficient, and ready to go.
|
|
10
|
+
- **⚙️ Peer Dependencies:** Keep bundle sizes lean with React and React DOM set as peer dependencies.
|
|
11
|
+
- **🎨 CSS Support:** Easily import and process CSS files, giving you more control over your styles.
|
|
12
|
+
|
|
13
|
+
### 🛠️ How to Use[WIP]
|
|
14
|
+
|
|
15
|
+
1. **Import the specific blocks packages** 📦:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @nodeblocks/frontend-faq-block
|
|
19
|
+
npm install @nodeblocks/frontend-signin-block
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { FAQ } from ' @nodeblocks/frontend-faq-block';
|
|
24
|
+
import { SignIn } from '@nodeblocks/frontend-signin-block';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
2. **Start storybook for development** 🛠️ [WIP]:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# in two separate terminals
|
|
31
|
+
|
|
32
|
+
# 1. to start storybook dev server
|
|
33
|
+
npm run dev
|
|
34
|
+
|
|
35
|
+
# 2. to select which packages to run locally and which from npm
|
|
36
|
+
npm run ws:manage
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
3. **Build for production** 🏗️ [WIP]:
|
|
40
|
+
```bash
|
|
41
|
+
npm run build
|
|
42
|
+
```
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/icons-material"),n=require("@mui/material"),r=require("react"),i=require("@mui/material/useMediaQuery"),s=require("@mui/material/styles");class a extends Error{}class o extends a{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class l extends a{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class c extends a{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class u extends a{}class d extends a{constructor(e){super(`Invalid unit ${e}`)}}class h extends a{}class m extends a{constructor(){super("Zone is an abstract class")}}const f="numeric",y="short",g="long",p={year:f,month:f,day:f},b={year:f,month:y,day:f},w={year:f,month:y,day:f,weekday:y},v={year:f,month:g,day:f},k={year:f,month:g,day:f,weekday:g},x={hour:f,minute:f},S={hour:f,minute:f,second:f},T={hour:f,minute:f,second:f,timeZoneName:y},C={hour:f,minute:f,second:f,timeZoneName:g},O={hour:f,minute:f,hourCycle:"h23"},M={hour:f,minute:f,second:f,hourCycle:"h23"},N={hour:f,minute:f,second:f,hourCycle:"h23",timeZoneName:y},j={hour:f,minute:f,second:f,hourCycle:"h23",timeZoneName:g},I={year:f,month:f,day:f,hour:f,minute:f},D={year:f,month:f,day:f,hour:f,minute:f,second:f},A={year:f,month:y,day:f,hour:f,minute:f},V={year:f,month:y,day:f,hour:f,minute:f,second:f},E={year:f,month:y,day:f,weekday:y,hour:f,minute:f},F={year:f,month:g,day:f,hour:f,minute:f,timeZoneName:y},L={year:f,month:g,day:f,hour:f,minute:f,second:f,timeZoneName:y},z={year:f,month:g,day:f,weekday:g,hour:f,minute:f,timeZoneName:g},W={year:f,month:g,day:f,weekday:g,hour:f,minute:f,second:f,timeZoneName:g};class ${get type(){throw new m}get name(){throw new m}get ianaName(){return this.name}get isUniversal(){throw new m}offsetName(e,t){throw new m}formatOffset(e,t){throw new m}offset(e){throw new m}equals(e){throw new m}get isValid(){throw new m}}let R=null;class Z extends ${static get instance(){return null===R&&(R=new Z),R}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return ot(e,t,n)}formatOffset(e,t){return dt(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}const B=new Map,P={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6},q=new Map;class H extends ${static create(e){let t=q.get(e);return void 0===t&&q.set(e,t=new H(e)),t}static resetCache(){q.clear(),B.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=H.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return ot(e,t,n,this.name)}formatOffset(e,t){return dt(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const n=function(e){let t=B.get(e);return void 0===t&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),B.set(e,t)),t}(this.name);let[r,i,s,a,o,l,c]=n.formatToParts?function(e,t){const n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){const{type:t,value:i}=n[e],s=P[t];"era"===t?r[s]=i:Re(s)||(r[s]=parseInt(i,10))}return r}(n,t):function(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,s,a,o,l,c,u]=r;return[a,i,s,o,l,c,u]}(n,t);"BC"===a&&(r=1-Math.abs(r));let u=+t;const d=u%1e3;return u-=d>=0?d:1e3+d,(rt({year:r,month:i,day:s,hour:24===o?0:o,minute:l,second:c,millisecond:0})-u)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let U={};const _=new Map;function Y(e,t={}){const n=JSON.stringify([e,t]);let r=_.get(n);return void 0===r&&(r=new Intl.DateTimeFormat(e,t),_.set(n,r)),r}const J=new Map,G=new Map;let Q=null;const K=new Map;function X(e){let t=K.get(e);return void 0===t&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),K.set(e,t)),t}const ee=new Map;function te(e,t,n,r){const i=e.listingMode();return"error"===i?null:"en"===i?n(t):r(t)}class ne{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:r,floor:i,...s}=n;if(!t||Object.keys(s).length>0){const t={useGrouping:!1,...n};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=function(e,t={}){const n=JSON.stringify([e,t]);let r=J.get(n);return void 0===r&&(r=new Intl.NumberFormat(e,t),J.set(n,r)),r}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Je(this.floor?Math.floor(e):Xe(e,3),this.padTo)}}class re{constructor(e,t,n){let r;if(this.opts=n,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){const t=e.offset/60*-1,n=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&H.create(n).valid?(r=n,this.dt=e):(r="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=Y(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if("timeZoneName"===e.type){const t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class ie{constructor(e,t,n){this.opts={style:"long",...n},!t&&Pe()&&(this.rtf=function(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let s=G.get(i);return void 0===s&&(s=new Intl.RelativeTimeFormat(e,t),G.set(i,s)),s}(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&s){const n="days"===e;switch(t){case 1:return n?"tomorrow":`next ${i[e][0]}`;case-1:return n?"yesterday":`last ${i[e][0]}`;case 0:return n?"today":`this ${i[e][0]}`}}const a=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,c=i[e],u=r?l?c[1]:c[2]||c[1]:l?i[e][0]:e;return a?`${o} ${u} ago`:`in ${o} ${u}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const se={firstDay:1,minimalDays:4,weekend:[6,7]};class ae{static fromOpts(e){return ae.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,n,r,i=!1){const s=e||Te.defaultLocale,a=s||(i?"en-US":Q||(Q=(new Intl.DateTimeFormat).resolvedOptions().locale,Q)),o=t||Te.defaultNumberingSystem,l=n||Te.defaultOutputCalendar,c=_e(r)||Te.defaultWeekSettings;return new ae(a,o,l,c,s)}static resetCache(){Q=null,_.clear(),J.clear(),G.clear(),K.clear(),ee.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:n,weekSettings:r}={}){return ae.create(e,t,n,r)}constructor(e,t,n,r,i){const[s,a,o]=function(e){const t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(-1===n)return[e];{let t,r;try{t=Y(e).resolvedOptions(),r=e}catch(i){const s=e.substring(0,n);t=Y(s).resolvedOptions(),r=s}const{numberingSystem:i,calendar:s}=t;return[r,i,s]}}(e);this.locale=s,this.numberingSystem=t||a||null,this.outputCalendar=n||o||null,this.weekSettings=r,this.intl=function(e,t,n){return n||t?(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===X(e.locale).numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?ae.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,_e(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return te(this,e,gt,()=>{const n="ja"===this.intl||this.intl.startsWith("ja-"),r=(t&=!n)?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";if(!this.monthsCache[i][e]){const t=n?e=>this.dtFormatter(e,r).format():e=>this.extract(e,r,"month");this.monthsCache[i][e]=function(e){const t=[];for(let n=1;n<=12;n++){const r=wr.utc(2009,n,1);t.push(e(r))}return t}(t)}return this.monthsCache[i][e]})}weekdays(e,t=!1){return te(this,e,vt,()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=function(e){const t=[];for(let n=1;n<=7;n++){const r=wr.utc(2016,11,13+n);t.push(e(r))}return t}(e=>this.extract(e,n,"weekday"))),this.weekdaysCache[r][e]})}meridiems(){return te(this,void 0,()=>kt,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[wr.utc(2016,11,13,9),wr.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return te(this,e,Ct,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[wr.utc(-40,1,1),wr.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,n){const r=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===n);return r?r.value:null}numberFormatter(e={}){return new ne(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new re(e,this.intl,t)}relFormatter(e={}){return new ie(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const n=JSON.stringify([e,t]);let r=U[n];return r||(r=new Intl.ListFormat(e,t),U[n]=r),r}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||X(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:qe()?function(e){let t=ee.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...se,...t}),ee.set(e,t)}return t}(this.locale):se}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let oe=null;class le extends ${static get utcInstance(){return null===oe&&(oe=new le(0)),oe}static instance(e){return 0===e?le.utcInstance:new le(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new le(lt(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${dt(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${dt(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return dt(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class ce extends ${constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function ue(e,t){if(Re(e)||null===e)return t;if(e instanceof $)return e;if("string"==typeof e){const n=e.toLowerCase();return"default"===n?t:"local"===n||"system"===n?Z.instance:"utc"===n||"gmt"===n?le.utcInstance:le.parseSpecifier(n)||H.create(e)}return Ze(e)?le.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new ce(e)}const de={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},he={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},me=de.hanidec.replace(/[\[|\]]/g,"").split(""),fe=new Map;function ye({numberingSystem:e},t=""){const n=e||"latn";let r=fe.get(n);void 0===r&&(r=new Map,fe.set(n,r));let i=r.get(t);return void 0===i&&(i=new RegExp(`${de[n]}${t}`),r.set(t,i)),i}let ge,pe=()=>Date.now(),be="system",we=null,ve=null,ke=null,xe=60,Se=null;class Te{static get now(){return pe}static set now(e){pe=e}static set defaultZone(e){be=e}static get defaultZone(){return ue(be,Z.instance)}static get defaultLocale(){return we}static set defaultLocale(e){we=e}static get defaultNumberingSystem(){return ve}static set defaultNumberingSystem(e){ve=e}static get defaultOutputCalendar(){return ke}static set defaultOutputCalendar(e){ke=e}static get defaultWeekSettings(){return Se}static set defaultWeekSettings(e){Se=_e(e)}static get twoDigitCutoffYear(){return xe}static set twoDigitCutoffYear(e){xe=e%100}static get throwOnInvalid(){return ge}static set throwOnInvalid(e){ge=e}static resetCaches(){ae.resetCache(),H.resetCache(),wr.resetCache(),fe.clear()}}class Ce{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Oe=[0,31,59,90,120,151,181,212,243,273,304,334],Me=[0,31,60,91,121,152,182,213,244,274,305,335];function Ne(e,t){return new Ce("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function je(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return 0===i?7:i}function Ie(e,t,n){return n+(et(e)?Me:Oe)[t-1]}function De(e,t){const n=et(e)?Me:Oe,r=n.findIndex(e=>e<t);return{month:r+1,day:t-n[r]}}function Ae(e,t){return(e-t+7)%7+1}function Ve(e,t=4,n=1){const{year:r,month:i,day:s}=e,a=Ie(r,i,s),o=Ae(je(r,i,s),n);let l,c=Math.floor((a-o+14-t)/7);return c<1?(l=r-1,c=st(l,t,n)):c>st(r,t,n)?(l=r+1,c=1):l=r,{weekYear:l,weekNumber:c,weekday:o,...ht(e)}}function Ee(e,t=4,n=1){const{weekYear:r,weekNumber:i,weekday:s}=e,a=Ae(je(r,1,t),n),o=tt(r);let l,c=7*i+s-a-7+t;c<1?(l=r-1,c+=tt(l)):c>o?(l=r+1,c-=tt(r)):l=r;const{month:u,day:d}=De(l,c);return{year:l,month:u,day:d,...ht(e)}}function Fe(e){const{year:t,month:n,day:r}=e;return{year:t,ordinal:Ie(t,n,r),...ht(e)}}function Le(e){const{year:t,ordinal:n}=e,{month:r,day:i}=De(t,n);return{year:t,month:r,day:i,...ht(e)}}function ze(e,t){if(!Re(e.localWeekday)||!Re(e.localWeekNumber)||!Re(e.localWeekYear)){if(!Re(e.weekday)||!Re(e.weekNumber)||!Re(e.weekYear))throw new u("Cannot mix locale-based week fields with ISO-based week fields");return Re(e.localWeekday)||(e.weekday=e.localWeekday),Re(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Re(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function We(e){const t=Be(e.year),n=Ye(e.month,1,12),r=Ye(e.day,1,nt(e.year,e.month));return t?n?!r&&Ne("day",e.day):Ne("month",e.month):Ne("year",e.year)}function $e(e){const{hour:t,minute:n,second:r,millisecond:i}=e,s=Ye(t,0,23)||24===t&&0===n&&0===r&&0===i,a=Ye(n,0,59),o=Ye(r,0,59),l=Ye(i,0,999);return s?a?o?!l&&Ne("millisecond",i):Ne("second",r):Ne("minute",n):Ne("hour",t)}function Re(e){return void 0===e}function Ze(e){return"number"==typeof e}function Be(e){return"number"==typeof e&&e%1==0}function Pe(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function qe(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function He(e,t,n){if(0!==e.length)return e.reduce((e,r)=>{const i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i},null)[1]}function Ue(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _e(e){if(null==e)return null;if("object"!=typeof e)throw new h("Week settings must be an object");if(!Ye(e.firstDay,1,7)||!Ye(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!Ye(e,1,7)))throw new h("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function Ye(e,t,n){return Be(e)&&e>=t&&e<=n}function Je(e,t=2){let n;return n=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),n}function Ge(e){return Re(e)||null===e||""===e?void 0:parseInt(e,10)}function Qe(e){return Re(e)||null===e||""===e?void 0:parseFloat(e)}function Ke(e){if(!Re(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function Xe(e,t,n="round"){const r=10**t;switch(n){case"expand":return e>0?Math.ceil(e*r)/r:Math.floor(e*r)/r;case"trunc":return Math.trunc(e*r)/r;case"round":return Math.round(e*r)/r;case"floor":return Math.floor(e*r)/r;case"ceil":return Math.ceil(e*r)/r;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function et(e){return e%4==0&&(e%100!=0||e%400==0)}function tt(e){return et(e)?366:365}function nt(e,t){const n=(r=t-1)-12*Math.floor(r/12)+1;var r;return 2===n?et(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function rt(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function it(e,t,n){return-Ae(je(e,1,t),n)+t-1}function st(e,t=4,n=1){const r=it(e,t,n),i=it(e+1,t,n);return(tt(e)-r+i)/7}function at(e){return e>99?e:e>Te.twoDigitCutoffYear?1900+e:2e3+e}function ot(e,t,n,r=null){const i=new Date(e),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(s.timeZone=r);const a={timeZoneName:t,...s},o=new Intl.DateTimeFormat(n,a).formatToParts(i).find(e=>"timezonename"===e.type.toLowerCase());return o?o.value:null}function lt(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function ct(e){const t=Number(e);if("boolean"==typeof e||""===e||!Number.isFinite(t))throw new h(`Invalid unit value ${e}`);return t}function ut(e,t){const n={};for(const r in e)if(Ue(e,r)){const i=e[r];if(null==i)continue;n[t(r)]=ct(i)}return n}function dt(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Je(n,2)}:${Je(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Je(n,2)}${Je(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function ht(e){return function(e){return["hour","minute","second","millisecond"].reduce((t,n)=>(t[n]=e[n],t),{})}(e)}const mt=["January","February","March","April","May","June","July","August","September","October","November","December"],ft=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],yt=["J","F","M","A","M","J","J","A","S","O","N","D"];function gt(e){switch(e){case"narrow":return[...yt];case"short":return[...ft];case"long":return[...mt];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const pt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],bt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],wt=["M","T","W","T","F","S","S"];function vt(e){switch(e){case"narrow":return[...wt];case"short":return[...bt];case"long":return[...pt];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const kt=["AM","PM"],xt=["Before Christ","Anno Domini"],St=["BC","AD"],Tt=["B","A"];function Ct(e){switch(e){case"narrow":return[...Tt];case"short":return[...St];case"long":return[...xt];default:return null}}function Ot(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const Mt={D:p,DD:b,DDD:v,DDDD:k,t:x,tt:S,ttt:T,tttt:C,T:O,TT:M,TTT:N,TTTT:j,f:I,ff:A,fff:F,ffff:z,F:D,FF:V,FFF:L,FFFF:W};class Nt{static create(e,t={}){return new Nt(e,t)}static parseFormat(e){let t=null,n="",r=!1;const i=[];for(let s=0;s<e.length;s++){const a=e.charAt(s);"'"===a?((n.length>0||r)&&i.push({literal:r||/^\s+$/.test(n),val:""===n?"'":n}),t=null,n="",r=!r):r||a===t?n+=a:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=a,t=a)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(e){return Mt[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,n=void 0){if(this.opts.forceSimple)return Je(e,t);const r={...this.opts};return t>0&&(r.padTo=t),n&&(r.signDisplay=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,t){const n="en"===this.loc.listingMode(),r=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,i=(t,n)=>this.loc.extract(e,t,n),s=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",a=(t,r)=>n?function(e,t){return gt(t)[e.month-1]}(e,t):i(r?{month:t}:{month:t,day:"numeric"},"month"),o=(t,r)=>n?function(e,t){return vt(t)[e.weekday-1]}(e,t):i(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),l=t=>{const n=Nt.macroTokenToFormatOpts(t);return n?this.formatWithSystemDefault(e,n):t},c=t=>n?function(e,t){return Ct(t)[e.year<0?0:1]}(e,t):i({era:t},"era");return Ot(Nt.parseFormat(t),t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return n?function(e){return kt[e.hour<12?0:1]}(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod");case"d":return r?i({day:"numeric"},"day"):this.num(e.day);case"dd":return r?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return o("short",!0);case"cccc":return o("long",!0);case"ccccc":return o("narrow",!0);case"EEE":return o("short",!1);case"EEEE":return o("long",!1);case"EEEEE":return o("narrow",!1);case"L":return r?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return r?i({month:"numeric"},"month"):this.num(e.month);case"MM":return r?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return r?i({year:"numeric"},"year"):this.num(e.year);case"yy":return r?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return l(t)}})}formatDurationFromString(e,t){const n="negativeLargestOnly"===this.opts.signMode?-1:1,r=e=>{switch(e[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},i=Nt.parseFormat(t),s=i.reduce((e,{literal:t,val:n})=>t?e:e.concat(n),[]),a=e.shiftTo(...s.map(r).filter(e=>e));return Ot(i,((e,t)=>i=>{const s=r(i);if(s){const r=t.isNegativeDuration&&s!==t.largestUnit?n:1;let a;return a="negativeLargestOnly"===this.opts.signMode&&s!==t.largestUnit?"never":"all"===this.opts.signMode?"always":"auto",this.num(e.get(s)*r,i.length,a)}return i})(a,{isNegativeDuration:a<0,largestUnit:Object.keys(a.values)[0]}))}}const jt=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function It(...e){const t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function Dt(...e){return t=>e.reduce(([e,n,r],i)=>{const[s,a,o]=i(t,r);return[{...e,...s},a||n,o]},[{},null,1]).slice(0,2)}function At(e,...t){if(null==e)return[null,null];for(const[n,r]of t){const t=n.exec(e);if(t)return r(t)}return[null,null]}function Vt(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++)r[e[i]]=Ge(t[n+i]);return[r,null,n+i]}}const Et=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Ft=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Lt=RegExp(`${Ft.source}(?:${Et.source}?(?:\\[(${jt.source})\\])?)?`),zt=RegExp(`(?:[Tt]${Lt.source})?`),Wt=Vt("weekYear","weekNumber","weekDay"),$t=Vt("year","ordinal"),Rt=RegExp(`${Ft.source} ?(?:${Et.source}|(${jt.source}))?`),Zt=RegExp(`(?: ${Rt.source})?`);function Bt(e,t,n){const r=e[t];return Re(r)?n:Ge(r)}function Pt(e,t){return[{hours:Bt(e,t,0),minutes:Bt(e,t+1,0),seconds:Bt(e,t+2,0),milliseconds:Ke(e[t+3])},null,t+4]}function qt(e,t){const n=!e[t]&&!e[t+1],r=lt(e[t+1],e[t+2]);return[{},n?null:le.instance(r),t+3]}function Ht(e,t){return[{},e[t]?H.create(e[t]):null,t+1]}const Ut=RegExp(`^T?${Ft.source}$`),_t=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Yt(e){const[t,n,r,i,s,a,o,l,c]=e,u="-"===t[0],d=l&&"-"===l[0],h=(e,t=!1)=>void 0!==e&&(t||e&&u)?-e:e;return[{years:h(Qe(n)),months:h(Qe(r)),weeks:h(Qe(i)),days:h(Qe(s)),hours:h(Qe(a)),minutes:h(Qe(o)),seconds:h(Qe(l),"-0"===l),milliseconds:h(Ke(c),d)}]}const Jt={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Gt(e,t,n,r,i,s,a){const o={year:2===t.length?at(Ge(t)):Ge(t),month:ft.indexOf(n)+1,day:Ge(r),hour:Ge(i),minute:Ge(s)};return a&&(o.second=Ge(a)),e&&(o.weekday=e.length>3?pt.indexOf(e)+1:bt.indexOf(e)+1),o}const Qt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Kt(e){const[,t,n,r,i,s,a,o,l,c,u,d]=e,h=Gt(t,i,r,n,s,a,o);let m;return m=l?Jt[l]:c?0:lt(u,d),[h,new le(m)]}const Xt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,en=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,tn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function nn(e){const[,t,n,r,i,s,a,o]=e;return[Gt(t,i,r,n,s,a,o),le.utcInstance]}function rn(e){const[,t,n,r,i,s,a,o]=e;return[Gt(t,o,n,r,i,s,a),le.utcInstance]}const sn=It(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,zt),an=It(/(\d{4})-?W(\d\d)(?:-?(\d))?/,zt),on=It(/(\d{4})-?(\d{3})/,zt),ln=It(Lt),cn=Dt(function(e,t){return[{year:Bt(e,t),month:Bt(e,t+1,1),day:Bt(e,t+2,1)},null,t+3]},Pt,qt,Ht),un=Dt(Wt,Pt,qt,Ht),dn=Dt($t,Pt,qt,Ht),hn=Dt(Pt,qt,Ht),mn=Dt(Pt),fn=It(/(\d{4})-(\d\d)-(\d\d)/,Zt),yn=It(Rt),gn=Dt(Pt,qt,Ht),pn="Invalid Duration",bn={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},wn={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...bn},vn={years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...bn},kn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],xn=kn.slice(0).reverse();function Sn(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Mn(r)}function Tn(e,t){let n=t.milliseconds??0;for(const r of xn.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Cn(e,t){const n=Tn(e,t)<0?-1:1;kn.reduceRight((r,i)=>{if(Re(t[i]))return r;if(r){const s=t[r]*n,a=e[i][r],o=Math.floor(s/a);t[i]+=o*n,t[r]-=o*a*n}return i},null),kn.reduce((n,r)=>{if(Re(t[r]))return n;if(n){const i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r},null)}function On(e){const t={};for(const[n,r]of Object.entries(e))0!==r&&(t[n]=r);return t}class Mn{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let n=t?vn:wn;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||ae.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,t){return Mn.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new h("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Mn({values:ut(e,Mn.normalizeUnit),loc:ae.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Ze(e))return Mn.fromMillis(e);if(Mn.isDuration(e))return e;if("object"==typeof e)return Mn.fromObject(e);throw new h(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[n]=function(e){return At(e,[_t,Yt])}(e);return n?Mn.fromObject(n,t):Mn.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[n]=function(e){return At(e,[Ut,mn])}(e);return n?Mn.fromObject(n,t):Mn.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new h("need to specify a reason the Duration is invalid");const n=e instanceof Ce?e:new Ce(e,t);if(Te.throwOnInvalid)throw new c(n);return new Mn({invalid:n})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new d(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?Nt.create(this.loc,n).formatDurationFromString(this,e):pn}toHuman(e={}){if(!this.isValid)return pn;const t=!1!==e.showZeros,n=kn.map(n=>{const r=this.values[n];return Re(r)||0===r&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:n.slice(0,-1)}).format(r)}).filter(e=>e);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=Xe(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},wr.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Tn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=Mn.fromDurationLike(e),n={};for(const e of kn)(Ue(t.values,e)||Ue(this.values,e))&&(n[e]=t.get(e)+this.get(e));return Sn(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=Mn.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=ct(e(this.values[n],n));return Sn(this,{values:t},!0)}get(e){return this[Mn.normalizeUnit(e)]}set(e){return this.isValid?Sn(this,{values:{...this.values,...ut(e,Mn.normalizeUnit)}}):this}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:r}={}){return Sn(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:n})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Cn(this.matrix,e),Sn(this,{values:e},!0)}rescale(){return this.isValid?Sn(this,{values:On(this.normalize().shiftToAll().toObject())},!0):this}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map(e=>Mn.normalizeUnit(e));const t={},n={},r=this.toObject();let i;for(const s of kn)if(e.indexOf(s)>=0){i=s;let e=0;for(const t in n)e+=this.matrix[t][s]*n[t],n[t]=0;Ze(r[s])&&(e+=r[s]);const a=Math.trunc(e);t[s]=a,n[s]=(1e3*e-1e3*a)/1e3}else Ze(r[s])&&(n[s]=r[s]);for(const e in n)0!==n[e]&&(t[i]+=e===i?n[e]:n[e]/this.matrix[i][e]);return Cn(this.matrix,t),Sn(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return Sn(this,{values:e},!0)}removeZeros(){return this.isValid?Sn(this,{values:On(this.values)},!0):this}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;function t(e,t){return void 0===e||0===e?void 0===t||0===t:e===t}for(const n of kn)if(!t(this.values[n],e.values[n]))return!1;return!0}}const Nn="Invalid Interval";class jn{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new h("need to specify a reason the Interval is invalid");const n=e instanceof Ce?e:new Ce(e,t);if(Te.throwOnInvalid)throw new l(n);return new jn({invalid:n})}static fromDateTimes(e,t){const n=vr(e),r=vr(t),i=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?jn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null:jn.invalid("missing or invalid end"):jn.invalid("missing or invalid start")}(n,r);return null==i?new jn({start:n,end:r}):i}static after(e,t){const n=Mn.fromDurationLike(t),r=vr(e);return jn.fromDateTimes(r,r.plus(n))}static before(e,t){const n=Mn.fromDurationLike(t),r=vr(e);return jn.fromDateTimes(r.minus(n),r)}static fromISO(e,t){const[n,r]=(e||"").split("/",2);if(n&&r){let e,i,s,a;try{e=wr.fromISO(n,t),i=e.isValid}catch(r){i=!1}try{s=wr.fromISO(r,t),a=s.isValid}catch(r){a=!1}if(i&&a)return jn.fromDateTimes(e,s);if(i){const n=Mn.fromISO(r,t);if(n.isValid)return jn.after(e,n)}else if(a){const e=Mn.fromISO(n,t);if(e.isValid)return jn.before(s,e)}}return jn.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const n=this.start.startOf(e,t);let r;return r=t?.useLocaleWeeks?this.end.reconfigure({locale:n.locale}):this.end,r=r.startOf(e,t),Math.floor(r.diff(n,e).get(e))+(r.valueOf()!==this.end.valueOf())}hasSame(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&this.s<=e&&this.e>e}set({start:e,end:t}={}){return this.isValid?jn.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(vr).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),n=[];let{s:r}=this,i=0;for(;r<this.e;){const e=t[i]||this.e,s=+e>+this.e?this.e:e;n.push(jn.fromDateTimes(r,s)),r=s,i+=1}return n}splitBy(e){const t=Mn.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let n,{s:r}=this,i=1;const s=[];for(;r<this.e;){const e=this.start.plus(t.mapUnits(e=>e*i));n=+e>+this.e?this.e:e,s.push(jn.fromDateTimes(r,n)),r=n,i+=1}return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e===+e.s}abutsEnd(e){return!!this.isValid&&+e.e===+this.s}engulfs(e){return!!this.isValid&&this.s<=e.s&&this.e>=e.e}equals(e){return!(!this.isValid||!e.isValid)&&this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e<e.e?this.e:e.e;return t>=n?null:jn.fromDateTimes(t,n)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,n=this.e>e.e?this.e:e.e;return jn.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n],[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const r=[],i=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]),s=Array.prototype.concat(...i).sort((e,t)=>e.time-t.time);for(const e of s)n+="s"===e.type?1:-1,1===n?t=e.time:(t&&+t!==+e.time&&r.push(jn.fromDateTimes(t,e.time)),t=null);return jn.merge(r)}difference(...e){return jn.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Nn}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=p,t={}){return this.isValid?Nt.create(this.s.loc.clone(t),e).formatInterval(this):Nn}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Nn}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Nn}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Nn}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Nn}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Mn.invalid(this.invalidReason)}mapEndpoints(e){return jn.fromDateTimes(e(this.s),e(this.e))}}class In{static hasDST(e=Te.defaultZone){const t=wr.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return H.isValidZone(e)}static normalizeZone(e){return ue(e,Te.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||ae.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||ae.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||ae.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||ae.create(t,n,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||ae.create(t,n,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||ae.create(t,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||ae.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return ae.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return ae.create(t,null,"gregory").eras(e)}static features(){return{relative:Pe(),localeWeek:qe()}}}function Dn(e,t){const n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Mn.fromMillis(r).as("days"))}function An(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(-1!==e[n].search(de.hanidec))t+=me.indexOf(e[n]);else for(const e in he){const[n,i]=he[e];r>=n&&r<=i&&(t+=r-n)}}return parseInt(t,10)}return t}(e))}}const Vn=`[ ${String.fromCharCode(160)}]`,En=new RegExp(Vn,"g");function Fn(e){return e.replace(/\./g,"\\.?").replace(En,Vn)}function Ln(e){return e.replace(/\./g,"").replace(En," ").toLowerCase()}function zn(e,t){return null===e?null:{regex:RegExp(e.map(Fn).join("|")),deser:([n])=>e.findIndex(e=>Ln(n)===Ln(e))+t}}function Wn(e,t){return{regex:e,deser:([,e,t])=>lt(e,t),groups:t}}function $n(e){return{regex:e,deser:([e])=>e}}const Rn={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let Zn=null;function Bn(e,t){return Array.prototype.concat(...e.map(e=>function(e,t){if(e.literal)return e;const n=Hn(Nt.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t)))}class Pn{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Bn(Nt.parseFormat(t),e),this.units=this.tokens.map(t=>function(e,t){const n=ye(t),r=ye(t,"{2}"),i=ye(t,"{3}"),s=ye(t,"{4}"),a=ye(t,"{6}"),o=ye(t,"{1,2}"),l=ye(t,"{1,3}"),c=ye(t,"{1,6}"),u=ye(t,"{1,9}"),d=ye(t,"{2,4}"),h=ye(t,"{4,6}"),m=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},f=(f=>{if(e.literal)return m(f);switch(f.val){case"G":return zn(t.eras("short"),0);case"GG":return zn(t.eras("long"),0);case"y":return An(c);case"yy":case"kk":return An(d,at);case"yyyy":case"kkkk":return An(s);case"yyyyy":return An(h);case"yyyyyy":return An(a);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return An(o);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return An(r);case"MMM":return zn(t.months("short",!0),1);case"MMMM":return zn(t.months("long",!0),1);case"LLL":return zn(t.months("short",!1),1);case"LLLL":return zn(t.months("long",!1),1);case"o":case"S":return An(l);case"ooo":case"SSS":return An(i);case"u":return $n(u);case"uu":return $n(o);case"uuu":case"E":case"c":return An(n);case"a":return zn(t.meridiems(),0);case"EEE":return zn(t.weekdays("short",!1),1);case"EEEE":return zn(t.weekdays("long",!1),1);case"ccc":return zn(t.weekdays("short",!0),1);case"cccc":return zn(t.weekdays("long",!0),1);case"Z":case"ZZ":return Wn(new RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return Wn(new RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return $n(/[a-z_+-/]{1,256}?/i);case" ":return $n(/[^\S\n\r]/);default:return m(f)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return f.token=e,f}(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){const[e,t]=[`^${(n=this.units).map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"")}$`,n];this.regex=RegExp(e,"i"),this.handlers=t}var n}explainFromTokens(e){if(this.isValid){const[t,n]=function(e,t,n){const r=e.match(t);if(r){const e={};let t=1;for(const i in n)if(Ue(n,i)){const s=n[i],a=s.groups?s.groups+1:1;!s.literal&&s.token&&(e[s.token.val[0]]=s.deser(r.slice(t,t+a))),t+=a}return[r,e]}return[r,{}]}(e,this.regex,this.handlers),[r,i,s]=n?function(e){let t,n=null;return Re(e.z)||(n=H.create(e.z)),Re(e.Z)||(n||(n=new le(e.Z)),t=e.Z),Re(e.q)||(e.M=3*(e.q-1)+1),Re(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),Re(e.u)||(e.S=Ke(e.u)),[Object.keys(e).reduce((t,n)=>{const r=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(n);return r&&(t[r]=e[n]),t},{}),n,t]}(n):[null,null,void 0];if(Ue(n,"a")&&Ue(n,"H"))throw new u("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:n,result:r,zone:i,specificOffset:s}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function qn(e,t,n){return new Pn(e,n).explainFromTokens(t)}function Hn(e,t){if(!e)return null;const n=Nt.create(t,e).dtFormatter((Zn||(Zn=wr.fromMillis(1555555555555)),Zn)),r=n.formatToParts(),i=n.resolvedOptions();return r.map(t=>function(e,t,n){const{type:r,value:i}=e;if("literal"===r){const e=/^\s+$/.test(i);return{literal:!e,val:e?" ":i}}const s=t[r];let a=r;"hour"===r&&(a=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":n.hour12?"hour12":"hour24");let o=Rn[a];if("object"==typeof o&&(o=o[s]),o)return{literal:!1,val:o}}(t,e,i))}const Un="Invalid DateTime",_n=864e13;function Yn(e){return new Ce("unsupported zone",`the zone "${e.name}" is not supported`)}function Jn(e){return null===e.weekData&&(e.weekData=Ve(e.c)),e.weekData}function Gn(e){return null===e.localWeekData&&(e.localWeekData=Ve(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Qn(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new wr({...n,...t,old:n})}function Kn(e,t,n){let r=e-60*t*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=60*(i-t)*1e3;const s=n.offset(r);return i===s?[r,i]:[e-60*Math.min(i,s)*1e3,Math.max(i,s)]}function Xn(e,t){const n=new Date(e+=60*t*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function er(e,t,n){return Kn(rt(e),t,n)}function tr(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),s={...e.c,year:r,month:i,day:Math.min(e.c.day,nt(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},a=Mn.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),o=rt(s);let[l,c]=Kn(o,n,e.zone);return 0!==a&&(l+=a,c=e.zone.offset(l)),{ts:l,o:c}}function nr(e,t,n,r,i,s){const{setZone:a,zone:o}=n;if(e&&0!==Object.keys(e).length||t){const r=t||o,i=wr.fromObject(e,{...n,zone:r,specificOffset:s});return a?i:i.setZone(o)}return wr.invalid(new Ce("unparsable",`the input "${i}" can't be parsed as ${r}`))}function rr(e,t,n=!0){return e.isValid?Nt.create(ae.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function ir(e,t,n){const r=e.c.year>9999||e.c.year<0;let i="";if(r&&e.c.year>=0&&(i+="+"),i+=Je(e.c.year,r?6:4),"year"===n)return i;if(t){if(i+="-",i+=Je(e.c.month),"month"===n)return i;i+="-"}else if(i+=Je(e.c.month),"month"===n)return i;return i+=Je(e.c.day),i}function sr(e,t,n,r,i,s,a){let o=!n||0!==e.c.millisecond||0!==e.c.second,l="";switch(a){case"day":case"month":case"year":break;default:if(l+=Je(e.c.hour),"hour"===a)break;if(t){if(l+=":",l+=Je(e.c.minute),"minute"===a)break;o&&(l+=":",l+=Je(e.c.second))}else{if(l+=Je(e.c.minute),"minute"===a)break;o&&(l+=Je(e.c.second))}if("second"===a)break;!o||r&&0===e.c.millisecond||(l+=".",l+=Je(e.c.millisecond,3))}return i&&(e.isOffsetFixed&&0===e.offset&&!s?l+="Z":e.o<0?(l+="-",l+=Je(Math.trunc(-e.o/60)),l+=":",l+=Je(Math.trunc(-e.o%60))):(l+="+",l+=Je(Math.trunc(e.o/60)),l+=":",l+=Je(Math.trunc(e.o%60)))),s&&(l+="["+e.zone.ianaName+"]"),l}const ar={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},or={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},lr={ordinal:1,hour:0,minute:0,second:0,millisecond:0},cr=["year","month","day","hour","minute","second","millisecond"],ur=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],dr=["year","ordinal","hour","minute","second","millisecond"];function hr(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new d(e);return t}function mr(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return hr(e)}}function fr(e,t){const n=ue(t.zone,Te.defaultZone);if(!n.isValid)return wr.invalid(Yn(n));const r=ae.fromObject(t);let i,s;if(Re(e.year))i=Te.now();else{for(const t of cr)Re(e[t])&&(e[t]=ar[t]);const t=We(e)||$e(e);if(t)return wr.invalid(t);const r=function(e){if(void 0===pr&&(pr=Te.now()),"iana"!==e.type)return e.offset(pr);const t=e.name;let n=br.get(t);return void 0===n&&(n=e.offset(pr),br.set(t,n)),n}(n);[i,s]=er(e,r,n)}return new wr({ts:i,zone:n,loc:r,o:s})}function yr(e,t,n){const r=!!Re(n.round)||n.round,i=Re(n.rounding)?"trunc":n.rounding,s=(e,s)=>(e=Xe(e,r||n.calendary?0:2,n.calendary?"round":i),t.loc.clone(n).relFormatter(n).format(e,s)),a=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return s(a(n.unit),n.unit);for(const e of n.units){const t=a(e);if(Math.abs(t)>=1)return s(t,e)}return s(e>t?-0:0,n.units[n.units.length-1])}function gr(e){let t,n={};return e.length>0&&"object"==typeof e[e.length-1]?(n=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[n,t]}let pr;const br=new Map;class wr{constructor(e){const t=e.zone||Te.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new Ce("invalid input"):null)||(t.isValid?null:Yn(t));this.ts=Re(e.ts)?Te.now():e.ts;let r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{const s=Ze(e.o)&&!e.old?e.o:t.offset(this.ts);r=Xn(this.ts,s),n=Number.isNaN(r.year)?new Ce("invalid input"):null,r=n?null:r,i=n?null:s}this._zone=t,this.loc=e.loc||ae.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new wr({})}static local(){const[e,t]=gr(arguments),[n,r,i,s,a,o,l]=t;return fr({year:n,month:r,day:i,hour:s,minute:a,second:o,millisecond:l},e)}static utc(){const[e,t]=gr(arguments),[n,r,i,s,a,o,l]=t;return e.zone=le.utcInstance,fr({year:n,month:r,day:i,hour:s,minute:a,second:o,millisecond:l},e)}static fromJSDate(e,t={}){const n=(r=e,"[object Date]"===Object.prototype.toString.call(r)?e.valueOf():NaN);var r;if(Number.isNaN(n))return wr.invalid("invalid input");const i=ue(t.zone,Te.defaultZone);return i.isValid?new wr({ts:n,zone:i,loc:ae.fromObject(t)}):wr.invalid(Yn(i))}static fromMillis(e,t={}){if(Ze(e))return e<-_n||e>_n?wr.invalid("Timestamp out of range"):new wr({ts:e,zone:ue(t.zone,Te.defaultZone),loc:ae.fromObject(t)});throw new h(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Ze(e))return new wr({ts:1e3*e,zone:ue(t.zone,Te.defaultZone),loc:ae.fromObject(t)});throw new h("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const n=ue(t.zone,Te.defaultZone);if(!n.isValid)return wr.invalid(Yn(n));const r=ae.fromObject(t),i=ut(e,mr),{minDaysInFirstWeek:s,startOfWeek:a}=ze(i,r),o=Te.now(),l=Re(t.specificOffset)?n.offset(o):t.specificOffset,c=!Re(i.ordinal),d=!Re(i.year),h=!Re(i.month)||!Re(i.day),m=d||h,f=i.weekYear||i.weekNumber;if((m||c)&&f)throw new u("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&c)throw new u("Can't mix ordinal dates with month/day");const y=f||i.weekday&&!m;let g,p,b=Xn(o,l);y?(g=ur,p=or,b=Ve(b,s,a)):c?(g=dr,p=lr,b=Fe(b)):(g=cr,p=ar);let w=!1;for(const e of g)Re(i[e])?i[e]=w?p[e]:b[e]:w=!0;const v=y?function(e,t=4,n=1){const r=Be(e.weekYear),i=Ye(e.weekNumber,1,st(e.weekYear,t,n)),s=Ye(e.weekday,1,7);return r?i?!s&&Ne("weekday",e.weekday):Ne("week",e.weekNumber):Ne("weekYear",e.weekYear)}(i,s,a):c?function(e){const t=Be(e.year),n=Ye(e.ordinal,1,tt(e.year));return t?!n&&Ne("ordinal",e.ordinal):Ne("year",e.year)}(i):We(i),k=v||$e(i);if(k)return wr.invalid(k);const x=y?Ee(i,s,a):c?Le(i):i,[S,T]=er(x,l,n),C=new wr({ts:S,zone:n,o:T,loc:r});return i.weekday&&m&&e.weekday!==C.weekday?wr.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${C.toISO()}`):C.isValid?C:wr.invalid(C.invalid)}static fromISO(e,t={}){const[n,r]=function(e){return At(e,[sn,cn],[an,un],[on,dn],[ln,hn])}(e);return nr(n,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,r]=function(e){return At(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[Qt,Kt])}(e);return nr(n,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,r]=function(e){return At(e,[Xt,nn],[en,nn],[tn,rn])}(e);return nr(n,r,t,"HTTP",t)}static fromFormat(e,t,n={}){if(Re(e)||Re(t))throw new h("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:i=null}=n,s=ae.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),[a,o,l,c]=function(e,t,n){const{result:r,zone:i,specificOffset:s,invalidReason:a}=qn(e,t,n);return[r,i,s,a]}(s,e,t);return c?wr.invalid(c):nr(a,o,n,`format ${t}`,e,l)}static fromString(e,t,n={}){return wr.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,r]=function(e){return At(e,[fn,cn],[yn,gn])}(e);return nr(n,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new h("need to specify a reason the DateTime is invalid");const n=e instanceof Ce?e:new Ce(e,t);if(Te.throwOnInvalid)throw new o(n);return new wr({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const n=Hn(e,ae.fromObject(t));return n?n.map(e=>e?e.val:null).join(""):null}static expandFormat(e,t={}){return Bn(Nt.parseFormat(e),ae.fromObject(t)).map(e=>e.val).join("")}static resetCache(){pr=void 0,br.clear()}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Jn(this).weekYear:NaN}get weekNumber(){return this.isValid?Jn(this).weekNumber:NaN}get weekday(){return this.isValid?Jn(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Gn(this).weekday:NaN}get localWeekNumber(){return this.isValid?Gn(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Gn(this).weekYear:NaN}get ordinal(){return this.isValid?Fe(this.c).ordinal:NaN}get monthShort(){return this.isValid?In.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?In.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?In.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?In.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,n=rt(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),s=this.zone.offset(n-r*t),a=this.zone.offset(n-i*t);if(s===a)return[this];const o=n-s*t,l=n-a*t,c=Xn(o,s),u=Xn(l,a);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[Qn(this,{ts:o}),Qn(this,{ts:l})]:[this]}get isInLeapYear(){return et(this.year)}get daysInMonth(){return nt(this.year,this.month)}get daysInYear(){return this.isValid?tt(this.year):NaN}get weeksInWeekYear(){return this.isValid?st(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?st(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:n,calendar:r}=Nt.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(le.instance(e),t)}toLocal(){return this.setZone(Te.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if((e=ue(e,Te.defaultZone)).equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||n){const t=e.offset(this.ts),n=this.toObject();[r]=er(n,t,e)}return Qn(this,{ts:r,zone:e})}return wr.invalid(Yn(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){return Qn(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=ut(e,mr),{minDaysInFirstWeek:n,startOfWeek:r}=ze(t,this.loc),i=!Re(t.weekYear)||!Re(t.weekNumber)||!Re(t.weekday),s=!Re(t.ordinal),a=!Re(t.year),o=!Re(t.month)||!Re(t.day),l=a||o,c=t.weekYear||t.weekNumber;if((l||s)&&c)throw new u("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new u("Can't mix ordinal dates with month/day");let d;i?d=Ee({...Ve(this.c,n,r),...t},n,r):Re(t.ordinal)?(d={...this.toObject(),...t},Re(t.day)&&(d.day=Math.min(nt(d.year,d.month),d.day))):d=Le({...Fe(this.c),...t});const[h,m]=er(d,this.o,this.zone);return Qn(this,{ts:h,o:m})}plus(e){return this.isValid?Qn(this,tr(this,Mn.fromDurationLike(e))):this}minus(e){return this.isValid?Qn(this,tr(this,Mn.fromDurationLike(e).negate())):this}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const n={},r=Mn.normalizeUnit(e);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0}if("weeks"===r)if(t){const e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(n.weekNumber=this.weekNumber-1),n.weekday=e}else n.weekday=1;if("quarters"===r){const e=Math.ceil(this.month/3);n.month=3*(e-1)+1}return this.set(n)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?Nt.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):Un}toLocaleString(e=p,t={}){return this.isValid?Nt.create(this.loc.clone(t),e).formatDateTime(this):Un}toLocaleParts(e={}){return this.isValid?Nt.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r=!0,extendedZone:i=!1,precision:s="milliseconds"}={}){if(!this.isValid)return null;const a="extended"===e;let o=ir(this,a,s=hr(s));return cr.indexOf(s)>=3&&(o+="T"),o+=sr(this,a,t,n,r,i,s),o}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?ir(this,"extended"===e,hr(t)):null}toISOWeekDate(){return rr(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:r=!1,extendedZone:i=!1,format:s="extended",precision:a="milliseconds"}={}){return this.isValid?(a=hr(a),(r&&cr.indexOf(a)>=3?"T":"")+sr(this,"extended"===s,t,e,n,i,a)):null}toRFC2822(){return rr(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return rr(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ir(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let r="HH:mm:ss.SSS";return(t||e)&&(n&&(r+=" "),t?r+="z":e&&(r+="ZZ")),rr(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Un}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",n={}){if(!this.isValid||!e.isValid)return Mn.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=(o=t,Array.isArray(o)?o:[o]).map(Mn.normalizeUnit),s=e.valueOf()>this.valueOf(),a=function(e,t,n,r){let[i,s,a,o]=function(e,t,n){const r=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const n=Dn(e,t);return(n-n%7)/7}],["days",Dn]],i={},s=e;let a,o;for(const[l,c]of r)n.indexOf(l)>=0&&(a=l,i[l]=c(e,t),o=s.plus(i),o>t?(i[l]--,(e=s.plus(i))>t&&(o=e,i[l]--,e=s.plus(i))):e=o);return[e,i,o,a]}(e,t,n);const l=t-i,c=n.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===c.length&&(a<t&&(a=i.plus({[o]:1})),a!==i&&(s[o]=(s[o]||0)+l/(a-i)));const u=Mn.fromObject(s,r);return c.length>0?Mn.fromMillis(l,r).shiftTo(...c).plus(u):u}(s?this:e,s?e:this,i,r);var o;return s?a.negate():a}diffNow(e="milliseconds",t={}){return this.diff(wr.now(),e,t)}until(e){return this.isValid?jn.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;const r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||wr.fromObject({},{zone:this.zone}),n=e.padding?this<t?-e.padding:e.padding:0;let r=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(r=e.unit,i=void 0),yr(t,this.plus(n),{...e,numeric:"always",units:r,unit:i})}toRelativeCalendar(e={}){return this.isValid?yr(e.base||wr.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(wr.isDateTime))throw new h("min requires all arguments be DateTimes");return He(e,e=>e.valueOf(),Math.min)}static max(...e){if(!e.every(wr.isDateTime))throw new h("max requires all arguments be DateTimes");return He(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:r=null,numberingSystem:i=null}=n;return qn(ae.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,n={}){return wr.fromFormatExplain(e,t,n)}static buildFormatParser(e,t={}){const{locale:n=null,numberingSystem:r=null}=t,i=ae.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});return new Pn(i,e)}static fromFormatParser(e,t,n={}){if(Re(e)||Re(t))throw new h("fromFormatParser requires an input string and a format parser");const{locale:r=null,numberingSystem:i=null}=n,s=ae.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});if(!s.equals(t.locale))throw new h(`fromFormatParser called with a locale of ${s}, but the format parser was created for ${t.locale}`);const{result:a,zone:o,specificOffset:l,invalidReason:c}=t.explainFromTokens(e);return c?wr.invalid(c):nr(a,o,n,`format ${t.format}`,e,l)}static get DATE_SHORT(){return p}static get DATE_MED(){return b}static get DATE_MED_WITH_WEEKDAY(){return w}static get DATE_FULL(){return v}static get DATE_HUGE(){return k}static get TIME_SIMPLE(){return x}static get TIME_WITH_SECONDS(){return S}static get TIME_WITH_SHORT_OFFSET(){return T}static get TIME_WITH_LONG_OFFSET(){return C}static get TIME_24_SIMPLE(){return O}static get TIME_24_WITH_SECONDS(){return M}static get TIME_24_WITH_SHORT_OFFSET(){return N}static get TIME_24_WITH_LONG_OFFSET(){return j}static get DATETIME_SHORT(){return I}static get DATETIME_SHORT_WITH_SECONDS(){return D}static get DATETIME_MED(){return A}static get DATETIME_MED_WITH_SECONDS(){return V}static get DATETIME_MED_WITH_WEEKDAY(){return E}static get DATETIME_FULL(){return F}static get DATETIME_FULL_WITH_SECONDS(){return L}static get DATETIME_HUGE(){return z}static get DATETIME_HUGE_WITH_SECONDS(){return W}}function vr(e){if(wr.isDateTime(e))return e;if(e&&e.valueOf&&Ze(e.valueOf()))return wr.fromJSDate(e);if(e&&"object"==typeof e)return wr.fromObject(e);throw new h(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const kr=r.createContext(void 0),xr=({children:t,...n})=>e.jsx(kr.Provider,{value:n,children:t}),Sr=()=>{const e=r.useContext(kr);if(!e)throw new Error("useBaseTableContext must be used within a BaseTableProvider");return e};function Tr(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r.createElement(t,{key:e})]))}function Cr({blocksOverride:e,defaultBlocks:t,defaultBlockOrder:n,children:r}){if(void 0===e)return r({blocks:t,blockOrder:n});if("function"==typeof e){const{blocks:i,blockOrder:s}=e({defaultBlocks:t,defaultBlockOrder:n});return r({blocks:i,blockOrder:s})}return e}function Or(e,t){const n={...e};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}function Mr(...e){return e.flat().filter(Boolean).join(" ")}function Nr(e,...t){const n={...e};for(const e of t)delete n[e];return n}const jr=["isLoading","headerTitle","headerActions","searchChipsTitle","searchChips","onSearchChipDelete","tabs","activeTab","onTabChange","columns","rows","actionColumn","rowActions","pagination","noRowsOverlay","onRowClick","getRowId"];function Ir(t,i,s){const a=i[t.field],o={row:i,rowIndex:s,column:t};if(t.renderCell)return t.renderCell(a,o);const l=t.valueFormatter?t.valueFormatter(a,o):a;return e.jsx(n.Typography,{variant:"body2",children:(c=l,null==c?"":"string"==typeof c||"number"==typeof c||"boolean"==typeof c?String(c):r.isValidElement(c)?c:"")});var c}function Dr(e){return e.width??180}const Ar=["xs","sm","md","lg","xl"];function Vr(e,t){if(void 0===e||"string"==typeof e)return e;for(let n=Ar.indexOf(t);n>=0;n-=1){const t=e[Ar[n]];if(void 0!==t)return t??void 0}}function Er(e,t){return e?.pin?{position:"sticky",..."left"===e.pin?{left:e.left??0}:{right:e.right??0},zIndex:t?12:4,isolation:"isolate",...t?{backgroundColor:"common.white",backgroundImage:"none",backgroundClip:"padding-box",opacity:1,"&::before":{content:'""',position:"absolute",inset:0,zIndex:-1,backgroundColor:e=>e.palette.common.white}}:{},...t?{}:{backgroundColor:"inherit"},...e.isLeftBoundary?{borderRight:e=>`1px solid ${e.palette.divider}`}:{},...e.isRightBoundary?{borderLeft:e=>`1px solid ${e.palette.divider}`}:{}}:{}}function Fr(e,t,n){const r="left"===e;return{position:"absolute",top:0,bottom:0,...r?{left:t}:{right:t},width:0,pointerEvents:"none",zIndex:7,"&::after":{content:'""',position:"absolute",top:0,bottom:0,...r?{left:0}:{right:0},width:8,background:r?"linear-gradient(to right, rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0))":"linear-gradient(to left, rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0))",opacity:n?1:0,transition:e=>e.transitions.create("opacity",{duration:160})}}}function Lr(e,t,n){return r.isValidElement(e)?r.cloneElement(e,void 0===n?t:{key:n,...t}):e}function zr(t,n){return n.map(e=>({key:String(e),block:t[String(e)]})).filter(({block:e})=>void 0!==e).map(({key:t,block:n})=>e.jsx(r.Fragment,{children:n},t))}const Wr=t=>{const r=Sr(),{headerTitle:i}=r,{children:s,className:a,component:o="h1",sx:l=[],...c}=t;return s||i?e.jsx(n.Typography,{component:o,className:Mr("nbb-base-table-header-title",a),sx:[{fontSize:{xs:"subtitle1.fontSize",sm:"h4.fontSize"},fontWeight:"fontWeightBold"},...Array.isArray(l)?l:[l]],...c,children:s||i}):null},$r=t=>{const{headerActions:r}=Sr(),{children:i,className:s,sx:a=[],...o}=t;return i||r?e.jsx(n.Stack,{direction:"row",className:Mr("nbb-base-table-header-actions",s),sx:[{alignItems:"center"},...Array.isArray(a)?a:[a]],...o,children:i||r}):null},Rr=Tr({title:Wr,actions:$r}),Zr=t=>{const{headerTitle:r,headerActions:i}=Sr(),{children:s,className:a,sx:o=[],...l}=t;return s||r||i?e.jsx(n.Stack,{direction:"row",className:Mr("nbb-base-table-header",a),sx:[{justifyContent:"space-between",alignItems:"center"},...Array.isArray(o)?o:[o]],...l,children:e.jsx(Cr,{defaultBlocks:Rr,defaultBlockOrder:Object.keys(Rr),blocksOverride:s,children:({blocks:e,blockOrder:t})=>zr(e,t)})}):null},Br=t=>{const{children:r,className:i,sx:s=[],...a}=t;return e.jsx(n.Stack,{className:Mr("nbb-base-table-content-loader",i),sx:[{alignItems:"center",justifyContent:"center",width:"100%",height:e=>e.spacing(18.25)},...Array.isArray(s)?s:[s]],...a,children:r||e.jsx(n.CircularProgress,{})})},Pr=t=>{const{tabs:r,activeTab:i,onTabChange:s}=Sr(),{children:a,className:o,value:l,onChange:c,variant:u,sx:d,tabProps:h,centered:m=!1,...f}=t,{sx:y,...g}=h??{},p=void 0===d?[]:Array.isArray(d)?d:[d],b=void 0===y?[]:Array.isArray(y)?y:[y],w=l??i,v=u??"scrollable",k=c??((e,t)=>{s?.(t)});return r&&0!==r.length&&void 0!==w?e.jsx(n.Tabs,{value:w,onChange:k,variant:v,scrollButtons:"auto",allowScrollButtonsMobile:!0,centered:m,className:Mr("nbb-base-table-tabs",o),sx:[e=>({minHeight:44,position:"relative",width:"100%",overflow:"hidden","&::before":{content:'""',position:"absolute",bottom:0,left:0,width:"100%",height:"1px",backgroundColor:e.palette.divider},"& .MuiTabs-scroller":{overflowX:"auto"},"& .MuiTabs-list, & .MuiTabs-flexContainer":{minWidth:"max-content",justifyContent:"flex-start",margin:0},"& .MuiTabs-scrollButtons":{position:"absolute",top:0,bottom:0,zIndex:2,width:32,backgroundColor:"background.paper",opacity:1,visibility:"visible",transition:"opacity 160ms ease, visibility 160ms ease"},"& .MuiTabs-scrollButtons:first-of-type":{left:0,borderRight:e=>`1px solid ${e.palette.divider}`},"& .MuiTabs-scrollButtons:last-of-type":{right:0,borderLeft:e=>`1px solid ${e.palette.divider}`},"& .MuiTabs-scrollButtons.Mui-disabled":{opacity:0,visibility:"hidden",pointerEvents:"none"}}),...p],...f,children:a||r.map(t=>e.jsx(n.Tab,{value:t.value,...void 0!==t.disabled?{disabled:t.disabled}:{},sx:[{minHeight:44,minWidth:{xs:130,sm:182},flex:"0 0 auto",textTransform:"none"},...b],label:t.label,...g},String(t.value)))}):null},qr=r=>{const i=Sr(),{searchChipsTitle:s,searchChips:a,onSearchChipDelete:o}=Or(i,r),{children:l,className:c,sx:u=[],...d}=r,h=a??[];return l||0!==h.length?e.jsx(n.Stack,{className:Mr("nbb-base-table-search-chips",c),sx:[{width:"100%",minWidth:0,gap:{xs:1,sm:3}},...Array.isArray(u)?u:[u]],...Nr(d,...jr),children:l||e.jsxs(e.Fragment,{children:[s&&e.jsx(n.Typography,{sx:e=>({fontSize:{xs:e.typography.body1.fontSize,sm:e.typography.h6.fontSize},fontWeight:600}),children:s}),e.jsx(n.Stack,{direction:"row",spacing:{xs:1,sm:2},useFlexGap:!0,flexWrap:"wrap",children:h.map((r,i)=>e.jsx(n.Chip,{label:r.label,deleteIcon:e.jsx(t.CloseOutlined,{fontSize:"inherit"}),...o&&{onDelete:e=>o(r,i,e)},sx:e=>({height:"auto",borderRadius:1.5,bgcolor:e.palette.grey[50],py:e.spacing(1.25),px:{xs:e.spacing(1.5),sm:e.spacing(2)},"& .MuiChip-label":{px:0,fontSize:{xs:e.typography.body2.fontSize,sm:e.typography.body1.fontSize},lineHeight:1.75},"& .MuiChip-deleteIcon":{m:0,ml:e.spacing(1),fontSize:e.typography.body1.fontSize,color:e.palette.text.secondary}})},r.key))})]})}):null},Hr=t=>{const{className:r,column:i,pinMeta:s,labelProps:a,children:o,sx:l,...c}=t,{className:u,sx:d,...h}=a??{},m=void 0===l?[]:Array.isArray(l)?l:[l],f=void 0===d?[]:Array.isArray(d)?d:[d],y=i.width??(s?.pin?Dr(i):void 0);return e.jsx(n.TableCell,{className:Mr("nbb-base-table-content-grid-head-cell",r),...s?.pin?{"data-pinned":s.pin}:{},...s?.isLeftBoundary?{"data-pinned-boundary":"left"}:{},...s?.isRightBoundary?{"data-pinned-boundary":"right"}:{},...i.align?{align:i.align}:{},sx:[{py:1,verticalAlign:"middle",position:"relative",zIndex:10,backgroundColor:"common.white",backgroundImage:"none",opacity:1,...y?{width:y,minWidth:y}:{},...Er(s,!0)},...m],...c,children:o||e.jsx(n.Typography,{variant:"body2",color:"text.secondary",...void 0!==u?{className:u}:{},sx:[{fontWeight:"bold"},...f],...h,children:i.headLabel})})},Ur=t=>{const{className:r,column:i,pinMeta:s,row:a,rowIndex:o,children:l,sx:c,...u}=t,d=void 0===c?[]:Array.isArray(c)?c:[c],h=i.width??(s?.pin?Dr(i):void 0);return e.jsx(n.TableCell,{className:Mr("nbb-base-table-content-grid-body-cell",r),...s?.pin?{"data-pinned":s.pin}:{},...s?.isLeftBoundary?{"data-pinned-boundary":"left"}:{},...s?.isRightBoundary?{"data-pinned-boundary":"right"}:{},...i.align?{align:i.align}:{},sx:[{py:1,height:72,verticalAlign:"middle",wordBreak:"break-word",...h?{width:h,minWidth:h}:{},...Er(s,!1)},...d],...u,children:l||Ir(i,a,o)})},_r=t=>{const{className:r,children:i,pinMeta:s,sx:a,...o}=t,l=void 0===a?[]:Array.isArray(a)?a:[a];return e.jsx(n.TableCell,{className:Mr("nbb-base-table-content-grid-head-action-cell",r),...s?.pin?{"data-pinned":s.pin}:{},...s?.isLeftBoundary?{"data-pinned-boundary":"left"}:{},...s?.isRightBoundary?{"data-pinned-boundary":"right"}:{},sx:[{width:56,py:1,verticalAlign:"middle",position:"relative",zIndex:10,backgroundColor:"common.white",backgroundImage:"none",opacity:1},Er(s,!0),...l],...o,children:i})},Yr=r=>{const{className:i,row:s,showActionMenu:a,pinMeta:o,onOpenRowMenu:l,iconButtonProps:c,icon:u,children:d,sx:h,...m}=r,{sx:f,...y}=c??{},g=void 0===h?[]:Array.isArray(h)?h:[h],p=void 0===f?[]:Array.isArray(f)?f:[f],b=a&&Boolean(l);return e.jsx(n.TableCell,{className:Mr("nbb-base-table-content-grid-body-action-cell",i),...o?.pin?{"data-pinned":o.pin}:{},...o?.isLeftBoundary?{"data-pinned-boundary":"left"}:{},...o?.isRightBoundary?{"data-pinned-boundary":"right"}:{},sx:[{width:56,py:1,height:72,verticalAlign:"middle",textAlign:"right",...Er(o,!1)},...g],...m,children:d||e.jsx(n.IconButton,{"aria-label":"row action",size:"small",sx:[{color:"text.secondary",visibility:b?"visible":"hidden"},...p],onClick:e=>{l&&a&&l(e,s)},disabled:!b,tabIndex:b?0:-1,...y,children:u||e.jsx(t.MoreVertOutlined,{})})})},Jr=Tr({cell:Hr,actionCell:_r}),Gr=t=>{const{className:i,children:s,columns:a,rowActions:o,headCell:l,actionHeadCell:c,columnPinMeta:u,actionColumnPinMeta:d,sx:h,...m}=t,f=void 0===h?[]:Array.isArray(h)?h:[h];return e.jsx(n.TableRow,{className:Mr("nbb-base-table-content-grid-head-row",i),sx:[{backgroundColor:"background.paper"},...f],...m,children:e.jsx(Cr,{defaultBlocks:Jr,defaultBlockOrder:Object.keys(Jr),blocksOverride:s,children:({blocks:t})=>{const n=t.cell,i=t.actionCell;return e.jsxs(e.Fragment,{children:[a.map((t,i)=>{const s=u?.[i],a="function"==typeof l?l({column:t,columnIndex:i,...void 0!==s?{pinMeta:s}:{}}):l;return e.jsx(r.Fragment,{children:a??Lr(n,{column:t,...void 0!==s?{pinMeta:s}:{}},`cell-${String(t.field)}-${i}`)},`${String(t.field)}-${i}`)}),o&&(("function"==typeof c?c({rowActions:o,...void 0!==d?{actionColumnPinMeta:d}:{}}):c)??Lr(i,{...void 0!==d?{pinMeta:d}:{}},"action-cell"))]})}})})},Qr=Tr({cell:Ur,actionCell:Yr}),Kr=t=>{const{className:i,children:s,row:a,rowIndex:o,columns:l,rowActions:c,onRowClick:u,onOpenRowMenu:d,bodyCell:h,actionBodyCell:m,columnPinMeta:f,actionColumnPinMeta:y,sx:g,onClick:p,hover:b,...w}=t,v=void 0===g?[]:Array.isArray(g)?g:[g],k=(c?.(a)??[]).length>0,x=b??Boolean(u),S=u?e=>{p?.(e),e.defaultPrevented||u(a)}:p;return e.jsx(n.TableRow,{className:Mr("nbb-base-table-content-grid-body-row",i),hover:!1,sx:[{backgroundColor:"common.white","& > .MuiTableCell-root":{backgroundColor:"inherit",transition:e=>e.transitions.create("background-color",{duration:120})}},...x?[{...u?{cursor:"pointer"}:{},"&:hover":{backgroundColor:e=>e.palette.grey[100]||e.palette.action.hover},"&:hover > .MuiTableCell-root":{backgroundColor:"inherit"},"&:hover > .MuiTableCell-root[data-pinned]":{backgroundColor:"inherit"},"&.MuiTableRow-hover:hover":{backgroundColor:e=>e.palette.grey[100]||e.palette.action.hover},"&.MuiTableRow-hover:hover > .MuiTableCell-root":{backgroundColor:"inherit"},"&.MuiTableRow-hover:hover > .MuiTableCell-root[data-pinned]":{backgroundColor:"inherit"}}]:[],...v],onClick:S,...w,children:e.jsx(Cr,{defaultBlocks:Qr,defaultBlockOrder:Object.keys(Qr),blocksOverride:s,children:({blocks:t})=>{const n=t.cell,i=t.actionCell;return e.jsxs(e.Fragment,{children:[l.map((t,i)=>e.jsx(r.Fragment,{children:(()=>{const e=f?.[i];return"function"==typeof h?h({column:t,columnIndex:i,...void 0!==e?{pinMeta:e}:{},row:a,rowIndex:o}):h})()??Lr(n,{column:t,...void 0!==f?.[i]?{pinMeta:f[i]}:{},row:a,rowIndex:o},`cell-${String(t.field)}-${i}`)},`${String(t.field)}-${i}`)),c&&(("function"==typeof m?m({row:a,rowIndex:o,showActionMenu:k,...void 0!==y?{actionColumnPinMeta:y}:{},onOpenRowMenu:d}):m)??Lr(i,{row:a,showActionMenu:k,...void 0!==y?{pinMeta:y}:{},onOpenRowMenu:d},"action-cell"))]})}})})},Xr=Tr({row:Gr}),ei=t=>{const{className:r,children:i,columns:s,rowActions:a,headRow:o,headCell:l,actionHeadCell:c,columnPinMeta:u,actionColumnPinMeta:d,sx:h,...m}=t,f=void 0===h?[]:Array.isArray(h)?h:[h],y="function"==typeof o?o({columns:s,rowActions:a,...void 0!==u?{columnPinMeta:u}:{},...void 0!==d?{actionColumnPinMeta:d}:{}}):o;return e.jsx(n.TableHead,{className:Mr("nbb-base-table-content-grid-head",r),sx:[{width:"100%",minWidth:0,backgroundColor:"common.white",backgroundImage:"none","& .MuiTableCell-root":{backgroundColor:"common.white",backgroundImage:"none",backgroundClip:"padding-box",opacity:1},position:"relative",zIndex:6},...f],...m,children:e.jsx(Cr,{defaultBlocks:Xr,defaultBlockOrder:Object.keys(Xr),blocksOverride:i,children:({blocks:e})=>y??Lr(e.row,{columns:s,rowActions:a,headCell:l,actionHeadCell:c,...void 0!==u?{columnPinMeta:u}:{},...void 0!==d?{actionColumnPinMeta:d}:{}})})})},ti=Tr({row:Kr}),ni=t=>{const{className:i,children:s,columns:a,rows:o,rowActions:l,onRowClick:c,getRowId:u,onOpenRowMenu:d,bodyRow:h,bodyCell:m,actionBodyCell:f,columnPinMeta:y,actionColumnPinMeta:g,sx:p,...b}=t,w=void 0===p?[]:Array.isArray(p)?p:[p];return e.jsx(n.TableBody,{className:Mr("nbb-base-table-content-grid-body",i),sx:w,...b,children:e.jsx(Cr,{defaultBlocks:ti,defaultBlockOrder:Object.keys(ti),blocksOverride:s,children:({blocks:t})=>{const n=t.row;return o.map((t,i)=>{const s=u?.(t,i)??t.id??i,o="function"==typeof h?h({row:t,rowIndex:i,columns:a,rowActions:l,onRowClick:c,onOpenRowMenu:d,...void 0!==y?{columnPinMeta:y}:{},...void 0!==g?{actionColumnPinMeta:g}:{}}):h;return e.jsx(r.Fragment,{children:o??Lr(n,{row:t,rowIndex:i,columns:a,rowActions:l,onRowClick:c,onOpenRowMenu:d,bodyCell:m,actionBodyCell:f,...void 0!==y?{columnPinMeta:y}:{},...void 0!==g?{actionColumnPinMeta:g}:{}},`row-${String(s)}`)},String(s))})}})})},ri=t=>{const{className:r,children:i,menuAnchorEl:s,menuRow:a,menuActions:o,onClose:l,anchorOrigin:c={vertical:"bottom",horizontal:"right"},transformOrigin:u={vertical:"top",horizontal:"right"},...d}=t;return e.jsx(n.Menu,{className:Mr("nbb-base-table-content-grid-row-menu",r),anchorEl:s,open:Boolean(s&&a),onClose:l,anchorOrigin:c,transformOrigin:u,...d,children:i||o.map((t,r)=>e.jsxs(n.MenuItem,{...void 0!==t.disabled?{disabled:t.disabled}:{},onClick:e=>{e.stopPropagation(),a&&t.onClick(a),l()},children:[t.icon&&e.jsx(n.ListItemIcon,{children:t.icon}),t.label]},`${String(t.label)}-${r}`))})},ii=r=>{const{noRowsOverlay:i}=Or(Sr(),r),{children:s,className:a,sx:o,...l}=r,c=void 0===o?[]:Array.isArray(o)?o:[o],u={icon:e.jsx(t.PersonOutlined,{}),title:"No Item",...i};return e.jsx(n.Box,{className:Mr("nbb-base-table-content-empty-state",a),sx:[e=>({alignItems:"center",backgroundColor:e.palette.grey[50]||e.palette.background.default,borderRadius:e.spacing(1),boxSizing:"border-box",display:"flex",flexDirection:"column",justifyContent:"center",padding:`${e.spacing(4.375)} 0`,width:"100%",minHeight:e.spacing(18.25),gap:e.spacing(1)}),...c],...Nr(l,...jr),children:s||e.jsxs(e.Fragment,{children:[e.jsx(n.Box,{sx:{"& .MuiSvgIcon-root":{fontSize:e=>e.spacing(5),color:"text.disabled"}},children:u.icon}),e.jsx(n.Typography,{variant:"body1",sx:{fontWeight:e=>e.typography.h6.fontWeight,color:"text.disabled"},children:u.title}),u.description&&e.jsx(n.Typography,{variant:"body2",color:"text.secondary",children:u.description}),u.action&&e.jsx(n.Button,{variant:"outlined",size:"small",onClick:u.action.onClick,startIcon:u.action.icon,...void 0!==u.action.disabled?{disabled:u.action.disabled}:{},children:u.action.label})]})})},si=t=>{const{className:i,children:s,tableProps:a,onPinnedShadowChange:o,onHorizontalOverflowChange:l,showLeftPinnedShadow:c=!1,showRightPinnedShadow:u=!1,sx:d,...h}=t,{sx:m,...f}=a??{},y=r.useRef(null),g=r.useRef(null),[p,b]=r.useState({left:null,right:null}),w=void 0===d?[]:Array.isArray(d)?d:[d],v=r.useCallback(()=>{const e=y.current,t=g.current;if(!e||!t)return;const n=Math.max(0,t.scrollWidth-t.clientWidth),r=n>1;l?.(r);const i=r&&t.scrollLeft>1,s=r&&t.scrollLeft<n-1;o?.({left:i,right:s});const a=e.getBoundingClientRect(),c=t.querySelector('[data-pinned-boundary="left"]'),u=t.querySelector('[data-pinned-boundary="right"]'),d=c?Math.max(0,Math.round(c.getBoundingClientRect().right-a.left)):null,h=u?Math.max(0,Math.round(a.right-u.getBoundingClientRect().left)):null;b(e=>e.left===d&&e.right===h?e:{left:d,right:h})},[l,o]);return r.useEffect(()=>{const e=g.current;if(!e)return;v(),e.addEventListener("scroll",v,{passive:!0});const t=new ResizeObserver(v);return t.observe(e),()=>{e.removeEventListener("scroll",v),t.disconnect()}},[v]),r.useEffect(()=>{v()},[s,v]),e.jsxs(n.Box,{ref:y,sx:{position:"relative",width:"100%",minWidth:0},children:[null!==p.left&&e.jsx(n.Box,{sx:Fr("left",Math.max(0,p.left),c)}),null!==p.right&&e.jsx(n.Box,{sx:Fr("right",Math.max(0,p.right),u)}),e.jsx(n.TableContainer,{ref:g,component:n.Paper,elevation:0,className:Mr("nbb-base-table-content-grid-table",i),sx:[{width:"100%",overflowX:"auto",overflowY:"hidden",backgroundColor:"background.paper"},...w],...h,children:e.jsx(n.Table,{sx:[{backgroundColor:"common.white"},...void 0===m?[]:Array.isArray(m)?m:[m]],...f,children:s})})]})},ai=Tr({table:si,head:ei,body:ni,rowMenu:ri,emptyState:ii}),oi=t=>{const a=Sr(),{columns:o,rows:l,actionColumn:c,rowActions:u,noRowsOverlay:d,onRowClick:h,getRowId:m}=Or(a,t),{className:f,children:y,emptyState:g,head:p,body:b,rowMenu:w,headRow:v,headCell:k,actionHeadCell:x,bodyRow:S,bodyCell:T,actionBodyCell:C,sx:O,...M}=t,N=void 0===O?[]:Array.isArray(O)?O:[O],[j,I]=r.useState(null),[D,A]=r.useState(null),[V,E]=r.useState(!1),[F,L]=r.useState({left:!1,right:!1}),z=(()=>{const e=s.useTheme(),t=i(e.breakpoints.up("sm")),n=i(e.breakpoints.up("md")),r=i(e.breakpoints.up("lg"));return i(e.breakpoints.up("xl"))?"xl":r?"lg":n?"md":t?"sm":"xs"})(),W=r.useCallback(e=>{E(t=>t===e?t:e)},[]),$=r.useCallback(e=>{L(t=>t.left===e.left&&t.right===e.right?t:e)},[]),R=r.useMemo(()=>V?o.map(e=>{const t=Vr(e.pin,z);if(void 0===t){const{pin:t,...n}=e;return n}return{...e,pin:t}}):o.map(e=>{const{pin:t,...n}=e;return n}),[o,V,V&&z]),Z=V&&"right"===Vr(c?.pin,z)?"right":void 0,B=r.useMemo(()=>{const e=function(e){const t=e.map(()=>({})),n=[],r=[];let i=0;e.forEach((e,r)=>{"left"===e.pin&&(t[r]={pin:"left",left:i},i+=Dr(e),n.push(r))});let s=0;for(let n=e.length-1;n>=0;n-=1){const i=e[n];"right"===i?.pin&&(t[n]={pin:"right",right:s},s+=Dr(i),r.push(n))}const a=n[n.length-1];void 0!==a&&(t[a]={...t[a],isLeftBoundary:!0});const o=r[r.length-1];return void 0!==o&&(t[o]={...t[o],isRightBoundary:!0}),t}(R),t=Boolean(u)&&"right"===Z?56:0;return e.map(e=>{const n="left"===e.pin?e:"right"===e.pin?{...e,right:(e.right??0)+t}:e;return"left"===n.pin&&n.isLeftBoundary?{...n,showBoundaryShadow:F.left}:"right"===n.pin&&n.isRightBoundary?{...n,showBoundaryShadow:F.right}:n})},[F.left,F.right,Z,R,u]),P=r.useMemo(()=>{if(u&&"right"===Z){const e=!R.some(e=>"right"===e.pin);return{pin:"right",right:0,isRightBoundary:e,showBoundaryShadow:e&&F.right}}},[F.right,Z,R,u]),q=r.useMemo(()=>D&&u?u(D):[],[D,u]),H=(e,t)=>{e.stopPropagation(),I(e.currentTarget),A(t)},U=()=>{I(null),A(null)},_="function"==typeof p?p({columns:R,rowActions:u,columnPinMeta:B,...void 0!==P?{actionColumnPinMeta:P}:{},headRow:v,headCell:k,actionHeadCell:x}):p,Y="function"==typeof b?b({columns:R,rows:l,rowActions:u,onRowClick:h,getRowId:m,onOpenRowMenu:H,columnPinMeta:B,...void 0!==P?{actionColumnPinMeta:P}:{},bodyRow:S,bodyCell:T,actionBodyCell:C}):b,J="function"==typeof w?w({menuAnchorEl:j,menuRow:D,menuActions:q,onClose:U}):w;return e.jsx(n.Stack,{className:Mr("nbb-base-table-content-grid",f),sx:[{width:"100%",minWidth:0},...N],...Nr(M,...jr),children:e.jsx(Cr,{defaultBlocks:ai,defaultBlockOrder:Object.keys(ai),blocksOverride:y,children:({blocks:t})=>{const n=t;if(0===l.length)return g??Lr(n.emptyState,{...void 0!==d?{noRowsOverlay:d}:{}},"empty-state");const r=_??Lr(n.head,{columns:R,rowActions:u,...void 0!==B?{columnPinMeta:B}:{},...void 0!==P?{actionColumnPinMeta:P}:{},headRow:v,headCell:k,actionHeadCell:x},"grid-head"),i=Y??Lr(n.body,{columns:R,rows:l,rowActions:u,onRowClick:h,getRowId:m,onOpenRowMenu:H,...void 0!==B?{columnPinMeta:B}:{},...void 0!==P?{actionColumnPinMeta:P}:{},bodyRow:S,bodyCell:T,actionBodyCell:C},"grid-body"),s=Lr(n.table,{onHorizontalOverflowChange:W,onPinnedShadowChange:$,showLeftPinnedShadow:F.left,showRightPinnedShadow:F.right,children:e.jsxs(e.Fragment,{children:[r,i]})},"grid-table"),a=J??Lr(n.rowMenu,{menuAnchorEl:j,menuRow:D,menuActions:q,onClose:U},"grid-row-menu");return e.jsxs(e.Fragment,{children:[s,a]})}})})},li=Tr({loader:Br,emptyState:ii,grid:oi}),ci=t=>{const{isLoading:r,rows:i}=Or(Sr(),t),{children:s,className:a,...o}=t;return e.jsx(n.Box,{className:Mr("nbb-base-table-content",a),...Nr(o,...jr),children:e.jsx(Cr,{defaultBlocks:li,defaultBlockOrder:Object.keys(li),blocksOverride:s,children:({blocks:e})=>{const t=e;return r?Lr(t.loader,{},"content-loader"):i&&0!==i.length?Lr(t.grid,{},"content-grid"):Lr(t.emptyState,{},"content-empty-state")}})})},ui=t=>{const{pagination:r,rows:a,isLoading:o}=Or(Sr(),t),{children:l,className:c,sx:u=[],...d}=t,h=s.useTheme(),m=i(h.breakpoints.down("sm")),f=i(h.breakpoints.down("md"));if(!r||o||!a||0===a.length)return null;const y=m?0:1,g=m||f?0:1;return e.jsx(n.Stack,{className:Mr("nbb-base-table-pagination",c),sx:[{alignItems:"center",width:"100%"},...Array.isArray(u)?u:[u]],...Nr(d,...jr),children:l||e.jsx(n.Pagination,{count:Math.max(1,Math.ceil(r.total/r.pageSize)),page:r.page,onChange:(e,t)=>r.onPageChange(t),variant:"outlined",color:"primary",shape:"rounded",boundaryCount:y,siblingCount:g,sx:{maxWidth:"100%","& .MuiPagination-ul":{flexWrap:"nowrap",justifyContent:"center"}}})})},di=Tr({header:Zr,tabs:Pr,searchChips:qr,content:ci,pagination:ui}),hi=({sx:t,spacing:i=3,className:s,children:a,...o})=>{const l=function(e,...t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}(o,...jr),c=Nr(o,...jr),{tabs:u,activeTab:d,onTabChange:h}=l,[m,f]=r.useState(u?.[0]?.value);r.useEffect(()=>{u?.length&&f(e=>void 0!==e&&u.some(t=>t.value===e)?e:u[0]?.value)},[u]);const y=void 0!==d?d:m,g={...l,...void 0!==y?{activeTab:y}:{},onTabChange:e=>{void 0===d&&f(e),h?.(e)}};return e.jsx(n.Stack,{className:Mr("nbb-base-table",s),spacing:i,sx:[{p:2,width:"100%",maxWidth:"100%",boxSizing:"border-box"},...Array.isArray(t)?t:[t]],...c,children:e.jsx(xr,{...g,children:e.jsx(Cr,{defaultBlocks:di,defaultBlockOrder:Object.keys(di),blocksOverride:a,children:({blocks:e,blockOrder:t})=>zr(e,t)})})})},mi=Zr;mi.Title=Wr,mi.Actions=$r;const fi=qr,yi=ei;yi.Row=Gr,yi.Cell=Hr,yi.ActionCell=_r;const gi=ni;gi.Row=Kr,gi.Cell=Ur,gi.ActionCell=Yr;const pi=oi;pi.Table=si,pi.Head=yi,pi.Body=gi,pi.RowMenu=ri;const bi=ci;bi.Loader=Br,bi.EmptyState=ii,bi.Grid=pi,hi.Header=mi,hi.Tabs=Pr,hi.SearchChips=fi,hi.Content=bi,hi.Pagination=ui;const wi=["labels","headerAction","layout","data"],vi=r.createContext(void 0),ki=()=>{const e=r.useContext(vi);if(!e)throw new Error("useBaseViewListContext must be used within a BaseViewListProvider");return e};function xi(e){return"[object Object]"===Object.prototype.toString.call(e)&&!r.isValidElement(e)}const Si=new Set(["__proto__","prototype","constructor"]);function Ti(e,t){const n={...e};for(const e of Reflect.ownKeys(t)){if(Si.has(e))continue;const r=n[e],i=t[e];xi(r)&&xi(i)?n[e]=Ti(r,i):n[e]=i}return n}function Ci(...e){return e.flat().filter(Boolean).join(" ")}function Oi(e,...t){const n={...e};for(const e of t)delete n[e];return n}const Mi=({children:t,className:r,onClick:i,...s})=>{const{labels:a,headerAction:o}=Ti(ki(),s),{headerActionButton:l}=a??{};return e.jsx(n.Button,{variant:"outlined",size:"medium",className:Ci("nbb-base-view-list-header-action-button",r),...(i??o)&&{onClick:i??o},...Oi(s,...wi),children:t??l})},Ni=({sx:t,className:r,...i})=>{const{layout:s}=Ti(ki(),i),a="two-column"===s;return e.jsx(n.Typography,{component:"dt",variant:"subtitle1",sx:[e=>({display:"inline-flex",alignItems:"center",px:2,py:3,flexShrink:0,width:{xs:96,sm:204},fontWeight:e.typography.fontWeightBold,...a?{}:{p:0}}),...Array.isArray(t)?t:[t]],className:Ci("nbb-base-view-list-item-key",r),...Oi(i,...wi)})},ji=({sx:t,className:r,...i})=>{const{layout:s}=Ti(ki(),i);return e.jsx(n.Typography,{component:"dd",variant:"body2",sx:[{display:"inline-flex",alignItems:"center",px:2,py:3,..."two-column"===s?{}:{p:0}},...Array.isArray(t)?t:[t]],className:Ci("nbb-base-view-list-item-value",r),...Oi(i,...wi)})},Ii=({sx:t,className:r,...i})=>{const{layout:s}=Ti(ki(),i),a="two-column"===s;return e.jsx(n.ListItem,{divider:!0,sx:[e=>({display:"flex",flexDirection:a?"row":"column",alignItems:a?"center":"flex-start",...a?{p:0}:{px:2,py:3},"&:first-of-type":{borderTopColor:e.palette.divider,borderTopWidth:1,borderTopStyle:"solid"}}),...Array.isArray(t)?t:[t]],className:Ci("nbb-base-view-list-item",r),...Oi(i,...wi)})};var Di;function Ai(...e){return e.flat().filter(Boolean).join(" ")}function Vi({labels:r,searchValue:i,onSearchFieldChange:s,onSearchSubmit:a}){return e.jsx(n.TextField,{type:"search",variant:"outlined",placeholder:r.searchFieldPlaceholder,onChange:e=>s?.(e.target.value),onKeyDown:e=>{a&&"Enter"===e.key&&!e.nativeEvent.isComposing&&e.target instanceof HTMLInputElement&&(e.preventDefault(),a())},...void 0!==i?{value:i}:{},sx:e=>({width:{xs:"100%",md:e.spacing(44.75)},"& .MuiOutlinedInput-root":{pr:1.5,"& .MuiOutlinedInput-input":{pl:1.5,pt:1.625,pb:1.625,fontSize:e.typography.body2.fontSize}}}),slotProps:{input:{endAdornment:e.jsx(n.InputAdornment,{position:"end",children:e.jsx(n.IconButton,{"aria-label":"Search",edge:"end",size:"small",...a?{onClick:a}:{},children:e.jsx(t.Search,{})})})}}})}function Ei(n,r,i,s,a){if(!a||!n.rowActions)return;const o=n.rowActions;return n=>{if(s&&!s(n))return[];const l=a(n);return l&&0!==l.length?l.flatMap(s=>"activate"===s?r?[{label:o.activate,icon:e.jsx(t.Loop,{sx:e=>({fontSize:e.typography.h5.fontSize})}),onClick:()=>r(n.id)}]:[]:"deactivate"===s&&i?[{label:o.deactivate,icon:e.jsx(t.BlockOutlined,{sx:e=>({fontSize:e.typography.h5.fontSize})}),onClick:()=>i(n.id)}]:[]):[]}}function Fi(t){const r=function(e){if(!e)return null;const t=wr.fromISO(e);return t.isValid?t:null}("string"==typeof t?t:void 0),i=r?.toFormat("yyyy/MM/dd")??"N/A",s=r?.toLocaleString(wr.DATETIME_FULL)??"N/A";return e.jsx(n.Tooltip,{title:s,children:e.jsx("span",{children:i})})}function Li(e,t){return[{field:"name",headLabel:e.headerRow.name,pin:{sm:"left"},width:180},{field:"joinDate",headLabel:e.headerRow.joinDate,width:180,valueFormatter:Fi},{field:"createdAt",headLabel:e.headerRow.createdAt,width:180,valueFormatter:Fi},{field:"status",headLabel:e.headerRow.status,width:180,valueFormatter:(n,{row:r})=>r.status===t.active?e.cellData.statusActive:r.status===t.inactive?e.cellData.statusInactive:r.status}]}function zi(e){return{page:e.currentPage,pageSize:1,total:e.totalPages,onPageChange:e.onPageChange}}function Wi(n){return{icon:e.jsx(t.PersonOutlined,{}),title:n.emptyStateMessage}}function $i(t,n){return n.filter(e=>e in t).map(n=>e.jsx(r.Fragment,{children:t[n]},String(n)))}Ii.Key=Ni,Ii.Value=ji,Di={header:({children:t,className:r,sx:i,...s})=>{const{labels:a,headerAction:o}=Ti(ki(),s),{headerTitle:l,headerActionButton:c}=a??{};return(l??c??t??null)&&e.jsx(n.Stack,{direction:"row",className:Ci("nbb-base-view-list-header",r),sx:[{columnGap:2,justifyContent:"space-between",alignItems:"center"},...Array.isArray(i)?i:[i]],...Oi(s,...wi),children:t??e.jsxs(e.Fragment,{children:[e.jsx(n.Typography,{component:"div",sx:{typography:{xs:"h6",sm:"h4"},fontWeight:"bold",flex:"1 1 auto",minWidth:0},children:l}),c||o?e.jsx(n.Box,{sx:{flexShrink:0},children:e.jsx(Mi,{...a&&{labels:a},...o&&{headerAction:o}})}):null]})})},subheader:({children:t,className:r,sx:i,...s})=>{const{labels:a}=Ti(ki(),s),{subheaderTitle:o,headerTitle:l,headerActionButton:c}=a??{};return(o??t??null)&&e.jsx(n.Stack,{direction:"row",className:Ci("nbb-base-view-list-subheader",r),sx:[{columnGap:2,justifyContent:"space-between",alignItems:"center",...l||c?{"&&":{mt:{xs:2,sm:4}}}:{}},...Array.isArray(i)?i:[i]],...Oi(s,...wi),children:t??e.jsx(n.Typography,{component:"div",typography:"body2",sx:e=>({color:e.palette.secondary.main,flex:"1 1 auto",minWidth:0}),children:o})})},itemList:({children:t,sx:r,className:i,...s})=>{const{data:a}=Ti(ki(),s);return e.jsx(n.List,{component:"dl",sx:[{m:0,p:0},...Array.isArray(r)?r:[r]],className:Ci("nbb-base-view-list-item-list",i),...Oi(s,...wi),children:t??(void 0===a?null:Array.isArray(a)?a.map((t,n)=>e.jsx(Ii,{children:e.jsx(Ii.Value,{children:t})},`${n}-${String(t)}`)):Object.entries(a).map(([t,n])=>e.jsxs(Ii,{children:[e.jsx(Ii.Key,{children:t}),e.jsx(Ii.Value,{children:n})]},t)))})},item:Ii,itemKey:Ni,itemValue:ji},Object.fromEntries(Object.entries(Di).map(([e,t])=>[e,r.createElement(t,{key:e})])),"undefined"!=typeof navigator&&navigator.language&&(Te.defaultLocale=navigator.language);const Ri=({className:t,children:r,labels:i,searchValue:s,onSearchFieldChange:a,onSearchSubmit:o,onNavigate:l,onItemActivate:c,onItemDeactivate:u,shouldShowDropdownMenu:d,resolveRowAction:h,statusMatch:m={active:"active",inactive:"inactive"},pagination:f,data:y,rowHref:g,tabs:p,currentTab:b,onTabChange:w,listOrganizationsTitle:v,isLoading:k,...x})=>{const S=Li(i,m),T=p&&function(t){return t.map(t=>({value:t.key,disabled:Boolean(t.isDisabled),label:e.jsxs(e.Fragment,{children:[t.label,t.subtitle&&e.jsx(n.Typography,{component:"span",variant:"body2",color:"text.secondary",children:t.subtitle})]})}))}(p),C=f&&zi(f),O=Ei(i,c,u,d,h),M=Vi({labels:i,searchValue:s,onSearchFieldChange:a,onSearchSubmit:o}),N=e.jsx(Ri.Title,{}),j=e.jsx(Ri.Action,{}),I=e.jsxs(Ri.Header,{children:[N,j]}),D=e.jsx(Ri.Loader,{}),A=e.jsx(Ri.Tabs,{}),V=e.jsx(Ri.SearchChips,{}),E=e.jsx(Ri.Table,{}),F={title:N,action:j,header:I,loader:D,content:e.jsx(Ri.Content,{}),tabs:A,searchChips:V,table:E,pagination:e.jsx(Ri.Pagination,{...f?{pagination:f}:{},data:y,...void 0!==k?{isLoading:k}:{}})},L=["header","searchChips","tabs","content","pagination"],z=void 0===r?$i(F,L):"function"==typeof r?(()=>{const{blocks:e,blockOrder:t}=r({defaultBlocks:F,defaultBlockOrder:L});return $i(e,t)})():r;return e.jsx(hi,{className:Ai("nbb-list-organizations-container",t),headerTitle:v,headerActions:M,columns:S,rows:y,...O?{rowActions:O,actionColumn:{pin:"right"}}:{},noRowsOverlay:Wi(i),...T?{tabs:T}:{},...void 0!==b?{activeTab:b}:{},...w?{onTabChange:w}:{},...C?{pagination:C}:{},...void 0!==k?{isLoading:k}:{},...g&&l?{onRowClick:e=>{const t=g(e);t&&l(t)}}:{},...x,children:z})};Ri.Title=({listOrganizationsTitle:t,children:n,className:r,...i})=>e.jsx(hi.Header.Title,{className:Ai("nbb-list-organizations-title",r),...i,children:n||t}),Ri.Action=({children:t,className:n,labels:r,searchValue:i,onSearchFieldChange:s,onSearchSubmit:a,sx:o=[],...l})=>{const c=t||(r?Vi({labels:r,searchValue:i,onSearchFieldChange:s,onSearchSubmit:a}):void 0);return e.jsx(hi.Header.Actions,{className:Ai("nbb-list-organizations-actions",n),sx:[{width:{xs:"100%",md:"auto"},justifyContent:{xs:"flex-start",md:"flex-end"}},...Array.isArray(o)?o:[o]],...l,children:c})},Ri.Header=({children:t,className:n,sx:r=[],...i})=>e.jsx(hi.Header,{className:Ai("nbb-list-organizations-header",n),sx:[{flexWrap:{xs:"wrap",md:"nowrap"},alignItems:{xs:"flex-start",md:"center"},columnGap:2,rowGap:{xs:3.75,md:2}},...Array.isArray(r)?r:[r]],...i,children:t}),Ri.Loader=({children:t,className:n,...r})=>e.jsx(hi.Content.Loader,{className:Ai("nbb-list-organizations-loader",n),...r,children:t}),Ri.Content=({children:t,className:n,...r})=>e.jsx(hi.Content,{className:Ai("nbb-list-organizations-content",n),...r,children:t}),Ri.Tabs=({children:t,className:n,...r})=>e.jsx(hi.Tabs,{className:Ai("nbb-list-organizations-tabs",n),...r,children:t}),Ri.SearchChips=({className:t,...n})=>e.jsx(hi.SearchChips,{className:Ai("nbb-list-organizations-search-chips",t),...n}),Ri.Pagination=({className:t,pagination:n,data:r,isLoading:i,...s})=>{const a=n&&zi(n),o=Ai("nbb-list-organizations-pagination",n?.className,t);return e.jsx(hi.Pagination,{className:o,...a?{pagination:a}:{},...r?{rows:r}:{},...void 0!==i?{isLoading:i}:{},...s})},Ri.Table=({className:t,labels:n,data:r,columns:i,rowActions:s,actionColumn:a,onRowClick:o,onItemActivate:l,onItemDeactivate:c,shouldShowDropdownMenu:u,resolveRowAction:d,statusMatch:h={active:"active",inactive:"inactive"},rowHref:m,onNavigate:f,...y})=>{const g=i??(n?Li(n,h):void 0),p=n?Wi(n):void 0,b=n?Ei(n,l,c,u,d):void 0,w=void 0!==s?s:b,v=a??(w?{pin:"right"}:void 0),k=o??(m&&f?e=>{const t=m(e);t&&f(t)}:void 0);return e.jsx(hi.Content.Grid,{className:Ai("nbb-list-organizations-table",t),...g?{columns:g}:{},...r?{rows:r}:{},...p?{noRowsOverlay:p}:{},...w?{rowActions:w}:{},...v?{actionColumn:v}:{},...k?{onRowClick:k}:{},...y})},exports.ListOrganizations=Ri;
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/icons-material"),n=require("@mui/material"),r=require("react"),i=require("@mui/material/useMediaQuery"),s=require("@mui/material/styles");class a extends Error{}class o extends a{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class l extends a{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class c extends a{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class u extends a{}class d extends a{constructor(e){super(`Invalid unit ${e}`)}}class h extends a{}class m extends a{constructor(){super("Zone is an abstract class")}}const f="numeric",y="short",g="long",p={year:f,month:f,day:f},b={year:f,month:y,day:f},w={year:f,month:y,day:f,weekday:y},v={year:f,month:g,day:f},k={year:f,month:g,day:f,weekday:g},x={hour:f,minute:f},S={hour:f,minute:f,second:f},T={hour:f,minute:f,second:f,timeZoneName:y},C={hour:f,minute:f,second:f,timeZoneName:g},O={hour:f,minute:f,hourCycle:"h23"},M={hour:f,minute:f,second:f,hourCycle:"h23"},N={hour:f,minute:f,second:f,hourCycle:"h23",timeZoneName:y},j={hour:f,minute:f,second:f,hourCycle:"h23",timeZoneName:g},I={year:f,month:f,day:f,hour:f,minute:f},D={year:f,month:f,day:f,hour:f,minute:f,second:f},A={year:f,month:y,day:f,hour:f,minute:f},V={year:f,month:y,day:f,hour:f,minute:f,second:f},E={year:f,month:y,day:f,weekday:y,hour:f,minute:f},F={year:f,month:g,day:f,hour:f,minute:f,timeZoneName:y},L={year:f,month:g,day:f,hour:f,minute:f,second:f,timeZoneName:y},z={year:f,month:g,day:f,weekday:g,hour:f,minute:f,timeZoneName:g},W={year:f,month:g,day:f,weekday:g,hour:f,minute:f,second:f,timeZoneName:g};class ${get type(){throw new m}get name(){throw new m}get ianaName(){return this.name}get isUniversal(){throw new m}offsetName(e,t){throw new m}formatOffset(e,t){throw new m}offset(e){throw new m}equals(e){throw new m}get isValid(){throw new m}}let R=null;class Z extends ${static get instance(){return null===R&&(R=new Z),R}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return ot(e,t,n)}formatOffset(e,t){return dt(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}const B=new Map,P={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6},q=new Map;class H extends ${static create(e){let t=q.get(e);return void 0===t&&q.set(e,t=new H(e)),t}static resetCache(){q.clear(),B.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=H.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return ot(e,t,n,this.name)}formatOffset(e,t){return dt(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const n=function(e){let t=B.get(e);return void 0===t&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),B.set(e,t)),t}(this.name);let[r,i,s,a,o,l,c]=n.formatToParts?function(e,t){const n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){const{type:t,value:i}=n[e],s=P[t];"era"===t?r[s]=i:Re(s)||(r[s]=parseInt(i,10))}return r}(n,t):function(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,s,a,o,l,c,u]=r;return[a,i,s,o,l,c,u]}(n,t);"BC"===a&&(r=1-Math.abs(r));let u=+t;const d=u%1e3;return u-=d>=0?d:1e3+d,(rt({year:r,month:i,day:s,hour:24===o?0:o,minute:l,second:c,millisecond:0})-u)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let U={};const _=new Map;function Y(e,t={}){const n=JSON.stringify([e,t]);let r=_.get(n);return void 0===r&&(r=new Intl.DateTimeFormat(e,t),_.set(n,r)),r}const J=new Map,G=new Map;let Q=null;const K=new Map;function X(e){let t=K.get(e);return void 0===t&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),K.set(e,t)),t}const ee=new Map;function te(e,t,n,r){const i=e.listingMode();return"error"===i?null:"en"===i?n(t):r(t)}class ne{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:r,floor:i,...s}=n;if(!t||Object.keys(s).length>0){const t={useGrouping:!1,...n};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=function(e,t={}){const n=JSON.stringify([e,t]);let r=J.get(n);return void 0===r&&(r=new Intl.NumberFormat(e,t),J.set(n,r)),r}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Je(this.floor?Math.floor(e):Xe(e,3),this.padTo)}}class re{constructor(e,t,n){let r;if(this.opts=n,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){const t=e.offset/60*-1,n=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&H.create(n).valid?(r=n,this.dt=e):(r="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=Y(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if("timeZoneName"===e.type){const t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class ie{constructor(e,t,n){this.opts={style:"long",...n},!t&&Pe()&&(this.rtf=function(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let s=G.get(i);return void 0===s&&(s=new Intl.RelativeTimeFormat(e,t),G.set(i,s)),s}(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&s){const n="days"===e;switch(t){case 1:return n?"tomorrow":`next ${i[e][0]}`;case-1:return n?"yesterday":`last ${i[e][0]}`;case 0:return n?"today":`this ${i[e][0]}`}}const a=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,c=i[e],u=r?l?c[1]:c[2]||c[1]:l?i[e][0]:e;return a?`${o} ${u} ago`:`in ${o} ${u}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const se={firstDay:1,minimalDays:4,weekend:[6,7]};class ae{static fromOpts(e){return ae.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,n,r,i=!1){const s=e||Te.defaultLocale,a=s||(i?"en-US":Q||(Q=(new Intl.DateTimeFormat).resolvedOptions().locale,Q)),o=t||Te.defaultNumberingSystem,l=n||Te.defaultOutputCalendar,c=_e(r)||Te.defaultWeekSettings;return new ae(a,o,l,c,s)}static resetCache(){Q=null,_.clear(),J.clear(),G.clear(),K.clear(),ee.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:n,weekSettings:r}={}){return ae.create(e,t,n,r)}constructor(e,t,n,r,i){const[s,a,o]=function(e){const t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(-1===n)return[e];{let t,r;try{t=Y(e).resolvedOptions(),r=e}catch(i){const s=e.substring(0,n);t=Y(s).resolvedOptions(),r=s}const{numberingSystem:i,calendar:s}=t;return[r,i,s]}}(e);this.locale=s,this.numberingSystem=t||a||null,this.outputCalendar=n||o||null,this.weekSettings=r,this.intl=function(e,t,n){return n||t?(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===X(e.locale).numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?ae.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,_e(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return te(this,e,gt,()=>{const n="ja"===this.intl||this.intl.startsWith("ja-"),r=(t&=!n)?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";if(!this.monthsCache[i][e]){const t=n?e=>this.dtFormatter(e,r).format():e=>this.extract(e,r,"month");this.monthsCache[i][e]=function(e){const t=[];for(let n=1;n<=12;n++){const r=wr.utc(2009,n,1);t.push(e(r))}return t}(t)}return this.monthsCache[i][e]})}weekdays(e,t=!1){return te(this,e,vt,()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=function(e){const t=[];for(let n=1;n<=7;n++){const r=wr.utc(2016,11,13+n);t.push(e(r))}return t}(e=>this.extract(e,n,"weekday"))),this.weekdaysCache[r][e]})}meridiems(){return te(this,void 0,()=>kt,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[wr.utc(2016,11,13,9),wr.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return te(this,e,Ct,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[wr.utc(-40,1,1),wr.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,n){const r=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===n);return r?r.value:null}numberFormatter(e={}){return new ne(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new re(e,this.intl,t)}relFormatter(e={}){return new ie(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const n=JSON.stringify([e,t]);let r=U[n];return r||(r=new Intl.ListFormat(e,t),U[n]=r),r}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||X(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:qe()?function(e){let t=ee.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...se,...t}),ee.set(e,t)}return t}(this.locale):se}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let oe=null;class le extends ${static get utcInstance(){return null===oe&&(oe=new le(0)),oe}static instance(e){return 0===e?le.utcInstance:new le(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new le(lt(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${dt(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${dt(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return dt(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class ce extends ${constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function ue(e,t){if(Re(e)||null===e)return t;if(e instanceof $)return e;if("string"==typeof e){const n=e.toLowerCase();return"default"===n?t:"local"===n||"system"===n?Z.instance:"utc"===n||"gmt"===n?le.utcInstance:le.parseSpecifier(n)||H.create(e)}return Ze(e)?le.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new ce(e)}const de={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},he={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},me=de.hanidec.replace(/[\[|\]]/g,"").split(""),fe=new Map;function ye({numberingSystem:e},t=""){const n=e||"latn";let r=fe.get(n);void 0===r&&(r=new Map,fe.set(n,r));let i=r.get(t);return void 0===i&&(i=new RegExp(`${de[n]}${t}`),r.set(t,i)),i}let ge,pe=()=>Date.now(),be="system",we=null,ve=null,ke=null,xe=60,Se=null;class Te{static get now(){return pe}static set now(e){pe=e}static set defaultZone(e){be=e}static get defaultZone(){return ue(be,Z.instance)}static get defaultLocale(){return we}static set defaultLocale(e){we=e}static get defaultNumberingSystem(){return ve}static set defaultNumberingSystem(e){ve=e}static get defaultOutputCalendar(){return ke}static set defaultOutputCalendar(e){ke=e}static get defaultWeekSettings(){return Se}static set defaultWeekSettings(e){Se=_e(e)}static get twoDigitCutoffYear(){return xe}static set twoDigitCutoffYear(e){xe=e%100}static get throwOnInvalid(){return ge}static set throwOnInvalid(e){ge=e}static resetCaches(){ae.resetCache(),H.resetCache(),wr.resetCache(),fe.clear()}}class Ce{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Oe=[0,31,59,90,120,151,181,212,243,273,304,334],Me=[0,31,60,91,121,152,182,213,244,274,305,335];function Ne(e,t){return new Ce("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function je(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return 0===i?7:i}function Ie(e,t,n){return n+(et(e)?Me:Oe)[t-1]}function De(e,t){const n=et(e)?Me:Oe,r=n.findIndex(e=>e<t);return{month:r+1,day:t-n[r]}}function Ae(e,t){return(e-t+7)%7+1}function Ve(e,t=4,n=1){const{year:r,month:i,day:s}=e,a=Ie(r,i,s),o=Ae(je(r,i,s),n);let l,c=Math.floor((a-o+14-t)/7);return c<1?(l=r-1,c=st(l,t,n)):c>st(r,t,n)?(l=r+1,c=1):l=r,{weekYear:l,weekNumber:c,weekday:o,...ht(e)}}function Ee(e,t=4,n=1){const{weekYear:r,weekNumber:i,weekday:s}=e,a=Ae(je(r,1,t),n),o=tt(r);let l,c=7*i+s-a-7+t;c<1?(l=r-1,c+=tt(l)):c>o?(l=r+1,c-=tt(r)):l=r;const{month:u,day:d}=De(l,c);return{year:l,month:u,day:d,...ht(e)}}function Fe(e){const{year:t,month:n,day:r}=e;return{year:t,ordinal:Ie(t,n,r),...ht(e)}}function Le(e){const{year:t,ordinal:n}=e,{month:r,day:i}=De(t,n);return{year:t,month:r,day:i,...ht(e)}}function ze(e,t){if(!Re(e.localWeekday)||!Re(e.localWeekNumber)||!Re(e.localWeekYear)){if(!Re(e.weekday)||!Re(e.weekNumber)||!Re(e.weekYear))throw new u("Cannot mix locale-based week fields with ISO-based week fields");return Re(e.localWeekday)||(e.weekday=e.localWeekday),Re(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Re(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function We(e){const t=Be(e.year),n=Ye(e.month,1,12),r=Ye(e.day,1,nt(e.year,e.month));return t?n?!r&&Ne("day",e.day):Ne("month",e.month):Ne("year",e.year)}function $e(e){const{hour:t,minute:n,second:r,millisecond:i}=e,s=Ye(t,0,23)||24===t&&0===n&&0===r&&0===i,a=Ye(n,0,59),o=Ye(r,0,59),l=Ye(i,0,999);return s?a?o?!l&&Ne("millisecond",i):Ne("second",r):Ne("minute",n):Ne("hour",t)}function Re(e){return void 0===e}function Ze(e){return"number"==typeof e}function Be(e){return"number"==typeof e&&e%1==0}function Pe(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function qe(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function He(e,t,n){if(0!==e.length)return e.reduce((e,r)=>{const i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i},null)[1]}function Ue(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _e(e){if(null==e)return null;if("object"!=typeof e)throw new h("Week settings must be an object");if(!Ye(e.firstDay,1,7)||!Ye(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!Ye(e,1,7)))throw new h("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function Ye(e,t,n){return Be(e)&&e>=t&&e<=n}function Je(e,t=2){let n;return n=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),n}function Ge(e){return Re(e)||null===e||""===e?void 0:parseInt(e,10)}function Qe(e){return Re(e)||null===e||""===e?void 0:parseFloat(e)}function Ke(e){if(!Re(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function Xe(e,t,n="round"){const r=10**t;switch(n){case"expand":return e>0?Math.ceil(e*r)/r:Math.floor(e*r)/r;case"trunc":return Math.trunc(e*r)/r;case"round":return Math.round(e*r)/r;case"floor":return Math.floor(e*r)/r;case"ceil":return Math.ceil(e*r)/r;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function et(e){return e%4==0&&(e%100!=0||e%400==0)}function tt(e){return et(e)?366:365}function nt(e,t){const n=(r=t-1)-12*Math.floor(r/12)+1;var r;return 2===n?et(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function rt(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function it(e,t,n){return-Ae(je(e,1,t),n)+t-1}function st(e,t=4,n=1){const r=it(e,t,n),i=it(e+1,t,n);return(tt(e)-r+i)/7}function at(e){return e>99?e:e>Te.twoDigitCutoffYear?1900+e:2e3+e}function ot(e,t,n,r=null){const i=new Date(e),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(s.timeZone=r);const a={timeZoneName:t,...s},o=new Intl.DateTimeFormat(n,a).formatToParts(i).find(e=>"timezonename"===e.type.toLowerCase());return o?o.value:null}function lt(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function ct(e){const t=Number(e);if("boolean"==typeof e||""===e||!Number.isFinite(t))throw new h(`Invalid unit value ${e}`);return t}function ut(e,t){const n={};for(const r in e)if(Ue(e,r)){const i=e[r];if(null==i)continue;n[t(r)]=ct(i)}return n}function dt(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Je(n,2)}:${Je(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Je(n,2)}${Je(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function ht(e){return function(e){return["hour","minute","second","millisecond"].reduce((t,n)=>(t[n]=e[n],t),{})}(e)}const mt=["January","February","March","April","May","June","July","August","September","October","November","December"],ft=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],yt=["J","F","M","A","M","J","J","A","S","O","N","D"];function gt(e){switch(e){case"narrow":return[...yt];case"short":return[...ft];case"long":return[...mt];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const pt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],bt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],wt=["M","T","W","T","F","S","S"];function vt(e){switch(e){case"narrow":return[...wt];case"short":return[...bt];case"long":return[...pt];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const kt=["AM","PM"],xt=["Before Christ","Anno Domini"],St=["BC","AD"],Tt=["B","A"];function Ct(e){switch(e){case"narrow":return[...Tt];case"short":return[...St];case"long":return[...xt];default:return null}}function Ot(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const Mt={D:p,DD:b,DDD:v,DDDD:k,t:x,tt:S,ttt:T,tttt:C,T:O,TT:M,TTT:N,TTTT:j,f:I,ff:A,fff:F,ffff:z,F:D,FF:V,FFF:L,FFFF:W};class Nt{static create(e,t={}){return new Nt(e,t)}static parseFormat(e){let t=null,n="",r=!1;const i=[];for(let s=0;s<e.length;s++){const a=e.charAt(s);"'"===a?((n.length>0||r)&&i.push({literal:r||/^\s+$/.test(n),val:""===n?"'":n}),t=null,n="",r=!r):r||a===t?n+=a:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=a,t=a)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(e){return Mt[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,n=void 0){if(this.opts.forceSimple)return Je(e,t);const r={...this.opts};return t>0&&(r.padTo=t),n&&(r.signDisplay=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,t){const n="en"===this.loc.listingMode(),r=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,i=(t,n)=>this.loc.extract(e,t,n),s=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",a=(t,r)=>n?function(e,t){return gt(t)[e.month-1]}(e,t):i(r?{month:t}:{month:t,day:"numeric"},"month"),o=(t,r)=>n?function(e,t){return vt(t)[e.weekday-1]}(e,t):i(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),l=t=>{const n=Nt.macroTokenToFormatOpts(t);return n?this.formatWithSystemDefault(e,n):t},c=t=>n?function(e,t){return Ct(t)[e.year<0?0:1]}(e,t):i({era:t},"era");return Ot(Nt.parseFormat(t),t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return n?function(e){return kt[e.hour<12?0:1]}(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod");case"d":return r?i({day:"numeric"},"day"):this.num(e.day);case"dd":return r?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return o("short",!0);case"cccc":return o("long",!0);case"ccccc":return o("narrow",!0);case"EEE":return o("short",!1);case"EEEE":return o("long",!1);case"EEEEE":return o("narrow",!1);case"L":return r?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return r?i({month:"numeric"},"month"):this.num(e.month);case"MM":return r?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return r?i({year:"numeric"},"year"):this.num(e.year);case"yy":return r?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return l(t)}})}formatDurationFromString(e,t){const n="negativeLargestOnly"===this.opts.signMode?-1:1,r=e=>{switch(e[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},i=Nt.parseFormat(t),s=i.reduce((e,{literal:t,val:n})=>t?e:e.concat(n),[]),a=e.shiftTo(...s.map(r).filter(e=>e));return Ot(i,((e,t)=>i=>{const s=r(i);if(s){const r=t.isNegativeDuration&&s!==t.largestUnit?n:1;let a;return a="negativeLargestOnly"===this.opts.signMode&&s!==t.largestUnit?"never":"all"===this.opts.signMode?"always":"auto",this.num(e.get(s)*r,i.length,a)}return i})(a,{isNegativeDuration:a<0,largestUnit:Object.keys(a.values)[0]}))}}const jt=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function It(...e){const t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function Dt(...e){return t=>e.reduce(([e,n,r],i)=>{const[s,a,o]=i(t,r);return[{...e,...s},a||n,o]},[{},null,1]).slice(0,2)}function At(e,...t){if(null==e)return[null,null];for(const[n,r]of t){const t=n.exec(e);if(t)return r(t)}return[null,null]}function Vt(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++)r[e[i]]=Ge(t[n+i]);return[r,null,n+i]}}const Et=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Ft=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Lt=RegExp(`${Ft.source}(?:${Et.source}?(?:\\[(${jt.source})\\])?)?`),zt=RegExp(`(?:[Tt]${Lt.source})?`),Wt=Vt("weekYear","weekNumber","weekDay"),$t=Vt("year","ordinal"),Rt=RegExp(`${Ft.source} ?(?:${Et.source}|(${jt.source}))?`),Zt=RegExp(`(?: ${Rt.source})?`);function Bt(e,t,n){const r=e[t];return Re(r)?n:Ge(r)}function Pt(e,t){return[{hours:Bt(e,t,0),minutes:Bt(e,t+1,0),seconds:Bt(e,t+2,0),milliseconds:Ke(e[t+3])},null,t+4]}function qt(e,t){const n=!e[t]&&!e[t+1],r=lt(e[t+1],e[t+2]);return[{},n?null:le.instance(r),t+3]}function Ht(e,t){return[{},e[t]?H.create(e[t]):null,t+1]}const Ut=RegExp(`^T?${Ft.source}$`),_t=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Yt(e){const[t,n,r,i,s,a,o,l,c]=e,u="-"===t[0],d=l&&"-"===l[0],h=(e,t=!1)=>void 0!==e&&(t||e&&u)?-e:e;return[{years:h(Qe(n)),months:h(Qe(r)),weeks:h(Qe(i)),days:h(Qe(s)),hours:h(Qe(a)),minutes:h(Qe(o)),seconds:h(Qe(l),"-0"===l),milliseconds:h(Ke(c),d)}]}const Jt={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Gt(e,t,n,r,i,s,a){const o={year:2===t.length?at(Ge(t)):Ge(t),month:ft.indexOf(n)+1,day:Ge(r),hour:Ge(i),minute:Ge(s)};return a&&(o.second=Ge(a)),e&&(o.weekday=e.length>3?pt.indexOf(e)+1:bt.indexOf(e)+1),o}const Qt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Kt(e){const[,t,n,r,i,s,a,o,l,c,u,d]=e,h=Gt(t,i,r,n,s,a,o);let m;return m=l?Jt[l]:c?0:lt(u,d),[h,new le(m)]}const Xt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,en=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,tn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function nn(e){const[,t,n,r,i,s,a,o]=e;return[Gt(t,i,r,n,s,a,o),le.utcInstance]}function rn(e){const[,t,n,r,i,s,a,o]=e;return[Gt(t,o,n,r,i,s,a),le.utcInstance]}const sn=It(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,zt),an=It(/(\d{4})-?W(\d\d)(?:-?(\d))?/,zt),on=It(/(\d{4})-?(\d{3})/,zt),ln=It(Lt),cn=Dt(function(e,t){return[{year:Bt(e,t),month:Bt(e,t+1,1),day:Bt(e,t+2,1)},null,t+3]},Pt,qt,Ht),un=Dt(Wt,Pt,qt,Ht),dn=Dt($t,Pt,qt,Ht),hn=Dt(Pt,qt,Ht),mn=Dt(Pt),fn=It(/(\d{4})-(\d\d)-(\d\d)/,Zt),yn=It(Rt),gn=Dt(Pt,qt,Ht),pn="Invalid Duration",bn={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},wn={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...bn},vn={years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...bn},kn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],xn=kn.slice(0).reverse();function Sn(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Mn(r)}function Tn(e,t){let n=t.milliseconds??0;for(const r of xn.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Cn(e,t){const n=Tn(e,t)<0?-1:1;kn.reduceRight((r,i)=>{if(Re(t[i]))return r;if(r){const s=t[r]*n,a=e[i][r],o=Math.floor(s/a);t[i]+=o*n,t[r]-=o*a*n}return i},null),kn.reduce((n,r)=>{if(Re(t[r]))return n;if(n){const i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r},null)}function On(e){const t={};for(const[n,r]of Object.entries(e))0!==r&&(t[n]=r);return t}class Mn{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let n=t?vn:wn;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||ae.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,t){return Mn.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new h("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Mn({values:ut(e,Mn.normalizeUnit),loc:ae.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Ze(e))return Mn.fromMillis(e);if(Mn.isDuration(e))return e;if("object"==typeof e)return Mn.fromObject(e);throw new h(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[n]=function(e){return At(e,[_t,Yt])}(e);return n?Mn.fromObject(n,t):Mn.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[n]=function(e){return At(e,[Ut,mn])}(e);return n?Mn.fromObject(n,t):Mn.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new h("need to specify a reason the Duration is invalid");const n=e instanceof Ce?e:new Ce(e,t);if(Te.throwOnInvalid)throw new c(n);return new Mn({invalid:n})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new d(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?Nt.create(this.loc,n).formatDurationFromString(this,e):pn}toHuman(e={}){if(!this.isValid)return pn;const t=!1!==e.showZeros,n=kn.map(n=>{const r=this.values[n];return Re(r)||0===r&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:n.slice(0,-1)}).format(r)}).filter(e=>e);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=Xe(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},wr.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Tn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=Mn.fromDurationLike(e),n={};for(const e of kn)(Ue(t.values,e)||Ue(this.values,e))&&(n[e]=t.get(e)+this.get(e));return Sn(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=Mn.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=ct(e(this.values[n],n));return Sn(this,{values:t},!0)}get(e){return this[Mn.normalizeUnit(e)]}set(e){return this.isValid?Sn(this,{values:{...this.values,...ut(e,Mn.normalizeUnit)}}):this}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:r}={}){return Sn(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:n})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Cn(this.matrix,e),Sn(this,{values:e},!0)}rescale(){return this.isValid?Sn(this,{values:On(this.normalize().shiftToAll().toObject())},!0):this}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map(e=>Mn.normalizeUnit(e));const t={},n={},r=this.toObject();let i;for(const s of kn)if(e.indexOf(s)>=0){i=s;let e=0;for(const t in n)e+=this.matrix[t][s]*n[t],n[t]=0;Ze(r[s])&&(e+=r[s]);const a=Math.trunc(e);t[s]=a,n[s]=(1e3*e-1e3*a)/1e3}else Ze(r[s])&&(n[s]=r[s]);for(const e in n)0!==n[e]&&(t[i]+=e===i?n[e]:n[e]/this.matrix[i][e]);return Cn(this.matrix,t),Sn(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return Sn(this,{values:e},!0)}removeZeros(){return this.isValid?Sn(this,{values:On(this.values)},!0):this}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;function t(e,t){return void 0===e||0===e?void 0===t||0===t:e===t}for(const n of kn)if(!t(this.values[n],e.values[n]))return!1;return!0}}const Nn="Invalid Interval";class jn{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new h("need to specify a reason the Interval is invalid");const n=e instanceof Ce?e:new Ce(e,t);if(Te.throwOnInvalid)throw new l(n);return new jn({invalid:n})}static fromDateTimes(e,t){const n=vr(e),r=vr(t),i=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?jn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null:jn.invalid("missing or invalid end"):jn.invalid("missing or invalid start")}(n,r);return null==i?new jn({start:n,end:r}):i}static after(e,t){const n=Mn.fromDurationLike(t),r=vr(e);return jn.fromDateTimes(r,r.plus(n))}static before(e,t){const n=Mn.fromDurationLike(t),r=vr(e);return jn.fromDateTimes(r.minus(n),r)}static fromISO(e,t){const[n,r]=(e||"").split("/",2);if(n&&r){let e,i,s,a;try{e=wr.fromISO(n,t),i=e.isValid}catch(r){i=!1}try{s=wr.fromISO(r,t),a=s.isValid}catch(r){a=!1}if(i&&a)return jn.fromDateTimes(e,s);if(i){const n=Mn.fromISO(r,t);if(n.isValid)return jn.after(e,n)}else if(a){const e=Mn.fromISO(n,t);if(e.isValid)return jn.before(s,e)}}return jn.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const n=this.start.startOf(e,t);let r;return r=t?.useLocaleWeeks?this.end.reconfigure({locale:n.locale}):this.end,r=r.startOf(e,t),Math.floor(r.diff(n,e).get(e))+(r.valueOf()!==this.end.valueOf())}hasSame(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&this.s<=e&&this.e>e}set({start:e,end:t}={}){return this.isValid?jn.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(vr).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),n=[];let{s:r}=this,i=0;for(;r<this.e;){const e=t[i]||this.e,s=+e>+this.e?this.e:e;n.push(jn.fromDateTimes(r,s)),r=s,i+=1}return n}splitBy(e){const t=Mn.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let n,{s:r}=this,i=1;const s=[];for(;r<this.e;){const e=this.start.plus(t.mapUnits(e=>e*i));n=+e>+this.e?this.e:e,s.push(jn.fromDateTimes(r,n)),r=n,i+=1}return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e===+e.s}abutsEnd(e){return!!this.isValid&&+e.e===+this.s}engulfs(e){return!!this.isValid&&this.s<=e.s&&this.e>=e.e}equals(e){return!(!this.isValid||!e.isValid)&&this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e<e.e?this.e:e.e;return t>=n?null:jn.fromDateTimes(t,n)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,n=this.e>e.e?this.e:e.e;return jn.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n],[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const r=[],i=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]),s=Array.prototype.concat(...i).sort((e,t)=>e.time-t.time);for(const e of s)n+="s"===e.type?1:-1,1===n?t=e.time:(t&&+t!==+e.time&&r.push(jn.fromDateTimes(t,e.time)),t=null);return jn.merge(r)}difference(...e){return jn.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Nn}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=p,t={}){return this.isValid?Nt.create(this.s.loc.clone(t),e).formatInterval(this):Nn}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Nn}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Nn}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Nn}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Nn}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Mn.invalid(this.invalidReason)}mapEndpoints(e){return jn.fromDateTimes(e(this.s),e(this.e))}}class In{static hasDST(e=Te.defaultZone){const t=wr.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return H.isValidZone(e)}static normalizeZone(e){return ue(e,Te.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||ae.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||ae.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||ae.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||ae.create(t,n,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||ae.create(t,n,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||ae.create(t,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||ae.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return ae.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return ae.create(t,null,"gregory").eras(e)}static features(){return{relative:Pe(),localeWeek:qe()}}}function Dn(e,t){const n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Mn.fromMillis(r).as("days"))}function An(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(-1!==e[n].search(de.hanidec))t+=me.indexOf(e[n]);else for(const e in he){const[n,i]=he[e];r>=n&&r<=i&&(t+=r-n)}}return parseInt(t,10)}return t}(e))}}const Vn=`[ ${String.fromCharCode(160)}]`,En=new RegExp(Vn,"g");function Fn(e){return e.replace(/\./g,"\\.?").replace(En,Vn)}function Ln(e){return e.replace(/\./g,"").replace(En," ").toLowerCase()}function zn(e,t){return null===e?null:{regex:RegExp(e.map(Fn).join("|")),deser:([n])=>e.findIndex(e=>Ln(n)===Ln(e))+t}}function Wn(e,t){return{regex:e,deser:([,e,t])=>lt(e,t),groups:t}}function $n(e){return{regex:e,deser:([e])=>e}}const Rn={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let Zn=null;function Bn(e,t){return Array.prototype.concat(...e.map(e=>function(e,t){if(e.literal)return e;const n=Hn(Nt.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t)))}class Pn{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Bn(Nt.parseFormat(t),e),this.units=this.tokens.map(t=>function(e,t){const n=ye(t),r=ye(t,"{2}"),i=ye(t,"{3}"),s=ye(t,"{4}"),a=ye(t,"{6}"),o=ye(t,"{1,2}"),l=ye(t,"{1,3}"),c=ye(t,"{1,6}"),u=ye(t,"{1,9}"),d=ye(t,"{2,4}"),h=ye(t,"{4,6}"),m=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},f=(f=>{if(e.literal)return m(f);switch(f.val){case"G":return zn(t.eras("short"),0);case"GG":return zn(t.eras("long"),0);case"y":return An(c);case"yy":case"kk":return An(d,at);case"yyyy":case"kkkk":return An(s);case"yyyyy":return An(h);case"yyyyyy":return An(a);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return An(o);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return An(r);case"MMM":return zn(t.months("short",!0),1);case"MMMM":return zn(t.months("long",!0),1);case"LLL":return zn(t.months("short",!1),1);case"LLLL":return zn(t.months("long",!1),1);case"o":case"S":return An(l);case"ooo":case"SSS":return An(i);case"u":return $n(u);case"uu":return $n(o);case"uuu":case"E":case"c":return An(n);case"a":return zn(t.meridiems(),0);case"EEE":return zn(t.weekdays("short",!1),1);case"EEEE":return zn(t.weekdays("long",!1),1);case"ccc":return zn(t.weekdays("short",!0),1);case"cccc":return zn(t.weekdays("long",!0),1);case"Z":case"ZZ":return Wn(new RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return Wn(new RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return $n(/[a-z_+-/]{1,256}?/i);case" ":return $n(/[^\S\n\r]/);default:return m(f)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return f.token=e,f}(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){const[e,t]=[`^${(n=this.units).map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"")}$`,n];this.regex=RegExp(e,"i"),this.handlers=t}var n}explainFromTokens(e){if(this.isValid){const[t,n]=function(e,t,n){const r=e.match(t);if(r){const e={};let t=1;for(const i in n)if(Ue(n,i)){const s=n[i],a=s.groups?s.groups+1:1;!s.literal&&s.token&&(e[s.token.val[0]]=s.deser(r.slice(t,t+a))),t+=a}return[r,e]}return[r,{}]}(e,this.regex,this.handlers),[r,i,s]=n?function(e){let t,n=null;return Re(e.z)||(n=H.create(e.z)),Re(e.Z)||(n||(n=new le(e.Z)),t=e.Z),Re(e.q)||(e.M=3*(e.q-1)+1),Re(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),Re(e.u)||(e.S=Ke(e.u)),[Object.keys(e).reduce((t,n)=>{const r=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(n);return r&&(t[r]=e[n]),t},{}),n,t]}(n):[null,null,void 0];if(Ue(n,"a")&&Ue(n,"H"))throw new u("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:n,result:r,zone:i,specificOffset:s}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function qn(e,t,n){return new Pn(e,n).explainFromTokens(t)}function Hn(e,t){if(!e)return null;const n=Nt.create(t,e).dtFormatter((Zn||(Zn=wr.fromMillis(1555555555555)),Zn)),r=n.formatToParts(),i=n.resolvedOptions();return r.map(t=>function(e,t,n){const{type:r,value:i}=e;if("literal"===r){const e=/^\s+$/.test(i);return{literal:!e,val:e?" ":i}}const s=t[r];let a=r;"hour"===r&&(a=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":n.hour12?"hour12":"hour24");let o=Rn[a];if("object"==typeof o&&(o=o[s]),o)return{literal:!1,val:o}}(t,e,i))}const Un="Invalid DateTime",_n=864e13;function Yn(e){return new Ce("unsupported zone",`the zone "${e.name}" is not supported`)}function Jn(e){return null===e.weekData&&(e.weekData=Ve(e.c)),e.weekData}function Gn(e){return null===e.localWeekData&&(e.localWeekData=Ve(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Qn(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new wr({...n,...t,old:n})}function Kn(e,t,n){let r=e-60*t*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=60*(i-t)*1e3;const s=n.offset(r);return i===s?[r,i]:[e-60*Math.min(i,s)*1e3,Math.max(i,s)]}function Xn(e,t){const n=new Date(e+=60*t*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function er(e,t,n){return Kn(rt(e),t,n)}function tr(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),s={...e.c,year:r,month:i,day:Math.min(e.c.day,nt(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},a=Mn.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),o=rt(s);let[l,c]=Kn(o,n,e.zone);return 0!==a&&(l+=a,c=e.zone.offset(l)),{ts:l,o:c}}function nr(e,t,n,r,i,s){const{setZone:a,zone:o}=n;if(e&&0!==Object.keys(e).length||t){const r=t||o,i=wr.fromObject(e,{...n,zone:r,specificOffset:s});return a?i:i.setZone(o)}return wr.invalid(new Ce("unparsable",`the input "${i}" can't be parsed as ${r}`))}function rr(e,t,n=!0){return e.isValid?Nt.create(ae.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function ir(e,t,n){const r=e.c.year>9999||e.c.year<0;let i="";if(r&&e.c.year>=0&&(i+="+"),i+=Je(e.c.year,r?6:4),"year"===n)return i;if(t){if(i+="-",i+=Je(e.c.month),"month"===n)return i;i+="-"}else if(i+=Je(e.c.month),"month"===n)return i;return i+=Je(e.c.day),i}function sr(e,t,n,r,i,s,a){let o=!n||0!==e.c.millisecond||0!==e.c.second,l="";switch(a){case"day":case"month":case"year":break;default:if(l+=Je(e.c.hour),"hour"===a)break;if(t){if(l+=":",l+=Je(e.c.minute),"minute"===a)break;o&&(l+=":",l+=Je(e.c.second))}else{if(l+=Je(e.c.minute),"minute"===a)break;o&&(l+=Je(e.c.second))}if("second"===a)break;!o||r&&0===e.c.millisecond||(l+=".",l+=Je(e.c.millisecond,3))}return i&&(e.isOffsetFixed&&0===e.offset&&!s?l+="Z":e.o<0?(l+="-",l+=Je(Math.trunc(-e.o/60)),l+=":",l+=Je(Math.trunc(-e.o%60))):(l+="+",l+=Je(Math.trunc(e.o/60)),l+=":",l+=Je(Math.trunc(e.o%60)))),s&&(l+="["+e.zone.ianaName+"]"),l}const ar={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},or={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},lr={ordinal:1,hour:0,minute:0,second:0,millisecond:0},cr=["year","month","day","hour","minute","second","millisecond"],ur=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],dr=["year","ordinal","hour","minute","second","millisecond"];function hr(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new d(e);return t}function mr(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return hr(e)}}function fr(e,t){const n=ue(t.zone,Te.defaultZone);if(!n.isValid)return wr.invalid(Yn(n));const r=ae.fromObject(t);let i,s;if(Re(e.year))i=Te.now();else{for(const t of cr)Re(e[t])&&(e[t]=ar[t]);const t=We(e)||$e(e);if(t)return wr.invalid(t);const r=function(e){if(void 0===pr&&(pr=Te.now()),"iana"!==e.type)return e.offset(pr);const t=e.name;let n=br.get(t);return void 0===n&&(n=e.offset(pr),br.set(t,n)),n}(n);[i,s]=er(e,r,n)}return new wr({ts:i,zone:n,loc:r,o:s})}function yr(e,t,n){const r=!!Re(n.round)||n.round,i=Re(n.rounding)?"trunc":n.rounding,s=(e,s)=>(e=Xe(e,r||n.calendary?0:2,n.calendary?"round":i),t.loc.clone(n).relFormatter(n).format(e,s)),a=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return s(a(n.unit),n.unit);for(const e of n.units){const t=a(e);if(Math.abs(t)>=1)return s(t,e)}return s(e>t?-0:0,n.units[n.units.length-1])}function gr(e){let t,n={};return e.length>0&&"object"==typeof e[e.length-1]?(n=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[n,t]}let pr;const br=new Map;class wr{constructor(e){const t=e.zone||Te.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new Ce("invalid input"):null)||(t.isValid?null:Yn(t));this.ts=Re(e.ts)?Te.now():e.ts;let r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{const s=Ze(e.o)&&!e.old?e.o:t.offset(this.ts);r=Xn(this.ts,s),n=Number.isNaN(r.year)?new Ce("invalid input"):null,r=n?null:r,i=n?null:s}this._zone=t,this.loc=e.loc||ae.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new wr({})}static local(){const[e,t]=gr(arguments),[n,r,i,s,a,o,l]=t;return fr({year:n,month:r,day:i,hour:s,minute:a,second:o,millisecond:l},e)}static utc(){const[e,t]=gr(arguments),[n,r,i,s,a,o,l]=t;return e.zone=le.utcInstance,fr({year:n,month:r,day:i,hour:s,minute:a,second:o,millisecond:l},e)}static fromJSDate(e,t={}){const n=(r=e,"[object Date]"===Object.prototype.toString.call(r)?e.valueOf():NaN);var r;if(Number.isNaN(n))return wr.invalid("invalid input");const i=ue(t.zone,Te.defaultZone);return i.isValid?new wr({ts:n,zone:i,loc:ae.fromObject(t)}):wr.invalid(Yn(i))}static fromMillis(e,t={}){if(Ze(e))return e<-_n||e>_n?wr.invalid("Timestamp out of range"):new wr({ts:e,zone:ue(t.zone,Te.defaultZone),loc:ae.fromObject(t)});throw new h(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Ze(e))return new wr({ts:1e3*e,zone:ue(t.zone,Te.defaultZone),loc:ae.fromObject(t)});throw new h("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const n=ue(t.zone,Te.defaultZone);if(!n.isValid)return wr.invalid(Yn(n));const r=ae.fromObject(t),i=ut(e,mr),{minDaysInFirstWeek:s,startOfWeek:a}=ze(i,r),o=Te.now(),l=Re(t.specificOffset)?n.offset(o):t.specificOffset,c=!Re(i.ordinal),d=!Re(i.year),h=!Re(i.month)||!Re(i.day),m=d||h,f=i.weekYear||i.weekNumber;if((m||c)&&f)throw new u("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&c)throw new u("Can't mix ordinal dates with month/day");const y=f||i.weekday&&!m;let g,p,b=Xn(o,l);y?(g=ur,p=or,b=Ve(b,s,a)):c?(g=dr,p=lr,b=Fe(b)):(g=cr,p=ar);let w=!1;for(const e of g)Re(i[e])?i[e]=w?p[e]:b[e]:w=!0;const v=y?function(e,t=4,n=1){const r=Be(e.weekYear),i=Ye(e.weekNumber,1,st(e.weekYear,t,n)),s=Ye(e.weekday,1,7);return r?i?!s&&Ne("weekday",e.weekday):Ne("week",e.weekNumber):Ne("weekYear",e.weekYear)}(i,s,a):c?function(e){const t=Be(e.year),n=Ye(e.ordinal,1,tt(e.year));return t?!n&&Ne("ordinal",e.ordinal):Ne("year",e.year)}(i):We(i),k=v||$e(i);if(k)return wr.invalid(k);const x=y?Ee(i,s,a):c?Le(i):i,[S,T]=er(x,l,n),C=new wr({ts:S,zone:n,o:T,loc:r});return i.weekday&&m&&e.weekday!==C.weekday?wr.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${C.toISO()}`):C.isValid?C:wr.invalid(C.invalid)}static fromISO(e,t={}){const[n,r]=function(e){return At(e,[sn,cn],[an,un],[on,dn],[ln,hn])}(e);return nr(n,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,r]=function(e){return At(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[Qt,Kt])}(e);return nr(n,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,r]=function(e){return At(e,[Xt,nn],[en,nn],[tn,rn])}(e);return nr(n,r,t,"HTTP",t)}static fromFormat(e,t,n={}){if(Re(e)||Re(t))throw new h("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:i=null}=n,s=ae.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),[a,o,l,c]=function(e,t,n){const{result:r,zone:i,specificOffset:s,invalidReason:a}=qn(e,t,n);return[r,i,s,a]}(s,e,t);return c?wr.invalid(c):nr(a,o,n,`format ${t}`,e,l)}static fromString(e,t,n={}){return wr.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,r]=function(e){return At(e,[fn,cn],[yn,gn])}(e);return nr(n,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new h("need to specify a reason the DateTime is invalid");const n=e instanceof Ce?e:new Ce(e,t);if(Te.throwOnInvalid)throw new o(n);return new wr({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const n=Hn(e,ae.fromObject(t));return n?n.map(e=>e?e.val:null).join(""):null}static expandFormat(e,t={}){return Bn(Nt.parseFormat(e),ae.fromObject(t)).map(e=>e.val).join("")}static resetCache(){pr=void 0,br.clear()}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Jn(this).weekYear:NaN}get weekNumber(){return this.isValid?Jn(this).weekNumber:NaN}get weekday(){return this.isValid?Jn(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Gn(this).weekday:NaN}get localWeekNumber(){return this.isValid?Gn(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Gn(this).weekYear:NaN}get ordinal(){return this.isValid?Fe(this.c).ordinal:NaN}get monthShort(){return this.isValid?In.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?In.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?In.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?In.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,n=rt(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),s=this.zone.offset(n-r*t),a=this.zone.offset(n-i*t);if(s===a)return[this];const o=n-s*t,l=n-a*t,c=Xn(o,s),u=Xn(l,a);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[Qn(this,{ts:o}),Qn(this,{ts:l})]:[this]}get isInLeapYear(){return et(this.year)}get daysInMonth(){return nt(this.year,this.month)}get daysInYear(){return this.isValid?tt(this.year):NaN}get weeksInWeekYear(){return this.isValid?st(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?st(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:n,calendar:r}=Nt.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(le.instance(e),t)}toLocal(){return this.setZone(Te.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if((e=ue(e,Te.defaultZone)).equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||n){const t=e.offset(this.ts),n=this.toObject();[r]=er(n,t,e)}return Qn(this,{ts:r,zone:e})}return wr.invalid(Yn(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){return Qn(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=ut(e,mr),{minDaysInFirstWeek:n,startOfWeek:r}=ze(t,this.loc),i=!Re(t.weekYear)||!Re(t.weekNumber)||!Re(t.weekday),s=!Re(t.ordinal),a=!Re(t.year),o=!Re(t.month)||!Re(t.day),l=a||o,c=t.weekYear||t.weekNumber;if((l||s)&&c)throw new u("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new u("Can't mix ordinal dates with month/day");let d;i?d=Ee({...Ve(this.c,n,r),...t},n,r):Re(t.ordinal)?(d={...this.toObject(),...t},Re(t.day)&&(d.day=Math.min(nt(d.year,d.month),d.day))):d=Le({...Fe(this.c),...t});const[h,m]=er(d,this.o,this.zone);return Qn(this,{ts:h,o:m})}plus(e){return this.isValid?Qn(this,tr(this,Mn.fromDurationLike(e))):this}minus(e){return this.isValid?Qn(this,tr(this,Mn.fromDurationLike(e).negate())):this}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const n={},r=Mn.normalizeUnit(e);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0}if("weeks"===r)if(t){const e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(n.weekNumber=this.weekNumber-1),n.weekday=e}else n.weekday=1;if("quarters"===r){const e=Math.ceil(this.month/3);n.month=3*(e-1)+1}return this.set(n)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?Nt.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):Un}toLocaleString(e=p,t={}){return this.isValid?Nt.create(this.loc.clone(t),e).formatDateTime(this):Un}toLocaleParts(e={}){return this.isValid?Nt.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r=!0,extendedZone:i=!1,precision:s="milliseconds"}={}){if(!this.isValid)return null;const a="extended"===e;let o=ir(this,a,s=hr(s));return cr.indexOf(s)>=3&&(o+="T"),o+=sr(this,a,t,n,r,i,s),o}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?ir(this,"extended"===e,hr(t)):null}toISOWeekDate(){return rr(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:r=!1,extendedZone:i=!1,format:s="extended",precision:a="milliseconds"}={}){return this.isValid?(a=hr(a),(r&&cr.indexOf(a)>=3?"T":"")+sr(this,"extended"===s,t,e,n,i,a)):null}toRFC2822(){return rr(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return rr(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ir(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let r="HH:mm:ss.SSS";return(t||e)&&(n&&(r+=" "),t?r+="z":e&&(r+="ZZ")),rr(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Un}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",n={}){if(!this.isValid||!e.isValid)return Mn.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=(o=t,Array.isArray(o)?o:[o]).map(Mn.normalizeUnit),s=e.valueOf()>this.valueOf(),a=function(e,t,n,r){let[i,s,a,o]=function(e,t,n){const r=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const n=Dn(e,t);return(n-n%7)/7}],["days",Dn]],i={},s=e;let a,o;for(const[l,c]of r)n.indexOf(l)>=0&&(a=l,i[l]=c(e,t),o=s.plus(i),o>t?(i[l]--,(e=s.plus(i))>t&&(o=e,i[l]--,e=s.plus(i))):e=o);return[e,i,o,a]}(e,t,n);const l=t-i,c=n.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===c.length&&(a<t&&(a=i.plus({[o]:1})),a!==i&&(s[o]=(s[o]||0)+l/(a-i)));const u=Mn.fromObject(s,r);return c.length>0?Mn.fromMillis(l,r).shiftTo(...c).plus(u):u}(s?this:e,s?e:this,i,r);var o;return s?a.negate():a}diffNow(e="milliseconds",t={}){return this.diff(wr.now(),e,t)}until(e){return this.isValid?jn.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;const r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||wr.fromObject({},{zone:this.zone}),n=e.padding?this<t?-e.padding:e.padding:0;let r=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(r=e.unit,i=void 0),yr(t,this.plus(n),{...e,numeric:"always",units:r,unit:i})}toRelativeCalendar(e={}){return this.isValid?yr(e.base||wr.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(wr.isDateTime))throw new h("min requires all arguments be DateTimes");return He(e,e=>e.valueOf(),Math.min)}static max(...e){if(!e.every(wr.isDateTime))throw new h("max requires all arguments be DateTimes");return He(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:r=null,numberingSystem:i=null}=n;return qn(ae.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,n={}){return wr.fromFormatExplain(e,t,n)}static buildFormatParser(e,t={}){const{locale:n=null,numberingSystem:r=null}=t,i=ae.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});return new Pn(i,e)}static fromFormatParser(e,t,n={}){if(Re(e)||Re(t))throw new h("fromFormatParser requires an input string and a format parser");const{locale:r=null,numberingSystem:i=null}=n,s=ae.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});if(!s.equals(t.locale))throw new h(`fromFormatParser called with a locale of ${s}, but the format parser was created for ${t.locale}`);const{result:a,zone:o,specificOffset:l,invalidReason:c}=t.explainFromTokens(e);return c?wr.invalid(c):nr(a,o,n,`format ${t.format}`,e,l)}static get DATE_SHORT(){return p}static get DATE_MED(){return b}static get DATE_MED_WITH_WEEKDAY(){return w}static get DATE_FULL(){return v}static get DATE_HUGE(){return k}static get TIME_SIMPLE(){return x}static get TIME_WITH_SECONDS(){return S}static get TIME_WITH_SHORT_OFFSET(){return T}static get TIME_WITH_LONG_OFFSET(){return C}static get TIME_24_SIMPLE(){return O}static get TIME_24_WITH_SECONDS(){return M}static get TIME_24_WITH_SHORT_OFFSET(){return N}static get TIME_24_WITH_LONG_OFFSET(){return j}static get DATETIME_SHORT(){return I}static get DATETIME_SHORT_WITH_SECONDS(){return D}static get DATETIME_MED(){return A}static get DATETIME_MED_WITH_SECONDS(){return V}static get DATETIME_MED_WITH_WEEKDAY(){return E}static get DATETIME_FULL(){return F}static get DATETIME_FULL_WITH_SECONDS(){return L}static get DATETIME_HUGE(){return z}static get DATETIME_HUGE_WITH_SECONDS(){return W}}function vr(e){if(wr.isDateTime(e))return e;if(e&&e.valueOf&&Ze(e.valueOf()))return wr.fromJSDate(e);if(e&&"object"==typeof e)return wr.fromObject(e);throw new h(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const kr=r.createContext(void 0),xr=({children:t,...n})=>e.jsx(kr.Provider,{value:n,children:t}),Sr=()=>{const e=r.useContext(kr);if(!e)throw new Error("useBaseTableContext must be used within a BaseTableProvider");return e};function Tr(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r.createElement(t,{key:e})]))}function Cr({blocksOverride:e,defaultBlocks:t,defaultBlockOrder:n,children:r}){if(void 0===e)return r({blocks:t,blockOrder:n});if("function"==typeof e){const{blocks:i,blockOrder:s}=e({defaultBlocks:t,defaultBlockOrder:n});return r({blocks:i,blockOrder:s})}return e}function Or(e,t){const n={...e};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}function Mr(...e){return e.flat().filter(Boolean).join(" ")}function Nr(e,...t){const n={...e};for(const e of t)delete n[e];return n}const jr=["isLoading","headerTitle","headerActions","searchChipsTitle","searchChips","onSearchChipDelete","tabs","activeTab","onTabChange","columns","rows","actionColumn","rowActions","pagination","noRowsOverlay","onRowClick","getRowId"];function Ir(t,i,s){const a=i[t.field],o={row:i,rowIndex:s,column:t};if(t.renderCell)return t.renderCell(a,o);const l=t.valueFormatter?t.valueFormatter(a,o):a;return e.jsx(n.Typography,{variant:"body2",children:(c=l,null==c?"":"string"==typeof c||"number"==typeof c||"boolean"==typeof c?String(c):r.isValidElement(c)?c:"")});var c}function Dr(e){return e.width??180}const Ar=["xs","sm","md","lg","xl"];function Vr(e,t){if(void 0===e||"string"==typeof e)return e;for(let n=Ar.indexOf(t);n>=0;n-=1){const t=e[Ar[n]];if(void 0!==t)return t??void 0}}function Er(e,t){return e?.pin?{position:"sticky",..."left"===e.pin?{left:e.left??0}:{right:e.right??0},zIndex:t?12:4,isolation:"isolate",...t?{backgroundColor:"common.white",backgroundImage:"none",backgroundClip:"padding-box",opacity:1,"&::before":{content:'""',position:"absolute",inset:0,zIndex:-1,backgroundColor:e=>e.palette.common.white}}:{},...t?{}:{backgroundColor:"inherit"},...e.isLeftBoundary?{borderRight:e=>`1px solid ${e.palette.divider}`}:{},...e.isRightBoundary?{borderLeft:e=>`1px solid ${e.palette.divider}`}:{}}:{}}function Fr(e,t,n){const r="left"===e;return{position:"absolute",top:0,bottom:0,...r?{left:t}:{right:t},width:0,pointerEvents:"none",zIndex:7,"&::after":{content:'""',position:"absolute",top:0,bottom:0,...r?{left:0}:{right:0},width:8,background:r?"linear-gradient(to right, rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0))":"linear-gradient(to left, rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0))",opacity:n?1:0,transition:e=>e.transitions.create("opacity",{duration:160})}}}function Lr(e,t,n){return r.isValidElement(e)?r.cloneElement(e,void 0===n?t:{key:n,...t}):e}function zr(t,n){return n.map(e=>({key:String(e),block:t[String(e)]})).filter(({block:e})=>void 0!==e).map(({key:t,block:n})=>e.jsx(r.Fragment,{children:n},t))}const Wr=t=>{const r=Sr(),{headerTitle:i}=r,{children:s,className:a,component:o="h1",sx:l=[],...c}=t;return s||i?e.jsx(n.Typography,{component:o,className:Mr("nbb-base-table-header-title",a),sx:[{fontSize:{xs:"subtitle1.fontSize",sm:"h4.fontSize"},fontWeight:"fontWeightBold"},...Array.isArray(l)?l:[l]],...c,children:s||i}):null},$r=t=>{const{headerActions:r}=Sr(),{children:i,className:s,sx:a=[],...o}=t;return i||r?e.jsx(n.Stack,{direction:"row",className:Mr("nbb-base-table-header-actions",s),sx:[{alignItems:"center"},...Array.isArray(a)?a:[a]],...o,children:i||r}):null},Rr=Tr({title:Wr,actions:$r}),Zr=t=>{const{headerTitle:r,headerActions:i}=Sr(),{children:s,className:a,sx:o=[],...l}=t;return s||r||i?e.jsx(n.Stack,{direction:"row",className:Mr("nbb-base-table-header",a),sx:[{justifyContent:"space-between",alignItems:"center"},...Array.isArray(o)?o:[o]],...l,children:e.jsx(Cr,{defaultBlocks:Rr,defaultBlockOrder:Object.keys(Rr),blocksOverride:s,children:({blocks:e,blockOrder:t})=>zr(e,t)})}):null},Br=t=>{const{children:r,className:i,sx:s=[],...a}=t;return e.jsx(n.Stack,{className:Mr("nbb-base-table-content-loader",i),sx:[{alignItems:"center",justifyContent:"center",width:"100%",height:e=>e.spacing(18.25)},...Array.isArray(s)?s:[s]],...a,children:r||e.jsx(n.CircularProgress,{})})},Pr=t=>{const{tabs:r,activeTab:i,onTabChange:s}=Sr(),{children:a,className:o,value:l,onChange:c,variant:u,sx:d,tabProps:h,centered:m=!1,...f}=t,{sx:y,...g}=h??{},p=void 0===d?[]:Array.isArray(d)?d:[d],b=void 0===y?[]:Array.isArray(y)?y:[y],w=l??i,v=u??"scrollable",k=c??((e,t)=>{s?.(t)});return r&&0!==r.length&&void 0!==w?e.jsx(n.Tabs,{value:w,onChange:k,variant:v,scrollButtons:"auto",allowScrollButtonsMobile:!0,centered:m,className:Mr("nbb-base-table-tabs",o),sx:[e=>({minHeight:44,position:"relative",width:"100%",overflow:"hidden","&::before":{content:'""',position:"absolute",bottom:0,left:0,width:"100%",height:"1px",backgroundColor:e.palette.divider},"& .MuiTabs-scroller":{overflowX:"auto"},"& .MuiTabs-list, & .MuiTabs-flexContainer":{minWidth:"max-content",justifyContent:"flex-start",margin:0},"& .MuiTabs-scrollButtons":{position:"absolute",top:0,bottom:0,zIndex:2,width:32,backgroundColor:"background.paper",opacity:1,visibility:"visible",transition:"opacity 160ms ease, visibility 160ms ease"},"& .MuiTabs-scrollButtons:first-of-type":{left:0,borderRight:e=>`1px solid ${e.palette.divider}`},"& .MuiTabs-scrollButtons:last-of-type":{right:0,borderLeft:e=>`1px solid ${e.palette.divider}`},"& .MuiTabs-scrollButtons.Mui-disabled":{opacity:0,visibility:"hidden",pointerEvents:"none"}}),...p],...f,children:a||r.map(t=>e.jsx(n.Tab,{value:t.value,...void 0!==t.disabled?{disabled:t.disabled}:{},sx:[{minHeight:44,minWidth:{xs:130,sm:182},flex:"0 0 auto",textTransform:"none"},...b],label:t.label,...g},String(t.value)))}):null},qr=r=>{const i=Sr(),{searchChipsTitle:s,searchChips:a,onSearchChipDelete:o}=Or(i,r),{children:l,className:c,sx:u=[],...d}=r,h=a??[];return l||0!==h.length?e.jsx(n.Stack,{className:Mr("nbb-base-table-search-chips",c),sx:[{width:"100%",minWidth:0,gap:{xs:1,sm:3}},...Array.isArray(u)?u:[u]],...Nr(d,...jr),children:l||e.jsxs(e.Fragment,{children:[s&&e.jsx(n.Typography,{sx:e=>({fontSize:{xs:e.typography.body1.fontSize,sm:e.typography.h6.fontSize},fontWeight:600}),children:s}),e.jsx(n.Stack,{direction:"row",sx:{flexWrap:"wrap"},spacing:{xs:1,sm:2},useFlexGap:!0,children:h.map((r,i)=>e.jsx(n.Chip,{label:r.label,deleteIcon:e.jsx(t.CloseOutlined,{fontSize:"inherit"}),...o&&{onDelete:e=>o(r,i,e)},sx:e=>({height:"auto",borderRadius:1.5,bgcolor:e.palette.grey[50],py:e.spacing(1.25),px:{xs:e.spacing(1.5),sm:e.spacing(2)},"& .MuiChip-label":{px:0,fontSize:{xs:e.typography.body2.fontSize,sm:e.typography.body1.fontSize},lineHeight:1.75},"& .MuiChip-deleteIcon":{m:0,ml:e.spacing(1),fontSize:e.typography.body1.fontSize,color:e.palette.text.secondary}})},r.key))})]})}):null},Hr=t=>{const{className:r,column:i,pinMeta:s,labelProps:a,children:o,sx:l,...c}=t,{className:u,sx:d,...h}=a??{},m=void 0===l?[]:Array.isArray(l)?l:[l],f=void 0===d?[]:Array.isArray(d)?d:[d],y=i.width??(s?.pin?Dr(i):void 0);return e.jsx(n.TableCell,{className:Mr("nbb-base-table-content-grid-head-cell",r),...s?.pin?{"data-pinned":s.pin}:{},...s?.isLeftBoundary?{"data-pinned-boundary":"left"}:{},...s?.isRightBoundary?{"data-pinned-boundary":"right"}:{},...i.align?{align:i.align}:{},sx:[{py:1,verticalAlign:"middle",position:"relative",zIndex:10,backgroundColor:"common.white",backgroundImage:"none",opacity:1,...y?{width:y,minWidth:y}:{},...Er(s,!0)},...m],...c,children:o||e.jsx(n.Typography,{variant:"body2",...void 0!==u?{className:u}:{},sx:[{fontWeight:"bold",color:"text.secondary"},...f],...h,children:i.headLabel})})},Ur=t=>{const{className:r,column:i,pinMeta:s,row:a,rowIndex:o,children:l,sx:c,...u}=t,d=void 0===c?[]:Array.isArray(c)?c:[c],h=i.width??(s?.pin?Dr(i):void 0);return e.jsx(n.TableCell,{className:Mr("nbb-base-table-content-grid-body-cell",r),...s?.pin?{"data-pinned":s.pin}:{},...s?.isLeftBoundary?{"data-pinned-boundary":"left"}:{},...s?.isRightBoundary?{"data-pinned-boundary":"right"}:{},...i.align?{align:i.align}:{},sx:[{py:1,height:72,verticalAlign:"middle",wordBreak:"break-word",...h?{width:h,minWidth:h}:{},...Er(s,!1)},...d],...u,children:l||Ir(i,a,o)})},_r=t=>{const{className:r,children:i,pinMeta:s,sx:a,...o}=t,l=void 0===a?[]:Array.isArray(a)?a:[a];return e.jsx(n.TableCell,{className:Mr("nbb-base-table-content-grid-head-action-cell",r),...s?.pin?{"data-pinned":s.pin}:{},...s?.isLeftBoundary?{"data-pinned-boundary":"left"}:{},...s?.isRightBoundary?{"data-pinned-boundary":"right"}:{},sx:[{width:56,py:1,verticalAlign:"middle",position:"relative",zIndex:10,backgroundColor:"common.white",backgroundImage:"none",opacity:1},Er(s,!0),...l],...o,children:i})},Yr=r=>{const{className:i,row:s,showActionMenu:a,pinMeta:o,onOpenRowMenu:l,iconButtonProps:c,icon:u,children:d,sx:h,...m}=r,{sx:f,...y}=c??{},g=void 0===h?[]:Array.isArray(h)?h:[h],p=void 0===f?[]:Array.isArray(f)?f:[f],b=a&&Boolean(l);return e.jsx(n.TableCell,{className:Mr("nbb-base-table-content-grid-body-action-cell",i),...o?.pin?{"data-pinned":o.pin}:{},...o?.isLeftBoundary?{"data-pinned-boundary":"left"}:{},...o?.isRightBoundary?{"data-pinned-boundary":"right"}:{},sx:[{width:56,py:1,height:72,verticalAlign:"middle",textAlign:"right",...Er(o,!1)},...g],...m,children:d||e.jsx(n.IconButton,{"aria-label":"row action",size:"small",sx:[{color:"text.secondary",visibility:b?"visible":"hidden"},...p],onClick:e=>{l&&a&&l(e,s)},disabled:!b,tabIndex:b?0:-1,...y,children:u||e.jsx(t.MoreVertOutlined,{})})})},Jr=Tr({cell:Hr,actionCell:_r}),Gr=t=>{const{className:i,children:s,columns:a,rowActions:o,headCell:l,actionHeadCell:c,columnPinMeta:u,actionColumnPinMeta:d,sx:h,...m}=t,f=void 0===h?[]:Array.isArray(h)?h:[h];return e.jsx(n.TableRow,{className:Mr("nbb-base-table-content-grid-head-row",i),sx:[{backgroundColor:"background.paper"},...f],...m,children:e.jsx(Cr,{defaultBlocks:Jr,defaultBlockOrder:Object.keys(Jr),blocksOverride:s,children:({blocks:t})=>{const n=t.cell,i=t.actionCell;return e.jsxs(e.Fragment,{children:[a.map((t,i)=>{const s=u?.[i],a="function"==typeof l?l({column:t,columnIndex:i,...void 0!==s?{pinMeta:s}:{}}):l;return e.jsx(r.Fragment,{children:a??Lr(n,{column:t,...void 0!==s?{pinMeta:s}:{}},`cell-${String(t.field)}-${i}`)},`${String(t.field)}-${i}`)}),o&&(("function"==typeof c?c({rowActions:o,...void 0!==d?{actionColumnPinMeta:d}:{}}):c)??Lr(i,{...void 0!==d?{pinMeta:d}:{}},"action-cell"))]})}})})},Qr=Tr({cell:Ur,actionCell:Yr}),Kr=t=>{const{className:i,children:s,row:a,rowIndex:o,columns:l,rowActions:c,onRowClick:u,onOpenRowMenu:d,bodyCell:h,actionBodyCell:m,columnPinMeta:f,actionColumnPinMeta:y,sx:g,onClick:p,hover:b,...w}=t,v=void 0===g?[]:Array.isArray(g)?g:[g],k=(c?.(a)??[]).length>0,x=b??Boolean(u),S=u?e=>{p?.(e),e.defaultPrevented||u(a)}:p;return e.jsx(n.TableRow,{className:Mr("nbb-base-table-content-grid-body-row",i),hover:!1,sx:[{backgroundColor:"common.white","& > .MuiTableCell-root":{backgroundColor:"inherit",transition:e=>e.transitions.create("background-color",{duration:120})}},...x?[{...u?{cursor:"pointer"}:{},"&:hover":{backgroundColor:e=>e.palette.grey[100]||e.palette.action.hover},"&:hover > .MuiTableCell-root":{backgroundColor:"inherit"},"&:hover > .MuiTableCell-root[data-pinned]":{backgroundColor:"inherit"},"&.MuiTableRow-hover:hover":{backgroundColor:e=>e.palette.grey[100]||e.palette.action.hover},"&.MuiTableRow-hover:hover > .MuiTableCell-root":{backgroundColor:"inherit"},"&.MuiTableRow-hover:hover > .MuiTableCell-root[data-pinned]":{backgroundColor:"inherit"}}]:[],...v],onClick:S,...w,children:e.jsx(Cr,{defaultBlocks:Qr,defaultBlockOrder:Object.keys(Qr),blocksOverride:s,children:({blocks:t})=>{const n=t.cell,i=t.actionCell;return e.jsxs(e.Fragment,{children:[l.map((t,i)=>e.jsx(r.Fragment,{children:(()=>{const e=f?.[i];return"function"==typeof h?h({column:t,columnIndex:i,...void 0!==e?{pinMeta:e}:{},row:a,rowIndex:o}):h})()??Lr(n,{column:t,...void 0!==f?.[i]?{pinMeta:f[i]}:{},row:a,rowIndex:o},`cell-${String(t.field)}-${i}`)},`${String(t.field)}-${i}`)),c&&(("function"==typeof m?m({row:a,rowIndex:o,showActionMenu:k,...void 0!==y?{actionColumnPinMeta:y}:{},onOpenRowMenu:d}):m)??Lr(i,{row:a,showActionMenu:k,...void 0!==y?{pinMeta:y}:{},onOpenRowMenu:d},"action-cell"))]})}})})},Xr=Tr({row:Gr}),ei=t=>{const{className:r,children:i,columns:s,rowActions:a,headRow:o,headCell:l,actionHeadCell:c,columnPinMeta:u,actionColumnPinMeta:d,sx:h,...m}=t,f=void 0===h?[]:Array.isArray(h)?h:[h],y="function"==typeof o?o({columns:s,rowActions:a,...void 0!==u?{columnPinMeta:u}:{},...void 0!==d?{actionColumnPinMeta:d}:{}}):o;return e.jsx(n.TableHead,{className:Mr("nbb-base-table-content-grid-head",r),sx:[{width:"100%",minWidth:0,backgroundColor:"common.white",backgroundImage:"none","& .MuiTableCell-root":{backgroundColor:"common.white",backgroundImage:"none",backgroundClip:"padding-box",opacity:1},position:"relative",zIndex:6},...f],...m,children:e.jsx(Cr,{defaultBlocks:Xr,defaultBlockOrder:Object.keys(Xr),blocksOverride:i,children:({blocks:e})=>y??Lr(e.row,{columns:s,rowActions:a,headCell:l,actionHeadCell:c,...void 0!==u?{columnPinMeta:u}:{},...void 0!==d?{actionColumnPinMeta:d}:{}})})})},ti=Tr({row:Kr}),ni=t=>{const{className:i,children:s,columns:a,rows:o,rowActions:l,onRowClick:c,getRowId:u,onOpenRowMenu:d,bodyRow:h,bodyCell:m,actionBodyCell:f,columnPinMeta:y,actionColumnPinMeta:g,sx:p,...b}=t,w=void 0===p?[]:Array.isArray(p)?p:[p];return e.jsx(n.TableBody,{className:Mr("nbb-base-table-content-grid-body",i),sx:w,...b,children:e.jsx(Cr,{defaultBlocks:ti,defaultBlockOrder:Object.keys(ti),blocksOverride:s,children:({blocks:t})=>{const n=t.row;return o.map((t,i)=>{const s=u?.(t,i)??t.id??i,o="function"==typeof h?h({row:t,rowIndex:i,columns:a,rowActions:l,onRowClick:c,onOpenRowMenu:d,...void 0!==y?{columnPinMeta:y}:{},...void 0!==g?{actionColumnPinMeta:g}:{}}):h;return e.jsx(r.Fragment,{children:o??Lr(n,{row:t,rowIndex:i,columns:a,rowActions:l,onRowClick:c,onOpenRowMenu:d,bodyCell:m,actionBodyCell:f,...void 0!==y?{columnPinMeta:y}:{},...void 0!==g?{actionColumnPinMeta:g}:{}},`row-${String(s)}`)},String(s))})}})})},ri=t=>{const{className:r,children:i,menuAnchorEl:s,menuRow:a,menuActions:o,onClose:l,anchorOrigin:c={vertical:"bottom",horizontal:"right"},transformOrigin:u={vertical:"top",horizontal:"right"},...d}=t;return e.jsx(n.Menu,{className:Mr("nbb-base-table-content-grid-row-menu",r),anchorEl:s,open:Boolean(s&&a),onClose:l,anchorOrigin:c,transformOrigin:u,...d,children:i||o.map((t,r)=>e.jsxs(n.MenuItem,{...void 0!==t.disabled?{disabled:t.disabled}:{},onClick:e=>{e.stopPropagation(),a&&t.onClick(a),l()},children:[t.icon&&e.jsx(n.ListItemIcon,{children:t.icon}),t.label]},`${String(t.label)}-${r}`))})},ii=r=>{const{noRowsOverlay:i}=Or(Sr(),r),{children:s,className:a,sx:o,...l}=r,c=void 0===o?[]:Array.isArray(o)?o:[o],u={icon:e.jsx(t.PersonOutlined,{}),title:"No Item",...i};return e.jsx(n.Box,{className:Mr("nbb-base-table-content-empty-state",a),sx:[e=>({alignItems:"center",backgroundColor:e.palette.grey[50]||e.palette.background.default,borderRadius:e.spacing(1),boxSizing:"border-box",display:"flex",flexDirection:"column",justifyContent:"center",padding:`${e.spacing(4.375)} 0`,width:"100%",minHeight:e.spacing(18.25),gap:e.spacing(1)}),...c],...Nr(l,...jr),children:s||e.jsxs(e.Fragment,{children:[e.jsx(n.Box,{sx:{"& .MuiSvgIcon-root":{fontSize:e=>e.spacing(5),color:"text.disabled"}},children:u.icon}),e.jsx(n.Typography,{variant:"body1",sx:{fontWeight:e=>e.typography.h6.fontWeight,color:"text.disabled"},children:u.title}),u.description&&e.jsx(n.Typography,{variant:"body2",sx:{color:"text.secondary"},children:u.description}),u.action&&e.jsx(n.Button,{variant:"outlined",size:"small",onClick:u.action.onClick,startIcon:u.action.icon,...void 0!==u.action.disabled?{disabled:u.action.disabled}:{},children:u.action.label})]})})},si=t=>{const{className:i,children:s,tableProps:a,onPinnedShadowChange:o,onHorizontalOverflowChange:l,showLeftPinnedShadow:c=!1,showRightPinnedShadow:u=!1,sx:d,...h}=t,{sx:m,...f}=a??{},y=r.useRef(null),g=r.useRef(null),[p,b]=r.useState({left:null,right:null}),w=void 0===d?[]:Array.isArray(d)?d:[d],v=r.useCallback(()=>{const e=y.current,t=g.current;if(!e||!t)return;const n=Math.max(0,t.scrollWidth-t.clientWidth),r=n>1;l?.(r);const i=r&&t.scrollLeft>1,s=r&&t.scrollLeft<n-1;o?.({left:i,right:s});const a=e.getBoundingClientRect(),c=t.querySelector('[data-pinned-boundary="left"]'),u=t.querySelector('[data-pinned-boundary="right"]'),d=c?Math.max(0,Math.round(c.getBoundingClientRect().right-a.left)):null,h=u?Math.max(0,Math.round(a.right-u.getBoundingClientRect().left)):null;b(e=>e.left===d&&e.right===h?e:{left:d,right:h})},[l,o]);return r.useEffect(()=>{const e=g.current;if(!e)return;v(),e.addEventListener("scroll",v,{passive:!0});const t=new ResizeObserver(v);return t.observe(e),()=>{e.removeEventListener("scroll",v),t.disconnect()}},[v]),r.useEffect(()=>{v()},[s,v]),e.jsxs(n.Box,{ref:y,sx:{position:"relative",width:"100%",minWidth:0},children:[null!==p.left&&e.jsx(n.Box,{sx:Fr("left",Math.max(0,p.left),c)}),null!==p.right&&e.jsx(n.Box,{sx:Fr("right",Math.max(0,p.right),u)}),e.jsx(n.TableContainer,{ref:g,component:n.Paper,elevation:0,className:Mr("nbb-base-table-content-grid-table",i),sx:[{width:"100%",overflowX:"auto",overflowY:"hidden",backgroundColor:"background.paper",borderRadius:0},...w],...h,children:e.jsx(n.Table,{sx:[{backgroundColor:"common.white"},...void 0===m?[]:Array.isArray(m)?m:[m]],...f,children:s})})]})},ai=Tr({table:si,head:ei,body:ni,rowMenu:ri,emptyState:ii}),oi=t=>{const a=Sr(),{columns:o,rows:l,actionColumn:c,rowActions:u,noRowsOverlay:d,onRowClick:h,getRowId:m}=Or(a,t),{className:f,children:y,emptyState:g,head:p,body:b,rowMenu:w,headRow:v,headCell:k,actionHeadCell:x,bodyRow:S,bodyCell:T,actionBodyCell:C,sx:O,...M}=t,N=void 0===O?[]:Array.isArray(O)?O:[O],[j,I]=r.useState(null),[D,A]=r.useState(null),[V,E]=r.useState(!1),[F,L]=r.useState({left:!1,right:!1}),z=(()=>{const e=s.useTheme(),t=i(e.breakpoints.up("sm")),n=i(e.breakpoints.up("md")),r=i(e.breakpoints.up("lg"));return i(e.breakpoints.up("xl"))?"xl":r?"lg":n?"md":t?"sm":"xs"})(),W=r.useCallback(e=>{E(t=>t===e?t:e)},[]),$=r.useCallback(e=>{L(t=>t.left===e.left&&t.right===e.right?t:e)},[]),R=r.useMemo(()=>V?o.map(e=>{const t=Vr(e.pin,z);if(void 0===t){const{pin:t,...n}=e;return n}return{...e,pin:t}}):o.map(e=>{const{pin:t,...n}=e;return n}),[o,V,V&&z]),Z=V&&"right"===Vr(c?.pin,z)?"right":void 0,B=r.useMemo(()=>{const e=function(e){const t=e.map(()=>({})),n=[],r=[];let i=0;e.forEach((e,r)=>{"left"===e.pin&&(t[r]={pin:"left",left:i},i+=Dr(e),n.push(r))});let s=0;for(let n=e.length-1;n>=0;n-=1){const i=e[n];"right"===i?.pin&&(t[n]={pin:"right",right:s},s+=Dr(i),r.push(n))}const a=n[n.length-1];void 0!==a&&(t[a]={...t[a],isLeftBoundary:!0});const o=r[r.length-1];return void 0!==o&&(t[o]={...t[o],isRightBoundary:!0}),t}(R),t=Boolean(u)&&"right"===Z?56:0;return e.map(e=>{const n="left"===e.pin?e:"right"===e.pin?{...e,right:(e.right??0)+t}:e;return"left"===n.pin&&n.isLeftBoundary?{...n,showBoundaryShadow:F.left}:"right"===n.pin&&n.isRightBoundary?{...n,showBoundaryShadow:F.right}:n})},[F.left,F.right,Z,R,u]),P=r.useMemo(()=>{if(u&&"right"===Z){const e=!R.some(e=>"right"===e.pin);return{pin:"right",right:0,isRightBoundary:e,showBoundaryShadow:e&&F.right}}},[F.right,Z,R,u]),q=r.useMemo(()=>D&&u?u(D):[],[D,u]),H=(e,t)=>{e.stopPropagation(),I(e.currentTarget),A(t)},U=()=>{I(null),A(null)},_="function"==typeof p?p({columns:R,rowActions:u,columnPinMeta:B,...void 0!==P?{actionColumnPinMeta:P}:{},headRow:v,headCell:k,actionHeadCell:x}):p,Y="function"==typeof b?b({columns:R,rows:l,rowActions:u,onRowClick:h,getRowId:m,onOpenRowMenu:H,columnPinMeta:B,...void 0!==P?{actionColumnPinMeta:P}:{},bodyRow:S,bodyCell:T,actionBodyCell:C}):b,J="function"==typeof w?w({menuAnchorEl:j,menuRow:D,menuActions:q,onClose:U}):w;return e.jsx(n.Stack,{className:Mr("nbb-base-table-content-grid",f),sx:[{width:"100%",minWidth:0},...N],...Nr(M,...jr),children:e.jsx(Cr,{defaultBlocks:ai,defaultBlockOrder:Object.keys(ai),blocksOverride:y,children:({blocks:t})=>{const n=t;if(0===l.length)return g??Lr(n.emptyState,{...void 0!==d?{noRowsOverlay:d}:{}},"empty-state");const r=_??Lr(n.head,{columns:R,rowActions:u,...void 0!==B?{columnPinMeta:B}:{},...void 0!==P?{actionColumnPinMeta:P}:{},headRow:v,headCell:k,actionHeadCell:x},"grid-head"),i=Y??Lr(n.body,{columns:R,rows:l,rowActions:u,onRowClick:h,getRowId:m,onOpenRowMenu:H,...void 0!==B?{columnPinMeta:B}:{},...void 0!==P?{actionColumnPinMeta:P}:{},bodyRow:S,bodyCell:T,actionBodyCell:C},"grid-body"),s=Lr(n.table,{onHorizontalOverflowChange:W,onPinnedShadowChange:$,showLeftPinnedShadow:F.left,showRightPinnedShadow:F.right,children:e.jsxs(e.Fragment,{children:[r,i]})},"grid-table"),a=J??Lr(n.rowMenu,{menuAnchorEl:j,menuRow:D,menuActions:q,onClose:U},"grid-row-menu");return e.jsxs(e.Fragment,{children:[s,a]})}})})},li=Tr({loader:Br,emptyState:ii,grid:oi}),ci=t=>{const{isLoading:r,rows:i}=Or(Sr(),t),{children:s,className:a,...o}=t;return e.jsx(n.Box,{className:Mr("nbb-base-table-content",a),...Nr(o,...jr),children:e.jsx(Cr,{defaultBlocks:li,defaultBlockOrder:Object.keys(li),blocksOverride:s,children:({blocks:e})=>{const t=e;return r?Lr(t.loader,{},"content-loader"):i&&0!==i.length?Lr(t.grid,{},"content-grid"):Lr(t.emptyState,{},"content-empty-state")}})})},ui=t=>{const{pagination:r,rows:a,isLoading:o}=Or(Sr(),t),{children:l,className:c,sx:u=[],...d}=t,h=s.useTheme(),m=i(h.breakpoints.down("sm")),f=i(h.breakpoints.down("md"));if(!r||o||!a||0===a.length)return null;const y=m?0:1,g=m||f?0:1;return e.jsx(n.Stack,{className:Mr("nbb-base-table-pagination",c),sx:[{alignItems:"center",width:"100%"},...Array.isArray(u)?u:[u]],...Nr(d,...jr),children:l||e.jsx(n.Pagination,{count:Math.max(1,Math.ceil(r.total/r.pageSize)),page:r.page,onChange:(e,t)=>r.onPageChange(t),variant:"outlined",color:"primary",shape:"rounded",boundaryCount:y,siblingCount:g,sx:{maxWidth:"100%","& .MuiPagination-ul":{flexWrap:"nowrap",justifyContent:"center"}}})})},di=Tr({header:Zr,tabs:Pr,searchChips:qr,content:ci,pagination:ui}),hi=({sx:t,spacing:i=3,className:s,children:a,...o})=>{const l=function(e,...t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}(o,...jr),c=Nr(o,...jr),{tabs:u,activeTab:d,onTabChange:h}=l,[m,f]=r.useState(u?.[0]?.value);r.useEffect(()=>{u?.length&&f(e=>void 0!==e&&u.some(t=>t.value===e)?e:u[0]?.value)},[u]);const y=void 0!==d?d:m,g={...l,...void 0!==y?{activeTab:y}:{},onTabChange:e=>{void 0===d&&f(e),h?.(e)}};return e.jsx(n.Stack,{className:Mr("nbb-base-table",s),spacing:i,sx:[{p:2,width:"100%",maxWidth:"100%",boxSizing:"border-box"},...Array.isArray(t)?t:[t]],...c,children:e.jsx(xr,{...g,children:e.jsx(Cr,{defaultBlocks:di,defaultBlockOrder:Object.keys(di),blocksOverride:a,children:({blocks:e,blockOrder:t})=>zr(e,t)})})})},mi=Zr;mi.Title=Wr,mi.Actions=$r;const fi=qr,yi=ei;yi.Row=Gr,yi.Cell=Hr,yi.ActionCell=_r;const gi=ni;gi.Row=Kr,gi.Cell=Ur,gi.ActionCell=Yr;const pi=oi;pi.Table=si,pi.Head=yi,pi.Body=gi,pi.RowMenu=ri;const bi=ci;bi.Loader=Br,bi.EmptyState=ii,bi.Grid=pi,hi.Header=mi,hi.Tabs=Pr,hi.SearchChips=fi,hi.Content=bi,hi.Pagination=ui;const wi=["labels","headerAction","layout","data"],vi=r.createContext(void 0),ki=()=>{const e=r.useContext(vi);if(!e)throw new Error("useBaseViewListContext must be used within a BaseViewListProvider");return e};function xi(e){return"[object Object]"===Object.prototype.toString.call(e)&&!r.isValidElement(e)}const Si=new Set(["__proto__","prototype","constructor"]);function Ti(e,t){const n={...e};for(const e of Reflect.ownKeys(t)){if(Si.has(e))continue;const r=n[e],i=t[e];xi(r)&&xi(i)?n[e]=Ti(r,i):n[e]=i}return n}function Ci(...e){return e.flat().filter(Boolean).join(" ")}function Oi(e,...t){const n={...e};for(const e of t)delete n[e];return n}const Mi=({children:t,className:r,onClick:i,...s})=>{const{labels:a,headerAction:o}=Ti(ki(),s),{headerActionButton:l}=a??{};return e.jsx(n.Button,{variant:"outlined",size:"medium",className:Ci("nbb-base-view-list-header-action-button",r),...(i??o)&&{onClick:i??o},...Oi(s,...wi),children:t??l})},Ni=({sx:t,className:r,...i})=>{const{layout:s}=Ti(ki(),i),a="two-column"===s;return e.jsx(n.Typography,{component:"dt",variant:"subtitle1",sx:[e=>({display:"inline-flex",alignItems:"center",px:2,py:3,flexShrink:0,width:{xs:96,sm:204},fontWeight:e.typography.fontWeightBold,...a?{}:{p:0}}),...Array.isArray(t)?t:[t]],className:Ci("nbb-base-view-list-item-key",r),...Oi(i,...wi)})},ji=({sx:t,className:r,...i})=>{const{layout:s}=Ti(ki(),i);return e.jsx(n.Typography,{component:"dd",variant:"body2",sx:[{display:"inline-flex",alignItems:"center",px:2,py:3,..."two-column"===s?{}:{p:0}},...Array.isArray(t)?t:[t]],className:Ci("nbb-base-view-list-item-value",r),...Oi(i,...wi)})},Ii=({sx:t,className:r,...i})=>{const{layout:s}=Ti(ki(),i),a="two-column"===s;return e.jsx(n.ListItem,{divider:!0,sx:[e=>({display:"flex",flexDirection:a?"row":"column",alignItems:a?"center":"flex-start",...a?{p:0}:{px:2,py:3},"&:first-of-type":{borderTopColor:e.palette.divider,borderTopWidth:1,borderTopStyle:"solid"}}),...Array.isArray(t)?t:[t]],className:Ci("nbb-base-view-list-item",r),...Oi(i,...wi)})};var Di;function Ai(...e){return e.flat().filter(Boolean).join(" ")}function Vi({labels:r,searchValue:i,onSearchFieldChange:s,onSearchSubmit:a}){return e.jsx(n.TextField,{type:"search",variant:"outlined",placeholder:r.searchFieldPlaceholder,onChange:e=>s?.(e.target.value),onKeyDown:e=>{a&&"Enter"===e.key&&!e.nativeEvent.isComposing&&e.target instanceof HTMLInputElement&&(e.preventDefault(),a())},...void 0!==i?{value:i}:{},sx:e=>({flex:1,width:{md:e.spacing(44.75)},"& .MuiOutlinedInput-input":{py:1.5,fontSize:e.typography.body2.fontSize}}),slotProps:{input:{endAdornment:e.jsx(n.InputAdornment,{position:"end",children:e.jsx(n.IconButton,{"aria-label":"Search",edge:"end",size:"small",...a?{onClick:a}:{},children:e.jsx(t.Search,{})})})}}})}function Ei(n,r,i,s,a){if(!a||!n.rowActions)return;const o=n.rowActions;return n=>{if(s&&!s(n))return[];const l=a(n);return l&&0!==l.length?l.flatMap(s=>"activate"===s?r?[{label:o.activate,icon:e.jsx(t.Loop,{sx:e=>({fontSize:e.typography.h5.fontSize})}),onClick:()=>r(n.id)}]:[]:"deactivate"===s&&i?[{label:o.deactivate,icon:e.jsx(t.BlockOutlined,{sx:e=>({fontSize:e.typography.h5.fontSize})}),onClick:()=>i(n.id)}]:[]):[]}}function Fi(t){const r=function(e){if(!e)return null;const t=wr.fromISO(e);return t.isValid?t:null}("string"==typeof t?t:void 0),i=r?.toFormat("yyyy/MM/dd")??"N/A",s=r?.toLocaleString(wr.DATETIME_FULL)??"N/A";return e.jsx(n.Tooltip,{title:s,children:e.jsx("span",{children:i})})}function Li(e,t){return[{field:"name",headLabel:e.headerRow.name,pin:{sm:"left"},width:180},{field:"joinDate",headLabel:e.headerRow.joinDate,width:180,valueFormatter:Fi},{field:"createdAt",headLabel:e.headerRow.createdAt,width:180,valueFormatter:Fi},{field:"status",headLabel:e.headerRow.status,width:180,valueFormatter:(n,{row:r})=>r.status===t.active?e.cellData.statusActive:r.status===t.inactive?e.cellData.statusInactive:r.status}]}function zi(e){return{page:e.currentPage,pageSize:1,total:e.totalPages,onPageChange:e.onPageChange}}function Wi(n){return{icon:e.jsx(t.PersonOutlined,{}),title:n.emptyStateMessage}}function $i(t,n){return n.filter(e=>e in t).map(n=>e.jsx(r.Fragment,{children:t[n]},String(n)))}Ii.Key=Ni,Ii.Value=ji,Di={header:({children:t,className:r,sx:i,...s})=>{const{labels:a,headerAction:o}=Ti(ki(),s),{headerTitle:l,headerActionButton:c}=a??{};return(l??c??t??null)&&e.jsx(n.Stack,{direction:"row",className:Ci("nbb-base-view-list-header",r),sx:[{columnGap:2,justifyContent:"space-between",alignItems:"center"},...Array.isArray(i)?i:[i]],...Oi(s,...wi),children:t??e.jsxs(e.Fragment,{children:[e.jsx(n.Typography,{component:"div",sx:{typography:{xs:"h6",sm:"h4"},fontWeight:"bold",flex:"1 1 auto",minWidth:0},children:l}),c||o?e.jsx(n.Box,{sx:{flexShrink:0},children:e.jsx(Mi,{...a&&{labels:a},...o&&{headerAction:o}})}):null]})})},subheader:({children:t,className:r,sx:i,...s})=>{const{labels:a}=Ti(ki(),s),{subheaderTitle:o,headerTitle:l,headerActionButton:c}=a??{};return(o??t??null)&&e.jsx(n.Stack,{direction:"row",className:Ci("nbb-base-view-list-subheader",r),sx:[{columnGap:2,justifyContent:"space-between",alignItems:"center",...l||c?{"&&":{mt:{xs:2,sm:4}}}:{}},...Array.isArray(i)?i:[i]],...Oi(s,...wi),children:t??e.jsx(n.Typography,{component:"div",sx:e=>({typography:"body2",color:e.palette.secondary.main,flex:"1 1 auto",minWidth:0}),children:o})})},itemList:({children:t,sx:r,className:i,...s})=>{const{data:a}=Ti(ki(),s);return e.jsx(n.List,{component:"dl",sx:[{m:0,p:0},...Array.isArray(r)?r:[r]],className:Ci("nbb-base-view-list-item-list",i),...Oi(s,...wi),children:t??(void 0===a?null:Array.isArray(a)?a.map((t,n)=>e.jsx(Ii,{children:e.jsx(Ii.Value,{children:t})},`${n}-${String(t)}`)):Object.entries(a).map(([t,n])=>e.jsxs(Ii,{children:[e.jsx(Ii.Key,{children:t}),e.jsx(Ii.Value,{children:n})]},t)))})},item:Ii,itemKey:Ni,itemValue:ji},Object.fromEntries(Object.entries(Di).map(([e,t])=>[e,r.createElement(t,{key:e})])),"undefined"!=typeof navigator&&navigator.language&&(Te.defaultLocale=navigator.language);const Ri=({className:t,children:r,labels:i,searchValue:s,onSearchFieldChange:a,onSearchSubmit:o,onNavigate:l,onItemActivate:c,onItemDeactivate:u,shouldShowDropdownMenu:d,resolveRowAction:h,statusMatch:m={active:"active",inactive:"inactive"},pagination:f,data:y,rowHref:g,tabs:p,currentTab:b,onTabChange:w,listOrganizationsTitle:v,isLoading:k,...x})=>{const S=Li(i,m),T=p&&function(t){return t.map(t=>({value:t.key,disabled:Boolean(t.isDisabled),label:e.jsxs(e.Fragment,{children:[t.label,t.subtitle&&e.jsx(n.Typography,{component:"span",variant:"body2",sx:{color:"text.secondary"},children:t.subtitle})]})}))}(p),C=f&&zi(f),O=Ei(i,c,u,d,h),M=Vi({labels:i,searchValue:s,onSearchFieldChange:a,onSearchSubmit:o}),N=e.jsx(Ri.Title,{}),j=e.jsx(Ri.Action,{}),I=e.jsxs(Ri.Header,{children:[N,j]}),D=e.jsx(Ri.Loader,{}),A=e.jsx(Ri.Tabs,{}),V=e.jsx(Ri.SearchChips,{}),E=e.jsx(Ri.Table,{}),F={title:N,action:j,header:I,loader:D,content:e.jsx(Ri.Content,{}),tabs:A,searchChips:V,table:E,pagination:e.jsx(Ri.Pagination,{...f?{pagination:f}:{},data:y,...void 0!==k?{isLoading:k}:{}})},L=["header","searchChips","tabs","content","pagination"],z=void 0===r?$i(F,L):"function"==typeof r?(()=>{const{blocks:e,blockOrder:t}=r({defaultBlocks:F,defaultBlockOrder:L});return $i(e,t)})():r;return e.jsx(hi,{className:Ai("nbb-list-organizations-container",t),headerTitle:v,headerActions:M,columns:S,rows:y,...O?{rowActions:O,actionColumn:{pin:"right"}}:{},noRowsOverlay:Wi(i),...T?{tabs:T}:{},...void 0!==b?{activeTab:b}:{},...w?{onTabChange:w}:{},...C?{pagination:C}:{},...void 0!==k?{isLoading:k}:{},...g&&l?{onRowClick:e=>{const t=g(e);t&&l(t)}}:{},...x,children:z})};Ri.Title=({listOrganizationsTitle:t,children:n,className:r,...i})=>e.jsx(hi.Header.Title,{className:Ai("nbb-list-organizations-title",r),...i,children:n||t}),Ri.Action=({children:t,className:n,labels:r,searchValue:i,onSearchFieldChange:s,onSearchSubmit:a,sx:o=[],...l})=>{const c=t||(r?Vi({labels:r,searchValue:i,onSearchFieldChange:s,onSearchSubmit:a}):void 0);return e.jsx(hi.Header.Actions,{className:Ai("nbb-list-organizations-actions",n),sx:[{width:{xs:"100%",md:"auto"},justifyContent:{xs:"flex-start",md:"flex-end"}},...Array.isArray(o)?o:[o]],...l,children:c})},Ri.Header=({children:t,className:n,sx:r=[],...i})=>e.jsx(hi.Header,{className:Ai("nbb-list-organizations-header",n),sx:[{flexWrap:{xs:"wrap",md:"nowrap"},alignItems:{xs:"flex-start",md:"center"},columnGap:2,rowGap:{xs:3.75,md:2}},...Array.isArray(r)?r:[r]],...i,children:t}),Ri.Loader=({children:t,className:n,...r})=>e.jsx(hi.Content.Loader,{className:Ai("nbb-list-organizations-loader",n),...r,children:t}),Ri.Content=({children:t,className:n,...r})=>e.jsx(hi.Content,{className:Ai("nbb-list-organizations-content",n),...r,children:t}),Ri.Tabs=({children:t,className:n,...r})=>e.jsx(hi.Tabs,{className:Ai("nbb-list-organizations-tabs",n),...r,children:t}),Ri.SearchChips=({className:t,...n})=>e.jsx(hi.SearchChips,{className:Ai("nbb-list-organizations-search-chips",t),...n}),Ri.Pagination=({className:t,pagination:n,data:r,isLoading:i,...s})=>{const a=n&&zi(n),o=Ai("nbb-list-organizations-pagination",n?.className,t);return e.jsx(hi.Pagination,{className:o,...a?{pagination:a}:{},...r?{rows:r}:{},...void 0!==i?{isLoading:i}:{},...s})},Ri.Table=({className:t,labels:n,data:r,columns:i,rowActions:s,actionColumn:a,onRowClick:o,onItemActivate:l,onItemDeactivate:c,shouldShowDropdownMenu:u,resolveRowAction:d,statusMatch:h={active:"active",inactive:"inactive"},rowHref:m,onNavigate:f,...y})=>{const g=i??(n?Li(n,h):void 0),p=n?Wi(n):void 0,b=n?Ei(n,l,c,u,d):void 0,w=void 0!==s?s:b,v=a??(w?{pin:"right"}:void 0),k=o??(m&&f?e=>{const t=m(e);t&&f(t)}:void 0);return e.jsx(hi.Content.Grid,{className:Ai("nbb-list-organizations-table",t),...g?{columns:g}:{},...r?{rows:r}:{},...p?{noRowsOverlay:p}:{},...w?{rowActions:w}:{},...v?{actionColumn:v}:{},...k?{onRowClick:k}:{},...y})},exports.ListOrganizations=Ri;
|