iobroker.admin 7.7.0 → 7.7.2
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 +6 -8
- package/adminWww/assets/{AdapterUpdateDialog-n1ctcGKb.js → AdapterUpdateDialog-DHGhgEEq.js} +1 -1
- package/adminWww/assets/{Adapters-Byzq4dfE.js → Adapters-CgSIajcF.js} +2 -2
- package/adminWww/assets/{Config-BufFy_Z3.js → Config-BQSl4bfA.js} +1 -1
- package/adminWww/assets/{CustomModal-ASkCycZn.js → CustomModal-DNMTLv4y.js} +1 -1
- package/adminWww/assets/{CustomTab-D5ZlRfQA.js → CustomTab-Bl8S8QZW.js} +1 -1
- package/adminWww/assets/{DefaultPropsProvider-DxsXuIyE.js → DefaultPropsProvider-u5xB1Fxz.js} +1 -1
- package/adminWww/assets/{EasyMode-CTuK0TL7.js → EasyMode-xDbqrply.js} +1 -1
- package/adminWww/assets/{Enums-C5pau2hV.js → Enums-BSICIhWI.js} +1 -1
- package/adminWww/assets/{Fields-Cj6QGc97.js → Fields-C3JkTmfP.js} +1 -1
- package/adminWww/assets/{Files-DJmRnmH6.js → Files-DK85-COY.js} +2 -2
- package/adminWww/assets/{FilledInput-CKswrNd5.js → FilledInput-CysG4ax_.js} +1 -1
- package/adminWww/assets/{Hosts-B5BgwMoO.js → Hosts-qIsB4Gub.js} +2 -2
- package/adminWww/assets/Instances-BA_DCzs8.js +2 -0
- package/adminWww/assets/{Intro-Do7uao_1.js → Intro-00oh6SLw.js} +1 -1
- package/adminWww/assets/{Logs-DK0nfkio.js → Logs-Cvpgh-zN.js} +1 -1
- package/adminWww/assets/{Objects-9W6F_Gl6.js → Objects-Dp71iotS.js} +3 -3
- package/adminWww/assets/{State-CdKRELiQ.js → State-BqfD2ABf.js} +1 -1
- package/adminWww/assets/{Tabs-BJ1rL35Z.js → Tabs-sxfWgN0b.js} +2 -2
- package/adminWww/assets/{Users-7TI-QdQA.js → Users-CDcWqTfZ.js} +1 -1
- package/adminWww/assets/ace-BG5WYul1.js +985 -0
- package/adminWww/assets/{blueGrey-D-KQaGde.js → blueGrey-DYsiMDOn.js} +1 -1
- package/adminWww/assets/{bootstrap-BX2s0oWJ.js → bootstrap-BYQTdf9r.js} +10 -10
- package/adminWww/assets/{createSvgIcon-DuKI6CvW.js → createSvgIcon-Bh3KWtyp.js} +1 -1
- package/adminWww/assets/{emotion-react.browser.esm-DApPKwaj.js → emotion-react.browser.esm-BCDt9NrH.js} +1 -1
- package/adminWww/assets/{emotion-styled.browser.esm-Dc05hmeu.js → emotion-styled.browser.esm-CyFqGgyG.js} +1 -1
- package/adminWww/assets/{emotion-utils.browser.esm-DOjH6Olm.js → emotion-utils.browser.esm-pglN4_eI.js} +1 -1
- package/adminWww/assets/{geosearch.module-CWfRtxrN.js → geosearch.module-DH4NhiPj.js} +1 -1
- package/adminWww/assets/hostInit-fzxL8JAx.js +1 -1
- package/adminWww/assets/{iconBase-CgxZ5MMC.js → iconBase-C3vi24ZE.js} +1 -1
- package/adminWww/assets/{index-BmWdDCX_.js → index-B1ITPhEY.js} +2 -2
- package/adminWww/assets/{index-D7Rlw-5R.js → index-D--ojYan.js} +1 -1
- package/adminWww/assets/{index-nYRrWzRm.js → index-D3IAEXXP.js} +1 -1
- package/adminWww/assets/{index-HOidq_rM.js → index-DPDg2YA0.js} +1 -1
- package/adminWww/assets/{index-Bsv_DXxB.js → index-DTGUg51P.js} +1 -1
- package/adminWww/assets/{index-BP5kWU3L.js → index-Qa7Q_Dz5.js} +1 -1
- package/adminWww/assets/{index-4ywCzYtt.js → index-qcIeekse.js} +2 -2
- package/adminWww/assets/{index-gHyOgbGJ.js → index-rKfs-rCa.js} +1 -1
- package/adminWww/assets/{index-CL669NIb.js → index-wN1ZlPSW.js} +2 -2
- package/adminWww/assets/iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-BOKYvG_W.js +1 -0
- package/adminWww/assets/{iobroker_admin__loadShare__leaflet__loadShare__-B1OZ7tj-.js → iobroker_admin__loadShare__leaflet__loadShare__-h9SMNPLU.js} +1 -1
- package/adminWww/assets/iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BnsS7SOQ.js +1 -0
- package/adminWww/assets/{iobroker_admin__loadShare__react__loadShare__-DtlEM_52.js → iobroker_admin__loadShare__react__loadShare__-Bis6NHgw.js} +1 -1
- package/adminWww/assets/iobroker_admin__mf_v__runtimeInit__mf_v__-CTkuGOOk.js +5 -0
- package/adminWww/assets/{sentry-CVjuw0L7.js → sentry-H_UdJ2zx.js} +1 -1
- package/adminWww/assets/{zh-cn-Dv2ND1_P.js → zh-cn-vvAC9zpl.js} +3 -3
- package/adminWww/index.html +2 -2
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/remoteEntry.js +2 -2
- package/io-package.json +27 -27
- package/package.json +9 -9
- package/adminWww/assets/Instances-W2t3Z5_r.js +0 -2
- package/adminWww/assets/ace-kRq1OCR-.js +0 -985
- package/adminWww/assets/iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-gw2iqPBS.js +0 -1
- package/adminWww/assets/iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BGyJCibC.js +0 -1
- package/adminWww/assets/iobroker_admin__mf_v__runtimeInit__mf_v__-VDoBF19b.js +0 -10
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as a,J as Zt,B as er,F as Be,H as ye,E as he}from"./DefaultPropsProvider-u5xB1Fxz.js";import{i as Tt}from"./iobroker_admin__loadShare__react__loadShare__-Bis6NHgw.js";import{r as fs,j as Zs,i as d,U as pe,f as ot,I as ht,a as v,k as sr,D as nr,l as ms,m as rr,R as Ys,n as ir,c as xt,w as or,o as ar,h as lr,g as cr,T as ur}from"./bootstrap-BYQTdf9r.js";import{a as dr}from"./index-DPDg2YA0.js";import{C as hr}from"./Config-BQSl4bfA.js";import{S as et}from"./State-BqfD2ABf.js";import{s as pr,M as fr,C as mr}from"./sentry-H_UdJ2zx.js";import{C as Mt}from"./CustomModal-DNMTLv4y.js";import{a as gr}from"./blueGrey-DYsiMDOn.js";import"./iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BnsS7SOQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-CTkuGOOk.js";import"./emotion-serialize.esm-BUa21YfQ.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-BOKYvG_W.js";import"./ace-BG5WYul1.js";import"./FilledInput-CysG4ax_.js";import"./preload-helper-Dp1pzeXC.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-h9SMNPLU.js";import"./extends-CF3RwP-h.js";import"./iconBase-C3vi24ZE.js";import"./emotion-cache.browser.esm-B8BFze5o.js";var Ft={},P={},ee={},vt={},qs={};Object.defineProperty(qs,"__esModule",{value:!0});var Ce={},ut={};Object.defineProperty(ut,"__esModule",{value:!0});ut.CronField=void 0;class rs{#t=!1;#s=!1;#n=!1;#r=[];options={rawValue:""};static get min(){throw new Error("min must be overridden")}static get max(){throw new Error("max must be overridden")}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(t,e={rawValue:""}){if(!Array.isArray(t))throw new Error(`${this.constructor.name} Validation error, values is not an array`);if(!(t.length>0))throw new Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...e,rawValue:e.rawValue??""},this.#r=t.sort(rs.sorter),this.#n=this.options.wildcard!==void 0?this.options.wildcard:this.#i(),this.#t=this.options.rawValue.includes("L"),this.#s=this.options.rawValue.includes("?")}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#t}get hasQuestionMarkChar(){return this.#s}get isWildcard(){return this.#n}get values(){return this.#r}static sorter(t,e){const s=typeof t=="number",r=typeof e=="number";return s&&r?t-e:!s&&!r?t.localeCompare(e):s?-1:1}serialize(){return{wildcard:this.#n,values:this.#r}}validate(){let t;const e=this.chars.length>0?` or chars ${this.chars.join("")}`:"",s=l=>c=>new RegExp(`^\\d{0,2}${c}$`).test(l),r=l=>(t=l,typeof l=="number"?l>=this.min&&l<=this.max:this.chars.some(s(l)));if(!this.#r.every(r))throw new Error(`${this.constructor.name} Validation error, got value ${t} expected range ${this.min}-${this.max}${e}`);const o=this.#r.find((l,c)=>this.#r.indexOf(l)!==c);if(o)throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${o}`)}#i(){return this.options.rawValue.length>0?["*","?"].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(t,e)=>e+this.min).every(t=>this.#r.includes(t))}}ut.CronField=rs;Object.defineProperty(Ce,"__esModule",{value:!0});Ce.CronDayOfMonth=void 0;const yr=ut,xr=1,vr=31,wr=Object.freeze(["L"]);class Sr extends yr.CronField{static get min(){return xr}static get max(){return vr}static get chars(){return wr}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(t,e){super(t,e),this.validate()}get values(){return super.values}}Ce.CronDayOfMonth=Sr;var be={};Object.defineProperty(be,"__esModule",{value:!0});be.CronDayOfWeek=void 0;const Cr=ut,br=0,kr=7,Dr=Object.freeze(["L"]);class Tr extends Cr.CronField{static get min(){return br}static get max(){return kr}static get chars(){return Dr}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(t,e){super(t,e),this.validate()}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}}be.CronDayOfWeek=Tr;var ke={};Object.defineProperty(ke,"__esModule",{value:!0});ke.CronHour=void 0;const Or=ut,Mr=0,Ir=23,Er=Object.freeze([]);class jr extends Or.CronField{static get min(){return Mr}static get max(){return Ir}static get chars(){return Er}constructor(t,e){super(t,e),this.validate()}get values(){return super.values}}ke.CronHour=jr;var De={};Object.defineProperty(De,"__esModule",{value:!0});De.CronMinute=void 0;const Nr=ut,Fr=0,Lr=59,_r=Object.freeze([]);class Wr extends Nr.CronField{static get min(){return Fr}static get max(){return Lr}static get chars(){return _r}constructor(t,e){super(t,e),this.validate()}get values(){return super.values}}De.CronMinute=Wr;var Te={},se={},z={};Object.defineProperty(z,"__esModule",{value:!0});class Ot extends Error{}class $r extends Ot{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Ar extends Ot{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Hr extends Ot{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Lt extends Ot{}class Xs extends Ot{constructor(t){super(`Invalid unit ${t}`)}}class L extends Ot{}class mt extends Ot{constructor(){super("Zone is an abstract class")}}const g="numeric",at="short",B="long",xe={year:g,month:g,day:g},Js={year:g,month:at,day:g},Vr={year:g,month:at,day:g,weekday:at},Qs={year:g,month:B,day:g},Ks={year:g,month:B,day:g,weekday:B},tn={hour:g,minute:g},en={hour:g,minute:g,second:g},sn={hour:g,minute:g,second:g,timeZoneName:at},nn={hour:g,minute:g,second:g,timeZoneName:B},rn={hour:g,minute:g,hourCycle:"h23"},on={hour:g,minute:g,second:g,hourCycle:"h23"},an={hour:g,minute:g,second:g,hourCycle:"h23",timeZoneName:at},ln={hour:g,minute:g,second:g,hourCycle:"h23",timeZoneName:B},cn={year:g,month:g,day:g,hour:g,minute:g},un={year:g,month:g,day:g,hour:g,minute:g,second:g},dn={year:g,month:at,day:g,hour:g,minute:g},hn={year:g,month:at,day:g,hour:g,minute:g,second:g},Rr={year:g,month:at,day:g,weekday:at,hour:g,minute:g},pn={year:g,month:B,day:g,hour:g,minute:g,timeZoneName:at},fn={year:g,month:B,day:g,hour:g,minute:g,second:g,timeZoneName:at},mn={year:g,month:B,day:g,weekday:B,hour:g,minute:g,timeZoneName:B},gn={year:g,month:B,day:g,weekday:B,hour:g,minute:g,second:g,timeZoneName:B};class Ht{get type(){throw new mt}get name(){throw new mt}get ianaName(){return this.name}get isUniversal(){throw new mt}offsetName(t,e){throw new mt}formatOffset(t,e){throw new mt}offset(t){throw new mt}equals(t){throw new mt}get isValid(){throw new mt}}let Ne=null;class ne extends Ht{static get instance(){return Ne===null&&(Ne=new ne),Ne}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:s}){return Mn(t,e,s)}formatOffset(t,e){return Qt(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const ze=new Map;function Pr(n){let t=ze.get(n);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),ze.set(n,t)),t}const Br={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function zr(n,t){const e=n.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(e),[,r,i,o,l,c,h,f]=s;return[o,r,i,l,c,h,f]}function Ur(n,t){const e=n.formatToParts(t),s=[];for(let r=0;r<e.length;r++){const{type:i,value:o}=e[r],l=Br[i];i==="era"?s[l]=o:w(l)||(s[l]=parseInt(o,10))}return s}const Fe=new Map;class lt extends Ht{static create(t){let e=Fe.get(t);return e===void 0&&Fe.set(t,e=new lt(t)),e}static resetCache(){Fe.clear(),ze.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=lt.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:s}){return Mn(t,e,s,this.name)}formatOffset(t,e){return Qt(this.offset(t),e)}offset(t){if(!this.valid)return NaN;const e=new Date(t);if(isNaN(e))return NaN;const s=Pr(this.name);let[r,i,o,l,c,h,f]=s.formatToParts?Ur(s,e):zr(s,e);l==="BC"&&(r=-Math.abs(r)+1);const m=Me({year:r,month:i,day:o,hour:c===24?0:c,minute:h,second:f,millisecond:0});let p=+e;const x=p%1e3;return p-=x>=0?x:1e3+x,(m-p)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let gs={};function Gr(n,t={}){const e=JSON.stringify([n,t]);let s=gs[e];return s||(s=new Intl.ListFormat(n,t),gs[e]=s),s}const Ue=new Map;function Ge(n,t={}){const e=JSON.stringify([n,t]);let s=Ue.get(e);return s===void 0&&(s=new Intl.DateTimeFormat(n,t),Ue.set(e,s)),s}const Ze=new Map;function Zr(n,t={}){const e=JSON.stringify([n,t]);let s=Ze.get(e);return s===void 0&&(s=new Intl.NumberFormat(n,t),Ze.set(e,s)),s}const Ye=new Map;function Yr(n,t={}){const{base:e,...s}=t,r=JSON.stringify([n,s]);let i=Ye.get(r);return i===void 0&&(i=new Intl.RelativeTimeFormat(n,t),Ye.set(r,i)),i}let Yt=null;function qr(){return Yt||(Yt=new Intl.DateTimeFormat().resolvedOptions().locale,Yt)}const qe=new Map;function yn(n){let t=qe.get(n);return t===void 0&&(t=new Intl.DateTimeFormat(n).resolvedOptions(),qe.set(n,t)),t}const Xe=new Map;function Xr(n){let t=Xe.get(n);if(!t){const e=new Intl.Locale(n);t="getWeekInfo"in e?e.getWeekInfo():e.weekInfo,"minimalDays"in t||(t={...xn,...t}),Xe.set(n,t)}return t}function Jr(n){const t=n.indexOf("-x-");t!==-1&&(n=n.substring(0,t));const e=n.indexOf("-u-");if(e===-1)return[n];{let s,r;try{s=Ge(n).resolvedOptions(),r=n}catch{const c=n.substring(0,e);s=Ge(c).resolvedOptions(),r=c}const{numberingSystem:i,calendar:o}=s;return[r,i,o]}}function Qr(n,t,e){return(e||t)&&(n.includes("-u-")||(n+="-u"),e&&(n+=`-ca-${e}`),t&&(n+=`-nu-${t}`)),n}function Kr(n){const t=[];for(let e=1;e<=12;e++){const s=S.utc(2009,e,1);t.push(n(s))}return t}function ti(n){const t=[];for(let e=1;e<=7;e++){const s=S.utc(2016,11,13+e);t.push(n(s))}return t}function ae(n,t,e,s){const r=n.listingMode();return r==="error"?null:r==="en"?e(t):s(t)}function ei(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||yn(n.locale).numberingSystem==="latn"}class si{constructor(t,e,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:r,floor:i,...o}=s;if(!e||Object.keys(o).length>0){const l={useGrouping:!1,...s};s.padTo>0&&(l.minimumIntegerDigits=s.padTo),this.inf=Zr(t,l)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}else{const e=this.floor?Math.floor(t):cs(t,3);return E(e,this.padTo)}}}class ni{constructor(t,e,s){this.opts=s,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const o=-1*(t.offset/60),l=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;t.offset!==0&<.create(l).valid?(r=l,this.dt=t):(r="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,r=t.zone.name):(r="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=Ge(e,i)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(e=>{if(e.type==="timeZoneName"){const s=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:s}}else return e}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class ri{constructor(t,e,s){this.opts={style:"long",...s},!e&&Tn()&&(this.rtf=Yr(t,s))}format(t,e){return this.rtf?this.rtf.format(t,e):Di(e,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}const xn={firstDay:1,minimalDays:4,weekend:[6,7]};class D{static fromOpts(t){return D.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,e,s,r,i=!1){const o=t||I.defaultLocale,l=o||(i?"en-US":qr()),c=e||I.defaultNumberingSystem,h=s||I.defaultOutputCalendar,f=Qe(r)||I.defaultWeekSettings;return new D(l,c,h,f,o)}static resetCache(){Yt=null,Ue.clear(),Ze.clear(),Ye.clear(),qe.clear(),Xe.clear()}static fromObject({locale:t,numberingSystem:e,outputCalendar:s,weekSettings:r}={}){return D.create(t,e,s,r)}constructor(t,e,s,r,i){const[o,l,c]=Jr(t);this.locale=o,this.numberingSystem=e||l||null,this.outputCalendar=s||c||null,this.weekSettings=r,this.intl=Qr(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(){return this.fastNumbersCached==null&&(this.fastNumbersCached=ei(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),e=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&e?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:D.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,Qe(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1){return ae(this,t,jn,()=>{const s=this.intl==="ja"||this.intl.startsWith("ja-");e&=!s;const r=e?{month:t,day:"numeric"}:{month:t},i=e?"format":"standalone";if(!this.monthsCache[i][t]){const o=s?l=>this.dtFormatter(l,r).format():l=>this.extract(l,r,"month");this.monthsCache[i][t]=Kr(o)}return this.monthsCache[i][t]})}weekdays(t,e=!1){return ae(this,t,Ln,()=>{const s=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},r=e?"format":"standalone";return this.weekdaysCache[r][t]||(this.weekdaysCache[r][t]=ti(i=>this.extract(i,s,"weekday"))),this.weekdaysCache[r][t]})}meridiems(){return ae(this,void 0,()=>_n,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[S.utc(2016,11,13,9),S.utc(2016,11,13,19)].map(e=>this.extract(e,t,"dayperiod"))}return this.meridiemCache})}eras(t){return ae(this,t,Wn,()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[S.utc(-40,1,1),S.utc(2017,1,1)].map(s=>this.extract(s,e,"era"))),this.eraCache[t]})}extract(t,e,s){const r=this.dtFormatter(t,e),i=r.formatToParts(),o=i.find(l=>l.type.toLowerCase()===s);return o?o.value:null}numberFormatter(t={}){return new si(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new ni(t,this.intl,e)}relFormatter(t={}){return new ri(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Gr(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||yn(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:On()?Xr(this.locale):xn}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Le=null;class $ extends Ht{static get utcInstance(){return Le===null&&(Le=new $(0)),Le}static instance(t){return t===0?$.utcInstance:new $(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new $(Ie(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Qt(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Qt(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return Qt(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class vn extends Ht{constructor(t){super(),this.zoneName=t}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 wt(n,t){if(w(n)||n===null)return t;if(n instanceof Ht)return n;if(ui(n)){const e=n.toLowerCase();return e==="default"?t:e==="local"||e==="system"?ne.instance:e==="utc"||e==="gmt"?$.utcInstance:$.parseSpecifier(e)||lt.create(n)}else return St(n)?$.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new vn(n)}const is={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},ys={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]},ii=is.hanidec.replace(/[\[|\]]/g,"").split("");function oi(n){let t=parseInt(n,10);if(isNaN(t)){t="";for(let e=0;e<n.length;e++){const s=n.charCodeAt(e);if(n[e].search(is.hanidec)!==-1)t+=ii.indexOf(n[e]);else for(const r in ys){const[i,o]=ys[r];s>=i&&s<=o&&(t+=s-i)}}return parseInt(t,10)}else return t}const Je=new Map;function ai(){Je.clear()}function st({numberingSystem:n},t=""){const e=n||"latn";let s=Je.get(e);s===void 0&&(s=new Map,Je.set(e,s));let r=s.get(t);return r===void 0&&(r=new RegExp(`${is[e]}${t}`),s.set(t,r)),r}let xs=()=>Date.now(),vs="system",ws=null,Ss=null,Cs=null,bs=60,ks,Ds=null;class I{static get now(){return xs}static set now(t){xs=t}static set defaultZone(t){vs=t}static get defaultZone(){return wt(vs,ne.instance)}static get defaultLocale(){return ws}static set defaultLocale(t){ws=t}static get defaultNumberingSystem(){return Ss}static set defaultNumberingSystem(t){Ss=t}static get defaultOutputCalendar(){return Cs}static set defaultOutputCalendar(t){Cs=t}static get defaultWeekSettings(){return Ds}static set defaultWeekSettings(t){Ds=Qe(t)}static get twoDigitCutoffYear(){return bs}static set twoDigitCutoffYear(t){bs=t%100}static get throwOnInvalid(){return ks}static set throwOnInvalid(t){ks=t}static resetCaches(){D.resetCache(),lt.resetCache(),S.resetCache(),ai()}}class it{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const wn=[0,31,59,90,120,151,181,212,243,273,304,334],Sn=[0,31,60,91,121,152,182,213,244,274,305,335];function X(n,t){return new it("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${n}, which is invalid`)}function os(n,t,e){const s=new Date(Date.UTC(n,t-1,e));n<100&&n>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const r=s.getUTCDay();return r===0?7:r}function Cn(n,t,e){return e+(re(n)?Sn:wn)[t-1]}function bn(n,t){const e=re(n)?Sn:wn,s=e.findIndex(i=>i<t),r=t-e[s];return{month:s+1,day:r}}function as(n,t){return(n-t+7)%7+1}function ve(n,t=4,e=1){const{year:s,month:r,day:i}=n,o=Cn(s,r,i),l=as(os(s,r,i),e);let c=Math.floor((o-l+14-t)/7),h;return c<1?(h=s-1,c=te(h,t,e)):c>te(s,t,e)?(h=s+1,c=1):h=s,{weekYear:h,weekNumber:c,weekday:l,...Ee(n)}}function Ts(n,t=4,e=1){const{weekYear:s,weekNumber:r,weekday:i}=n,o=as(os(s,1,t),e),l=Wt(s);let c=r*7+i-o-7+t,h;c<1?(h=s-1,c+=Wt(h)):c>l?(h=s+1,c-=Wt(s)):h=s;const{month:f,day:u}=bn(h,c);return{year:h,month:f,day:u,...Ee(n)}}function _e(n){const{year:t,month:e,day:s}=n,r=Cn(t,e,s);return{year:t,ordinal:r,...Ee(n)}}function Os(n){const{year:t,ordinal:e}=n,{month:s,day:r}=bn(t,e);return{year:t,month:s,day:r,...Ee(n)}}function Ms(n,t){if(!w(n.localWeekday)||!w(n.localWeekNumber)||!w(n.localWeekYear)){if(!w(n.weekday)||!w(n.weekNumber)||!w(n.weekYear))throw new Lt("Cannot mix locale-based week fields with ISO-based week fields");return w(n.localWeekday)||(n.weekday=n.localWeekday),w(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),w(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function li(n,t=4,e=1){const s=Oe(n.weekYear),r=J(n.weekNumber,1,te(n.weekYear,t,e)),i=J(n.weekday,1,7);return s?r?i?!1:X("weekday",n.weekday):X("week",n.weekNumber):X("weekYear",n.weekYear)}function ci(n){const t=Oe(n.year),e=J(n.ordinal,1,Wt(n.year));return t?e?!1:X("ordinal",n.ordinal):X("year",n.year)}function kn(n){const t=Oe(n.year),e=J(n.month,1,12),s=J(n.day,1,we(n.year,n.month));return t?e?s?!1:X("day",n.day):X("month",n.month):X("year",n.year)}function Dn(n){const{hour:t,minute:e,second:s,millisecond:r}=n,i=J(t,0,23)||t===24&&e===0&&s===0&&r===0,o=J(e,0,59),l=J(s,0,59),c=J(r,0,999);return i?o?l?c?!1:X("millisecond",r):X("second",s):X("minute",e):X("hour",t)}function w(n){return typeof n>"u"}function St(n){return typeof n=="number"}function Oe(n){return typeof n=="number"&&n%1===0}function ui(n){return typeof n=="string"}function di(n){return Object.prototype.toString.call(n)==="[object Date]"}function Tn(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function On(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function hi(n){return Array.isArray(n)?n:[n]}function Is(n,t,e){if(n.length!==0)return n.reduce((s,r)=>{const i=[t(r),r];return s&&e(s[0],i[0])===s[0]?s:i},null)[1]}function pi(n,t){return t.reduce((e,s)=>(e[s]=n[s],e),{})}function At(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function Qe(n){if(n==null)return null;if(typeof n!="object")throw new L("Week settings must be an object");if(!J(n.firstDay,1,7)||!J(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(t=>!J(t,1,7)))throw new L("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function J(n,t,e){return Oe(n)&&n>=t&&n<=e}function fi(n,t){return n-t*Math.floor(n/t)}function E(n,t=2){const e=n<0;let s;return e?s="-"+(""+-n).padStart(t,"0"):s=(""+n).padStart(t,"0"),s}function gt(n){if(!(w(n)||n===null||n===""))return parseInt(n,10)}function bt(n){if(!(w(n)||n===null||n===""))return parseFloat(n)}function ls(n){if(!(w(n)||n===null||n==="")){const t=parseFloat("0."+n)*1e3;return Math.floor(t)}}function cs(n,t,e="round"){const s=10**t;switch(e){case"expand":return n>0?Math.ceil(n*s)/s:Math.floor(n*s)/s;case"trunc":return Math.trunc(n*s)/s;case"round":return Math.round(n*s)/s;case"floor":return Math.floor(n*s)/s;case"ceil":return Math.ceil(n*s)/s;default:throw new RangeError(`Value rounding ${e} is out of range`)}}function re(n){return n%4===0&&(n%100!==0||n%400===0)}function Wt(n){return re(n)?366:365}function we(n,t){const e=fi(t-1,12)+1,s=n+(t-e)/12;return e===2?re(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][e-1]}function Me(n){let t=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(t=new Date(t),t.setUTCFullYear(n.year,n.month-1,n.day)),+t}function Es(n,t,e){return-as(os(n,1,t),e)+t-1}function te(n,t=4,e=1){const s=Es(n,t,e),r=Es(n+1,t,e);return(Wt(n)-s+r)/7}function Ke(n){return n>99?n:n>I.twoDigitCutoffYear?1900+n:2e3+n}function Mn(n,t,e,s=null){const r=new Date(n),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const o={timeZoneName:t,...i},l=new Intl.DateTimeFormat(e,o).formatToParts(r).find(c=>c.type.toLowerCase()==="timezonename");return l?l.value:null}function Ie(n,t){let e=parseInt(n,10);Number.isNaN(e)&&(e=0);const s=parseInt(t,10)||0,r=e<0||Object.is(e,-0)?-s:s;return e*60+r}function In(n){const t=Number(n);if(typeof n=="boolean"||n===""||!Number.isFinite(t))throw new L(`Invalid unit value ${n}`);return t}function Se(n,t){const e={};for(const s in n)if(At(n,s)){const r=n[s];if(r==null)continue;e[t(s)]=In(r)}return e}function Qt(n,t){const e=Math.trunc(Math.abs(n/60)),s=Math.trunc(Math.abs(n%60)),r=n>=0?"+":"-";switch(t){case"short":return`${r}${E(e,2)}:${E(s,2)}`;case"narrow":return`${r}${e}${s>0?`:${s}`:""}`;case"techie":return`${r}${E(e,2)}${E(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Ee(n){return pi(n,["hour","minute","second","millisecond"])}const mi=["January","February","March","April","May","June","July","August","September","October","November","December"],En=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],gi=["J","F","M","A","M","J","J","A","S","O","N","D"];function jn(n){switch(n){case"narrow":return[...gi];case"short":return[...En];case"long":return[...mi];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 Nn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Fn=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],yi=["M","T","W","T","F","S","S"];function Ln(n){switch(n){case"narrow":return[...yi];case"short":return[...Fn];case"long":return[...Nn];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const _n=["AM","PM"],xi=["Before Christ","Anno Domini"],vi=["BC","AD"],wi=["B","A"];function Wn(n){switch(n){case"narrow":return[...wi];case"short":return[...vi];case"long":return[...xi];default:return null}}function Si(n){return _n[n.hour<12?0:1]}function Ci(n,t){return Ln(t)[n.weekday-1]}function bi(n,t){return jn(t)[n.month-1]}function ki(n,t){return Wn(t)[n.year<0?0:1]}function Di(n,t,e="always",s=!1){const r={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."]},i=["hours","minutes","seconds"].indexOf(n)===-1;if(e==="auto"&&i){const u=n==="days";switch(t){case 1:return u?"tomorrow":`next ${r[n][0]}`;case-1:return u?"yesterday":`last ${r[n][0]}`;case 0:return u?"today":`this ${r[n][0]}`}}const o=Object.is(t,-0)||t<0,l=Math.abs(t),c=l===1,h=r[n],f=s?c?h[1]:h[2]||h[1]:c?r[n][0]:n;return o?`${l} ${f} ago`:`in ${l} ${f}`}function js(n,t){let e="";for(const s of n)s.literal?e+=s.val:e+=t(s.val);return e}const Ti={D:xe,DD:Js,DDD:Qs,DDDD:Ks,t:tn,tt:en,ttt:sn,tttt:nn,T:rn,TT:on,TTT:an,TTTT:ln,f:cn,ff:dn,fff:pn,ffff:mn,F:un,FF:hn,FFF:fn,FFFF:gn};class W{static create(t,e={}){return new W(t,e)}static parseFormat(t){let e=null,s="",r=!1;const i=[];for(let o=0;o<t.length;o++){const l=t.charAt(o);l==="'"?((s.length>0||r)&&i.push({literal:r||/^\s+$/.test(s),val:s===""?"'":s}),e=null,s="",r=!r):r||l===e?s+=l:(s.length>0&&i.push({literal:/^\s+$/.test(s),val:s}),s=l,e=l)}return s.length>0&&i.push({literal:r||/^\s+$/.test(s),val:s}),i}static macroTokenToFormatOpts(t){return Ti[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}dtFormatter(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e})}formatDateTime(t,e){return this.dtFormatter(t,e).format()}formatDateTimeParts(t,e){return this.dtFormatter(t,e).formatToParts()}formatInterval(t,e){return this.dtFormatter(t.start,e).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,e){return this.dtFormatter(t,e).resolvedOptions()}num(t,e=0,s=void 0){if(this.opts.forceSimple)return E(t,e);const r={...this.opts};return e>0&&(r.padTo=e),s&&(r.signDisplay=s),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,e){const s=this.loc.listingMode()==="en",r=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(p,x)=>this.loc.extract(t,p,x),o=p=>t.isOffsetFixed&&t.offset===0&&p.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,p.format):"",l=()=>s?Si(t):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),c=(p,x)=>s?bi(t,p):i(x?{month:p}:{month:p,day:"numeric"},"month"),h=(p,x)=>s?Ci(t,p):i(x?{weekday:p}:{weekday:p,month:"long",day:"numeric"},"weekday"),f=p=>{const x=W.macroTokenToFormatOpts(p);return x?this.formatWithSystemDefault(t,x):p},u=p=>s?ki(t,p):i({era:p},"era"),m=p=>{switch(p){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return l();case"d":return r?i({day:"numeric"},"day"):this.num(t.day);case"dd":return r?i({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return h("short",!0);case"cccc":return h("long",!0);case"ccccc":return h("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return h("short",!1);case"EEEE":return h("long",!1);case"EEEEE":return h("narrow",!1);case"L":return r?i({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return r?i({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return r?i({month:"numeric"},"month"):this.num(t.month);case"MM":return r?i({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return r?i({year:"numeric"},"year"):this.num(t.year);case"yy":return r?i({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return r?i({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return r?i({year:"numeric"},"year"):this.num(t.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return f(p)}};return js(W.parseFormat(e),m)}formatDurationFromString(t,e){const s=this.opts.signMode==="negativeLargestOnly"?-1:1,r=f=>{switch(f[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=(f,u)=>m=>{const p=r(m);if(p){const x=u.isNegativeDuration&&p!==u.largestUnit?s:1;let T;return this.opts.signMode==="negativeLargestOnly"&&p!==u.largestUnit?T="never":this.opts.signMode==="all"?T="always":T="auto",this.num(f.get(p)*x,m.length,T)}else return m},o=W.parseFormat(e),l=o.reduce((f,{literal:u,val:m})=>u?f:f.concat(m),[]),c=t.shiftTo(...l.map(r).filter(f=>f)),h={isNegativeDuration:c<0,largestUnit:Object.keys(c.values)[0]};return js(o,i(c,h))}}const $n=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Vt(...n){const t=n.reduce((e,s)=>e+s.source,"");return RegExp(`^${t}$`)}function Rt(...n){return t=>n.reduce(([e,s,r],i)=>{const[o,l,c]=i(t,r);return[{...e,...o},l||s,c]},[{},null,1]).slice(0,2)}function Pt(n,...t){if(n==null)return[null,null];for(const[e,s]of t){const r=e.exec(n);if(r)return s(r)}return[null,null]}function An(...n){return(t,e)=>{const s={};let r;for(r=0;r<n.length;r++)s[n[r]]=gt(t[e+r]);return[s,null,e+r]}}const Hn=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Oi=`(?:${Hn.source}?(?:\\[(${$n.source})\\])?)?`,us=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Vn=RegExp(`${us.source}${Oi}`),ds=RegExp(`(?:[Tt]${Vn.source})?`),Mi=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ii=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Ei=/(\d{4})-?(\d{3})/,ji=An("weekYear","weekNumber","weekDay"),Ni=An("year","ordinal"),Fi=/(\d{4})-(\d\d)-(\d\d)/,Rn=RegExp(`${us.source} ?(?:${Hn.source}|(${$n.source}))?`),Li=RegExp(`(?: ${Rn.source})?`);function $t(n,t,e){const s=n[t];return w(s)?e:gt(s)}function _i(n,t){return[{year:$t(n,t),month:$t(n,t+1,1),day:$t(n,t+2,1)},null,t+3]}function Bt(n,t){return[{hours:$t(n,t,0),minutes:$t(n,t+1,0),seconds:$t(n,t+2,0),milliseconds:ls(n[t+3])},null,t+4]}function ie(n,t){const e=!n[t]&&!n[t+1],s=Ie(n[t+1],n[t+2]),r=e?null:$.instance(s);return[{},r,t+3]}function oe(n,t){const e=n[t]?lt.create(n[t]):null;return[{},e,t+1]}const Wi=RegExp(`^T?${us.source}$`),$i=/^-?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 Ai(n){const[t,e,s,r,i,o,l,c,h]=n,f=t[0]==="-",u=c&&c[0]==="-",m=(p,x=!1)=>p!==void 0&&(x||p&&f)?-p:p;return[{years:m(bt(e)),months:m(bt(s)),weeks:m(bt(r)),days:m(bt(i)),hours:m(bt(o)),minutes:m(bt(l)),seconds:m(bt(c),c==="-0"),milliseconds:m(ls(h),u)}]}const Hi={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function hs(n,t,e,s,r,i,o){const l={year:t.length===2?Ke(gt(t)):gt(t),month:En.indexOf(e)+1,day:gt(s),hour:gt(r),minute:gt(i)};return o&&(l.second=gt(o)),n&&(l.weekday=n.length>3?Nn.indexOf(n)+1:Fn.indexOf(n)+1),l}const Vi=/^(?:(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 Ri(n){const[,t,e,s,r,i,o,l,c,h,f,u]=n,m=hs(t,r,s,e,i,o,l);let p;return c?p=Hi[c]:h?p=0:p=Ie(f,u),[m,new $(p)]}function Pi(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Bi=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,zi=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Ui=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Ns(n){const[,t,e,s,r,i,o,l]=n;return[hs(t,r,s,e,i,o,l),$.utcInstance]}function Gi(n){const[,t,e,s,r,i,o,l]=n;return[hs(t,l,e,s,r,i,o),$.utcInstance]}const Zi=Vt(Mi,ds),Yi=Vt(Ii,ds),qi=Vt(Ei,ds),Xi=Vt(Vn),Pn=Rt(_i,Bt,ie,oe),Ji=Rt(ji,Bt,ie,oe),Qi=Rt(Ni,Bt,ie,oe),Ki=Rt(Bt,ie,oe);function to(n){return Pt(n,[Zi,Pn],[Yi,Ji],[qi,Qi],[Xi,Ki])}function eo(n){return Pt(Pi(n),[Vi,Ri])}function so(n){return Pt(n,[Bi,Ns],[zi,Ns],[Ui,Gi])}function no(n){return Pt(n,[$i,Ai])}const ro=Rt(Bt);function io(n){return Pt(n,[Wi,ro])}const oo=Vt(Fi,Li),ao=Vt(Rn),lo=Rt(Bt,ie,oe);function co(n){return Pt(n,[oo,Pn],[ao,lo])}const Fs="Invalid Duration",Bn={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},uo={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...Bn},U=146097/400,It=146097/4800,ho={years:{quarters:4,months:12,weeks:U/7,days:U,hours:U*24,minutes:U*24*60,seconds:U*24*60*60,milliseconds:U*24*60*60*1e3},quarters:{months:3,weeks:U/28,days:U/4,hours:U*24/4,minutes:U*24*60/4,seconds:U*24*60*60/4,milliseconds:U*24*60*60*1e3/4},months:{weeks:It/7,days:It,hours:It*24,minutes:It*24*60,seconds:It*24*60*60,milliseconds:It*24*60*60*1e3},...Bn},Dt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],po=Dt.slice(0).reverse();function dt(n,t,e=!1){const s={values:e?t.values:{...n.values,...t.values||{}},loc:n.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||n.conversionAccuracy,matrix:t.matrix||n.matrix};return new b(s)}function zn(n,t){var e;let s=(e=t.milliseconds)!=null?e:0;for(const r of po.slice(1))t[r]&&(s+=t[r]*n[r].milliseconds);return s}function Ls(n,t){const e=zn(n,t)<0?-1:1;Dt.reduceRight((s,r)=>{if(w(t[r]))return s;if(s){const i=t[s]*e,o=n[r][s],l=Math.floor(i/o);t[r]+=l*e,t[s]-=l*o*e}return r},null),Dt.reduce((s,r)=>{if(w(t[r]))return s;if(s){const i=t[s]%1;t[s]-=i,t[r]+=i*n[s][r]}return r},null)}function _s(n){const t={};for(const[e,s]of Object.entries(n))s!==0&&(t[e]=s);return t}class b{constructor(t){const e=t.conversionAccuracy==="longterm"||!1;let s=e?ho:uo;t.matrix&&(s=t.matrix),this.values=t.values,this.loc=t.loc||D.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(t,e){return b.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(t==null||typeof t!="object")throw new L(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new b({values:Se(t,b.normalizeUnit),loc:D.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(St(t))return b.fromMillis(t);if(b.isDuration(t))return t;if(typeof t=="object")return b.fromObject(t);throw new L(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[s]=no(t);return s?b.fromObject(s,e):b.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[s]=io(t);return s?b.fromObject(s,e):b.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new L("need to specify a reason the Duration is invalid");const s=t instanceof it?t:new it(t,e);if(I.throwOnInvalid)throw new Hr(s);return new b({invalid:s})}static normalizeUnit(t){const e={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"}[t&&t.toLowerCase()];if(!e)throw new Xs(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,e={}){const s={...e,floor:e.round!==!1&&e.floor!==!1};return this.isValid?W.create(this.loc,s).formatDurationFromString(this,t):Fs}toHuman(t={}){if(!this.isValid)return Fs;const e=t.showZeros!==!1,s=Dt.map(r=>{const i=this.values[r];return w(i)||i===0&&!e?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(s)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=cs(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const e=this.toMillis();return e<0||e>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},S.fromMillis(e,{zone:"UTC"}).toISOTime(t))}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?zn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=b.fromDurationLike(t),s={};for(const r of Dt)(At(e.values,r)||At(this.values,r))&&(s[r]=e.get(r)+this.get(r));return dt(this,{values:s},!0)}minus(t){if(!this.isValid)return this;const e=b.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;const e={};for(const s of Object.keys(this.values))e[s]=In(t(this.values[s],s));return dt(this,{values:e},!0)}get(t){return this[b.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const e={...this.values,...Se(t,b.normalizeUnit)};return dt(this,{values:e})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:s,matrix:r}={}){const o={loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:r,conversionAccuracy:s};return dt(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Ls(this.matrix,t),dt(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=_s(this.normalize().shiftToAll().toObject());return dt(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>b.normalizeUnit(o));const e={},s={},r=this.toObject();let i;for(const o of Dt)if(t.indexOf(o)>=0){i=o;let l=0;for(const h in s)l+=this.matrix[h][o]*s[h],s[h]=0;St(r[o])&&(l+=r[o]);const c=Math.trunc(l);e[o]=c,s[o]=(l*1e3-c*1e3)/1e3}else St(r[o])&&(s[o]=r[o]);for(const o in s)s[o]!==0&&(e[i]+=o===i?s[o]:s[o]/this.matrix[i][o]);return Ls(this.matrix,e),dt(this,{values:e},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const e of Object.keys(this.values))t[e]=this.values[e]===0?0:-this.values[e];return dt(this,{values:t},!0)}removeZeros(){if(!this.isValid)return this;const t=_s(this.values);return dt(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function e(s,r){return s===void 0||s===0?r===void 0||r===0:s===r}for(const s of Dt)if(!e(this.values[s],t.values[s]))return!1;return!0}}const Et="Invalid Interval";function fo(n,t){return!n||!n.isValid?M.invalid("missing or invalid start"):!t||!t.isValid?M.invalid("missing or invalid end"):t<n?M.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${t.toISO()}`):null}class M{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,e=null){if(!t)throw new L("need to specify a reason the Interval is invalid");const s=t instanceof it?t:new it(t,e);if(I.throwOnInvalid)throw new Ar(s);return new M({invalid:s})}static fromDateTimes(t,e){const s=Gt(t),r=Gt(e),i=fo(s,r);return i??new M({start:s,end:r})}static after(t,e){const s=b.fromDurationLike(e),r=Gt(t);return M.fromDateTimes(r,r.plus(s))}static before(t,e){const s=b.fromDurationLike(e),r=Gt(t);return M.fromDateTimes(r.minus(s),r)}static fromISO(t,e){const[s,r]=(t||"").split("/",2);if(s&&r){let i,o;try{i=S.fromISO(s,e),o=i.isValid}catch{o=!1}let l,c;try{l=S.fromISO(r,e),c=l.isValid}catch{c=!1}if(o&&c)return M.fromDateTimes(i,l);if(o){const h=b.fromISO(r,e);if(h.isValid)return M.after(i,h)}else if(c){const h=b.fromISO(s,e);if(h.isValid)return M.before(l,h)}}return M.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",e){if(!this.isValid)return NaN;const s=this.start.startOf(t,e);let r;return e!=null&&e.useLocaleWeeks?r=this.end.reconfigure({locale:s.locale}):r=this.end,r=r.startOf(t,e),Math.floor(r.diff(s,t).get(t))+(r.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:e}={}){return this.isValid?M.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(Gt).filter(o=>this.contains(o)).sort((o,l)=>o.toMillis()-l.toMillis()),s=[];let{s:r}=this,i=0;for(;r<this.e;){const o=e[i]||this.e,l=+o>+this.e?this.e:o;s.push(M.fromDateTimes(r,l)),r=l,i+=1}return s}splitBy(t){const e=b.fromDurationLike(t);if(!this.isValid||!e.isValid||e.as("milliseconds")===0)return[];let{s}=this,r=1,i;const o=[];for(;s<this.e;){const l=this.start.plus(e.mapUnits(c=>c*r));i=+l>+this.e?this.e:l,o.push(M.fromDateTimes(s,i)),s=i,r+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const e=this.s>t.s?this.s:t.s,s=this.e<t.e?this.e:t.e;return e>=s?null:M.fromDateTimes(e,s)}union(t){if(!this.isValid)return this;const e=this.s<t.s?this.s:t.s,s=this.e>t.e?this.e:t.e;return M.fromDateTimes(e,s)}static merge(t){const[e,s]=t.sort((r,i)=>r.s-i.s).reduce(([r,i],o)=>i?i.overlaps(o)||i.abutsStart(o)?[r,i.union(o)]:[r.concat([i]),o]:[r,o],[[],null]);return s&&e.push(s),e}static xor(t){let e=null,s=0;const r=[],i=t.map(c=>[{time:c.s,type:"s"},{time:c.e,type:"e"}]),o=Array.prototype.concat(...i),l=o.sort((c,h)=>c.time-h.time);for(const c of l)s+=c.type==="s"?1:-1,s===1?e=c.time:(e&&+e!=+c.time&&r.push(M.fromDateTimes(e,c.time)),e=null);return M.merge(r)}difference(...t){return M.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Et}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=xe,e={}){return this.isValid?W.create(this.s.loc.clone(e),t).formatInterval(this):Et}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Et}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Et}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Et}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:Et}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):b.invalid(this.invalidReason)}mapEndpoints(t){return M.fromDateTimes(t(this.s),t(this.e))}}class qt{static hasDST(t=I.defaultZone){const e=S.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return lt.isValidZone(t)}static normalizeZone(t){return wt(t,I.defaultZone)}static getStartOfWeek({locale:t=null,locObj:e=null}={}){return(e||D.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:e=null}={}){return(e||D.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:e=null}={}){return(e||D.create(t)).getWeekendDays().slice()}static months(t="long",{locale:e=null,numberingSystem:s=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||D.create(e,s,i)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:s=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||D.create(e,s,i)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:s=null,locObj:r=null}={}){return(r||D.create(e,s,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:s=null,locObj:r=null}={}){return(r||D.create(e,s,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return D.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return D.create(e,null,"gregory").eras(t)}static features(){return{relative:Tn(),localeWeek:On()}}}function Ws(n,t){const e=r=>r.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=e(t)-e(n);return Math.floor(b.fromMillis(s).as("days"))}function mo(n,t,e){const s=[["years",(c,h)=>h.year-c.year],["quarters",(c,h)=>h.quarter-c.quarter+(h.year-c.year)*4],["months",(c,h)=>h.month-c.month+(h.year-c.year)*12],["weeks",(c,h)=>{const f=Ws(c,h);return(f-f%7)/7}],["days",Ws]],r={},i=n;let o,l;for(const[c,h]of s)e.indexOf(c)>=0&&(o=c,r[c]=h(n,t),l=i.plus(r),l>t?(r[c]--,n=i.plus(r),n>t&&(l=n,r[c]--,n=i.plus(r))):n=l);return[n,r,l,o]}function go(n,t,e,s){let[r,i,o,l]=mo(n,t,e);const c=t-r,h=e.filter(u=>["hours","minutes","seconds","milliseconds"].indexOf(u)>=0);h.length===0&&(o<t&&(o=r.plus({[l]:1})),o!==r&&(i[l]=(i[l]||0)+c/(o-r)));const f=b.fromObject(i,s);return h.length>0?b.fromMillis(c,s).shiftTo(...h).plus(f):f}const yo="missing Intl.DateTimeFormat.formatToParts support";function k(n,t=e=>e){return{regex:n,deser:([e])=>t(oi(e))}}const xo=" ",Un=`[ ${xo}]`,Gn=new RegExp(Un,"g");function vo(n){return n.replace(/\./g,"\\.?").replace(Gn,Un)}function $s(n){return n.replace(/\./g,"").replace(Gn," ").toLowerCase()}function nt(n,t){return n===null?null:{regex:RegExp(n.map(vo).join("|")),deser:([e])=>n.findIndex(s=>$s(e)===$s(s))+t}}function As(n,t){return{regex:n,deser:([,e,s])=>Ie(e,s),groups:t}}function le(n){return{regex:n,deser:([t])=>t}}function wo(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function So(n,t){const e=st(t),s=st(t,"{2}"),r=st(t,"{3}"),i=st(t,"{4}"),o=st(t,"{6}"),l=st(t,"{1,2}"),c=st(t,"{1,3}"),h=st(t,"{1,6}"),f=st(t,"{1,9}"),u=st(t,"{2,4}"),m=st(t,"{4,6}"),p=O=>({regex:RegExp(wo(O.val)),deser:([N])=>N,literal:!0}),T=(O=>{if(n.literal)return p(O);switch(O.val){case"G":return nt(t.eras("short"),0);case"GG":return nt(t.eras("long"),0);case"y":return k(h);case"yy":return k(u,Ke);case"yyyy":return k(i);case"yyyyy":return k(m);case"yyyyyy":return k(o);case"M":return k(l);case"MM":return k(s);case"MMM":return nt(t.months("short",!0),1);case"MMMM":return nt(t.months("long",!0),1);case"L":return k(l);case"LL":return k(s);case"LLL":return nt(t.months("short",!1),1);case"LLLL":return nt(t.months("long",!1),1);case"d":return k(l);case"dd":return k(s);case"o":return k(c);case"ooo":return k(r);case"HH":return k(s);case"H":return k(l);case"hh":return k(s);case"h":return k(l);case"mm":return k(s);case"m":return k(l);case"q":return k(l);case"qq":return k(s);case"s":return k(l);case"ss":return k(s);case"S":return k(c);case"SSS":return k(r);case"u":return le(f);case"uu":return le(l);case"uuu":return k(e);case"a":return nt(t.meridiems(),0);case"kkkk":return k(i);case"kk":return k(u,Ke);case"W":return k(l);case"WW":return k(s);case"E":case"c":return k(e);case"EEE":return nt(t.weekdays("short",!1),1);case"EEEE":return nt(t.weekdays("long",!1),1);case"ccc":return nt(t.weekdays("short",!0),1);case"cccc":return nt(t.weekdays("long",!0),1);case"Z":case"ZZ":return As(new RegExp(`([+-]${l.source})(?::(${s.source}))?`),2);case"ZZZ":return As(new RegExp(`([+-]${l.source})(${s.source})?`),2);case"z":return le(/[a-z_+-/]{1,256}?/i);case" ":return le(/[^\S\n\r]/);default:return p(O)}})(n)||{invalidReason:yo};return T.token=n,T}const Co={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function bo(n,t,e){const{type:s,value:r}=n;if(s==="literal"){const c=/^\s+$/.test(r);return{literal:!c,val:c?" ":r}}const i=t[s];let o=s;s==="hour"&&(t.hour12!=null?o=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?o="hour12":o="hour24":o=e.hour12?"hour12":"hour24");let l=Co[o];if(typeof l=="object"&&(l=l[i]),l)return{literal:!1,val:l}}function ko(n){return[`^${n.map(e=>e.regex).reduce((e,s)=>`${e}(${s.source})`,"")}$`,n]}function Do(n,t,e){const s=n.match(t);if(s){const r={};let i=1;for(const o in e)if(At(e,o)){const l=e[o],c=l.groups?l.groups+1:1;!l.literal&&l.token&&(r[l.token.val[0]]=l.deser(s.slice(i,i+c))),i+=c}return[s,r]}else return[s,{}]}function To(n){const t=i=>{switch(i){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}};let e=null,s;return w(n.z)||(e=lt.create(n.z)),w(n.Z)||(e||(e=new $(n.Z)),s=n.Z),w(n.q)||(n.M=(n.q-1)*3+1),w(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),w(n.u)||(n.S=ls(n.u)),[Object.keys(n).reduce((i,o)=>{const l=t(o);return l&&(i[l]=n[o]),i},{}),e,s]}let We=null;function Oo(){return We||(We=S.fromMillis(1555555555555)),We}function Mo(n,t){if(n.literal)return n;const e=W.macroTokenToFormatOpts(n.val),s=Xn(e,t);return s==null||s.includes(void 0)?n:s}function Zn(n,t){return Array.prototype.concat(...n.map(e=>Mo(e,t)))}class Yn{constructor(t,e){if(this.locale=t,this.format=e,this.tokens=Zn(W.parseFormat(e),t),this.units=this.tokens.map(s=>So(s,t)),this.disqualifyingUnit=this.units.find(s=>s.invalidReason),!this.disqualifyingUnit){const[s,r]=ko(this.units);this.regex=RegExp(s,"i"),this.handlers=r}}explainFromTokens(t){if(this.isValid){const[e,s]=Do(t,this.regex,this.handlers),[r,i,o]=s?To(s):[null,null,void 0];if(At(s,"a")&&At(s,"H"))throw new Lt("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:e,matches:s,result:r,zone:i,specificOffset:o}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function qn(n,t,e){return new Yn(n,e).explainFromTokens(t)}function Io(n,t,e){const{result:s,zone:r,specificOffset:i,invalidReason:o}=qn(n,t,e);return[s,r,i,o]}function Xn(n,t){if(!n)return null;const s=W.create(t,n).dtFormatter(Oo()),r=s.formatToParts(),i=s.resolvedOptions();return r.map(o=>bo(o,n,i))}const $e="Invalid DateTime",Hs=864e13;function Xt(n){return new it("unsupported zone",`the zone "${n.name}" is not supported`)}function Ae(n){return n.weekData===null&&(n.weekData=ve(n.c)),n.weekData}function He(n){return n.localWeekData===null&&(n.localWeekData=ve(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function kt(n,t){const e={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new S({...e,...t,old:e})}function Jn(n,t,e){let s=n-t*60*1e3;const r=e.offset(s);if(t===r)return[s,t];s-=(r-t)*60*1e3;const i=e.offset(s);return r===i?[s,r]:[n-Math.min(r,i)*60*1e3,Math.max(r,i)]}function ce(n,t){n+=t*60*1e3;const e=new Date(n);return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),millisecond:e.getUTCMilliseconds()}}function fe(n,t,e){return Jn(Me(n),t,e)}function Vs(n,t){const e=n.o,s=n.c.year+Math.trunc(t.years),r=n.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,i={...n.c,year:s,month:r,day:Math.min(n.c.day,we(s,r))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=b.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"),l=Me(i);let[c,h]=Jn(l,e,n.zone);return o!==0&&(c+=o,h=n.zone.offset(c)),{ts:c,o:h}}function jt(n,t,e,s,r,i){const{setZone:o,zone:l}=e;if(n&&Object.keys(n).length!==0||t){const c=t||l,h=S.fromObject(n,{...e,zone:c,specificOffset:i});return o?h:h.setZone(l)}else return S.invalid(new it("unparsable",`the input "${r}" can't be parsed as ${s}`))}function ue(n,t,e=!0){return n.isValid?W.create(D.create("en-US"),{allowZ:e,forceSimple:!0}).formatDateTimeFromString(n,t):null}function Ve(n,t,e){const s=n.c.year>9999||n.c.year<0;let r="";if(s&&n.c.year>=0&&(r+="+"),r+=E(n.c.year,s?6:4),e==="year")return r;if(t){if(r+="-",r+=E(n.c.month),e==="month")return r;r+="-"}else if(r+=E(n.c.month),e==="month")return r;return r+=E(n.c.day),r}function Rs(n,t,e,s,r,i,o){let l=!e||n.c.millisecond!==0||n.c.second!==0,c="";switch(o){case"day":case"month":case"year":break;default:if(c+=E(n.c.hour),o==="hour")break;if(t){if(c+=":",c+=E(n.c.minute),o==="minute")break;l&&(c+=":",c+=E(n.c.second))}else{if(c+=E(n.c.minute),o==="minute")break;l&&(c+=E(n.c.second))}if(o==="second")break;l&&(!s||n.c.millisecond!==0)&&(c+=".",c+=E(n.c.millisecond,3))}return r&&(n.isOffsetFixed&&n.offset===0&&!i?c+="Z":n.o<0?(c+="-",c+=E(Math.trunc(-n.o/60)),c+=":",c+=E(Math.trunc(-n.o%60))):(c+="+",c+=E(Math.trunc(n.o/60)),c+=":",c+=E(Math.trunc(n.o%60)))),i&&(c+="["+n.zone.ianaName+"]"),c}const Qn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Eo={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},jo={ordinal:1,hour:0,minute:0,second:0,millisecond:0},me=["year","month","day","hour","minute","second","millisecond"],No=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Fo=["year","ordinal","hour","minute","second","millisecond"];function ge(n){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"}[n.toLowerCase()];if(!t)throw new Xs(n);return t}function Ps(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return ge(n)}}function Lo(n){if(Jt===void 0&&(Jt=I.now()),n.type!=="iana")return n.offset(Jt);const t=n.name;let e=ts.get(t);return e===void 0&&(e=n.offset(Jt),ts.set(t,e)),e}function Bs(n,t){const e=wt(t.zone,I.defaultZone);if(!e.isValid)return S.invalid(Xt(e));const s=D.fromObject(t);let r,i;if(w(n.year))r=I.now();else{for(const c of me)w(n[c])&&(n[c]=Qn[c]);const o=kn(n)||Dn(n);if(o)return S.invalid(o);const l=Lo(e);[r,i]=fe(n,l,e)}return new S({ts:r,zone:e,loc:s,o:i})}function zs(n,t,e){const s=w(e.round)?!0:e.round,r=w(e.rounding)?"trunc":e.rounding,i=(l,c)=>(l=cs(l,s||e.calendary?0:2,e.calendary?"round":r),t.loc.clone(e).relFormatter(e).format(l,c)),o=l=>e.calendary?t.hasSame(n,l)?0:t.startOf(l).diff(n.startOf(l),l).get(l):t.diff(n,l).get(l);if(e.unit)return i(o(e.unit),e.unit);for(const l of e.units){const c=o(l);if(Math.abs(c)>=1)return i(c,l)}return i(n>t?-0:0,e.units[e.units.length-1])}function Us(n){let t={},e;return n.length>0&&typeof n[n.length-1]=="object"?(t=n[n.length-1],e=Array.from(n).slice(0,n.length-1)):e=Array.from(n),[t,e]}let Jt;const ts=new Map;class S{constructor(t){const e=t.zone||I.defaultZone;let s=t.invalid||(Number.isNaN(t.ts)?new it("invalid input"):null)||(e.isValid?null:Xt(e));this.ts=w(t.ts)?I.now():t.ts;let r=null,i=null;if(!s)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[r,i]=[t.old.c,t.old.o];else{const l=St(t.o)&&!t.old?t.o:e.offset(this.ts);r=ce(this.ts,l),s=Number.isNaN(r.year)?new it("invalid input"):null,r=s?null:r,i=s?null:l}this._zone=e,this.loc=t.loc||D.create(),this.invalid=s,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new S({})}static local(){const[t,e]=Us(arguments),[s,r,i,o,l,c,h]=e;return Bs({year:s,month:r,day:i,hour:o,minute:l,second:c,millisecond:h},t)}static utc(){const[t,e]=Us(arguments),[s,r,i,o,l,c,h]=e;return t.zone=$.utcInstance,Bs({year:s,month:r,day:i,hour:o,minute:l,second:c,millisecond:h},t)}static fromJSDate(t,e={}){const s=di(t)?t.valueOf():NaN;if(Number.isNaN(s))return S.invalid("invalid input");const r=wt(e.zone,I.defaultZone);return r.isValid?new S({ts:s,zone:r,loc:D.fromObject(e)}):S.invalid(Xt(r))}static fromMillis(t,e={}){if(St(t))return t<-Hs||t>Hs?S.invalid("Timestamp out of range"):new S({ts:t,zone:wt(e.zone,I.defaultZone),loc:D.fromObject(e)});throw new L(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(St(t))return new S({ts:t*1e3,zone:wt(e.zone,I.defaultZone),loc:D.fromObject(e)});throw new L("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const s=wt(e.zone,I.defaultZone);if(!s.isValid)return S.invalid(Xt(s));const r=D.fromObject(e),i=Se(t,Ps),{minDaysInFirstWeek:o,startOfWeek:l}=Ms(i,r),c=I.now(),h=w(e.specificOffset)?s.offset(c):e.specificOffset,f=!w(i.ordinal),u=!w(i.year),m=!w(i.month)||!w(i.day),p=u||m,x=i.weekYear||i.weekNumber;if((p||f)&&x)throw new Lt("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(m&&f)throw new Lt("Can't mix ordinal dates with month/day");const T=x||i.weekday&&!p;let O,N,j=ce(c,h);T?(O=No,N=Eo,j=ve(j,o,l)):f?(O=Fo,N=jo,j=_e(j)):(O=me,N=Qn);let Q=!1;for(const Ut of O){const tr=i[Ut];w(tr)?Q?i[Ut]=N[Ut]:i[Ut]=j[Ut]:Q=!0}const K=T?li(i,o,l):f?ci(i):kn(i),tt=K||Dn(i);if(tt)return S.invalid(tt);const pt=T?Ts(i,o,l):f?Os(i):i,[A,Ct]=fe(pt,h,s),ft=new S({ts:A,zone:s,o:Ct,loc:r});return i.weekday&&p&&t.weekday!==ft.weekday?S.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${ft.toISO()}`):ft.isValid?ft:S.invalid(ft.invalid)}static fromISO(t,e={}){const[s,r]=to(t);return jt(s,r,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[s,r]=eo(t);return jt(s,r,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[s,r]=so(t);return jt(s,r,e,"HTTP",e)}static fromFormat(t,e,s={}){if(w(t)||w(e))throw new L("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:i=null}=s,o=D.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),[l,c,h,f]=Io(o,t,e);return f?S.invalid(f):jt(l,c,s,`format ${e}`,t,h)}static fromString(t,e,s={}){return S.fromFormat(t,e,s)}static fromSQL(t,e={}){const[s,r]=co(t);return jt(s,r,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new L("need to specify a reason the DateTime is invalid");const s=t instanceof it?t:new it(t,e);if(I.throwOnInvalid)throw new $r(s);return new S({invalid:s})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){const s=Xn(t,D.fromObject(e));return s?s.map(r=>r?r.val:null).join(""):null}static expandFormat(t,e={}){return Zn(W.parseFormat(t),D.fromObject(e)).map(r=>r.val).join("")}static resetCache(){Jt=void 0,ts.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Ae(this).weekYear:NaN}get weekNumber(){return this.isValid?Ae(this).weekNumber:NaN}get weekday(){return this.isValid?Ae(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?He(this).weekday:NaN}get localWeekNumber(){return this.isValid?He(this).weekNumber:NaN}get localWeekYear(){return this.isValid?He(this).weekYear:NaN}get ordinal(){return this.isValid?_e(this.c).ordinal:NaN}get monthShort(){return this.isValid?qt.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?qt.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?qt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?qt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,e=6e4,s=Me(this.c),r=this.zone.offset(s-t),i=this.zone.offset(s+t),o=this.zone.offset(s-r*e),l=this.zone.offset(s-i*e);if(o===l)return[this];const c=s-o*e,h=s-l*e,f=ce(c,o),u=ce(h,l);return f.hour===u.hour&&f.minute===u.minute&&f.second===u.second&&f.millisecond===u.millisecond?[kt(this,{ts:c}),kt(this,{ts:h})]:[this]}get isInLeapYear(){return re(this.year)}get daysInMonth(){return we(this.year,this.month)}get daysInYear(){return this.isValid?Wt(this.year):NaN}get weeksInWeekYear(){return this.isValid?te(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?te(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:s,calendar:r}=W.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:s,outputCalendar:r}}toUTC(t=0,e={}){return this.setZone($.instance(t),e)}toLocal(){return this.setZone(I.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:s=!1}={}){if(t=wt(t,I.defaultZone),t.equals(this.zone))return this;if(t.isValid){let r=this.ts;if(e||s){const i=t.offset(this.ts),o=this.toObject();[r]=fe(o,i,t)}return kt(this,{ts:r,zone:t})}else return S.invalid(Xt(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:s}={}){const r=this.loc.clone({locale:t,numberingSystem:e,outputCalendar:s});return kt(this,{loc:r})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=Se(t,Ps),{minDaysInFirstWeek:s,startOfWeek:r}=Ms(e,this.loc),i=!w(e.weekYear)||!w(e.weekNumber)||!w(e.weekday),o=!w(e.ordinal),l=!w(e.year),c=!w(e.month)||!w(e.day),h=l||c,f=e.weekYear||e.weekNumber;if((h||o)&&f)throw new Lt("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&o)throw new Lt("Can't mix ordinal dates with month/day");let u;i?u=Ts({...ve(this.c,s,r),...e},s,r):w(e.ordinal)?(u={...this.toObject(),...e},w(e.day)&&(u.day=Math.min(we(u.year,u.month),u.day))):u=Os({..._e(this.c),...e});const[m,p]=fe(u,this.o,this.zone);return kt(this,{ts:m,o:p})}plus(t){if(!this.isValid)return this;const e=b.fromDurationLike(t);return kt(this,Vs(this,e))}minus(t){if(!this.isValid)return this;const e=b.fromDurationLike(t).negate();return kt(this,Vs(this,e))}startOf(t,{useLocaleWeeks:e=!1}={}){if(!this.isValid)return this;const s={},r=b.normalizeUnit(t);switch(r){case"years":s.month=1;case"quarters":case"months":s.day=1;case"weeks":case"days":s.hour=0;case"hours":s.minute=0;case"minutes":s.second=0;case"seconds":s.millisecond=0;break}if(r==="weeks")if(e){const i=this.loc.getStartOfWeek(),{weekday:o}=this;o<i&&(s.weekNumber=this.weekNumber-1),s.weekday=i}else s.weekday=1;if(r==="quarters"){const i=Math.ceil(this.month/3);s.month=(i-1)*3+1}return this.set(s)}endOf(t,e){return this.isValid?this.plus({[t]:1}).startOf(t,e).minus(1):this}toFormat(t,e={}){return this.isValid?W.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):$e}toLocaleString(t=xe,e={}){return this.isValid?W.create(this.loc.clone(e),t).formatDateTime(this):$e}toLocaleParts(t={}){return this.isValid?W.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:s=!1,includeOffset:r=!0,extendedZone:i=!1,precision:o="milliseconds"}={}){if(!this.isValid)return null;o=ge(o);const l=t==="extended";let c=Ve(this,l,o);return me.indexOf(o)>=3&&(c+="T"),c+=Rs(this,l,e,s,r,i,o),c}toISODate({format:t="extended",precision:e="day"}={}){return this.isValid?Ve(this,t==="extended",ge(e)):null}toISOWeekDate(){return ue(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:s=!0,includePrefix:r=!1,extendedZone:i=!1,format:o="extended",precision:l="milliseconds"}={}){return this.isValid?(l=ge(l),(r&&me.indexOf(l)>=3?"T":"")+Rs(this,o==="extended",e,t,s,i,l)):null}toRFC2822(){return ue(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return ue(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ve(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:s=!0}={}){let r="HH:mm:ss.SSS";return(e||t)&&(s&&(r+=" "),e?r+="z":t&&(r+="ZZ")),ue(this,r,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():$e}[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(t={}){if(!this.isValid)return{};const e={...this.c};return t.includeConfig&&(e.outputCalendar=this.outputCalendar,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,e="milliseconds",s={}){if(!this.isValid||!t.isValid)return b.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...s},i=hi(e).map(b.normalizeUnit),o=t.valueOf()>this.valueOf(),l=o?this:t,c=o?t:this,h=go(l,c,i,r);return o?h.negate():h}diffNow(t="milliseconds",e={}){return this.diff(S.now(),t,e)}until(t){return this.isValid?M.fromDateTimes(this,t):this}hasSame(t,e,s){if(!this.isValid)return!1;const r=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(e,s)<=r&&r<=i.endOf(e,s)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const e=t.base||S.fromObject({},{zone:this.zone}),s=t.padding?this<e?-t.padding:t.padding:0;let r=["years","months","days","hours","minutes","seconds"],i=t.unit;return Array.isArray(t.unit)&&(r=t.unit,i=void 0),zs(e,this.plus(s),{...t,numeric:"always",units:r,unit:i})}toRelativeCalendar(t={}){return this.isValid?zs(t.base||S.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(S.isDateTime))throw new L("min requires all arguments be DateTimes");return Is(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(S.isDateTime))throw new L("max requires all arguments be DateTimes");return Is(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(t,e,s={}){const{locale:r=null,numberingSystem:i=null}=s,o=D.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return qn(o,t,e)}static fromStringExplain(t,e,s={}){return S.fromFormatExplain(t,e,s)}static buildFormatParser(t,e={}){const{locale:s=null,numberingSystem:r=null}=e,i=D.fromOpts({locale:s,numberingSystem:r,defaultToEN:!0});return new Yn(i,t)}static fromFormatParser(t,e,s={}){if(w(t)||w(e))throw new L("fromFormatParser requires an input string and a format parser");const{locale:r=null,numberingSystem:i=null}=s,o=D.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});if(!o.equals(e.locale))throw new L(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${e.locale}`);const{result:l,zone:c,specificOffset:h,invalidReason:f}=e.explainFromTokens(t);return f?S.invalid(f):jt(l,c,s,`format ${e.format}`,t,h)}static get DATE_SHORT(){return xe}static get DATE_MED(){return Js}static get DATE_MED_WITH_WEEKDAY(){return Vr}static get DATE_FULL(){return Qs}static get DATE_HUGE(){return Ks}static get TIME_SIMPLE(){return tn}static get TIME_WITH_SECONDS(){return en}static get TIME_WITH_SHORT_OFFSET(){return sn}static get TIME_WITH_LONG_OFFSET(){return nn}static get TIME_24_SIMPLE(){return rn}static get TIME_24_WITH_SECONDS(){return on}static get TIME_24_WITH_SHORT_OFFSET(){return an}static get TIME_24_WITH_LONG_OFFSET(){return ln}static get DATETIME_SHORT(){return cn}static get DATETIME_SHORT_WITH_SECONDS(){return un}static get DATETIME_MED(){return dn}static get DATETIME_MED_WITH_SECONDS(){return hn}static get DATETIME_MED_WITH_WEEKDAY(){return Rr}static get DATETIME_FULL(){return pn}static get DATETIME_FULL_WITH_SECONDS(){return fn}static get DATETIME_HUGE(){return mn}static get DATETIME_HUGE_WITH_SECONDS(){return gn}}function Gt(n){if(S.isDateTime(n))return n;if(n&&n.valueOf&&St(n.valueOf()))return S.fromJSDate(n);if(n&&typeof n=="object")return S.fromObject(n);throw new L(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const _o="3.7.1";z.DateTime=S;z.Duration=b;z.FixedOffsetZone=$;z.IANAZone=lt;z.Info=qt;z.Interval=M;z.InvalidZone=vn;z.Settings=I;z.SystemZone=ne;z.VERSION=_o;z.Zone=Ht;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CronDate=n.DAYS_IN_MONTH=n.DateMathOp=n.TimeUnit=void 0;const t=z;var e;(function(i){i.Second="Second",i.Minute="Minute",i.Hour="Hour",i.Day="Day",i.Month="Month",i.Year="Year"})(e||(n.TimeUnit=e={}));var s;(function(i){i.Add="Add",i.Subtract="Subtract"})(s||(n.DateMathOp=s={})),n.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);class r{#t;#s=null;#n=null;#r={add:{[e.Year]:this.addYear.bind(this),[e.Month]:this.addMonth.bind(this),[e.Day]:this.addDay.bind(this),[e.Hour]:this.addHour.bind(this),[e.Minute]:this.addMinute.bind(this),[e.Second]:this.addSecond.bind(this)},subtract:{[e.Year]:this.subtractYear.bind(this),[e.Month]:this.subtractMonth.bind(this),[e.Day]:this.subtractDay.bind(this),[e.Hour]:this.subtractHour.bind(this),[e.Minute]:this.subtractMinute.bind(this),[e.Second]:this.subtractSecond.bind(this)}};constructor(o,l){const c={zone:l};if(o?o instanceof r?(this.#t=o.#t,this.#s=o.#s,this.#n=o.#n):o instanceof Date?this.#t=t.DateTime.fromJSDate(o,c):typeof o=="number"?this.#t=t.DateTime.fromMillis(o,c):(this.#t=t.DateTime.fromISO(o,c),this.#t.isValid||(this.#t=t.DateTime.fromRFC2822(o,c)),this.#t.isValid||(this.#t=t.DateTime.fromSQL(o,c)),this.#t.isValid||(this.#t=t.DateTime.fromFormat(o,"EEE, d MMM yyyy HH:mm:ss",c))):this.#t=t.DateTime.local(),!this.#t.isValid)throw new Error(`CronDate: unhandled timestamp: ${o}`);l&&l!==this.#t.zoneName&&(this.#t=this.#t.setZone(l))}static#i(o){return o%4===0&&o%100!==0||o%400===0}get dstStart(){return this.#s}set dstStart(o){this.#s=o}get dstEnd(){return this.#n}set dstEnd(o){this.#n=o}addYear(){this.#t=this.#t.plus({years:1})}addMonth(){this.#t=this.#t.plus({months:1}).startOf("month")}addDay(){this.#t=this.#t.plus({days:1}).startOf("day")}addHour(){this.#t=this.#t.plus({hours:1}).startOf("hour")}addMinute(){this.#t=this.#t.plus({minutes:1}).startOf("minute")}addSecond(){this.#t=this.#t.plus({seconds:1})}subtractYear(){this.#t=this.#t.minus({years:1})}subtractMonth(){this.#t=this.#t.minus({months:1}).endOf("month").startOf("second")}subtractDay(){this.#t=this.#t.minus({days:1}).endOf("day").startOf("second")}subtractHour(){this.#t=this.#t.minus({hours:1}).endOf("hour").startOf("second")}subtractMinute(){this.#t=this.#t.minus({minutes:1}).endOf("minute").startOf("second")}subtractSecond(){this.#t=this.#t.minus({seconds:1})}addUnit(o){this.#r.add[o]()}subtractUnit(o){this.#r.subtract[o]()}invokeDateOperation(o,l){if(o===s.Add){this.addUnit(l);return}if(o===s.Subtract){this.subtractUnit(l);return}throw new Error(`Invalid verb: ${o}`)}getDate(){return this.#t.day}getFullYear(){return this.#t.year}getDay(){const o=this.#t.weekday;return o===7?0:o}getMonth(){return this.#t.month-1}getHours(){return this.#t.hour}getMinutes(){return this.#t.minute}getSeconds(){return this.#t.second}getMilliseconds(){return this.#t.millisecond}getTime(){return this.#t.valueOf()}getUTCDate(){return this.#e().day}getUTCFullYear(){return this.#e().year}getUTCDay(){const o=this.#e().weekday;return o===7?0:o}getUTCMonth(){return this.#e().month-1}getUTCHours(){return this.#e().hour}getUTCMinutes(){return this.#e().minute}getUTCSeconds(){return this.#e().second}toISOString(){return this.#t.toUTC().toISO()}toJSON(){return this.#t.toJSON()}setDate(o){this.#t=this.#t.set({day:o})}setFullYear(o){this.#t=this.#t.set({year:o})}setDay(o){this.#t=this.#t.set({weekday:o})}setMonth(o){this.#t=this.#t.set({month:o+1})}setHours(o){this.#t=this.#t.set({hour:o})}setMinutes(o){this.#t=this.#t.set({minute:o})}setSeconds(o){this.#t=this.#t.set({second:o})}setMilliseconds(o){this.#t=this.#t.set({millisecond:o})}toString(){return this.toDate().toString()}toDate(){return this.#t.toJSDate()}isLastDayOfMonth(){const{day:o,month:l}=this.#t;if(l===2){const c=r.#i(this.#t.year);return o===n.DAYS_IN_MONTH[l-1]-(c?0:1)}return o===n.DAYS_IN_MONTH[l-1]}isLastWeekdayOfMonth(){const{day:o,month:l}=this.#t;let c;return l===2?c=n.DAYS_IN_MONTH[l-1]-(r.#i(this.#t.year)?0:1):c=n.DAYS_IN_MONTH[l-1],o>c-7}applyDateOperation(o,l,c){if(l===e.Month||l===e.Day){this.invokeDateOperation(o,l);return}const h=this.getHours();this.invokeDateOperation(o,l);const f=this.getHours(),u=f-h;u===2?c!==24&&(this.dstStart=f):u===0&&this.getMinutes()===0&&this.getSeconds()===0&&c!==24&&(this.dstEnd=f)}#e(){return this.#t.toUTC()}}n.CronDate=r,n.default=r})(se);Object.defineProperty(Te,"__esModule",{value:!0});Te.CronMonth=void 0;const Wo=se,$o=ut,Ao=1,Ho=12,Vo=Object.freeze([]);class Ro extends $o.CronField{static get min(){return Ao}static get max(){return Ho}static get chars(){return Vo}static get daysInMonth(){return Wo.DAYS_IN_MONTH}constructor(t,e){super(t,e),this.validate()}get values(){return super.values}}Te.CronMonth=Ro;var je={};Object.defineProperty(je,"__esModule",{value:!0});je.CronSecond=void 0;const Po=ut,Bo=0,zo=59,Uo=Object.freeze([]);class Go extends Po.CronField{static get min(){return Bo}static get max(){return zo}static get chars(){return Uo}constructor(t,e){super(t,e),this.validate()}get values(){return super.values}}je.CronSecond=Go;(function(n){var t=vt&&vt.__createBinding||(Object.create?function(s,r,i,o){o===void 0&&(o=i);var l=Object.getOwnPropertyDescriptor(r,i);(!l||("get"in l?!r.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(s,o,l)}:function(s,r,i,o){o===void 0&&(o=i),s[o]=r[i]}),e=vt&&vt.__exportStar||function(s,r){for(var i in s)i!=="default"&&!Object.prototype.hasOwnProperty.call(r,i)&&t(r,s,i)};Object.defineProperty(n,"__esModule",{value:!0}),e(qs,n),e(Ce,n),e(be,n),e(ut,n),e(ke,n),e(De,n),e(Te,n),e(je,n)})(vt);Object.defineProperty(ee,"__esModule",{value:!0});ee.CronFieldCollection=void 0;const G=vt;class _t{#t;#s;#n;#r;#i;#e;static from(t,e){return new _t({second:this.resolveField(G.CronSecond,t.second,e.second),minute:this.resolveField(G.CronMinute,t.minute,e.minute),hour:this.resolveField(G.CronHour,t.hour,e.hour),dayOfMonth:this.resolveField(G.CronDayOfMonth,t.dayOfMonth,e.dayOfMonth),month:this.resolveField(G.CronMonth,t.month,e.month),dayOfWeek:this.resolveField(G.CronDayOfWeek,t.dayOfWeek,e.dayOfWeek)})}static resolveField(t,e,s){return s?s instanceof G.CronField?s:new t(s):e}constructor({second:t,minute:e,hour:s,dayOfMonth:r,month:i,dayOfWeek:o}){if(!t)throw new Error("Validation error, Field second is missing");if(!e)throw new Error("Validation error, Field minute is missing");if(!s)throw new Error("Validation error, Field hour is missing");if(!r)throw new Error("Validation error, Field dayOfMonth is missing");if(!i)throw new Error("Validation error, Field month is missing");if(!o)throw new Error("Validation error, Field dayOfWeek is missing");if(i.values.length===1&&!r.hasLastChar&&!(parseInt(r.values[0],10)<=G.CronMonth.daysInMonth[i.values[0]-1]))throw new Error("Invalid explicit day of month definition");this.#t=t,this.#s=e,this.#n=s,this.#i=i,this.#e=o,this.#r=r}get second(){return this.#t}get minute(){return this.#s}get hour(){return this.#n}get dayOfMonth(){return this.#r}get month(){return this.#i}get dayOfWeek(){return this.#e}static compactField(t){if(t.length===0)return[];const e=[];let s;return t.forEach((r,i,o)=>{if(s===void 0){s={start:r,count:1};return}const l=o[i-1]||s.start,c=o[i+1];if(r==="L"||r==="W"){e.push(s),e.push({start:r,count:1}),s=void 0;return}if(s.step===void 0&&c!==void 0){const h=r-l,f=c-r;if(h<=f){s={...s,count:2,end:r,step:h};return}s.step=1}r-(s.end??0)===s.step?(s.count++,s.end=r):(s.count===1?e.push({start:s.start,count:1}):s.count===2?(e.push({start:s.start,count:1}),e.push({start:s.end??l,count:1})):e.push(s),s={start:r,count:1})}),s&&e.push(s),e}static#o(t,e,s){const r=e.step;return r?r===1&&e.start===t.min&&e.end&&e.end>=s?t.hasQuestionMarkChar?"?":"*":r!==1&&e.start===t.min&&e.end&&e.end>=s-r+1?`*/${r}`:null:null}static#l(t,e){const s=t.step;if(s===1)return`${t.start}-${t.end}`;const r=t.start===0?t.count-1:t.count;if(!s)throw new Error("Unexpected range step");if(!t.end)throw new Error("Unexpected range end");if(s*r>t.end){const i=(l,c)=>{if(typeof t.start!="number")throw new Error("Unexpected range start");return c%s===0?t.start+c:null};if(typeof t.start!="number")throw new Error("Unexpected range start");const o={length:t.end-t.start+1};return Array.from(o,i).filter(l=>l!==null).join(",")}return t.end===e-s+1?`${t.start}/${s}`:`${t.start}-${t.end}/${s}`}stringifyField(t){let e=t.max,s=t.values;if(t instanceof G.CronDayOfWeek){e=6;const i=this.#e.values;s=i[i.length-1]===7?i.slice(0,-1):i}t instanceof G.CronDayOfMonth&&(e=this.#i.values.length===1?G.CronMonth.daysInMonth[this.#i.values[0]-1]:t.max);const r=_t.compactField(s);if(r.length===1){const i=_t.#o(t,r[0],e);if(i)return i}return r.map(i=>{const o=i.count===1?i.start.toString():_t.#l(i,e);return t instanceof G.CronDayOfWeek&&t.nthDay>0?`${o}#${t.nthDay}`:o}).join(",")}stringify(t=!1){const e=[];return t&&e.push(this.stringifyField(this.#t)),e.push(this.stringifyField(this.#s),this.stringifyField(this.#n),this.stringifyField(this.#r),this.stringifyField(this.#i),this.stringifyField(this.#e)),e.join(" ")}serialize(){return{second:this.#t.serialize(),minute:this.#s.serialize(),hour:this.#n.serialize(),dayOfMonth:this.#r.serialize(),month:this.#i.serialize(),dayOfWeek:this.#e.serialize()}}}ee.CronFieldCollection=_t;var zt={};Object.defineProperty(zt,"__esModule",{value:!0});zt.CronExpression=void 0;const F=se,Gs=1e4;class q{#t;#s;#n;#r;#i;#e;constructor(t,e){this.#t=e,this.#s=e.tz,this.#n=new F.CronDate(e.currentDate,this.#s),this.#r=e.startDate?new F.CronDate(e.startDate,this.#s):null,this.#i=e.endDate?new F.CronDate(e.endDate,this.#s):null,this.#e=t}get fields(){return this.#e}static fieldsToExpression(t,e){return new q(t,e||{})}static#o(t,e){return e.some(s=>s===t)}static#l(t,e){const s=e.isLastWeekdayOfMonth();return t.some(r=>{const i=parseInt(r.toString().charAt(0),10)%7;if(Number.isNaN(i))throw new Error(`Invalid last weekday of the month expression: ${r}`);return e.getDay()===i&&s})}next(){return this.#a()}prev(){return this.#a(!0)}hasNext(){const t=this.#n;try{return this.#a(),!0}catch{return!1}finally{this.#n=t}}hasPrev(){const t=this.#n;try{return this.#a(!0),!0}catch{return!1}finally{this.#n=t}}take(t){const e=[];if(t>=0)for(let s=0;s<t;s++)try{e.push(this.next())}catch{return e}else for(let s=0;s>t;s--)try{e.push(this.prev())}catch{return e}return e}reset(t){this.#n=new F.CronDate(t||this.#t.currentDate)}stringify(t=!1){return this.#e.stringify(t)}includesDate(t){const{second:e,minute:s,hour:r,month:i}=this.#e,o=new F.CronDate(t,this.#s);return!(!e.values.includes(o.getSeconds())||!s.values.includes(o.getMinutes())||!r.values.includes(o.getHours())||!i.values.includes(o.getMonth()+1)||!this.#c(o)||this.#e.dayOfWeek.nthDay>0&&Math.ceil(o.getDate()/7)!==this.#e.dayOfWeek.nthDay)}toString(){return this.#t.expression||this.stringify(!0)}#c(t){const e=this.#e.dayOfMonth.isWildcard,s=!e,r=this.#e.dayOfWeek.isWildcard,i=!r,o=q.#o(t.getDate(),this.#e.dayOfMonth.values)||this.#e.dayOfMonth.hasLastChar&&t.isLastDayOfMonth(),l=q.#o(t.getDay(),this.#e.dayOfWeek.values)||this.#e.dayOfWeek.hasLastChar&&q.#l(this.#e.dayOfWeek.values,t);return!!(s&&i&&(o||l)||o&&!i||e&&!r&&l)}#u(t,e,s){const r=t.getHours(),i=q.#o(r,this.#e.hour.values),o=t.dstStart===r,l=t.dstEnd===r;return!i&&!o?(t.dstStart=null,t.applyDateOperation(e,F.TimeUnit.Hour,this.#e.hour.values.length),!1):o&&!q.#o(r-1,this.#e.hour.values)?(t.invokeDateOperation(e,F.TimeUnit.Hour),!1):l&&!s?(t.dstEnd=null,t.applyDateOperation(F.DateMathOp.Add,F.TimeUnit.Hour,this.#e.hour.values.length),!1):!0}#a(t=!1){const e=t?F.DateMathOp.Subtract:F.DateMathOp.Add,s=new F.CronDate(this.#n),r=this.#r,i=this.#i,o=s.getTime();let l=0;for(;l++<Gs;){if(l>Gs)throw new Error("Invalid expression, loop limit exceeded");if(t&&r&&r.getTime()>s.getTime())throw new Error("Out of the timespan range");if(!t&&i&&s.getTime()>i.getTime())throw new Error("Out of the timespan range");if(!this.#c(s)){s.applyDateOperation(e,F.TimeUnit.Day,this.#e.hour.values.length);continue}if(!(this.#e.dayOfWeek.nthDay<=0||Math.ceil(s.getDate()/7)===this.#e.dayOfWeek.nthDay)){s.applyDateOperation(e,F.TimeUnit.Day,this.#e.hour.values.length);continue}if(!q.#o(s.getMonth()+1,this.#e.month.values)){s.applyDateOperation(e,F.TimeUnit.Month,this.#e.hour.values.length);continue}if(this.#u(s,e,t)){if(!q.#o(s.getMinutes(),this.#e.minute.values)){s.applyDateOperation(e,F.TimeUnit.Minute,this.#e.hour.values.length);continue}if(!q.#o(s.getSeconds(),this.#e.second.values)){s.applyDateOperation(e,F.TimeUnit.Second,this.#e.hour.values.length);continue}if(o===s.getTime()){(e==="Add"||s.getMilliseconds()===0)&&s.applyDateOperation(e,F.TimeUnit.Second,this.#e.hour.values.length);continue}break}}return s.getMilliseconds()!==0&&s.setMilliseconds(0),this.#n=s,s}[Symbol.iterator](){return{next:()=>({value:this.#a(),done:!this.hasNext()})}}}zt.CronExpression=q;zt.default=q;var ps={};Object.defineProperty(ps,"__esModule",{value:!0});ps.seededRandom=qo;function Zo(n){let t=2166136261;for(let e=0;e<n.length;e++)t^=n.charCodeAt(e),t=Math.imul(t,16777619);return()=>t>>>0}function Yo(n){return()=>{let t=n+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function qo(n){const t=n?Zo(n)():Math.floor(Math.random()*1e10);return Yo(t)}Object.defineProperty(P,"__esModule",{value:!0});P.CronExpressionParser=P.DayOfWeek=P.Months=P.CronUnit=P.PredefinedExpressions=void 0;const Xo=ee,Jo=se,Qo=zt,Ko=ps,Z=vt;var es;(function(n){n["@yearly"]="0 0 0 1 1 *",n["@annually"]="0 0 0 1 1 *",n["@monthly"]="0 0 0 1 * *",n["@weekly"]="0 0 0 * * 0",n["@daily"]="0 0 0 * * *",n["@hourly"]="0 0 * * * *",n["@minutely"]="0 * * * * *",n["@secondly"]="* * * * * *",n["@weekdays"]="0 0 0 * * 1-5",n["@weekends"]="0 0 0 * * 0,6"})(es||(P.PredefinedExpressions=es={}));var Y;(function(n){n.Second="Second",n.Minute="Minute",n.Hour="Hour",n.DayOfMonth="DayOfMonth",n.Month="Month",n.DayOfWeek="DayOfWeek"})(Y||(P.CronUnit=Y={}));var ss;(function(n){n[n.jan=1]="jan",n[n.feb=2]="feb",n[n.mar=3]="mar",n[n.apr=4]="apr",n[n.may=5]="may",n[n.jun=6]="jun",n[n.jul=7]="jul",n[n.aug=8]="aug",n[n.sep=9]="sep",n[n.oct=10]="oct",n[n.nov=11]="nov",n[n.dec=12]="dec"})(ss||(P.Months=ss={}));var ns;(function(n){n[n.sun=0]="sun",n[n.mon=1]="mon",n[n.tue=2]="tue",n[n.wed=3]="wed",n[n.thu=4]="thu",n[n.fri=5]="fri",n[n.sat=6]="sat"})(ns||(P.DayOfWeek=ns={}));class R{static parse(t,e={}){const{strict:s=!1}=e,r=e.currentDate||new Jo.CronDate,i=(0,Ko.seededRandom)(e.hashSeed);t=es[t]||t;const o=R.#t(t,s);if(!(o.dayOfMonth==="*"||o.dayOfWeek==="*"||!s))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");const l=R.#s(Y.Second,o.second,Z.CronSecond.constraints,i),c=R.#s(Y.Minute,o.minute,Z.CronMinute.constraints,i),h=R.#s(Y.Hour,o.hour,Z.CronHour.constraints,i),f=R.#s(Y.Month,o.month,Z.CronMonth.constraints,i),u=R.#s(Y.DayOfMonth,o.dayOfMonth,Z.CronDayOfMonth.constraints,i),{dayOfWeek:m,nthDayOfWeek:p}=R.#a(o.dayOfWeek),x=R.#s(Y.DayOfWeek,m,Z.CronDayOfWeek.constraints,i),T=new Xo.CronFieldCollection({second:new Z.CronSecond(l,{rawValue:o.second}),minute:new Z.CronMinute(c,{rawValue:o.minute}),hour:new Z.CronHour(h,{rawValue:o.hour}),dayOfMonth:new Z.CronDayOfMonth(u,{rawValue:o.dayOfMonth}),month:new Z.CronMonth(f,{rawValue:o.month}),dayOfWeek:new Z.CronDayOfWeek(x,{rawValue:o.dayOfWeek,nthDayOfWeek:p})});return new Qo.CronExpression(T,{...e,expression:t,currentDate:r})}static#t(t,e){if(e&&!t.length)throw new Error("Invalid cron expression");t=t||"0 * * * * *";const s=t.trim().split(/\s+/);if(e&&s.length<6)throw new Error("Invalid cron expression, expected 6 fields");if(s.length>6)throw new Error("Invalid cron expression, too many fields");const r=["*","*","*","*","*","0"];s.length<r.length&&s.unshift(...r.slice(s.length));const[i,o,l,c,h,f]=s;return{second:i,minute:o,hour:l,dayOfMonth:c,month:h,dayOfWeek:f}}static#s(t,e,s,r){if((t===Y.Month||t===Y.DayOfWeek)&&(e=e.replace(/[a-z]{3}/gi,i=>{i=i.toLowerCase();const o=ss[i]||ns[i];if(o===void 0)throw new Error(`Validation error, cannot resolve alias "${i}"`);return o.toString()})),!s.validChars.test(e))throw new Error(`Invalid characters, got value: ${e}`);return e=this.#n(e,s),e=this.#r(e,s,r),this.#i(t,e,s)}static#n(t,e){return t.replace(/[*?]/g,e.min+"-"+e.max)}static#r(t,e,s){const r=s();return t.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(i,o,l,c)=>{if(o&&l&&c){const h=parseInt(o,10),f=parseInt(l,10),u=parseInt(c,10);if(h>f)throw new Error(`Invalid range: ${h}-${f}, min > max`);if(u<=0)throw new Error(`Invalid step: ${u}, must be positive`);const m=Math.max(h,e.min),p=Math.floor(r*u),x=[];for(let T=Math.floor(m/u)*u+p;T<=f;T+=u)T>=m&&x.push(T);return x.join(",")}else if(o&&l){const h=parseInt(o,10),f=parseInt(l,10);if(h>f)throw new Error(`Invalid range: ${h}-${f}, min > max`);return String(Math.floor(r*(f-h+1))+h)}else if(c){const h=parseInt(c,10);if(h<=0)throw new Error(`Invalid step: ${h}, must be positive`);const f=Math.floor(r*h),u=[];for(let m=Math.floor(e.min/h)*h+f;m<=e.max;m+=h)m>=e.min&&u.push(m);return u.join(",")}else return String(Math.floor(r*(e.max-e.min+1)+e.min))})}static#i(t,e,s){const r=[];function i(l,c){if(Array.isArray(l))r.push(...l);else if(R.#d(c,l))r.push(l);else{const h=parseInt(l.toString(),10);if(!(h>=c.min&&h<=c.max))throw new Error(`Constraint error, got value ${l} expected range ${c.min}-${c.max}`);r.push(t===Y.DayOfWeek?h%7:l)}}return e.split(",").forEach(l=>{if(!(l.length>0))throw new Error("Invalid list value format");i(R.#e(t,l,s),s)}),r}static#e(t,e,s){const r=e.split("/");if(r.length>2)throw new Error(`Invalid repeat: ${e}`);return r.length===2?(isNaN(parseInt(r[0],10))||(r[0]=`${r[0]}-${s.max}`),R.#u(t,r[0],parseInt(r[1],10),s)):R.#u(t,e,1,s)}static#o(t,e,s){if(!(!isNaN(t)&&!isNaN(e)&&t>=s.min&&e<=s.max))throw new Error(`Constraint error, got range ${t}-${e} expected range ${s.min}-${s.max}`);if(t>e)throw new Error(`Invalid range: ${t}-${e}, min(${t}) > max(${e})`)}static#l(t){if(!(!isNaN(t)&&t>0))throw new Error(`Constraint error, cannot repeat at every ${t} time.`)}static#c(t,e,s,r){const i=[];t===Y.DayOfWeek&&s%7===0&&i.push(0);for(let o=e;o<=s;o+=r)i.indexOf(o)===-1&&i.push(o);return i}static#u(t,e,s,r){const i=e.split("-");if(i.length<=1)return isNaN(+e)?e:+e;const[o,l]=i.map(c=>parseInt(c,10));return this.#o(o,l,r),this.#l(s),this.#c(t,o,l,s)}static#a(t){const e=t.split("#");if(e.length<=1)return{dayOfWeek:e[0]};const s=+e[e.length-1],r=t.match(/([,-/])/);if(r!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${r==null?void 0:r[0]}\` special characters are incompatible`);if(!(e.length<=2&&!isNaN(s)&&s>=1&&s<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:e[0],nthDayOfWeek:s}}static#d(t,e){return t.chars.some(s=>e.toString().includes(s))}}P.CronExpressionParser=R;var ct={},ta=ct&&ct.__createBinding||(Object.create?function(n,t,e,s){s===void 0&&(s=e);var r=Object.getOwnPropertyDescriptor(t,e);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(n,s,r)}:function(n,t,e,s){s===void 0&&(s=e),n[s]=t[e]}),ea=ct&&ct.__setModuleDefault||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),sa=ct&&ct.__importStar||function(){var n=function(t){return n=Object.getOwnPropertyNames||function(e){var s=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(s[s.length]=r);return s},n(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var s=n(t),r=0;r<s.length;r++)s[r]!=="default"&&ta(e,t,s[r]);return ea(e,t),e}}();Object.defineProperty(ct,"__esModule",{value:!0});ct.CronFileParser=void 0;const na=P;class Kt{static async parseFile(t){const{readFile:e}=await Promise.resolve().then(()=>sa(fs)),s=await e(t,"utf8");return Kt.#t(s)}static parseFileSync(t){const{readFileSync:e}=fs,s=e(t,"utf8");return Kt.#t(s)}static#t(t){const e=t.split(`
|
|
2
|
+
`),s={variables:{},expressions:[],errors:{}};for(const r of e){const i=r.trim();if(i.length===0||i.startsWith("#"))continue;const o=i.match(/^(.*)=(.*)$/);if(o){const[,l,c]=o;s.variables[l]=c.replace(/["']/g,"");continue}try{const l=Kt.#s(i);s.expressions.push(l.interval)}catch(l){s.errors[i]=l}}return s}static#s(t){const e=t.split(" ");return{interval:na.CronExpressionParser.parse(e.slice(0,5).join(" ")),command:e.slice(5,e.length)}}}ct.CronFileParser=Kt;(function(n){var t=Ft&&Ft.__createBinding||(Object.create?function(h,f,u,m){m===void 0&&(m=u);var p=Object.getOwnPropertyDescriptor(f,u);(!p||("get"in p?!f.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return f[u]}}),Object.defineProperty(h,m,p)}:function(h,f,u,m){m===void 0&&(m=u),h[m]=f[u]}),e=Ft&&Ft.__exportStar||function(h,f){for(var u in h)u!=="default"&&!Object.prototype.hasOwnProperty.call(f,u)&&t(f,h,u)};Object.defineProperty(n,"__esModule",{value:!0}),n.CronFileParser=n.CronExpressionParser=n.CronExpression=n.CronFieldCollection=n.CronDate=void 0;const s=P;var r=se;Object.defineProperty(n,"CronDate",{enumerable:!0,get:function(){return r.CronDate}});var i=ee;Object.defineProperty(n,"CronFieldCollection",{enumerable:!0,get:function(){return i.CronFieldCollection}});var o=zt;Object.defineProperty(n,"CronExpression",{enumerable:!0,get:function(){return o.CronExpression}});var l=P;Object.defineProperty(n,"CronExpressionParser",{enumerable:!0,get:function(){return l.CronExpressionParser}});var c=ct;Object.defineProperty(n,"CronFileParser",{enumerable:!0,get:function(){return c.CronFileParser}}),e(vt,n),n.default=s.CronExpressionParser})(Ft);var ra={exports:{}};(function(n,t){(function(s,r){n.exports=r(Zs)})(globalThis,e=>(()=>{var s={93:u=>{u.exports=e}},r={};function i(u){var m=r[u];if(m!==void 0)return m.exports;var p=r[u]={exports:{}};return s[u](p,p.exports,i),p.exports}i.n=u=>{var m=u&&u.__esModule?()=>u.default:()=>u;return i.d(m,{a:m}),m},i.d=(u,m)=>{for(var p in m)i.o(m,p)&&!i.o(u,p)&&Object.defineProperty(u,p,{enumerable:!0,get:m[p]})},i.o=(u,m)=>Object.prototype.hasOwnProperty.call(u,m),i.r=u=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})};var o={};i.r(o);var l=i(93),c=i.n(l),h=o;Object.defineProperty(h,"__esModule",{value:!0}),h.en=void 0;var f=function(){function u(){}return u.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},u.prototype.atX0MinutesPastTheHourGt20=function(){return null},u.prototype.commaMonthX0ThroughMonthX1=function(){return null},u.prototype.commaYearX0ThroughYearX1=function(){return null},u.prototype.use24HourTimeFormatByDefault=function(){return!1},u.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},u.prototype.everyMinute=function(){return"every minute"},u.prototype.everyHour=function(){return"every hour"},u.prototype.atSpace=function(){return"At "},u.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},u.prototype.at=function(){return"At"},u.prototype.spaceAnd=function(){return" and"},u.prototype.everySecond=function(){return"every second"},u.prototype.everyX0Seconds=function(){return"every %s seconds"},u.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},u.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},u.prototype.everyX0Minutes=function(){return"every %s minutes"},u.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},u.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},u.prototype.everyX0Hours=function(){return"every %s hours"},u.prototype.betweenX0AndX1=function(){return"between %s and %s"},u.prototype.atX0=function(){return"at %s"},u.prototype.commaEveryDay=function(){return", every day"},u.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},u.prototype.commaX0ThroughX1=function(){return", %s through %s"},u.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},u.prototype.first=function(){return"first"},u.prototype.second=function(){return"second"},u.prototype.third=function(){return"third"},u.prototype.fourth=function(){return"fourth"},u.prototype.fifth=function(){return"fifth"},u.prototype.commaOnThe=function(){return", on the "},u.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},u.prototype.lastDay=function(){return"the last day"},u.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},u.prototype.commaOnlyOnX0=function(){return", only on %s"},u.prototype.commaAndOnX0=function(){return", and on %s"},u.prototype.commaEveryX0Months=function(){return", every %s months"},u.prototype.commaOnlyInX0=function(){return", only in %s"},u.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},u.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},u.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},u.prototype.firstWeekday=function(){return"first weekday"},u.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},u.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},u.prototype.commaEveryX0Days=function(){return", every %s days"},u.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},u.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},u.prototype.commaEveryHour=function(){return", every hour"},u.prototype.commaEveryX0Years=function(){return", every %s years"},u.prototype.commaStartingX0=function(){return", starting %s"},u.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},u.prototype.atReboot=function(){return"Run once, at startup"},u}();return h.en=f,c().locales.en=new f,o})())})(ra);var ia={exports:{}};(function(n,t){(function(s,r){n.exports=r(Zs)})(globalThis,e=>(()=>{var s={93:u=>{u.exports=e}},r={};function i(u){var m=r[u];if(m!==void 0)return m.exports;var p=r[u]={exports:{}};return s[u](p,p.exports,i),p.exports}i.n=u=>{var m=u&&u.__esModule?()=>u.default:()=>u;return i.d(m,{a:m}),m},i.d=(u,m)=>{for(var p in m)i.o(m,p)&&!i.o(u,p)&&Object.defineProperty(u,p,{enumerable:!0,get:m[p]})},i.o=(u,m)=>Object.prototype.hasOwnProperty.call(u,m),i.r=u=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})};var o={};i.r(o);var l=i(93),c=i.n(l),h=o;Object.defineProperty(h,"__esModule",{value:!0}),h.nl=void 0;var f=function(){function u(){}return u.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},u.prototype.atX0MinutesPastTheHourGt20=function(){return null},u.prototype.commaMonthX0ThroughMonthX1=function(){return null},u.prototype.commaYearX0ThroughYearX1=function(){return null},u.prototype.use24HourTimeFormatByDefault=function(){return!0},u.prototype.everyMinute=function(){return"elke minuut"},u.prototype.everyHour=function(){return"elk uur"},u.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"Er is een fout opgetreden bij het vertalen van de gegevens. Controleer de gegevens."},u.prototype.atSpace=function(){return"Om "},u.prototype.everyMinuteBetweenX0AndX1=function(){return"Elke minuut tussen %s en %s"},u.prototype.at=function(){return"Om"},u.prototype.spaceAnd=function(){return" en"},u.prototype.everySecond=function(){return"elke seconde"},u.prototype.everyX0Seconds=function(){return"elke %s seconden"},u.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconden %s t/m %s na de minuut"},u.prototype.atX0SecondsPastTheMinute=function(){return"op %s seconden na de minuut"},u.prototype.everyX0Minutes=function(){return"elke %s minuten"},u.prototype.minutesX0ThroughX1PastTheHour=function(){return"minuut %s t/m %s na het uur"},u.prototype.atX0MinutesPastTheHour=function(){return"op %s minuten na het uur"},u.prototype.everyX0Hours=function(){return"elke %s uur"},u.prototype.betweenX0AndX1=function(){return"tussen %s en %s"},u.prototype.atX0=function(){return"om %s"},u.prototype.commaEveryDay=function(){return", elke dag"},u.prototype.commaEveryX0DaysOfTheWeek=function(){return", elke %s dagen van de week"},u.prototype.commaX0ThroughX1=function(){return", %s t/m %s"},u.prototype.commaAndX0ThroughX1=function(){return", en %s t/m %s"},u.prototype.first=function(){return"eerste"},u.prototype.second=function(){return"tweede"},u.prototype.third=function(){return"derde"},u.prototype.fourth=function(){return"vierde"},u.prototype.fifth=function(){return"vijfde"},u.prototype.commaOnThe=function(){return", op de "},u.prototype.spaceX0OfTheMonth=function(){return" %s van de maand"},u.prototype.lastDay=function(){return"de laatste dag"},u.prototype.commaOnTheLastX0OfTheMonth=function(){return", op de laatste %s van de maand"},u.prototype.commaOnlyOnX0=function(){return", alleen op %s"},u.prototype.commaAndOnX0=function(){return", en op %s"},u.prototype.commaEveryX0Months=function(){return", elke %s maanden"},u.prototype.commaOnlyInX0=function(){return", alleen in %s"},u.prototype.commaOnTheLastDayOfTheMonth=function(){return", op de laatste dag van de maand"},u.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", op de laatste werkdag van de maand"},u.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s dagen vóór de laatste dag van de maand"},u.prototype.firstWeekday=function(){return"eerste werkdag"},u.prototype.weekdayNearestDayX0=function(){return"werkdag dichtst bij dag %s"},u.prototype.commaOnTheX0OfTheMonth=function(){return", op de %s van de maand"},u.prototype.commaEveryX0Days=function(){return", elke %s dagen"},u.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", tussen dag %s en %s van de maand"},u.prototype.commaOnDayX0OfTheMonth=function(){return", op dag %s van de maand"},u.prototype.commaEveryX0Years=function(){return", elke %s jaren"},u.prototype.commaStartingX0=function(){return", beginnend %s"},u.prototype.daysOfTheWeek=function(){return["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},u.prototype.monthsOfTheYear=function(){return["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]},u}();return h.nl=f,c().locales.nl=new f,o})())})(ia);const de={nowrap:{flexFlow:"nowrap",overflow:"hidden"},width:{width:"100%",overflow:"hidden"},tooltip:{pointerEvents:"none"}},rt=n=>a.jsxs(d.Grid2,{container:!0,title:n.icon?"":n.tooltip||"",alignItems:"center",direction:"row",spacing:1,style:de.nowrap,children:[n.icon&&a.jsx(d.Grid2,{style:{minWidth:24},children:a.jsx(d.Tooltip,{title:n.tooltip||"",slotProps:{popper:{sx:de.tooltip}},children:n.icon})}),a.jsx(d.Grid2,{style:de.width,children:a.jsx(d.Tooltip,{title:n.tooltip||"",slotProps:{popper:{sx:de.tooltip}},children:a.jsx(d.Typography,{component:"div",style:n.style,children:n.children})})})]}),oa="data:image/svg+xml,%3csvg%20width='256'%20height='230'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M251.22%20187.856c5.785%2010.045%206.345%2020.608%201.538%2028.958-4.8%208.357-14.192%2013.143-25.768%2013.143h-21.816c.259-4.068.431-8.17.431-12.302%200-4.628-.215-9.198-.531-13.754l14.35-.014c3.528%200%206.38-2.867%206.38-6.403a6.46%206.46%200%200%200-.768-3.053l-91.46-158.97a6.349%206.349%200%200%200-5.54-3.24%206.374%206.374%200%200%200-5.461%203.09l-14.522%2025.243c44.134%2033.27%2073.804%2084.813%2077.864%20143.333.316%204.548.531%209.119.531%2013.753%200%204.132-.172%208.228-.424%2012.302h-71.246c.388-4.053.611-8.148.611-12.302%200-4.649-.273-9.233-.776-13.753-3.52-32.206-19.286-60.748-42.503-80.89l-10.003%2017.376c17.54%2016.325%2029.512%2038.558%2032.767%2063.514.59%204.505.92%209.09.92%2013.753%200%204.154-.273%208.264-.74%2012.302H29.01c-11.576%200-20.968-4.793-25.768-13.15-4.807-8.35-4.247-18.905%201.538-28.958l13.56-23.238a79.42%2079.42%200%200%201%2020.715%2016.052l-8.083%2013.768a6.523%206.523%200%200%200-.77%203.054%206.383%206.383%200%200%200%206.382%206.395l32.033.015c-2.687-15.356-9.772-29.21-19.918-40.183-5.979-6.445-12.963-11.9-20.738-16.074l35.77-62.15a151.427%20151.427%200%200%201%2021.564%2014.624c30.827%2025.013%2051.644%2061.955%2055.416%20103.776h19.172c-3.91-48.892-28.477-92.006-64.937-120.548a171.205%20171.205%200%200%200-21.672-14.457l30.532-53.045C109.583%205.77%20118.42%200%20128.036%200c9.607%200%2018.438%205.77%2024.223%2015.823l98.961%20172.033z'%20fill='%23FB2D26'/%3e%3cline%20stroke-width='33'%20y2='223'%20x2='250.40002'%20y1='8'%20x1='6.40002'%20stroke='%23FB2D26'%20fill='none'/%3e%3cline%20stroke-width='32'%20y2='224'%20x2='8.40002'%20y1='7'%20x1='247.40002'%20stroke='%23FB2D26'%20fill='none'/%3e%3c/svg%3e",aa={img:{width:"100%",height:"100%"}};class la extends Tt.Component{render(){if(!this.props.links||!this.props.links.length)return null;const t=this.props.links[0].port,e=this.props.links.find(s=>s.port!==t);return a.jsxs(d.Dialog,{onClose:()=>this.props.onClose(),open:!0,children:[a.jsx(d.DialogTitle,{style:{padding:"8px 0 0 0",textAlign:"center"},children:this.props.t("Links")}),a.jsx(d.List,{children:this.props.links.map(s=>a.jsxs(d.ListItemButton,{style:s.color?{backgroundColor:s.color,color:pe.getInvertedColor(s.color,this.props.themeType,!0)}:{},onClick:r=>{r.stopPropagation();let i=s.link;i=i.replace(/\/\/([0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*)(:\d+)?\//i,"//[$1]$2/"),window.open(i,this.props.instanceId),this.props.onClose()},children:[a.jsx(d.ListItemAvatar,{children:a.jsx(d.Avatar,{variant:"rounded",children:a.jsx("img",{style:aa.img,src:this.props.image,alt:this.props.instanceId})})}),a.jsx(d.ListItemText,{primary:ot.getText(s.name,ht.getLanguage())+(e?` [:${s.port}]`:"")})]},ot.getText(s.name,ht.getLanguage())))})]})}}const ca=["silly","debug","info","warn","error"],Re=[{value:1,desc:"1: Logic adapters"},{value:2,desc:"2: Data provider adapters"},{value:3,desc:"3: Other adapters"}],ua="0 2px 2px 0 rgba(0, 0, 0, .14),0 3px 1px -2px rgba(0, 0, 0, .12),0 1px 5px 0 rgba(0, 0, 0, .2)",da="0 8px 17px 0 rgba(0, 0, 0, .2),0 6px 20px 0 rgba(0, 0, 0, .19)",Kn={root:n=>({position:"relative",m:"10px",width:300,minHeight:200,background:n.palette.background.default,boxShadow:ua,display:"flex",flexDirection:"column",transition:"box-shadow 0.5s","&:hover":{boxShadow:da}}),imageBlock:{background:"silver",minHeight:60,display:"flex",padding:"0 10px 0 10px",position:"relative",justifyContent:"space-between",transition:"background 0.5s"},logLevel:{width:"100%",marginBottom:5},hostInfo:{width:"100%"},addCompact:{width:"100%",marginBottom:5},selectStyle:{display:"flex",margin:5,justifyContent:"space-around"},hide:{visibility:"hidden"},tooltip:{pointerEvents:"none"},deleting:{position:"relative","&:before":{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:100,opacity:".3 !important",background:"repeating-linear-gradient(135deg, #333, #333 10px, #888 10px, #888 20px)"}},enabled:{color:he[400],"&:hover":{backgroundColor:he[200]}},disabled:{color:Zt[400],"&:hover":{backgroundColor:Zt[200]}},sentry:{width:24,height:24,objectFit:"fill",filter:"invert(0%) sepia(90%) saturate(1267%) hue-rotate(-260deg) brightness(99%) contrast(97%)"},displayFlex:{display:"flex"},marginLeft5:{marginLeft:5},marginRight5:{marginRight:5},instanceStateNotEnabled1:{backgroundColor:"rgba(192, 192, 192, 0.2)"},instanceStateNotEnabled2:{backgroundColor:"rgba(192, 192, 192, 0.15)"},instanceStateNotAlive1:{backgroundColor:"rgba(255,14,14,0.2)"},instanceStateNotAlive2:{backgroundColor:"rgba(255,14,14, 0.15)"},instanceStateAliveNotConnected1:{backgroundColor:"rgba(255, 177, 0, 0.1)"},instanceStateAliveNotConnected2:{backgroundColor:"rgba(255, 177, 0, 0.15)"},instanceStateAliveAndConnected1:{backgroundColor:"rgba(0, 255, 0, 0.1)"},instanceStateAliveAndConnected2:{backgroundColor:"rgba(0, 255, 0, 0.15)"},statusIcon_green:{border:"2px solid grey",borderRadius:2},statusIcon_red:{border:"2px solid grey",borderRadius:20},statusIcon_orange:{border:0,borderRadius:0},statusIcon_orangeDevice:{border:0,borderRadius:0},statusIcon_blue:{border:"2px solid grey",borderRadius:20},statusIcon_grey:{border:"2px solid grey",borderRadius:20},orangeDevice:{color:ye[300]},button:{padding:"5px",transition:"opacity 0.2s",height:34},hiddenOpacity:{opacity:0,cursor:"default"},smallAvatar:{width:24,height:24},statusIndicator:{marginLeft:8},green:{color:he[700]},red:{color:Zt[700]},grey:{color:Be[700]},blue:{color:"#0055a9"},orange:{color:ye[400]},transparent:{color:"transparent",backgroundColor:"transparent"},silly:{},debug:{backgroundColor:Be[700]},info:{backgroundColor:er[700]},warn:{backgroundColor:gr[700]},error:{backgroundColor:Zt[700]},scheduleIcon:{color:"#dc8e00"},memoryIcon:{color:"#dc8e00"},contrast0:{filter:"contrast(0%)"},hidden:{display:"none"},okSymbol:{width:20,height:20,margin:2,borderRadius:2},okSymbolInner:{width:"calc(100% - 2px)",height:"calc(100% - 2px)",borderRadius:2,margin:1,backgroundColor:"#66bb6a"},editButton:{minHeight:32,"& .admin-edit-button":ot.isTouchDevice()?void 0:{display:"none",maxHeight:32},"&:hover":ot.isTouchDevice()?void 0:{"& .admin-edit-button":{display:"block"}}}};class _ extends Tt.Component{componentDidMount(){this.props.context.onRegisterClose(this.props.id,this.commandClose)}componentWillUnmount(){this.props.context.onRegisterClose(this.props.id,null)}getDefaultState(t){return{openDialog:!1,openSelectCompactGroup:!1,openDialogCron:!1,openDialogSchedule:!1,openDialogName:!1,openDialogLogLevel:!1,openDialogDelete:!1,openDialogMemoryLimit:!1,openDialogHost:!1,openDialogCompact:!1,openDialogTier:!1,showLinks:!1,showStopAdminDialog:!1,logLevel:t.item.logLevel,logOnTheFly:!1,compactGroup:t.item.compactGroup||0,maxCompactGroupNumber:t.context.maxCompactGroupNumber,tier:t.item.tier,host:t.instance.host,deleteCustom:!1,visibleEdit:!1,expanded:!1}}static isCompact(t){var e;return((e=t==null?void 0:t.common)==null?void 0:e.runAsCompactMode)||!1}isSentry(){var t;return!!((t=this.props.context.states[`system.adapter.${this.props.instance.id}.plugins.sentry.enabled`])!=null&&t.val)}static getSchedule(t){var e;return((e=t==null?void 0:t.common)==null?void 0:e.schedule)||""}static isRunning(t){var e,s;return((e=t==null?void 0:t.common)==null?void 0:e.onlyWWW)||((s=t==null?void 0:t.common)==null?void 0:s.enabled)}static isCompactGroup(t){var e;return((e=t==null?void 0:t.common)==null?void 0:e.compactGroup)||null}static getSentrySettings(t){var e,s;return!!((s=(e=t==null?void 0:t.common)==null?void 0:e.plugins)!=null&&s.sentry)}static isModeSchedule(t){var e;return((e=t==null?void 0:t.common)==null?void 0:e.mode)==="schedule"}static getMemoryLimitMB(t){var e;return((e=t==null?void 0:t.common)==null?void 0:e.memoryLimitMB)||0}static getRestartSchedule(t){var e;return(e=t==null?void 0:t.common)!=null&&e.restartSchedule?t.common.restartSchedule:""}async setCommonValue(t,e){try{await this.props.context.socket.extendObject(t,{common:e})}catch(s){window.alert(s)}}commandClose=()=>this.setState({expanded:!1});toggleSentry(){const t=!this.isSentry();this.props.context.socket.setState(`system.adapter.${this.props.instance.id}.plugins.sentry.enabled`,t,!0).catch(e=>window.alert(`Cannot set sentry: ${e}`))}setTier(t,e){this.setCommonValue(`system.adapter.${t.id}`,{tier:e})}setName(t,e){this.setCommonValue(`system.adapter.${t.id}`,{titleLang:e})}setLogLevel(t,e,s){s?this.props.context.socket.setState(`system.adapter.${t.id}.logLevel`,e):this.setCommonValue(`system.adapter.${t.id}`,{loglevel:e})}setSchedule(t,e){e?this.setCommonValue(`system.adapter.${t.id}`,{schedule:e}):this.props.context.socket.getObject(`system.adapter.${t.id}`).then(s=>{s.common.schedule!==""&&(s.common.schedule="",this.props.context.socket.setObject(s._id,s).catch(r=>window.alert(`Cannot set schedule: ${r}`)))}).catch(s=>window.alert(`Cannot set schedule: ${s}`))}setMemoryLimitMB(t,e){this.setCommonValue(`system.adapter.${t.id}`,{memoryLimitMB:e})}toggleCompactMode(){this.setCommonValue(`system.adapter.${this.props.instance.id}`,{runAsCompactMode:!_.isCompact(this.props.instance.obj)})}setRestartSchedule(t,e){e?this.setCommonValue(`system.adapter.${t.id}`,{restartSchedule:e}):this.props.context.socket.getObject(`system.adapter.${t.id}`).then(s=>{s.common.restartSchedule!==""&&(s.common.restartSchedule="",this.props.context.socket.setObject(s._id,s))})}setHost(t,e){this.setCommonValue(`system.adapter.${t.id}`,{host:e})}setCompactGroup(t,e){e=e==="controller"?0:e==="default"?1:parseInt(e,10),this.setCommonValue(`system.adapter.${t.id}`,{compactGroup:e}),this.props.context.maxCompactGroupNumber<e&&this.props.context.setMaxCompactGroupNumber(e)}getMemory(){const t=this.props.context.states[`${this.props.id}.memRss`];return(t==null?void 0:t.val)||0}renderDeleteDialog(){return a.jsxs(d.Dialog,{onClose:()=>this.setState({openDialogDelete:!1,openDialog:!1}),open:!0,children:[a.jsx(d.DialogTitle,{children:this.props.context.t("Please confirm")}),a.jsxs(d.DialogContent,{children:[this.state.openDialogDelete===1?this.props.context.t('Are you sure you want to delete the instance "%s" or whole adapter "%s"?',this.props.instance.id,this.props.instance.id.split(".")[0]):this.props.context.t("Are you sure you want to delete the instance %s?",this.props.instance.id),this.props.context.deleteCustomSupported&&this.props.instance.obj.common.supportCustoms&&a.jsx("br",{}),this.props.context.deleteCustomSupported&&this.props.instance.obj.common.supportCustoms&&a.jsx(d.FormControlLabel,{control:a.jsx(d.Checkbox,{checked:this.state.deleteCustom,onChange:t=>this.setState({deleteCustom:t.target.checked})}),label:this.props.context.t("Delete all custom object settings of this adapter too")})]}),a.jsxs(d.DialogActions,{children:[this.state.openDialogDelete===1?a.jsx(d.Button,{startIcon:a.jsx(v.Delete,{}),onClick:()=>{this.props.context.onDeleteInstance(this.props.instance,this.state.deleteCustom,!0),this.setState({deleteCustom:!1,openDialogDelete:!1,openDialog:!1})},variant:"contained",style:{background:"red",color:"white"},children:this.props.context.t("Delete adapter")}):null,a.jsx(d.Button,{startIcon:a.jsx(v.Delete,{}),onClick:()=>{this.props.context.onDeleteInstance(this.props.instance,this.state.deleteCustom),this.setState({deleteCustom:!1,openDialogDelete:!1,openDialog:!1})},variant:"contained",color:"primary",children:this.props.context.t("Delete instance")}),a.jsx(d.Button,{color:"grey",onClick:()=>this.setState({openDialogDelete:!1,openDialog:!1}),variant:"contained",startIcon:a.jsx(v.Close,{}),children:this.props.context.t("Cancel")})]})]})}renderEditNameDialog(){return a.jsx(Mt,{theme:this.props.context.theme,title:this.props.context.t("Enter title for %s",this.props.instance.id),disableApplyIfNotChanged:!0,textInput:!0,defaultValue:ot.getText(this.props.item.name,this.props.context.lang),onApply:t=>{this.setName(this.props.instance,t.toString()),this.setState({openDialogName:!1,openDialog:!1})},onClose:()=>this.setState({openDialogName:!1,openDialog:!1})})}renderEditLogLevelDialog(){return a.jsxs(Mt,{theme:this.props.context.theme,title:this.props.context.t("Edit log level rule for %s",this.props.instance.id),onApply:()=>{this.setLogLevel(this.props.instance,this.state.logLevel,this.state.logOnTheFly),this.setState({openDialogLogLevel:!1,openDialog:!1})},disableApply:this.state.logLevel===this.props.item.logLevel,onClose:()=>this.setState({openDialogLogLevel:!1,logLevel:this.props.item.logLevel,openDialog:!1}),children:[a.jsxs(d.FormControl,{style:this.styles.logLevel,variant:"standard",children:[a.jsx(d.InputLabel,{children:this.props.context.t("log level")}),a.jsx(d.Select,{variant:"standard",value:this.state.logLevel,fullWidth:!0,onChange:t=>this.setState({logLevel:t.target.value}),children:ca.map(t=>a.jsx(d.MenuItem,{value:t,children:this.props.context.t(t)},t))})]}),a.jsxs(d.FormControl,{variant:"outlined",children:[a.jsx(d.FormControlLabel,{control:a.jsx(d.Checkbox,{checked:this.state.logOnTheFly,onChange:t=>this.setState({logOnTheFly:t.target.checked})}),label:this.props.context.t("Without restart")}),a.jsx(d.FormHelperText,{children:this.state.logOnTheFly?this.props.context.t("Will be reset to the saved log level after restart of adapter"):this.props.context.t("Log level will be saved permanently")})]})]})}renderEditMemoryLimitDialog(){return a.jsx(Mt,{theme:this.props.context.theme,title:this.props.context.t("Edit memory limit rule for %s",this.props.instance.id),onApply:t=>{this.setMemoryLimitMB(this.props.instance,parseFloat(t.toString())||0),this.setState({openDialogMemoryLimit:!1,openDialog:!1})},disableApplyIfNotChanged:!0,textInput:!0,defaultValue:this.props.item.memoryLimitMB,help:this.props.context.t("Default V8 has a memory limit of 512mb on 32-bit systems, and 1gb on 64-bit systems. The limit can be raised by setting --max-old-space-size to a maximum of ~1gb (32-bit) and ~1.7gb (64-bit)"),onClose:()=>this.setState({openDialogMemoryLimit:!1,openDialog:!1})})}renderEditHostDialog(){return a.jsx(Mt,{theme:this.props.context.theme,title:this.props.context.t("Edit host for %s",this.props.instance.id),onApply:()=>{this.setHost(this.props.instance,this.state.host),this.setState({openDialogHost:!1,openDialog:!1})},disableApply:this.state.host===this.props.instance.host,onClose:()=>this.setState({openDialogHost:!1,host:this.props.instance.host,openDialog:!1}),children:a.jsx(sr,{themeType:this.props.context.themeType,value:this.state.host,list:this.props.context.hosts,removePrefix:"system.host.",fullWidth:!0,style:this.styles.hostInfo,onChange:t=>this.setState({host:t}),lang:this.props.context.lang,t:this.props.context.t})})}renderEditCompactGroupDialog(){return a.jsx(Mt,{theme:this.props.context.theme,title:this.props.context.t("Edit compact groups for %s",this.props.instance.id),onApply:()=>{this.setCompactGroup(this.props.instance,parseInt(this.state.compactGroup.toString(),10)||0),this.setState({openDialogCompact:!1,openDialog:!1})},disableApply:this.state.compactGroup===this.props.item.compactGroup,onClose:()=>this.setState({openDialogCompact:!1,openDialog:!1,compactGroup:this.props.item.compactGroup,maxCompactGroupNumber:this.props.context.maxCompactGroupNumber}),children:a.jsxs(d.FormControl,{style:this.styles.addCompact,variant:"standard",children:[a.jsx(d.InputLabel,{children:this.props.context.t("compact groups")}),a.jsxs(d.Select,{variant:"standard",autoWidth:!0,onClose:()=>this.setState({openSelectCompactGroup:!1}),onOpen:()=>this.setState({openSelectCompactGroup:!0}),open:this.state.openSelectCompactGroup,value:(this.state.compactGroup===1?"default":(this.state.compactGroup||"").toString()==="0"?"controller":this.state.compactGroup?this.state.compactGroup:"default")||"default",onChange:t=>this.setState({compactGroup:parseInt(t.target.value,10)}),children:[a.jsx("div",{onClick:t=>{t.preventDefault(),t.stopPropagation()},style:this.styles.selectStyle,children:a.jsx(d.Button,{color:"grey",onClick:()=>this.setState({openSelectCompactGroup:!1,compactGroup:this.state.maxCompactGroupNumber+1,maxCompactGroupNumber:this.state.maxCompactGroupNumber+1}),variant:"outlined",children:this.props.context.t("Add compact group")})}),a.jsx(d.MenuItem,{value:"controller",children:this.props.context.t("with js-controller")}),a.jsx(d.MenuItem,{value:"default",children:this.props.context.t("default group")}),Array(this.state.maxCompactGroupNumber-1).fill(0).map((t,e)=>a.jsx(d.MenuItem,{value:(e+2).toString(),children:e+2},e))]})]})})}renderEditTierDialog(){return a.jsx(Mt,{theme:this.props.context.theme,title:this.props.context.t("Set tier for %s",this.props.instance.id),onApply:()=>{this.setTier(this.props.instance,this.state.tier),this.setState({openDialogTier:!1,openDialog:!1})},help:this.props.context.t("Tiers define the order of adapters when the system starts."),disableApply:this.state.tier===this.props.item.tier,onClose:()=>this.setState({openDialogTier:!1,tier:this.props.item.tier,openDialog:!1}),children:a.jsxs(d.FormControl,{style:this.styles.logLevel,variant:"standard",children:[a.jsx(d.InputLabel,{children:this.props.context.t("Tiers")}),a.jsx(d.Select,{variant:"standard",value:this.state.tier,fullWidth:!0,onChange:t=>this.setState({tier:parseInt(t.target.value,10)}),children:Re.map(t=>a.jsx(d.MenuItem,{value:t.value,children:this.props.context.t(t.desc)},t.value))})]})})}renderStopAdminDialog(){return this.state.showStopAdminDialog?a.jsx(nr,{title:this.props.context.t("Please confirm"),text:this.props.context.t("stop_admin",this.props.context.adminInstance),ok:this.props.context.t("Stop admin"),onClose:t=>{t&&this.setCommonValue(this.state.showStopAdminDialog,{enabled:!1}),this.setState({showStopAdminDialog:!1,openDialog:!1})}}):null}renderLinksDialog(){return this.state.showLinks?a.jsx(la,{image:this.props.instance.image,instanceId:this.props.instance.id,links:this.props.instance.links,onClose:()=>this.setState({showLinks:!1,openDialog:!1}),t:this.props.context.t,themeType:this.props.context.themeType}):null}renderCronDialog(){return a.jsx(ms,{title:this.props.context.t("Edit restart rule for %s",this.props.instance.id),clearButton:!0,cron:_.getRestartSchedule(this.props.instance.obj),onOk:t=>this.setRestartSchedule(this.props.instance,t),onClose:()=>this.setState({openDialogCron:!1,openDialog:!1})})}renderScheduleDialog(){return a.jsx(ms,{title:this.props.context.t("Edit schedule rule for %s",this.props.instance.id),clearButton:!0,cron:_.getSchedule(this.props.instance.obj),onOk:t=>this.setSchedule(this.props.instance,t),onClose:()=>this.setState({openDialogSchedule:!1,openDialog:!1})})}renderDialogs(){return this.state.openDialog?this.state.openDialogDelete?this.renderDeleteDialog():this.state.openDialogHost?this.renderEditHostDialog():this.state.openDialogTier?this.renderEditTierDialog():this.state.openDialogCompact?this.renderEditCompactGroupDialog():this.state.openDialogLogLevel?this.renderEditLogLevelDialog():this.state.openDialogName?this.renderEditNameDialog():this.state.showStopAdminDialog?this.renderStopAdminDialog():this.state.openDialogCron?this.renderCronDialog():this.state.openDialogSchedule?this.renderScheduleDialog():this.state.showLinks?this.renderLinksDialog():this.state.openDialogMemoryLimit?this.renderEditMemoryLimitDialog():null:null}renderModeIcon(t){return a.jsx("div",{style:{...this.styles.smallAvatar,...this.styles.statusIndicator,...this.props.instance.mode==="daemon"||this.props.instance.mode==="schedule"?this.styles[t]:this.styles.transparent,...this.props.item.connectedToHost&&this.props.item.alive&&this.props.item.connected===!1?this.styles.orangeDevice:void 0},children:this.getModeIcon(this.props.instance.mode,t,this.styles[`statusIcon_${t}`],this.props.item.stoppedWhenWebExtension)})}getModeIcon(t,e,s,r){return t==="daemon"?r?a.jsx("div",{style:{...s,...this.styles.okSymbol},children:a.jsx("div",{style:this.styles.okSymbolInner})}):e==="orange"?a.jsx(v.Warning,{style:s}):e==="green"?a.jsx("div",{style:{...s,...this.styles.okSymbol},children:a.jsx("div",{style:this.styles.okSymbolInner})}):a.jsx(v.Settings,{style:s}):t==="schedule"?a.jsx(v.Schedule,{style:s}):null}renderTooltip(){const{instance:t,item:e}=this.props;let s,r,i;if(t.mode==="schedule"&&t.schedule){try{i=rr.toString(t.schedule,{locale:this.props.context.lang})}catch{i=t.schedule}if(t.enabled)try{const o=Ft.CronExpressionParser.parse(t.schedule);s=o.next().toDate(),r=o.prev().toDate()}catch{s=null,r=null}}return[e.stoppedWhenWebExtension!==void 0?a.jsx(et,{state:!0,children:this.props.context.t("Runs as web-extension")},1):"",t.mode==="daemon"&&this.props.item.stoppedWhenWebExtension===void 0?a.jsx(et,{state:e.connectedToHost,children:this.props.context.t("Connected to host")},2):"",t.mode==="daemon"&&this.props.item.stoppedWhenWebExtension===void 0?a.jsx(et,{state:e.alive,children:this.props.context.t("Heartbeat")},3):"",this.props.item.connected!==null&&this.props.item.stoppedWhenWebExtension===void 0?a.jsx(et,{state:!!e.connected,children:typeof e.connected=="string"?`${this.props.context.t("Connected:")} ${e.connected||"-"}`:this.props.context.t("Connected to device or service")},4):"",i?a.jsxs(et,{state:t.enabled,children:["CRON:",i]},5):null,s?a.jsx(et,{state:!0,children:this.props.context.t("Next start: %s",`${s.toLocaleDateString(this.props.context.lang)} ${s.toLocaleTimeString(this.props.context.lang)}`)},6):null,r?a.jsx(et,{state:!0,children:this.props.context.t("Last start: %s",`${r.toLocaleDateString(this.props.context.lang)} ${r.toLocaleTimeString(this.props.context.lang)}`)},7):null].filter(o=>o)}renderMemoryUsage(){return this.props.item.running&&a.jsx(rt,{icon:a.jsx(v.Memory,{}),tooltip:this.props.context.t("RAM usage"),children:`${this.props.instance.mode==="daemon"&&!_.isCompact(this.props.instance.obj)?this.getMemory():"-.--"} MB`})}renderPlayPause(){return a.jsx(d.Tooltip,{title:this.props.context.t("Start/stop"),slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsx("div",{children:a.jsx(d.IconButton,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),this.props.item.running&&this.props.instance.id===this.props.context.adminInstance?this.setState({showStopAdminDialog:`system.adapter.${this.props.instance.id}`,openDialog:!0}):this.setCommonValue(`system.adapter.${this.props.instance.id}`,{enabled:!this.props.item.running})},onFocus:t=>t.stopPropagation(),sx:{...this.styles.button,...this.props.instance.canStart?this.props.item.running?this.styles.enabled:this.styles.disabled:this.styles.hide},children:this.props.item.running?a.jsx(v.Pause,{}):a.jsx(v.PlayArrow,{})})})})}renderSettingsButton(){return a.jsx(d.Tooltip,{title:this.props.instance.config?this.props.context.t("Settings"):"",slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsx("div",{children:a.jsx(d.IconButton,{disabled:!this.props.instance.config,size:"small",style:{...this.styles.button,...this.props.instance.config?void 0:this.styles.hiddenOpacity},onClick:t=>{t.stopPropagation(),t.preventDefault(),this.props.saveScrollPosition(),Ys.doNavigate("tab-instances","config",this.props.id)},children:a.jsx(v.Build,{})})})})}renderRestartButton(){return a.jsx(d.Tooltip,{title:this.props.context.t("Restart"),slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsx("div",{children:a.jsx(d.IconButton,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),this.props.context.socket.extendObject(`system.adapter.${this.props.instance.id}`,{})},onFocus:t=>t.stopPropagation(),style:{...this.styles.button,...this.props.instance.canStart?void 0:this.styles.hide},disabled:!this.props.item.running,children:a.jsx(v.Refresh,{})})})})}renderLink(){return a.jsx(d.Tooltip,{title:this.props.context.t("Instance link %s",this.props.instance.id),slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsx("div",{children:a.jsx(d.IconButton,{size:"small",style:{...this.styles.button,...!this.props.instance.links||!this.props.instance.links[0]?this.styles.hide:void 0},disabled:!this.props.item.running,onClick:t=>{if(t.stopPropagation(),t.preventDefault(),this.props.instance.links.length===1){let e=this.props.instance.links[0].link;e=e.replace(/\/\/([0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*)(:\d+)?\//i,"//$1$2/"),window.open(e,this.props.instance.id)}else this.setState({showLinks:!0,openDialog:!0})},onFocus:t=>t.stopPropagation(),children:a.jsx(v.Input,{})})})})}renderEditNameButton(){return a.jsx(d.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsx(d.IconButton,{size:"small",className:"admin-edit-button",style:{...this.styles.button,...this.state.visibleEdit?void 0:this.styles.hiddenOpacity},onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogName:!0,openDialog:!0})},children:a.jsx(v.Edit,{})})})}renderInputOutput(){return a.jsx(rt,{icon:a.jsx(v.ImportExport,{}),children:a.jsxs("div",{style:this.styles.displayFlex,children:[a.jsx(d.Tooltip,{title:this.props.context.t("input events"),slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsxs("div",{style:this.styles.marginRight5,children:["⇥",this.props.item.inputOutput.stateInput]})}),"/",a.jsx(d.Tooltip,{title:this.props.context.t("output events"),slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsxs("div",{style:this.styles.marginLeft5,children:["↦",this.props.item.inputOutput.stateOutput]})})]})})}renderHost(){return a.jsx(ir,{value:this.props.instance.host,list:this.props.context.hosts,removePrefix:"system.host.",themeType:this.props.context.themeType,lang:this.props.context.lang})}renderEditHostButton(){return a.jsx(d.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsx(d.IconButton,{size:"small",style:this.styles.button,className:"admin-edit-button",onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogHost:!0,openDialog:!0})},children:a.jsx(v.Edit,{})})})}renderSentry(){return a.jsx(d.Tooltip,{title:"sentry",slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsx(d.IconButton,{size:"small",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.toggleSentry()},children:a.jsx(d.CardMedia,{style:{...this.styles.sentry,...this.props.item.sentry?void 0:this.styles.contrast0},component:"img",image:this.props.item.sentry?pr:oa})})})}renderCompactGroupEnabled(){return a.jsx(d.Tooltip,{title:this.props.context.t("compact groups"),slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsx(d.IconButton,{size:"small",style:{...this.styles.button,...this.props.context.expertMode&&this.props.item.checkCompact?void 0:this.styles.hide},onClick:t=>{t.stopPropagation(),t.preventDefault(),this.toggleCompactMode()},children:a.jsx(v.ViewCompact,{color:this.props.item.compact?"primary":"inherit"})})})}renderVersion(){return a.jsxs(rt,{tooltip:this.props.context.t("Installed"),children:["v",this.props.instance.version]})}renderInfo(t){return a.jsxs(a.Fragment,{children:[t?void 0:a.jsx("span",{style:this.styles.instanceName,children:this.props.instance.id}),this.props.item.stoppedWhenWebExtension!==void 0&&a.jsx(et,{state:this.props.item.stoppedWhenWebExtension,children:this.props.context.t("Runs as web-extension")}),this.props.item.running&&this.props.instance.mode==="daemon"&&this.props.item.stoppedWhenWebExtension===void 0&&a.jsx(et,{state:this.props.item.connectedToHost,children:this.props.context.t("Connected to host")}),this.props.item.running&&this.props.instance.mode==="daemon"&&this.props.item.stoppedWhenWebExtension===void 0&&a.jsx(et,{state:this.props.item.alive,children:this.props.context.t("Heartbeat")}),this.props.item.running&&this.props.item.connected!==null&&this.props.item.stoppedWhenWebExtension===void 0&&a.jsx(et,{state:!!this.props.item.connected,children:typeof this.props.item.connected=="string"?`${this.props.context.t("Connected:")} ${this.props.item.connected||"-"}`:this.props.context.t("Connected to device or service")})]})}renderLogLevel(){return a.jsxs(a.Fragment,{children:[a.jsx(rt,{icon:this.props.item.loglevelIcon,tooltip:this.props.item.logLevelObject===this.props.item.logLevel?`${this.props.context.t("loglevel")} ${this.props.item.logLevel}`:`${this.props.context.t("saved:")} ${this.props.item.logLevelObject} / ${this.props.context.t("actual:")} ${this.props.item.logLevel}`,children:this.props.item.logLevelObject===this.props.item.logLevel?this.props.item.logLevel:`${this.props.item.logLevelObject} / ${this.props.item.logLevel}`}),a.jsx(d.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsx(d.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogLogLevel:!0,openDialog:!0})},children:a.jsx(v.Edit,{})})})]})}renderSchedule(){return a.jsxs(a.Fragment,{children:[a.jsx(rt,{icon:a.jsx(v.Schedule,{}),tooltip:this.props.context.t("schedule_group"),children:_.getSchedule(this.props.instance.obj)||"-"}),a.jsx(d.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsx(d.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogSchedule:!0,openDialog:!0})},children:a.jsx(v.Edit,{})})})]})}renderRestartSchedule(){return a.jsxs(a.Fragment,{children:[a.jsx(rt,{icon:a.jsx(v.Schedule,{style:this.styles.scheduleIcon}),tooltip:this.props.context.t("restart"),children:_.getRestartSchedule(this.props.instance.obj)||"-"}),a.jsx(d.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsx(d.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogCron:!0,openDialog:!0})},children:a.jsx(v.Edit,{})})})]})}renderRamLimit(){return a.jsxs(a.Fragment,{children:[a.jsx(rt,{icon:a.jsx(v.Memory,{style:this.styles.memoryIcon}),tooltip:this.props.context.t("RAM limit"),children:`${this.props.item.memoryLimitMB?this.props.item.memoryLimitMB:"-.--"} MB`}),a.jsx(d.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsx(d.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogMemoryLimit:!0,openDialog:!0})},children:a.jsx(v.Edit,{})})})]})}renderCompactGroup(){return a.jsxs(a.Fragment,{children:[a.jsx(rt,{icon:a.jsx(v.ViewCompact,{style:this.styles.marginRight5,color:"inherit"}),tooltip:this.props.context.t("compact groups"),children:(this.props.item.compactGroup===1?"default":(this.props.item.compactGroup||"").toString()==="0"?"controller":this.props.item.compactGroup?this.props.item.compactGroup:"default").toString()||"default"}),a.jsx(d.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsx(d.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogCompact:!0,openDialog:!0})},children:a.jsx(v.Edit,{})})})]})}renderTier(){var t;return a.jsxs(a.Fragment,{children:[a.jsx(rt,{icon:a.jsx(v.LowPriority,{style:this.styles.marginRight5,color:"inherit"}),tooltip:this.props.context.t("Start order (tier)"),children:this.props.instance.adapter==="admin"?this.props.context.t("Always first"):this.props.context.t(((t=Re.find(e=>e.value===this.props.item.tier))==null?void 0:t.desc)||Re[2].desc)}),this.props.instance.adapter!=="admin"?a.jsx(d.Tooltip,{title:this.props.context.t("Edit start order (tier)"),slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsx(d.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:e=>{e.stopPropagation(),e.preventDefault(),this.setState({openDialogTier:!0,openDialog:!0})},children:a.jsx(v.Edit,{})})}):null]})}renderHostWithButton(){return a.jsxs(a.Fragment,{children:[a.jsx(rt,{icon:a.jsx(v.Storage,{style:this.styles.marginRight5}),tooltip:this.props.context.t("Host for this instance"),children:this.renderHost()}),this.renderEditHostButton()]})}renderDeleteButton(){return a.jsx(d.Tooltip,{title:this.props.context.t("Delete"),slotProps:{popper:{sx:this.styles.tooltip}},children:a.jsx(d.IconButton,{size:"small",style:this.styles.button,onClick:async t=>{t.stopPropagation(),t.preventDefault();const e=await this.props.context.socket.getAdapterInstances(this.props.instance.id.split(".")[0]);this.setState({openDialogDelete:e.length||!0,openDialog:!0})},children:a.jsx(v.Delete,{})})})}render(){return a.jsx("div",{children:this.state.expanded})}}const C={...Kn,fab:{position:"absolute",bottom:-20,width:40,height:40,right:20},collapse:n=>({height:"100%",backgroundColor:n.palette.mode==="dark"?"#4a4a4a":"#d4d4d4",position:"absolute",width:"100%",zIndex:3,marginTop:"auto",bottom:0,transition:"height 0.3s",justifyContent:"space-between",display:"flex",flexDirection:"column"}),collapseOff:{height:0},close:{width:20,height:20,opacity:.9,cursor:"pointer",position:"relative",marginLeft:"auto",mb:"10px",transition:"all 0.6s ease","&:hover":{transform:"rotate(90deg)"},"&:before":{position:"absolute",left:9,content:'""',height:20,width:3,backgroundColor:"#ff4f4f",transform:"rotate(45deg)"},"&:after":{position:"absolute",left:9,content:'""',height:20,width:3,backgroundColor:"#ff4f4f",transform:"rotate(-45deg)"}},footerBlock:n=>({background:n.palette.background.default,p:"10px",display:"flex",justifyContent:"space-between"}),versionDate:{alignSelf:"center"},adapter:{width:"100%",fontWeight:"bold",fontSize:16,verticalAlign:"middle",paddingLeft:8,paddingTop:16},cardContent:{mt:2,paddingTop:0},cardContentH5:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},marginTop10:{marginTop:10},overflowAuto:{overflow:"auto"},collapseIcon:n=>({position:"sticky",right:0,top:0,background:n.palette.mode==="dark"?"#4a4a4a":"#d4d4d4",zIndex:2}),enableButton:{display:"flex",justifyContent:"space-between"},instanceName:{fontSize:16,padding:4,paddingBottom:15,fontWeight:"bold"},img:{width:45,height:45,margin:"auto 0",position:"relative","&:after":{content:'""',position:"absolute",zIndex:2,top:0,left:0,width:"100%",height:"100%",background:'url("img/no-image.svg") 100% 100% no-repeat',backgroundSize:"cover",backgroundColor:"#fff"}},instanceStateNotEnabled1:n=>({backgroundColor:"rgba(192, 192, 192, 0.2)",color:n.palette.mode==="dark"?"#CCC":"#333"}),instanceStateNotAlive1:n=>({backgroundColor:"rgba(192, 192, 192, 0.7)",color:n.palette.mode==="dark"?"#CCC":"#333"}),instanceStateAliveNotConnected1:n=>({backgroundColor:"rgba(255, 177, 0, 0.4)",color:n.palette.mode==="dark"?"#CCC":"#333"}),instanceStateAliveAndConnected1:n=>({backgroundColor:"rgba(0, 255, 0, 0.4)",color:n.palette.mode==="dark"?"#CCC":"#333"})};class ha extends _{styles=C;constructor(t){super(t),this.state=Object.assign(this.getDefaultState(t),{mouseOver:!1})}renderSecondCardInfo(){var s;if(this.props.deleting||!this.state.expanded)return null;const{item:t,instance:e}=this.props;return a.jsxs(d.Box,{component:"div",sx:pe.getStyle(this.props.context.theme,C.collapse,this.state.expanded?"":C.collapseOff,this.props.deleting&&C.deleting),children:[a.jsxs(d.CardContent,{sx:{"&.MuiCardContent-root":{...C.cardContent,...C.overflowAuto}},children:[a.jsx(d.Box,{component:"div",sx:C.collapseIcon,children:a.jsx(d.Box,{component:"div",sx:C.close,onClick:()=>{this.state.openDialog||this.setState({expanded:!1},()=>this.props.context.onToggleExpanded(this.props.id,!1))}})}),a.jsxs(d.Typography,{gutterBottom:!0,component:"span",variant:"body2",children:[this.renderInfo(),this.renderVersion(),this.renderMemoryUsage(),t.running&&this.props.context.expertMode&&a.jsx("div",{style:C.displayFlex,children:this.renderInputOutput()}),this.props.context.expertMode&&a.jsx("div",{style:C.displayFlex,children:this.renderRamLimit()}),this.props.context.expertMode&&a.jsx("div",{style:C.displayFlex,children:this.renderLogLevel()}),t.modeSchedule&&a.jsx("div",{style:C.displayFlex,children:this.renderSchedule()}),this.props.context.expertMode&&e.mode==="daemon"&&a.jsx("div",{style:C.displayFlex,children:this.renderRestartSchedule()}),this.props.context.expertMode&&t.checkCompact&&t.compact&&t.supportCompact&&a.jsx("div",{style:C.displayFlex,children:this.renderCompactGroup()}),this.props.context.expertMode&&a.jsx("div",{style:C.displayFlex,children:this.renderTier()}),this.props.context.hosts.length>1||this.props.context.hosts.length&&((s=this.props.context.hosts[0].common)==null?void 0:s.name)!==e.host?a.jsx("div",{style:C.displayFlex,children:this.renderHostWithButton()}):null,a.jsx(xt,{config:t,name:"allowInstanceSettings",children:a.jsx(d.Box,{component:"div",sx:{display:{sm:"none",xs:"inline-block"}},children:this.renderSettingsButton()})})]})]}),a.jsxs(d.Box,{component:"div",sx:C.footerBlock,children:[a.jsx(xt,{config:t,name:"allowInstanceDelete",children:a.jsx("div",{style:C.displayFlex,children:this.renderDeleteButton()})}),this.props.context.expertMode&&t.checkSentry&&a.jsx("div",{style:C.displayFlex,children:this.renderSentry()}),t.supportCompact&&this.props.context.expertMode&&t.checkCompact&&a.jsx("div",{style:C.displayFlex,children:this.renderCompactGroupEnabled()})]})]})}render(){const{item:t,instance:e}=this.props;return a.jsxs(d.Card,{sx:pe.getStyle(this.props.context.theme,C.root,this.props.hidden&&C.hidden),children:[this.state.openDialog&&this.renderDialogs(),this.renderSecondCardInfo(),a.jsxs(d.Box,{component:"div",sx:pe.getStyle(this.props.context.theme,C.imageBlock,(!t.running||e.mode!=="daemon"||t.stoppedWhenWebExtension!==void 0)&&C.instanceStateNotEnabled1,t.running&&e.mode==="daemon"&&t.stoppedWhenWebExtension===void 0&&(!t.connectedToHost||!t.alive)&&C.instanceStateNotAlive1,t.running&&t.connectedToHost&&t.alive&&t.connected===!1&&C.instanceStateAliveNotConnected1,t.running&&t.connectedToHost&&t.alive&&t.connected!==!1&&C.instanceStateAliveAndConnected1),children:[a.jsx(d.CardMedia,{sx:C.img,component:"img",image:e.image||"img/no-image.svg"}),a.jsx("div",{style:C.adapter,children:e.id}),a.jsx("div",{style:C.versionDate}),this.state.expanded?null:a.jsx(d.Fab,{onMouseOver:()=>this.setState({mouseOver:!0}),onMouseOut:()=>this.setState({mouseOver:!1}),onClick:()=>this.setState({expanded:!0},()=>this.props.context.onToggleExpanded(this.props.id,!0)),style:C.fab,color:"primary","aria-label":"add",children:a.jsx(v.MoreVert,{})})]}),a.jsxs(d.CardContent,{style:C.cardContentH5,children:[a.jsx(d.Typography,{gutterBottom:!0,variant:"h5",component:"h5",children:a.jsxs("div",{onMouseEnter:()=>this.setState({visibleEdit:!0}),onMouseLeave:()=>this.setState({visibleEdit:!1}),style:C.displayFlex,children:[ot.getText(t.name,this.props.context.lang),this.renderEditNameButton()]})}),a.jsx("div",{style:C.marginTop10,children:a.jsxs(d.Typography,{component:"span",style:C.enableButton,children:[this.renderPlayPause(),a.jsx(d.Box,{component:"div",sx:{display:{sm:"inline-block",xs:"none"}},children:this.renderSettingsButton()}),this.renderRestartButton(),a.jsx(xt,{config:t,name:"allowInstanceLink",children:this.renderLink()})]})})]})]})}}const y={...Kn,row:{pl:1,pr:2,p:0},expanded:{minHeight:64},invisible:{opacity:0},instanceIcon:{height:42,width:42,"@media screen and (max-width: 800px)":{height:28,width:28,ml:"4px"}},hidden1250:{display:"flex",width:200,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","@media screen and (max-width: 1500px)":{display:"none !important"}},visible1250:{display:"flex",width:200,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","@media screen and (max-width: 1500px)":{display:"flex !important"}},visible1050:{display:"none","@media screen and (max-width: 1120px)":{display:"flex !important"}},hidden1050:{display:"flex","@media screen and (max-width: 1120px)":{display:"none !important"}},hidden800:{display:"flex","@media screen and (max-width: 800px)":{display:"none !important"}},visible800:{display:"none","@media screen and (max-width: 800px)":{display:"flex !important"}},hidden570:{display:"flex","@media screen and (max-width: 650px)":{display:"none !important"}},visible570:{display:"none","@media screen and (max-width: 650px)":{display:"flex !important"}},hidden1230:{"@media screen and (max-width: 1300px)":{display:"none !important"}},hidden380:{display:"flex","@media screen and (max-width: 380px)":{display:"none !important"}},instanceId:{overflow:"hidden",alignSelf:"center",fontSize:16,ml:"5px",maxWidth:150,minWidth:100,whiteSpace:"nowrap",textOverflow:"ellipsis",flexGrow:2,"@media screen and (max-width: 380px)":{width:"70px !important",minWidth:"70px !important"},"@media screen and (max-width: 480px)":{width:100}},secondaryHeading:{maxWidth:200,fontSize:12},secondaryHeadingDiv:{display:"flex",alignItems:"center",width:200},secondaryHeadingDivDiv:{whiteSpace:"nowrap",overflow:"hidden",padding:5,textOverflow:"ellipsis",maxWidth:200},gridStyle:{display:"flex",minWidth:270,lineHeight:"34px",justifyContent:"space-around",alignItems:"center","@media screen and (max-width: 480px)":{minWidth:"auto !important",ml:"10px"},"@media screen and (max-width: 335px)":{ml:"0px"}},paddingRight200:{},maxWidth300:{width:300,"@media screen and (max-width: 480px)":{width:"250px !important"}},width150:{width:150},desktopRow:{minHeight:0},desktopIcon:{height:32,width:32,mt:1},desktopRowContent:{mt:"2px",mb:"2px"},desktopButton:{},rowGridLine:{marginTop:-2}};class pa extends _{desktop=window.innerWidth>1e3;styles=y;constructor(t){super(t),this.state=this.getDefaultState(t)}renderDetails(){var s;const{instance:t,item:e}=this.props;return a.jsx(d.AccordionDetails,{children:a.jsxs(d.Grid2,{container:!0,direction:"row",children:[a.jsxs(d.Grid2,{container:!0,direction:"row",size:{xs:10},children:[a.jsx(d.Grid2,{container:!0,direction:"column",size:{xs:12,sm:6,md:4},children:this.renderInfo(!0)}),a.jsx(d.Grid2,{container:!0,direction:"column",size:{xs:12,sm:6,md:4},children:this.renderVersion()}),a.jsxs(d.Grid2,{container:!0,direction:"column",size:{xs:12,sm:6,md:4},style:y.paddingRight200,children:[this.props.context.expertMode&&a.jsx(d.Box,{component:"div",sx:{...y.displayFlex,...y.maxWidth300,...y.editButton},children:this.renderLogLevel()}),e.running&&this.props.context.expertMode&&a.jsx(d.Box,{component:"div",sx:y.visible1250,children:this.renderInputOutput()}),a.jsx(d.Grid2,{sx:y.visible1050,children:this.renderMemoryUsage()}),e.modeSchedule&&a.jsx(d.Box,{component:"div",sx:{...y.displayFlex,...y.maxWidth300,...y.editButton},children:this.renderSchedule()}),this.props.context.expertMode&&t.mode==="daemon"&&a.jsx(d.Box,{component:"div",sx:{...y.displayFlex,...y.maxWidth300,...y.editButton},children:this.renderRestartSchedule()}),this.props.context.expertMode&&a.jsx(d.Box,{component:"div",sx:{...y.displayFlex,...y.maxWidth300,...y.editButton},children:this.renderRamLimit()}),this.props.context.expertMode&&e.checkCompact&&e.compact&&e.supportCompact&&a.jsx(d.Box,{component:"div",sx:{...y.displayFlex,...y.maxWidth300,...y.editButton},children:this.renderCompactGroup()}),this.props.context.expertMode&&a.jsx(d.Box,{component:"div",sx:{...y.displayFlex,...y.maxWidth300,...y.editButton},children:this.renderTier()}),a.jsxs(d.Box,{component:"div",sx:{...y.maxWidth300,...y.visible800,...y.editButton},children:[a.jsx(rt,{children:ot.getText(e.name,this.props.context.lang)}),this.renderEditNameButton()]}),this.props.context.hosts.length>1||this.props.context.hosts.length&&((s=this.props.context.hosts[0].common)==null?void 0:s.name)!==t.host?a.jsx(d.Box,{component:"div",sx:{...y.displayFlex,...y.maxWidth300,...y.editButton},children:this.renderHostWithButton()}):null]})]}),a.jsxs("div",{style:y.displayFlex,children:[a.jsx(xt,{config:e,name:"allowInstanceDelete",children:a.jsx(d.Box,{component:"div",sx:{display:{xs:"inline-block",md:"none"}},children:this.renderSettingsButton()})}),a.jsx(d.Box,{component:"div",sx:{display:{md:"none",xs:"inline-block"}},children:this.renderRestartButton()}),a.jsx(xt,{config:e,name:"allowInstanceLink",children:a.jsx(d.Box,{component:"div",sx:{display:{md:"none",xs:"inline-block"}},children:this.renderLink()})}),a.jsx(xt,{config:e,name:"allowInstanceDelete",children:this.renderDeleteButton()}),a.jsx(d.Box,{component:"div",sx:y.visible570,children:this.renderSentry()}),a.jsx(d.Box,{component:"div",sx:y.visible570,children:this.renderCompactGroupEnabled()})]})]})})}render(){var o;const{instance:t,item:e}=this.props,s=this.props.context.getInstanceStatus(t.obj),r=this.renderTooltip(),i={...y.row,...(!e.running||t.mode!=="daemon"||e.stoppedWhenWebExtension!==void 0)&&(this.props.idx%2===0?y.instanceStateNotEnabled1:y.instanceStateNotEnabled2),...e.running&&t.mode==="daemon"&&e.stoppedWhenWebExtension===void 0&&(!e.connectedToHost||!e.alive)?this.props.idx%2===0?y.instanceStateNotAlive1:y.instanceStateNotAlive2:void 0,...e.running&&e.connectedToHost&&e.alive&&e.connected===!1?this.props.idx%2===0?y.instanceStateAliveNotConnected1:y.instanceStateAliveNotConnected2:void 0,...e.running&&e.connectedToHost&&e.alive&&e.connected!==!1?this.props.idx%2===0?y.instanceStateAliveAndConnected1:y.instanceStateAliveAndConnected2:void 0,...this.desktop?y.desktopRow:void 0,...this.state.expanded&&!this.props.deleting?y.expanded:void 0};return a.jsxs(d.Accordion,{square:!0,sx:{"&.MuiAccordion-root":{...this.props.deleting?y.deleting:void 0,...this.props.hidden?y.hidden:void 0}},expanded:this.state.expanded&&!this.props.deleting,onChange:()=>{this.state.openDialog||this.setState({expanded:!this.state.expanded},()=>this.props.context.onToggleExpanded(this.props.id,this.state.expanded))},children:[a.jsxs(d.AccordionSummary,{sx:{"&.MuiAccordionSummary-root":i,"& .MuiAccordionSummary-content":this.desktop?y.desktopRowContent:void 0},expandIcon:a.jsx(v.ExpandMore,{style:this.desktop?y.desktopButton:void 0}),children:[this.renderDialogs(),a.jsxs(d.Grid2,{container:!0,spacing:1,alignItems:"center",direction:"row",wrap:"nowrap",style:y.rowGridLine,children:[a.jsxs(d.Box,{component:"div",style:y.gridStyle,children:[r.length?a.jsx(d.Tooltip,{slotProps:{popper:{sx:y.tooltip}},title:a.jsx("span",{style:{display:"flex",flexDirection:"column"},children:r}),children:this.renderModeIcon(s)}):this.renderModeIcon(s),a.jsx(d.Avatar,{variant:"square",alt:t.id,src:t.image,sx:{...y.instanceIcon,...this.desktop?y.desktopIcon:void 0}}),a.jsx(d.Box,{component:"div",sx:y.instanceId,children:t.id})]}),this.renderPlayPause(),a.jsx(xt,{config:e,name:"allowInstanceSettings",children:a.jsx(d.Box,{component:"div",sx:{display:{md:"inline-block",xs:"none"}},children:this.renderSettingsButton()})}),a.jsx(d.Box,{component:"div",sx:{display:{md:"inline-block",xs:"none"}},children:this.renderRestartButton()}),a.jsx(xt,{config:e,name:"allowInstanceLink",children:a.jsx(d.Box,{component:"div",sx:{display:{md:"inline-block",xs:"none"}},children:this.renderLink()})}),a.jsx(d.Typography,{sx:{...y.secondaryHeading,...y.hidden800},component:"div",children:a.jsxs("div",{onMouseEnter:()=>this.setState({visibleEdit:!0}),onMouseLeave:()=>this.setState({visibleEdit:!1}),style:y.secondaryHeadingDiv,children:[a.jsx("div",{style:y.secondaryHeadingDivDiv,children:ot.getText(e.name,this.props.context.lang)}),this.renderEditNameButton()]})}),this.props.context.expertMode&&a.jsx(d.Box,{component:"div",sx:{...y.hidden1250,...t.mode!=="daemon"||!e.running?y.invisible:void 0},children:this.renderInputOutput()}),this.props.context.expertMode&&a.jsx(d.Tooltip,{title:e.logLevelObject===e.logLevel?`${this.props.context.t("loglevel")} ${e.logLevel}`:`${this.props.context.t("saved:")} ${e.logLevelObject} / ${this.props.context.t("actual:")} ${e.logLevel}`,slotProps:{popper:{sx:y.tooltip}},children:a.jsx(d.Avatar,{sx:{...y.smallAvatar,...y.hidden380,...y[e.logLevel]},children:e.loglevelIcon})}),a.jsx(d.Grid2,{sx:{...y.hidden1050,...y.width150,...t.mode!=="daemon"||!e.running?y.invisible:void 0},children:this.renderMemoryUsage()}),this.props.context.hosts.length>1||this.props.context.hosts.length&&((o=this.props.context.hosts[0].common)==null?void 0:o.name)!==t.host?a.jsx(d.Grid2,{sx:y.hidden1230,children:this.renderHost()}):null]}),a.jsx(d.Box,{component:"div",sx:y.hidden570,children:this.renderSentry()}),a.jsx(d.Box,{component:"div",sx:y.hidden570,children:this.renderCompactGroupEnabled()})]}),this.state.expanded?this.renderDetails():null,this.renderDialogs()]})}}const fa="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='%23FB2D26'%3e%3cg%3e%3cpath%20d='M0,0h24%20M24,24H0'%20fill='currentColor'/%3e%3cpath%20d='M4.25,5.61C6.27,8.2,10,13,10,13v6c0,0.55,0.45,1,1,1h2c0.55,0,1-0.45,1-1v-6c0,0,3.72-4.8,5.74-7.39%20C20.25,4.95,19.78,4,18.95,4H5.04C4.21,4,3.74,4.95,4.25,5.61z'/%3e%3cpath%20d='M0,0h24v24H0V0z'%20fill='none'/%3e%3c/g%3e%3c/svg%3e",H={root:{width:"100%",padding:10},paper:{width:"100%",maxHeight:800},overflowHidden:{display:"flex",overflow:"hidden"},pre:{overflow:"auto",whiteSpace:"pre-wrap",margin:0},rowBlock:{display:"flex",width:"100%",justifyContent:"space-between",margin:"10px 0"},select:{minWidth:200},checkbox:{minWidth:160},statusIcon_1:{border:"2px solid grey",borderRadius:20,color:"grey"},statusIcon_2:{border:"2px solid grey",borderRadius:20,color:"#d32f2f"},statusIcon_3:{border:0,borderRadius:0,color:"#ffa726"},statusIcon_4:{border:"2px solid grey",borderRadius:20,color:"#0055a9"},statusIcon_5:{border:"2px solid grey",borderRadius:20},statusIcon_6:{border:"2px solid grey",borderRadius:20},menuWrapper:{display:"flex",alignItems:"center"},iconWrapper:{marginRight:10},textWrapper:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},square:{width:24,height:24,marginRight:10,filter:"invert(0%) sepia(90%) saturate(300%) hue-rotate(-537deg) brightness(99%) contrast(97%)"},statusIcon_green:{border:"2px solid grey",borderRadius:2},statusIcon_red:{border:"2px solid grey",borderRadius:20},statusIcon_orange:{border:0,borderRadius:0},statusIcon_orangeDevice:{border:0,borderRadius:0},statusIcon_blue:{border:"2px solid grey",borderRadius:20},statusIcon_gray:{border:"2px solid grey",borderRadius:20},statusIcon_grey:{border:"2px solid grey",borderRadius:20},green:{color:he[700]},red:{color:Zt[700]},grey:{color:Be[700]},blue:{color:"#0055a9"},orange:{color:ye[400]},orangeDevice:{color:ye[300]},icon:{width:18,height:18,marginRight:8,display:"inline-block"},menuValue:{whiteSpace:"nowrap"}},ma=["none","daemon","schedule","once"],ga=(n,t)=>n===1?a.jsx(v.Lens,{style:t}):n===2?a.jsx(v.Lens,{style:t}):n===3?a.jsx(v.Warning,{style:t}):n===4?a.jsx(v.Schedule,{style:t}):n===5?a.jsx("div",{style:{...t,width:20,height:20,margin:2,borderRadius:2},children:a.jsx("div",{style:{width:"calc(100% - 2px)",height:"calc(100% - 2px)",borderRadius:2,margin:1,backgroundColor:"#66bb6a"}})}):null,Pe={none:{text:"none",_class:"",status:""},disabled:{text:"disabled",_class:"statusIcon_grey",status:"grey"},not_alive:{text:"enabled, but not alive",_class:"statusIcon_red",status:"red"},alive_not_connected:{text:"enabled, alive, but not connected to controller",_class:"statusIcon_orange",status:"orange"},alive_no_device:{text:"enabled, alive, but not connected to device or service",_class:"statusIcon_orangeDevice",status:"orange"},ok:{text:"enabled and OK",_class:"statusIcon_green",status:"green"}},ya=({onClose:n,filterMode:t,filterStatus:e})=>{const[s,r]=Tt.useState(t),[i,o]=Tt.useState(e);return a.jsxs(d.Dialog,{onClose:()=>n(),open:!0,sx:{"& .MuiDialog-paper":H.paper},children:[a.jsx(d.DialogTitle,{style:{display:"flex"},children:a.jsxs("div",{style:{display:"flex"},children:[a.jsx(d.Avatar,{variant:"square",style:H.square,src:fa}),ht.t("Filter instances")]})}),a.jsx(d.DialogContent,{style:H.overflowHidden,dividers:!0,children:a.jsxs(d.Card,{style:H.root,children:[a.jsxs("div",{style:H.rowBlock,children:[a.jsx(d.FormControlLabel,{style:H.checkbox,control:a.jsx(d.Checkbox,{checked:!!s,onChange:l=>l.target.checked?r("daemon"):r(null)}),label:ht.t("Filter by mode")}),a.jsx(d.Select,{disabled:!s,variant:"standard",value:s||"none",style:H.select,onChange:l=>{l.target.value==="none"?r(null):r(l.target.value)},children:ma.map(l=>a.jsx(d.MenuItem,{value:l,children:ht.t(l)},l))})]}),a.jsxs("div",{style:H.rowBlock,children:[a.jsx(d.FormControlLabel,{style:H.checkbox,control:a.jsx(d.Checkbox,{checked:!!i,onChange:l=>l.target.checked?o("ok"):o(null)}),label:ht.t("Filter by status")}),a.jsx(d.Select,{disabled:!i,variant:"standard",value:i||"none",style:H.select,onChange:l=>{l.target.value==="none"?o(null):o(l.target.value)},children:Object.keys(Pe).map((l,c)=>a.jsx(d.MenuItem,{value:l,children:a.jsxs("div",{style:H.menuWrapper,children:[Pe[l].status?a.jsx("div",{style:H.iconWrapper,children:ga(c,H[`statusIcon_${c}`])}):null,a.jsx("div",{style:H.textWrapper,children:ht.t(Pe[l].text)})]})},l))})]})]})}),a.jsxs(d.DialogActions,{children:[a.jsx(d.Button,{variant:"contained",autoFocus:!0,disabled:s===t&&e===i,onClick:()=>{n({filterMode:s,filterStatus:i})},color:"primary",startIcon:a.jsx(v.Check,{}),children:ht.t("Apply")}),a.jsx(d.Button,{color:"grey",variant:"contained",onClick:()=>n(),startIcon:a.jsx(v.Close,{}),children:ht.t("Close")})]})]})},Nt={row:{paddingLeft:8,flexDirection:"row-reverse",minHeight:"48px !important",height:48,fontWeight:"bold",fontSize:16},iconStyle:{marginRight:10},wrapperName:{margin:"0 10px",display:"flex",alignItems:"center"},wrapperChildren:{width:"100%"},accordionDetails:{padding:0},accordion:{margin:"1px 0 !important"}};function xa({name:n,key:t,children:e,expanded:s,onExpand:r}){return a.jsxs(d.Accordion,{expanded:!!s,onChange:()=>r(!s),style:Nt.accordion,square:!0,children:[a.jsx(d.AccordionSummary,{style:Nt.row,expandIcon:a.jsx(v.ExpandMore,{}),children:a.jsxs("div",{style:Nt.wrapperName,children:[a.jsx(fr,{iconName:n,style:Nt.iconStyle}),n]})}),a.jsx(d.AccordionDetails,{style:Nt.accordionDetails,children:a.jsx("div",{style:Nt.wrapperChildren,children:e})})]},t)}const V={paper:{height:"100%"},iframe:{height:"100%",width:"100%",color:"#000",borderRadius:4,boxShadow:"0px 2px 1px -1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%), 0px 1px 3px 0px rgb(0 0 0 / 12%)",border:"0px solid #888"},cards:{display:"flex",flexFlow:"wrap",justifyContent:"center"},filterActive:n=>({color:n.palette.primary.main}),tooltip:{pointerEvents:"none"},grow:{flexGrow:1}};class yt extends Tt.Component{static lastScrollPosition=0;localStorage;statePromise=null;states;adapters;statesUpdateTimer=null;typingTimer=null;hostsTimer=null;wordCache;t;inputRef;refTabContent;subscribed=!1;_cacheList=null;shouldUpdateAfterDialogClosed=!1;expanded="";closeCommands={};constructor(t){super(t),this.localStorage=window._localStorage||window.localStorage;let e=[];if(this.localStorage.getItem("Instances.expandedFolder"))try{e=JSON.parse(this.localStorage.getItem("Instances.expandedFolder"))}catch{}this.state={expertMode:this.props.expertMode,dialog:null,instances:null,dialogProp:null,playArrow:0,onlyCurrentHost:!1,viewMode:!1,viewCategory:!1,hostInfo:null,processes:null,mem:null,percent:null,memFree:null,filterText:this.localStorage.getItem("instances.filter")||"",compact:!1,maxCompactGroupNumber:1,filterCompactGroup:"All",deleting:null,deleteCustomSupported:!1,currentHost:this.props.currentHost,showFilterDialog:!1,expandedFolder:e,filterMode:this.localStorage.getItem("Instances.filterMode")?this.localStorage.getItem("Instances.filterMode")==="null"?null:this.localStorage.getItem("Instances.filterMode"):null,filterStatus:this.localStorage.getItem("Instances.filterStatus")?this.localStorage.getItem("Instances.filterStatus")==="null"?null:this.localStorage.getItem("Instances.filterStatus"):null},this.states={},this.adapters=[],this.statesUpdateTimer=null,this.wordCache={},this.t=this.translate,this.inputRef=Tt.createRef(),this.refTabContent=Tt.createRef()}translate=(t,e,s)=>e!==void 0?this.props.t(t,e,s):(this.wordCache[t]||(this.wordCache[t]=this.props.t(t)),this.wordCache[t]);async componentDidMount(){this.props.instancesWorker.registerHandler(this.getInstances),await this.updateData();const t=await this.props.socket.checkFeatureSupported("DEL_INSTANCE_CUSTOM");t&&this.setState({deleteCustomSupported:t})}async updateData(){await this.getParamsLocalAndPanel(),await this.getData(),await this.getHostsData(),await this.getInstances()}componentWillUnmount(){this.subscribeStates(!0),this.props.instancesWorker.unregisterHandler(this.getInstances)}getStates(t){return t&&(this.statePromise=null),this.statePromise instanceof Promise||(this.statePromise=this.props.socket.getForeignStates("system.adapter.*")),this.statePromise}static getDerivedStateFromProps(t,e){const s=Ys.getLocation(),r={dialog:s.dialog,dialogProp:s.id};return t.expertMode!==e.expertMode&&(r.expertMode=t.expertMode),r}getInstances=async()=>{const t=Date.now();let e=[];const s=await this.props.instancesWorker.getObjects();if(!s){window.alert("Cannot read instances!");return}e=Object.values(s);let r=`${this.state.currentHost}.memRss`;this.states[r]=this.states[r]||await this.props.socket.getState(r);const i=this.states[r];let o=1,l=i&&parseFloat(i.val)||0;const c={};this.props.hosts.forEach(m=>c[m._id]=m);for(let m=0;m<e.length;m++){const p=e[m];if(!(!p||!p.common||p.common.host!==this.props.currentHostName)&&p.common.enabled&&p.common.mode==="daemon"&&!_.isCompact(p)){r=`${p._id}.memRss`,this.states[r]=this.states[r]||await this.props.socket.getState(r);const x=this.states[r];l+=x&&parseFloat(x.val)||0,o++}}const h={};e.sort((m,p)=>{const x=m._id.split("."),T=p._id.split("."),O=parseInt(x[x.length-1],10),N=parseInt(T[T.length-1],10),j=x[x.length-2],Q=T[T.length-2];return j===Q?O>N?1:O<N?-1:0:j>Q?1:j<Q?-1:0});let f=1;const u={};for(let m=0;m<e.length;m++){const p=e[m],x=p.common||null,T=parseInt(p._id.split(".").pop(),10);x.compactGroup&&typeof x.compactGroup=="number"&&f<x.compactGroup&&(f=x.compactGroup);const O={id:p._id.replace("system.adapter.",""),obj:p,compact:!!x.compact,host:x.host,name:this.getName(p),image:x.icon?`adapter/${x.name}/${x.icon}`:"img/no-image.svg",enabled:x.enabled,canStart:!x.onlyWWW,config:x.adminUI.config!=="none",jsonConfig:x.adminUI.config==="json",materialize:x.adminUI.config==="materialize",compactMode:x.runAsCompactMode||!1,mode:x.mode||null,schedule:x.schedule===void 0||x.schedule===null?null:x.schedule,loglevel:x.loglevel||null,adapter:x.name||null,version:x.version||null,stoppedWhenWebExtension:p.common.mode==="daemon"&&p.common.webExtension!==void 0?!!p.common.webExtension:void 0,links:[]},N=x.localLinks||x.localLink||"";let j=null;N&&typeof N=="string"?j={_default:N}:N&&typeof N=="object"&&(j=N);const Q=j?Object.keys(j):[];if(Q.forEach(K=>{O.links=O.links||[];let tt;typeof j[K]=="string"?tt={link:j[K]}:tt=j[K];const pt=ar(tt.link,x.name,T,{instances:s,hostname:this.props.hostname,hosts:c,adminInstance:this.props.adminInstance})||[];let A=tt.name||K;A==="_default"?A=Q.length===1?"":this.t("default"):typeof A=="object"?A=ot.getText(A,this.props.lang):A=this.t(A),pt.length===1?O.links.push({name:A,link:pt[0].url,port:pt[0].port,color:tt.color}):pt.length>1&&pt.forEach(Ct=>{O.links.push({name:A,link:Ct.url,port:Ct.port,color:tt.color})})}),O.stoppedWhenWebExtension){const K=this.states[`${O.id}.info.extension`]||await this.props.socket.getState(`${O.id}.info.extension`);O.stoppedWhenWebExtension=K?!!K.val:void 0}console.log(p._id),h[p._id]=O}console.log(`getInstances: ${Date.now()-t}`);for(let m=1;m<=f;m++){const p=`${this.state.currentHost}.compactgroup${m}.memRss`;this.states[p]=this.states[p]||await this.props.socket.getState(p);const x=this.states[p];x&&(l+=x&&parseFloat(x.val)||0,o++)}this.state.deleting&&!h[`system.adapter.${this.state.deleting}`]&&(u.deleting=null),u.maxCompactGroupNumber=f,u.processes=o,u.mem=Math.round(l),u.instances=h,this._cacheList=null,this.setState(u)};getParamsLocalAndPanel=async()=>{var l,c;let t=!1;try{t=!!((c=(l=(await this.props.socket.readBaseSettings(this.state.currentHost)).config)==null?void 0:l.system)!=null&&c.compact)}catch(h){window.alert(`Cannot read compact mode by host "${this.state.currentHost}": ${h}`)}let e=0,s="All";try{e=JSON.parse(this.localStorage.getItem("Instances.playArrow")),e.toString()==="true"?e=1:e.toString()==="false"&&(e=0),s=JSON.parse(this.localStorage.getItem("Instances.filterCompactGroup"))}catch{}const r=this.localStorage.getItem("Instances.onlyCurrentHost")==="true",i=this.localStorage.getItem("Instances.viewMode")==="true",o=this.localStorage.getItem("Instances.viewCategory")==="true";!s&&s!==0&&(s="All"),this._cacheList=null,this.setState({filterCompactGroup:s,compact:t,onlyCurrentHost:r,playArrow:e,viewMode:i,viewCategory:o})};async getData(t){try{const e=this.props.socket.getAdapters(t),s=this.getStates(),[r,i]=await Promise.all([s,e]);this.adapters=i||[],this.states=r||{}}catch(e){console.log(e)}this.states&&(this.subscribed||(this.subscribed=!0,this.subscribeStates()))}onStateChange=(t,e)=>{const s=this.states[t];this.states[t]=e,(!s&&e||s&&!e||s&&e&&s.val!==e.val)&&(this.state.dialog==="config"&&this.state.dialogProp?(this.statesUpdateTimer&&(clearTimeout(this.statesUpdateTimer),this.statesUpdateTimer=null),this.shouldUpdateAfterDialogClosed=!0):this.statesUpdateTimer||(this.statesUpdateTimer=setTimeout(()=>{this.statesUpdateTimer=null,this._cacheList=null,this.forceUpdate()},1e3)))};subscribeStates(t){const e=t?this.props.socket.unsubscribeState:this.props.socket.subscribeState;e.call(this.props.socket,"system.adapter.*.alive",this.onStateChange),e.call(this.props.socket,"system.adapter.*.connected",this.onStateChange),e.call(this.props.socket,"system.adapter.*.inputCount",this.onStateChange),e.call(this.props.socket,"system.adapter.*.memRss",this.onStateChange),e.call(this.props.socket,"system.adapter.*.outputCount",this.onStateChange),e.call(this.props.socket,"system.adapter.*.logLevel",this.onStateChange),e.call(this.props.socket,"system.adapter.*.plugins.sentry.enabled",this.onStateChange),e.call(this.props.socket,"system.host.*.diskFree",this.onStateChange),e.call(this.props.socket,"system.host.*.diskSize",this.onStateChange),e.call(this.props.socket,"system.host.*.diskWarning",this.onStateChange),e.call(this.props.socket,"system.host.*.freemem",this.onStateChange),e.call(this.props.socket,"*.info.connection",this.onStateChange),e.call(this.props.socket,"*.info.extension",this.onStateChange)}getInstanceStatus=t=>{const e=t?t.common:null,s=(e==null?void 0:e.mode)||"";let r=s==="daemon"?"green":"blue";if(e!=null&&e.enabled&&(!e.webExtension||!t.native.webInstance||s==="daemon")){const i=this.states[`${t._id}.alive`],o=this.states[`${t._id}.connected`],l=this.states[`${t._id.replace("system.adapter.","")}.info.connection`];if(e.webExtension&&t.native.webInstance){const c=this.states[`${t._id.replace("system.adapter.","")}.info.extension`];if(c)return c.val?"green":"red"}(!(o!=null&&o.val)||!(i!=null&&i.val))&&(r=s==="daemon"?"red":"orangeDevice"),l&&!(l!=null&&l.val)&&r!=="red"&&(r="orange")}else r=s==="daemon"?"grey":"blue";return r};isCompactGroupCheck(t){var s;const e=this.adapters.find(({_id:r})=>r===`system.adapter.${t}`);return((s=e==null?void 0:e.common)==null?void 0:s.compact)||!1}getName(t){return t!=null&&t.common?t.common.titleLang?ot.getText(t.common.titleLang,this.props.lang):ot.getText(t.common.title,this.props.lang):""}getInputOutput(t){const e=this.states[`${t}.inputCount`],s=this.states[`${t}.outputCount`];return{stateInput:e!=null&&e.val?e.val:0,stateOutput:s!=null&&s.val?s.val:0}}isAlive(t){const e=this.states[`${t}.alive`];return!!(e!=null&&e.val)}isConnectedToHost(t){const e=this.states[`${t}.connected`];return!!(e!=null&&e.val)&&this.isAlive(t)}getConnected(t){const e=this.state.instances[t];return this.states[`${e.id}.info.connection`]?this.isAlive(t)&&this.states[`${e.id}.info.connection`].val:null}static getStatusFilter(t){switch(t){case"not_alive":return"red";case"alive_no_device":return"orangeDevice";case"alive_not_connected":return"orange";case"ok":return"green";case"disabled":default:return"grey"}}static getLogLevelIcon(t){return t==="debug"?a.jsx(v.BugReport,{}):t==="info"?a.jsx(v.Info,{}):t==="warn"?a.jsx(v.Warning,{}):t==="error"?a.jsx(v.Error,{}):null}onDeleteInstance=(t,e,s)=>{this.setState({deleting:t.id},()=>this.props.executeCommand(`del ${s?t.id.split(".")[0]:t.id}${e?" --custom":""}${this.props.expertMode?" --debug":""}`))};isSentry(t){var e;return!!((e=this.states[`${t}.plugins.sentry.enabled`])!=null&&e.val)}cacheInstances(){const t=this.state.currentHost.replace(/^system.host./,"");if(this._cacheList=Object.keys(this.state.instances).map(e=>{var A,Ct,ft;const s=this.state.instances[e],r=_.isRunning(s.obj),i=_.isCompactGroup(s.obj),o=this.isCompactGroupCheck(s.adapter)&&this.state.compact,l=_.isCompact(s.obj),c=s.compact||!1,h=this.isAlive(e),f=this.isConnectedToHost(e),u=this.getConnected(e),m=this.getName(s.obj),p=((A=this.states[`${e}.logLevel`])==null?void 0:A.val)||s.loglevel,x=s.loglevel,T=((ft=(Ct=s==null?void 0:s.obj)==null?void 0:Ct.common)==null?void 0:ft.tier)||3,O=yt.getLogLevelIcon(p),N=this.getInputOutput(e),j=_.isModeSchedule(s.obj),Q=_.getMemoryLimitMB(s.obj),K=_.getSentrySettings(s.obj),tt=this.isSentry(e);return{id:e,running:r,host:s.host,nameId:s.id,compactGroup:i,checkCompact:o,mode:s.mode,sentry:tt,category:s.obj.common.type||"other",status:this.getInstanceStatus(s.obj),alive:h,compact:l,supportCompact:c,connectedToHost:f,connected:u,name:m,logLevel:p,logLevelObject:x,tier:T,loglevelIcon:O,inputOutput:N,modeSchedule:j,checkSentry:K,memoryLimitMB:Q,stoppedWhenWebExtension:s.stoppedWhenWebExtension,allowInstanceSettings:this.props.repository[s.adapter]?this.props.repository[s.adapter].allowInstanceSettings:!0,allowInstanceDelete:this.props.repository[s.adapter]?this.props.repository[s.adapter].allowInstanceDelete:!0,allowInstanceLink:this.props.repository[s.adapter]?this.props.repository[s.adapter].allowInstanceLink:!0}}),this.state.playArrow&&(this._cacheList=this._cacheList.filter(({running:e})=>this.state.playArrow===1?e:!e)),this.state.onlyCurrentHost&&(this._cacheList=this._cacheList.filter(({host:e})=>e===t)),this.state.filterText){const e=this.state.filterText.toLowerCase();this._cacheList=this._cacheList.filter(({name:s,nameId:r})=>s.toLowerCase().includes(e)||r.toLowerCase().includes(e))}if(this.props.expertMode&&(this.state.filterCompactGroup||this.state.filterCompactGroup===0)&&this.state.compact&&(this._cacheList=this._cacheList.filter(({compactGroup:e})=>e===this.state.filterCompactGroup||this.state.filterCompactGroup==="All"||this.state.filterCompactGroup==="default"&&(e===null||e===1)||this.state.filterCompactGroup==="controller"&&e==="0")),this.state.filterMode&&(this._cacheList=this._cacheList.filter(e=>e.mode===this.state.filterMode)),this.state.filterStatus){const e=yt.getStatusFilter(this.state.filterStatus);this._cacheList=this._cacheList.filter(s=>e===s.status)}return this._cacheList}clearAllFilters(){const t={playArrow:0,onlyCurrentHost:!1,filterCompactGroup:"All",filterMode:null,filterStatus:null,filterText:""};this.localStorage.removeItem("instances.filter"),this.localStorage.removeItem("Instances.playArrow"),this.localStorage.removeItem("Instances.onlyCurrentHost"),this.localStorage.removeItem("Instances.filterCompactGroup"),this.localStorage.removeItem("Instances.filterMode"),this.localStorage.removeItem("Instances.filterStatus"),this._cacheList=null,this.setState(t,()=>{this.inputRef.current&&(this.inputRef.current.value=""),this.cacheInstances()})}onMaxCompactGroupNumber=t=>this.setState({maxCompactGroupNumber:t});onRegisterClose=(t,e)=>{this.closeCommands[t]=e};saveScrollPosition=()=>{var t,e;yt.lastScrollPosition=(e=(t=this.refTabContent.current)==null?void 0:t.parentNode)==null?void 0:e.scrollTop};getPanels(){this._cacheList||this.cacheInstances();const t={adminInstance:this.props.adminInstance,onDeleteInstance:this.onDeleteInstance,expertMode:this.props.expertMode,hosts:this.props.hosts,socket:this.props.socket,t:this.t,lang:this.props.lang,themeType:this.props.themeType,setMaxCompactGroupNumber:this.onMaxCompactGroupNumber,maxCompactGroupNumber:this.state.maxCompactGroupNumber,deleteCustomSupported:this.state.deleteCustomSupported,states:this.states,onToggleExpanded:this.onToggleExpanded,getInstanceStatus:this.getInstanceStatus,theme:this.props.theme,onRegisterClose:this.onRegisterClose},e=this._cacheList.map((s,r)=>{const i=s.id,o=this.state.instances[i];return this.state.viewMode?{category:s.category,render:a.jsx(ha,{saveScrollPosition:this.saveScrollPosition,deleting:this.state.deleting===o.id,id:i,idx:r,instance:o,item:s,context:t},o.id)}:{category:s.category,render:a.jsx(pa,{saveScrollPosition:this.saveScrollPosition,deleting:this.state.deleting===o.id,id:i,idx:r,instance:o,item:s,context:t},o.id)}});if(!e.length)return a.jsx("div",{title:this.t("Click to clear all filters"),onClick:()=>this.clearAllFilters(),style:{margin:20,fontSize:26,textAlign:"center",cursor:"pointer"},children:this.t("all items are filtered out")});if(!this.state.viewMode&&this.state.viewCategory){const s=[];return e.forEach(({category:r})=>!s.includes(r)&&s.push(r)),s.sort((r,i)=>r==="general"&&i!=="general"?-1:r!=="general"&&i==="general"||r>i?1:r<i?-1:0),s.map(r=>a.jsx(xa,{name:r,expanded:this.state.expandedFolder.includes(r),onExpand:i=>{const o=[...this.state.expandedFolder],l=o.indexOf(r);i?l===-1&&(o.push(r),o.sort()):l!==-1&&o.splice(l,1),this.localStorage.setItem("Instances.expandedFolder",JSON.stringify(o)),this.setState({expandedFolder:o})},children:e.filter(({category:i})=>i===r).map(({render:i})=>i)},r))}return e.map(({render:s})=>s)}onToggleExpanded=(t,e)=>{this.expanded!==t&&e&&this.closeCommands[this.expanded]&&this.closeCommands[this.expanded](),this.expanded=e?t:null};async getHostsData(){this.props.socket.getHostInfo(this.state.currentHost,!1,1e4).catch(i=>(i.toString().includes("May not read")||window.alert(`Cannot read host information: ${i}`),{})).then(i=>{this._cacheList=null,this.setState({hostInfo:i})});let t;const e=await this.props.socket.getState(`${this.state.currentHost}.memAvailable`),s=await this.props.socket.getState(`${this.state.currentHost}.freemem`),r=await this.props.socket.getObject(`${this.state.currentHost}`);if(e?t=e:s&&(t=s),t){const i=((r==null?void 0:r.native.hardware.totalmem)||0)/1048576,o=Math.round(t.val/i*100);this._cacheList=null,this.setState({percent:o,memFree:t.val})}}changeStartedStopped=()=>{this._cacheList=null,this.setState(t=>{const e=t.playArrow?t.playArrow===1?2:0:1;return this.localStorage.setItem("Instances.playArrow",JSON.stringify(e)),{playArrow:e}})};changeCompactGroup(t){this._cacheList=null,this.localStorage.setItem("Instances.filterCompactGroup",JSON.stringify(t)),this.setState({filterCompactGroup:t})}handleFilterChange(t){this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout(e=>{this.typingTimer=null,this._cacheList=null,this.setState({filterText:e}),this.localStorage.setItem("instances.filter",e)},300,t.target.value)}renderFilterDialog(){return this.state.showFilterDialog?a.jsx(ya,{filterMode:this.state.filterMode,filterStatus:this.state.filterStatus,onClose:t=>{t&&(this._cacheList=null,this.localStorage.setItem("Instances.filterMode",t.filterMode),this.localStorage.setItem("Instances.filterStatus",t.filterStatus),this.setState(t)),this.setState({showFilterDialog:!1})}}):null}render(){if(!this.state.instances)return a.jsx(d.LinearProgress,{});if(this.props.currentHost!==this.state.currentHost&&(this.hostsTimer=this.hostsTimer||setTimeout(()=>{this.hostsTimer=null,this.setState({currentHost:this.props.currentHost},()=>this.updateData())},200)),this.state.dialog==="config"&&this.state.dialogProp){const e=this.state.instances[this.state.dialogProp]||null;if(e)return a.jsxs(d.Paper,{style:V.paper,children:[this.renderFilterDialog(),a.jsx(hr,{expertMode:this.props.expertMode,adapter:e.id.split(".")[0],adminInstance:this.props.adminInstance,style:V.iframe,configStored:this.props.configStored,dateFormat:this.props.dateFormat,icon:e.image,instance:parseInt(e.id.split(".")[1]),isFloatComma:this.props.isFloatComma,jsonConfig:e.jsonConfig,lang:this.props.lang,materialize:e.materialize,socket:this.props.socket,t:this.t,theme:this.props.theme,themeName:this.props.themeName,themeType:this.props.themeType,width:this.props.width,version:e.version,onRegisterIframeRef:s=>this.props.onRegisterIframeRef(s),onUnregisterIframeRef:s=>this.props.onUnregisterIframeRef(s),handleNavigation:this.props.handleNavigation})]})}else yt.lastScrollPosition&&(setTimeout(e=>{var s,r;(s=this.refTabContent.current)!=null&&s.parentNode&&(((r=this.refTabContent.current)==null?void 0:r.parentNode).scrollTop=e)},200,yt.lastScrollPosition),yt.lastScrollPosition=0);this.shouldUpdateAfterDialogClosed&&(this.shouldUpdateAfterDialogClosed=!1,this.statesUpdateTimer||this.statesUpdateTimer||(this.statesUpdateTimer=setTimeout(()=>{this.statesUpdateTimer=null,this.forceUpdate()},300)));const t=this.state.hostInfo?`${this.state.hostInfo["Disk free"]?`${this.t("Disk free")}: ${Math.round(this.state.hostInfo["Disk free"]/(this.state.hostInfo["Disk size"]/100))}%, `:""}${this.t("Total RAM usage")}: ${this.state.mem} Mb / ${this.t("Free")}: ${this.state.percent}% = ${this.state.memFree} Mb [${this.t("Host")}: ${this.props.currentHostName} - ${this.state.processes} ${this.state.processes===1?this.t("process"):this.t("processes")}]`:null;return a.jsxs(lr,{children:[this.renderFilterDialog(),a.jsxs(cr,{children:[a.jsx(d.Tooltip,{title:this.t("Show / hide List"),slotProps:{popper:{sx:V.tooltip}},children:a.jsx(d.IconButton,{size:"large",onClick:()=>{this.setState({viewMode:!this.state.viewMode}),this.localStorage.setItem("Instances.viewMode",this.state.viewMode?"false":"true")},children:this.state.viewMode?a.jsx(v.ViewModule,{}):a.jsx(v.ViewList,{})})}),!this.state.viewMode&&a.jsx(d.Tooltip,{title:this.t("Category"),slotProps:{popper:{sx:V.tooltip}},children:a.jsx(d.IconButton,{size:"large",onClick:()=>{this.setState({viewCategory:!this.state.viewCategory}),this.localStorage.setItem("Instances.viewCategory",this.state.viewCategory?"false":"true")},children:a.jsx(v.List,{color:this.state.viewCategory?"primary":"inherit"})})}),!this.state.viewMode&&this.state.viewCategory&&a.jsxs(a.Fragment,{children:[a.jsx(d.Tooltip,{title:this.t("expand all"),slotProps:{popper:{sx:V.tooltip}},children:a.jsx(d.IconButton,{size:"large",onClick:()=>{const e=[];this._cacheList.forEach(({category:s})=>!e.includes(s)&&e.push(s)),e.sort(),this.localStorage.setItem("Instances.expandedFolder",JSON.stringify(e)),this.setState({expandedFolder:e})},children:a.jsx(v.FolderOpen,{})})}),a.jsx(d.Tooltip,{title:this.t("collapse all"),slotProps:{popper:{sx:V.tooltip}},children:a.jsx(d.IconButton,{size:"large",onClick:()=>{this.localStorage.removeItem("Instances.expandedFolder"),this.setState({expandedFolder:[]})},children:a.jsx(v.Folder,{})})})]}),a.jsx(d.Tooltip,{title:this.t("Reload"),slotProps:{popper:{sx:V.tooltip}},children:a.jsx(d.IconButton,{size:"large",onClick:()=>this.getData(!0),children:a.jsx(v.Refresh,{})})}),this.props.hosts.length>1?a.jsx(d.Tooltip,{title:this.t("Show instances only for current host"),slotProps:{popper:{sx:V.tooltip}},children:a.jsx(d.IconButton,{size:"large",onClick:()=>{this.setState({onlyCurrentHost:!this.state.onlyCurrentHost}),this.localStorage.setItem("Instances.onlyCurrentHost",this.state.onlyCurrentHost?"false":"true")},children:a.jsx(v.Devices,{color:this.state.onlyCurrentHost?"primary":"inherit"})})}):null,a.jsx(d.Tooltip,{title:this.t(this.state.playArrow?this.state.playArrow===1?"Showed only running instances":"Showed only stopped instances":"Show running or stopped instances"),slotProps:{popper:{sx:V.tooltip}},children:a.jsx(d.IconButton,{size:"large",onClick:()=>this.changeStartedStopped(),children:a.jsx(v.PlayArrow,{style:this.state.playArrow===2?{color:"red"}:null,color:this.state.playArrow===1?"primary":"inherit"})})}),a.jsx(d.Tooltip,{title:this.t("Filter instances"),slotProps:{popper:{sx:V.tooltip}},children:a.jsx(d.IconButton,{size:"large",onClick:()=>this.setState({showFilterDialog:!0}),sx:this.state.filterMode||this.state.filterStatus?V.filterActive:void 0,children:a.jsx(dr,{style:{width:16,height:16}})})}),this.props.expertMode&&this.state.compact?a.jsx(mr,{title:this.t("Filter specific compact group"),t:this.t,arrayItem:[{name:"All"},{name:"controller"},{name:"default"},...Array(this.state.maxCompactGroupNumber-1).fill(0).map((e,s)=>({name:s+2}))],buttonIcon:a.jsx(v.ViewCompact,{style:{marginRight:4},color:"primary"}),onClick:e=>this.changeCompactGroup(e),value:this.state.filterCompactGroup}):null,a.jsx("div",{style:V.grow}),a.jsx(d.TextField,{variant:"standard",inputRef:this.inputRef,label:this.t("Filter"),sx:{margin:{xs:"0 0 2px 16px",md:"5px 0 5px 0"}},defaultValue:this.state.filterText,onChange:e=>this.handleFilterChange(e),slotProps:{input:{endAdornment:this.state.filterText?a.jsx(d.InputAdornment,{position:"end",children:a.jsx(d.IconButton,{tabIndex:-1,size:"small",onClick:()=>{this.inputRef.current.value="",this._cacheList=null,this.setState({filterText:""}),this.localStorage.setItem("instances.filter","")},children:a.jsx(v.Close,{})})}):null}}}),a.jsx("div",{style:V.grow}),a.jsx(d.Box,{component:"span",sx:{display:{xs:"none",sm:"inline-block"}},children:t})]}),a.jsx(ur,{overflow:"auto",children:a.jsx("div",{ref:this.refTabContent,style:this.state.viewMode?V.cards:void 0,children:this.getPanels()})})]})}}const Va=or()(yt);export{Va as default};
|