iobroker.admin 7.7.1 → 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.
Files changed (73) hide show
  1. package/README.md +3 -4
  2. package/adminWww/assets/{AdapterUpdateDialog-Bgswiqs9.js → AdapterUpdateDialog-DHGhgEEq.js} +1 -1
  3. package/adminWww/assets/{Adapters-yQiEeoh8.js → Adapters-CgSIajcF.js} +2 -2
  4. package/adminWww/assets/{Config-C1Gjt8DC.js → Config-BQSl4bfA.js} +1 -1
  5. package/adminWww/assets/{CustomModal-CgEtkfCG.js → CustomModal-DNMTLv4y.js} +1 -1
  6. package/adminWww/assets/{CustomTab-CwioFUor.js → CustomTab-Bl8S8QZW.js} +1 -1
  7. package/adminWww/assets/{DefaultPropsProvider-DxsXuIyE.js → DefaultPropsProvider-u5xB1Fxz.js} +1 -1
  8. package/adminWww/assets/{EasyMode-CN-reJVI.js → EasyMode-xDbqrply.js} +1 -1
  9. package/adminWww/assets/{Enums-8m252lzC.js → Enums-BSICIhWI.js} +1 -1
  10. package/adminWww/assets/{Fields-lI3YkIzQ.js → Fields-C3JkTmfP.js} +1 -1
  11. package/adminWww/assets/{Files-fQpSPYWI.js → Files-DK85-COY.js} +2 -2
  12. package/adminWww/assets/{FilledInput-CKswrNd5.js → FilledInput-CysG4ax_.js} +1 -1
  13. package/adminWww/assets/{Hosts-BPdUlXV5.js → Hosts-qIsB4Gub.js} +2 -2
  14. package/adminWww/assets/Instances-BA_DCzs8.js +2 -0
  15. package/adminWww/assets/{Intro-Dr1-aqO9.js → Intro-00oh6SLw.js} +1 -1
  16. package/adminWww/assets/{Logs-xCCrWV30.js → Logs-Cvpgh-zN.js} +1 -1
  17. package/adminWww/assets/Objects-Dp71iotS.js +60 -0
  18. package/adminWww/assets/{State-nZ6sjU9_.js → State-BqfD2ABf.js} +1 -1
  19. package/adminWww/assets/{Tabs-BJ1rL35Z.js → Tabs-sxfWgN0b.js} +2 -2
  20. package/adminWww/assets/{Users-B0iasrSG.js → Users-CDcWqTfZ.js} +1 -1
  21. package/adminWww/assets/ace-BG5WYul1.js +985 -0
  22. package/adminWww/assets/{blueGrey-D-KQaGde.js → blueGrey-DYsiMDOn.js} +1 -1
  23. package/adminWww/assets/{bootstrap-DDrI3lVl.js → bootstrap-BYQTdf9r.js} +91 -103
  24. package/adminWww/assets/{createSvgIcon-DuKI6CvW.js → createSvgIcon-Bh3KWtyp.js} +1 -1
  25. package/adminWww/assets/{emotion-react.browser.esm-DApPKwaj.js → emotion-react.browser.esm-BCDt9NrH.js} +1 -1
  26. package/adminWww/assets/{emotion-styled.browser.esm-Dc05hmeu.js → emotion-styled.browser.esm-CyFqGgyG.js} +1 -1
  27. package/adminWww/assets/{emotion-utils.browser.esm-DOjH6Olm.js → emotion-utils.browser.esm-pglN4_eI.js} +1 -1
  28. package/adminWww/assets/{geosearch.module-CWfRtxrN.js → geosearch.module-DH4NhiPj.js} +1 -1
  29. package/adminWww/assets/hostInit-fzxL8JAx.js +1 -1
  30. package/adminWww/assets/{iconBase-CgxZ5MMC.js → iconBase-C3vi24ZE.js} +1 -1
  31. package/adminWww/assets/{index-BmWdDCX_.js → index-B1ITPhEY.js} +2 -2
  32. package/adminWww/assets/{index-D7Rlw-5R.js → index-D--ojYan.js} +1 -1
  33. package/adminWww/assets/{index-BjVqnwqt.js → index-D3IAEXXP.js} +1 -1
  34. package/adminWww/assets/{index-HOidq_rM.js → index-DPDg2YA0.js} +1 -1
  35. package/adminWww/assets/{index-Bsv_DXxB.js → index-DTGUg51P.js} +1 -1
  36. package/adminWww/assets/{index-BP5kWU3L.js → index-Qa7Q_Dz5.js} +1 -1
  37. package/adminWww/assets/{index-RvHSqeMD.js → index-qcIeekse.js} +13 -13
  38. package/adminWww/assets/{index-gHyOgbGJ.js → index-rKfs-rCa.js} +1 -1
  39. package/adminWww/assets/{index-DH1kmwK1.js → index-wN1ZlPSW.js} +2 -2
  40. package/adminWww/assets/iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-BOKYvG_W.js +1 -0
  41. package/adminWww/assets/{iobroker_admin__loadShare__leaflet__loadShare__-B1OZ7tj-.js → iobroker_admin__loadShare__leaflet__loadShare__-h9SMNPLU.js} +1 -1
  42. package/adminWww/assets/iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BnsS7SOQ.js +1 -0
  43. package/adminWww/assets/{iobroker_admin__loadShare__react__loadShare__-DtlEM_52.js → iobroker_admin__loadShare__react__loadShare__-Bis6NHgw.js} +1 -1
  44. package/adminWww/assets/iobroker_admin__mf_v__runtimeInit__mf_v__-CTkuGOOk.js +5 -0
  45. package/adminWww/assets/{sentry-CNy_SQq1.js → sentry-H_UdJ2zx.js} +1 -1
  46. package/adminWww/assets/{zh-cn-DZTx1vAh.js → zh-cn-vvAC9zpl.js} +3 -3
  47. package/adminWww/index.html +2 -2
  48. package/adminWww/mf-manifest.json +1 -1
  49. package/adminWww/remoteEntry.js +2 -2
  50. package/adminWww/static/js/worker-javascript.js +1 -1
  51. package/adminWww/static/js/worker-yaml.js +1 -1
  52. package/io-package.json +14 -14
  53. package/package.json +10 -9
  54. package/adminWww/assets/Instances-BStmfz4r.js +0 -2
  55. package/adminWww/assets/Objects-BF8brXaf.js +0 -60
  56. package/adminWww/assets/ace-CFIUQz8j.js +0 -970
  57. package/adminWww/assets/iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-gw2iqPBS.js +0 -1
  58. package/adminWww/assets/iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BGyJCibC.js +0 -1
  59. package/adminWww/assets/iobroker_admin__mf_v__runtimeInit__mf_v__-VDoBF19b.js +0 -10
  60. package/build-backend/src/lib/checkLinuxPass.js +0 -280
  61. package/build-backend/src/lib/checkLinuxPass.js.map +0 -1
  62. package/build-backend/src/lib/testPassword.js +0 -58
  63. package/build-backend/src/lib/testPassword.js.map +0 -1
  64. package/build-backend/src/lib/translations.js +0 -27
  65. package/build-backend/src/lib/translations.js.map +0 -1
  66. package/build-backend/src/lib/utils.js +0 -344
  67. package/build-backend/src/lib/utils.js.map +0 -1
  68. package/build-backend/src/lib/web.js +0 -1165
  69. package/build-backend/src/lib/web.js.map +0 -1
  70. package/build-backend/src/main.js +0 -1704
  71. package/build-backend/src/main.js.map +0 -1
  72. package/build-backend/src-admin/src/components/Adapters/Utils.js +0 -39
  73. package/build-backend/src-admin/src/components/Adapters/Utils.js.map +0 -1
@@ -1,2 +0,0 @@
1
- import{j as a,J as Ze,B as Qn,F as Rt,H as ft,E as ht}from"./DefaultPropsProvider-DxsXuIyE.js";import{i as Te}from"./iobroker_admin__loadShare__react__loadShare__-DtlEM_52.js";import{r as hs,j as Bs,i as d,U as pt,f as oe,I as de,a as v,k as Kn,D as er,l as ps,m as tr,R as zs,n as sr,c as xe,w as nr,o as rr,h as ir,g as or,T as ar}from"./bootstrap-DDrI3lVl.js";import{a as lr}from"./index-HOidq_rM.js";import{C as cr}from"./Config-C1Gjt8DC.js";import{S as te}from"./State-nZ6sjU9_.js";import{s as ur,M as dr,C as hr}from"./sentry-CNy_SQq1.js";import{C as Me}from"./CustomModal-CgEtkfCG.js";import{a as pr}from"./blueGrey-D-KQaGde.js";import"./iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BGyJCibC.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-VDoBF19b.js";import"./emotion-serialize.esm-BUa21YfQ.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-gw2iqPBS.js";import"./ace-CFIUQz8j.js";import"./FilledInput-CKswrNd5.js";import"./preload-helper-Dp1pzeXC.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-B1OZ7tj-.js";import"./extends-CF3RwP-h.js";import"./iconBase-CgxZ5MMC.js";import"./emotion-cache.browser.esm-B8BFze5o.js";var Fe={},P={},tt={},ve={},Us={};Object.defineProperty(Us,"__esModule",{value:!0});var wt={},ue={};Object.defineProperty(ue,"__esModule",{value:!0});ue.CronField=void 0;class ss{#e=!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/-]+$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(e,t={rawValue:""}){if(!Array.isArray(e))throw new Error(`${this.constructor.name} Validation error, values is not an array`);if(!(e.length>0))throw new Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...t,rawValue:t.rawValue??""},this.#r=e.sort(ss.sorter),this.#n=this.options.wildcard!==void 0?this.options.wildcard:this.#i(),this.#e=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.#e}get hasQuestionMarkChar(){return this.#s}get isWildcard(){return this.#n}get values(){return this.#r}static sorter(e,t){const s=typeof e=="number",r=typeof t=="number";return s&&r?e-t:!s&&!r?e.localeCompare(t):s?-1:1}serialize(){return{wildcard:this.#n,values:this.#r}}validate(){let e;const t=this.chars.length>0?` or chars ${this.chars.join("")}`:"",s=l=>u=>new RegExp(`^\\d{0,2}${u}$`).test(l),r=l=>(e=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 ${e} expected range ${this.min}-${this.max}${t}`);const o=this.#r.find((l,u)=>this.#r.indexOf(l)!==u);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},(e,t)=>t+this.min).every(e=>this.#r.includes(e))}}ue.CronField=ss;Object.defineProperty(wt,"__esModule",{value:!0});wt.CronDayOfMonth=void 0;const mr=ue,fr=1,gr=31,yr=Object.freeze(["L"]);class xr extends mr.CronField{static get min(){return fr}static get max(){return gr}static get chars(){return yr}static get validChars(){return/^[?,*\dLH/-]+$/}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}wt.CronDayOfMonth=xr;var St={};Object.defineProperty(St,"__esModule",{value:!0});St.CronDayOfWeek=void 0;const vr=ue,wr=0,Sr=7,Cr=Object.freeze(["L"]);class br extends vr.CronField{static get min(){return wr}static get max(){return Sr}static get chars(){return Cr}static get validChars(){return/^[?,*\dLH#/-]+$/}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}}St.CronDayOfWeek=br;var Ct={};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.CronHour=void 0;const kr=ue,Dr=0,Tr=23,Or=Object.freeze([]);class Mr extends kr.CronField{static get min(){return Dr}static get max(){return Tr}static get chars(){return Or}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}Ct.CronHour=Mr;var bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.CronMinute=void 0;const Ir=ue,Er=0,jr=59,Nr=Object.freeze([]);class Fr extends Ir.CronField{static get min(){return Er}static get max(){return jr}static get chars(){return Nr}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}bt.CronMinute=Fr;var kt={},st={},z={};Object.defineProperty(z,"__esModule",{value:!0});class Oe extends Error{}class Lr extends Oe{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class _r extends Oe{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Wr extends Oe{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Le extends Oe{}class Gs extends Oe{constructor(e){super(`Invalid unit ${e}`)}}class L extends Oe{}class me extends Oe{constructor(){super("Zone is an abstract class")}}const g="numeric",ae="short",B="long",gt={year:g,month:g,day:g},Zs={year:g,month:ae,day:g},$r={year:g,month:ae,day:g,weekday:ae},Ys={year:g,month:B,day:g},qs={year:g,month:B,day:g,weekday:B},Xs={hour:g,minute:g},Js={hour:g,minute:g,second:g},Qs={hour:g,minute:g,second:g,timeZoneName:ae},Ks={hour:g,minute:g,second:g,timeZoneName:B},en={hour:g,minute:g,hourCycle:"h23"},tn={hour:g,minute:g,second:g,hourCycle:"h23"},sn={hour:g,minute:g,second:g,hourCycle:"h23",timeZoneName:ae},nn={hour:g,minute:g,second:g,hourCycle:"h23",timeZoneName:B},rn={year:g,month:g,day:g,hour:g,minute:g},on={year:g,month:g,day:g,hour:g,minute:g,second:g},an={year:g,month:ae,day:g,hour:g,minute:g},ln={year:g,month:ae,day:g,hour:g,minute:g,second:g},Ar={year:g,month:ae,day:g,weekday:ae,hour:g,minute:g},cn={year:g,month:B,day:g,hour:g,minute:g,timeZoneName:ae},un={year:g,month:B,day:g,hour:g,minute:g,second:g,timeZoneName:ae},dn={year:g,month:B,day:g,weekday:B,hour:g,minute:g,timeZoneName:B},hn={year:g,month:B,day:g,weekday:B,hour:g,minute:g,second:g,timeZoneName:B};class He{get type(){throw new me}get name(){throw new me}get ianaName(){return this.name}get isUniversal(){throw new me}offsetName(e,t){throw new me}formatOffset(e,t){throw new me}offset(e){throw new me}equals(e){throw new me}get isValid(){throw new me}}let Et=null;class nt extends He{static get instance(){return Et===null&&(Et=new nt),Et}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:s}){return kn(e,t,s)}formatOffset(e,t){return Qe(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}const Pt=new Map;function Hr(n){let e=Pt.get(n);return e===void 0&&(e=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"}),Pt.set(n,e)),e}const Vr={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Rr(n,e){const t=n.format(e).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,r,i,o,l,u,h,m]=s;return[o,r,i,l,u,h,m]}function Pr(n,e){const t=n.formatToParts(e),s=[];for(let r=0;r<t.length;r++){const{type:i,value:o}=t[r],l=Vr[i];i==="era"?s[l]=o:S(l)||(s[l]=parseInt(o,10))}return s}const jt=new Map;class le extends He{static create(e){let t=jt.get(e);return t===void 0&&jt.set(e,t=new le(e)),t}static resetCache(){jt.clear(),Pt.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=le.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:s}){return kn(e,t,s,this.name)}formatOffset(e,t){return Qe(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const s=Hr(this.name);let[r,i,o,l,u,h,m]=s.formatToParts?Pr(s,t):Rr(s,t);l==="BC"&&(r=-Math.abs(r)+1);const f=Tt({year:r,month:i,day:o,hour:u===24?0:u,minute:h,second:m,millisecond:0});let p=+t;const x=p%1e3;return p-=x>=0?x:1e3+x,(f-p)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let ms={};function Br(n,e={}){const t=JSON.stringify([n,e]);let s=ms[t];return s||(s=new Intl.ListFormat(n,e),ms[t]=s),s}const Bt=new Map;function zt(n,e={}){const t=JSON.stringify([n,e]);let s=Bt.get(t);return s===void 0&&(s=new Intl.DateTimeFormat(n,e),Bt.set(t,s)),s}const Ut=new Map;function zr(n,e={}){const t=JSON.stringify([n,e]);let s=Ut.get(t);return s===void 0&&(s=new Intl.NumberFormat(n,e),Ut.set(t,s)),s}const Gt=new Map;function Ur(n,e={}){const{base:t,...s}=e,r=JSON.stringify([n,s]);let i=Gt.get(r);return i===void 0&&(i=new Intl.RelativeTimeFormat(n,e),Gt.set(r,i)),i}let Ye=null;function Gr(){return Ye||(Ye=new Intl.DateTimeFormat().resolvedOptions().locale,Ye)}const Zt=new Map;function pn(n){let e=Zt.get(n);return e===void 0&&(e=new Intl.DateTimeFormat(n).resolvedOptions(),Zt.set(n,e)),e}const Yt=new Map;function Zr(n){let e=Yt.get(n);if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,"minimalDays"in e||(e={...mn,...e}),Yt.set(n,e)}return e}function Yr(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let s,r;try{s=zt(n).resolvedOptions(),r=n}catch{const u=n.substring(0,t);s=zt(u).resolvedOptions(),r=u}const{numberingSystem:i,calendar:o}=s;return[r,i,o]}}function qr(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function Xr(n){const e=[];for(let t=1;t<=12;t++){const s=w.utc(2009,t,1);e.push(n(s))}return e}function Jr(n){const e=[];for(let t=1;t<=7;t++){const s=w.utc(2016,11,13+t);e.push(n(s))}return e}function at(n,e,t,s){const r=n.listingMode();return r==="error"?null:r==="en"?t(e):s(e)}function Qr(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||pn(n.locale).numberingSystem==="latn"}class Kr{constructor(e,t,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:r,floor:i,...o}=s;if(!t||Object.keys(o).length>0){const l={useGrouping:!1,...s};s.padTo>0&&(l.minimumIntegerDigits=s.padTo),this.inf=zr(e,l)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):as(e,3);return I(t,this.padTo)}}}class ei{constructor(e,t,s){this.opts=s,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),l=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&le.create(l).valid?(r=l,this.dt=e):(r="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=zt(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const s=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:s}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class ti{constructor(e,t,s){this.opts={style:"long",...s},!t&&Cn()&&(this.rtf=Ur(e,s))}format(e,t){return this.rtf?this.rtf.format(e,t):Ci(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const mn={firstDay:1,minimalDays:4,weekend:[6,7]};class D{static fromOpts(e){return D.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,s,r,i=!1){const o=e||M.defaultLocale,l=o||(i?"en-US":Gr()),u=t||M.defaultNumberingSystem,h=s||M.defaultOutputCalendar,m=Xt(r)||M.defaultWeekSettings;return new D(l,u,h,m,o)}static resetCache(){Ye=null,Bt.clear(),Ut.clear(),Gt.clear(),Zt.clear(),Yt.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:s,weekSettings:r}={}){return D.create(e,t,s,r)}constructor(e,t,s,r,i){const[o,l,u]=Yr(e);this.locale=o,this.numberingSystem=t||l||null,this.outputCalendar=s||u||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=Qr(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:D.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Xt(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return at(this,e,On,()=>{const s=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=Xr(i=>this.extract(i,s,"month"))),this.monthsCache[r][e]})}weekdays(e,t=!1){return at(this,e,En,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=Jr(i=>this.extract(i,s,"weekday"))),this.weekdaysCache[r][e]})}meridiems(){return at(this,void 0,()=>jn,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[w.utc(2016,11,13,9),w.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return at(this,e,Nn,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[w.utc(-40,1,1),w.utc(2017,1,1)].map(s=>this.extract(s,t,"era"))),this.eraCache[e]})}extract(e,t,s){const r=this.dtFormatter(e,t),i=r.formatToParts(),o=i.find(l=>l.type.toLowerCase()===s);return o?o.value:null}numberFormatter(e={}){return new Kr(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new ei(e,this.intl,t)}relFormatter(e={}){return new ti(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Br(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||pn(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:bn()?Zr(this.locale):mn}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Nt=null;class $ extends He{static get utcInstance(){return Nt===null&&(Nt=new $(0)),Nt}static instance(e){return e===0?$.utcInstance:new $(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new $(Ot(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Qe(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Qe(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Qe(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class fn extends He{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function we(n,e){if(S(n)||n===null)return e;if(n instanceof He)return n;if(ai(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?nt.instance:t==="utc"||t==="gmt"?$.utcInstance:$.parseSpecifier(t)||le.create(n)}else return Se(n)?$.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new fn(n)}const ns={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},fs={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},si=ns.hanidec.replace(/[\[|\]]/g,"").split("");function ni(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t<n.length;t++){const s=n.charCodeAt(t);if(n[t].search(ns.hanidec)!==-1)e+=si.indexOf(n[t]);else for(const r in fs){const[i,o]=fs[r];s>=i&&s<=o&&(e+=s-i)}}return parseInt(e,10)}else return e}const qt=new Map;function ri(){qt.clear()}function se({numberingSystem:n},e=""){const t=n||"latn";let s=qt.get(t);s===void 0&&(s=new Map,qt.set(t,s));let r=s.get(e);return r===void 0&&(r=new RegExp(`${ns[t]}${e}`),s.set(e,r)),r}let gs=()=>Date.now(),ys="system",xs=null,vs=null,ws=null,Ss=60,Cs,bs=null;class M{static get now(){return gs}static set now(e){gs=e}static set defaultZone(e){ys=e}static get defaultZone(){return we(ys,nt.instance)}static get defaultLocale(){return xs}static set defaultLocale(e){xs=e}static get defaultNumberingSystem(){return vs}static set defaultNumberingSystem(e){vs=e}static get defaultOutputCalendar(){return ws}static set defaultOutputCalendar(e){ws=e}static get defaultWeekSettings(){return bs}static set defaultWeekSettings(e){bs=Xt(e)}static get twoDigitCutoffYear(){return Ss}static set twoDigitCutoffYear(e){Ss=e%100}static get throwOnInvalid(){return Cs}static set throwOnInvalid(e){Cs=e}static resetCaches(){D.resetCache(),le.resetCache(),w.resetCache(),ri()}}class ie{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const gn=[0,31,59,90,120,151,181,212,243,273,304,334],yn=[0,31,60,91,121,152,182,213,244,274,305,335];function X(n,e){return new ie("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function rs(n,e,t){const s=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const r=s.getUTCDay();return r===0?7:r}function xn(n,e,t){return t+(rt(n)?yn:gn)[e-1]}function vn(n,e){const t=rt(n)?yn:gn,s=t.findIndex(i=>i<e),r=e-t[s];return{month:s+1,day:r}}function is(n,e){return(n-e+7)%7+1}function yt(n,e=4,t=1){const{year:s,month:r,day:i}=n,o=xn(s,r,i),l=is(rs(s,r,i),t);let u=Math.floor((o-l+14-e)/7),h;return u<1?(h=s-1,u=et(h,e,t)):u>et(s,e,t)?(h=s+1,u=1):h=s,{weekYear:h,weekNumber:u,weekday:l,...Mt(n)}}function ks(n,e=4,t=1){const{weekYear:s,weekNumber:r,weekday:i}=n,o=is(rs(s,1,e),t),l=We(s);let u=r*7+i-o-7+e,h;u<1?(h=s-1,u+=We(h)):u>l?(h=s+1,u-=We(s)):h=s;const{month:m,day:c}=vn(h,u);return{year:h,month:m,day:c,...Mt(n)}}function Ft(n){const{year:e,month:t,day:s}=n,r=xn(e,t,s);return{year:e,ordinal:r,...Mt(n)}}function Ds(n){const{year:e,ordinal:t}=n,{month:s,day:r}=vn(e,t);return{year:e,month:s,day:r,...Mt(n)}}function Ts(n,e){if(!S(n.localWeekday)||!S(n.localWeekNumber)||!S(n.localWeekYear)){if(!S(n.weekday)||!S(n.weekNumber)||!S(n.weekYear))throw new Le("Cannot mix locale-based week fields with ISO-based week fields");return S(n.localWeekday)||(n.weekday=n.localWeekday),S(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),S(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function ii(n,e=4,t=1){const s=Dt(n.weekYear),r=J(n.weekNumber,1,et(n.weekYear,e,t)),i=J(n.weekday,1,7);return s?r?i?!1:X("weekday",n.weekday):X("week",n.weekNumber):X("weekYear",n.weekYear)}function oi(n){const e=Dt(n.year),t=J(n.ordinal,1,We(n.year));return e?t?!1:X("ordinal",n.ordinal):X("year",n.year)}function wn(n){const e=Dt(n.year),t=J(n.month,1,12),s=J(n.day,1,xt(n.year,n.month));return e?t?s?!1:X("day",n.day):X("month",n.month):X("year",n.year)}function Sn(n){const{hour:e,minute:t,second:s,millisecond:r}=n,i=J(e,0,23)||e===24&&t===0&&s===0&&r===0,o=J(t,0,59),l=J(s,0,59),u=J(r,0,999);return i?o?l?u?!1:X("millisecond",r):X("second",s):X("minute",t):X("hour",e)}function S(n){return typeof n>"u"}function Se(n){return typeof n=="number"}function Dt(n){return typeof n=="number"&&n%1===0}function ai(n){return typeof n=="string"}function li(n){return Object.prototype.toString.call(n)==="[object Date]"}function Cn(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function bn(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function ci(n){return Array.isArray(n)?n:[n]}function Os(n,e,t){if(n.length!==0)return n.reduce((s,r)=>{const i=[e(r),r];return s&&t(s[0],i[0])===s[0]?s:i},null)[1]}function ui(n,e){return e.reduce((t,s)=>(t[s]=n[s],t),{})}function Ae(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Xt(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(e=>!J(e,1,7)))throw new L("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function J(n,e,t){return Dt(n)&&n>=e&&n<=t}function di(n,e){return n-e*Math.floor(n/e)}function I(n,e=2){const t=n<0;let s;return t?s="-"+(""+-n).padStart(e,"0"):s=(""+n).padStart(e,"0"),s}function ge(n){if(!(S(n)||n===null||n===""))return parseInt(n,10)}function be(n){if(!(S(n)||n===null||n===""))return parseFloat(n)}function os(n){if(!(S(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function as(n,e,t=!1){const s=10**e;return(t?Math.trunc:Math.round)(n*s)/s}function rt(n){return n%4===0&&(n%100!==0||n%400===0)}function We(n){return rt(n)?366:365}function xt(n,e){const t=di(e-1,12)+1,s=n+(e-t)/12;return t===2?rt(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Tt(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function Ms(n,e,t){return-is(rs(n,1,e),t)+e-1}function et(n,e=4,t=1){const s=Ms(n,e,t),r=Ms(n+1,e,t);return(We(n)-s+r)/7}function Jt(n){return n>99?n:n>M.twoDigitCutoffYear?1900+n:2e3+n}function kn(n,e,t,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:e,...i},l=new Intl.DateTimeFormat(t,o).formatToParts(r).find(u=>u.type.toLowerCase()==="timezonename");return l?l.value:null}function Ot(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const s=parseInt(e,10)||0,r=t<0||Object.is(t,-0)?-s:s;return t*60+r}function Dn(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new L(`Invalid unit value ${n}`);return e}function vt(n,e){const t={};for(const s in n)if(Ae(n,s)){const r=n[s];if(r==null)continue;t[e(s)]=Dn(r)}return t}function Qe(n,e){const t=Math.trunc(Math.abs(n/60)),s=Math.trunc(Math.abs(n%60)),r=n>=0?"+":"-";switch(e){case"short":return`${r}${I(t,2)}:${I(s,2)}`;case"narrow":return`${r}${t}${s>0?`:${s}`:""}`;case"techie":return`${r}${I(t,2)}${I(s,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Mt(n){return ui(n,["hour","minute","second","millisecond"])}const hi=["January","February","March","April","May","June","July","August","September","October","November","December"],Tn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],pi=["J","F","M","A","M","J","J","A","S","O","N","D"];function On(n){switch(n){case"narrow":return[...pi];case"short":return[...Tn];case"long":return[...hi];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 Mn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],In=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],mi=["M","T","W","T","F","S","S"];function En(n){switch(n){case"narrow":return[...mi];case"short":return[...In];case"long":return[...Mn];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const jn=["AM","PM"],fi=["Before Christ","Anno Domini"],gi=["BC","AD"],yi=["B","A"];function Nn(n){switch(n){case"narrow":return[...yi];case"short":return[...gi];case"long":return[...fi];default:return null}}function xi(n){return jn[n.hour<12?0:1]}function vi(n,e){return En(e)[n.weekday-1]}function wi(n,e){return On(e)[n.month-1]}function Si(n,e){return Nn(e)[n.year<0?0:1]}function Ci(n,e,t="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(t==="auto"&&i){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${r[n][0]}`;case-1:return c?"yesterday":`last ${r[n][0]}`;case 0:return c?"today":`this ${r[n][0]}`}}const o=Object.is(e,-0)||e<0,l=Math.abs(e),u=l===1,h=r[n],m=s?u?h[1]:h[2]||h[1]:u?r[n][0]:n;return o?`${l} ${m} ago`:`in ${l} ${m}`}function Is(n,e){let t="";for(const s of n)s.literal?t+=s.val:t+=e(s.val);return t}const bi={D:gt,DD:Zs,DDD:Ys,DDDD:qs,t:Xs,tt:Js,ttt:Qs,tttt:Ks,T:en,TT:tn,TTT:sn,TTTT:nn,f:rn,ff:an,fff:cn,ffff:dn,F:on,FF:ln,FFF:un,FFFF:hn};class W{static create(e,t={}){return new W(e,t)}static parseFormat(e){let t=null,s="",r=!1;const i=[];for(let o=0;o<e.length;o++){const l=e.charAt(o);l==="'"?(s.length>0&&i.push({literal:r||/^\s+$/.test(s),val:s}),t=null,s="",r=!r):r||l===t?s+=l:(s.length>0&&i.push({literal:/^\s+$/.test(s),val:s}),s=l,t=l)}return s.length>0&&i.push({literal:r||/^\s+$/.test(s),val:s}),i}static macroTokenToFormatOpts(e){return bi[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return I(e,t);const s={...this.opts};return t>0&&(s.padTo=t),this.loc.numberFormatter(s).format(e)}formatDateTimeFromString(e,t){const s=this.loc.listingMode()==="en",r=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(p,x)=>this.loc.extract(e,p,x),o=p=>e.isOffsetFixed&&e.offset===0&&p.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,p.format):"",l=()=>s?xi(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(p,x)=>s?wi(e,p):i(x?{month:p}:{month:p,day:"numeric"},"month"),h=(p,x)=>s?vi(e,p):i(x?{weekday:p}:{weekday:p,month:"long",day:"numeric"},"weekday"),m=p=>{const x=W.macroTokenToFormatOpts(p);return x?this.formatWithSystemDefault(e,x):p},c=p=>s?Si(e,p):i({era:p},"era"),f=p=>{switch(p){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return l();case"d":return r?i({day:"numeric"},"day"):this.num(e.day);case"dd":return r?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return h("short",!0);case"cccc":return h("long",!0);case"ccccc":return h("narrow",!0);case"E":return this.num(e.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(e.month);case"LL":return r?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return r?i({month:"numeric"},"month"):this.num(e.month);case"MM":return r?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return r?i({year:"numeric"},"year"):this.num(e.year);case"yy":return r?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return m(p)}};return Is(W.parseFormat(t),f)}formatDurationFromString(e,t){const s=u=>{switch(u[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},r=u=>h=>{const m=s(h);return m?this.num(u.get(m),h.length):h},i=W.parseFormat(t),o=i.reduce((u,{literal:h,val:m})=>h?u:u.concat(m),[]),l=e.shiftTo(...o.map(s).filter(u=>u));return Is(i,r(l))}}const Fn=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ve(...n){const e=n.reduce((t,s)=>t+s.source,"");return RegExp(`^${e}$`)}function Re(...n){return e=>n.reduce(([t,s,r],i)=>{const[o,l,u]=i(e,r);return[{...t,...o},l||s,u]},[{},null,1]).slice(0,2)}function Pe(n,...e){if(n==null)return[null,null];for(const[t,s]of e){const r=t.exec(n);if(r)return s(r)}return[null,null]}function Ln(...n){return(e,t)=>{const s={};let r;for(r=0;r<n.length;r++)s[n[r]]=ge(e[t+r]);return[s,null,t+r]}}const _n=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,ki=`(?:${_n.source}?(?:\\[(${Fn.source})\\])?)?`,ls=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Wn=RegExp(`${ls.source}${ki}`),cs=RegExp(`(?:T${Wn.source})?`),Di=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ti=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Oi=/(\d{4})-?(\d{3})/,Mi=Ln("weekYear","weekNumber","weekDay"),Ii=Ln("year","ordinal"),Ei=/(\d{4})-(\d\d)-(\d\d)/,$n=RegExp(`${ls.source} ?(?:${_n.source}|(${Fn.source}))?`),ji=RegExp(`(?: ${$n.source})?`);function $e(n,e,t){const s=n[e];return S(s)?t:ge(s)}function Ni(n,e){return[{year:$e(n,e),month:$e(n,e+1,1),day:$e(n,e+2,1)},null,e+3]}function Be(n,e){return[{hours:$e(n,e,0),minutes:$e(n,e+1,0),seconds:$e(n,e+2,0),milliseconds:os(n[e+3])},null,e+4]}function it(n,e){const t=!n[e]&&!n[e+1],s=Ot(n[e+1],n[e+2]),r=t?null:$.instance(s);return[{},r,e+3]}function ot(n,e){const t=n[e]?le.create(n[e]):null;return[{},t,e+1]}const Fi=RegExp(`^T?${ls.source}$`),Li=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function _i(n){const[e,t,s,r,i,o,l,u,h]=n,m=e[0]==="-",c=u&&u[0]==="-",f=(p,x=!1)=>p!==void 0&&(x||p&&m)?-p:p;return[{years:f(be(t)),months:f(be(s)),weeks:f(be(r)),days:f(be(i)),hours:f(be(o)),minutes:f(be(l)),seconds:f(be(u),u==="-0"),milliseconds:f(os(h),c)}]}const Wi={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function us(n,e,t,s,r,i,o){const l={year:e.length===2?Jt(ge(e)):ge(e),month:Tn.indexOf(t)+1,day:ge(s),hour:ge(r),minute:ge(i)};return o&&(l.second=ge(o)),n&&(l.weekday=n.length>3?Mn.indexOf(n)+1:In.indexOf(n)+1),l}const $i=/^(?:(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 Ai(n){const[,e,t,s,r,i,o,l,u,h,m,c]=n,f=us(e,r,s,t,i,o,l);let p;return u?p=Wi[u]:h?p=0:p=Ot(m,c),[f,new $(p)]}function Hi(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Vi=/^(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$/,Ri=/^(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$/,Pi=/^(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 Es(n){const[,e,t,s,r,i,o,l]=n;return[us(e,r,s,t,i,o,l),$.utcInstance]}function Bi(n){const[,e,t,s,r,i,o,l]=n;return[us(e,l,t,s,r,i,o),$.utcInstance]}const zi=Ve(Di,cs),Ui=Ve(Ti,cs),Gi=Ve(Oi,cs),Zi=Ve(Wn),An=Re(Ni,Be,it,ot),Yi=Re(Mi,Be,it,ot),qi=Re(Ii,Be,it,ot),Xi=Re(Be,it,ot);function Ji(n){return Pe(n,[zi,An],[Ui,Yi],[Gi,qi],[Zi,Xi])}function Qi(n){return Pe(Hi(n),[$i,Ai])}function Ki(n){return Pe(n,[Vi,Es],[Ri,Es],[Pi,Bi])}function eo(n){return Pe(n,[Li,_i])}const to=Re(Be);function so(n){return Pe(n,[Fi,to])}const no=Ve(Ei,ji),ro=Ve($n),io=Re(Be,it,ot);function oo(n){return Pe(n,[no,An],[ro,io])}const js="Invalid Duration",Hn={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},ao={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Hn},U=146097/400,Ie=146097/4800,lo={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:Ie/7,days:Ie,hours:Ie*24,minutes:Ie*24*60,seconds:Ie*24*60*60,milliseconds:Ie*24*60*60*1e3},...Hn},De=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],co=De.slice(0).reverse();function fe(n,e,t=!1){const s={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new b(s)}function Vn(n,e){var t;let s=(t=e.milliseconds)!=null?t:0;for(const r of co.slice(1))e[r]&&(s+=e[r]*n[r].milliseconds);return s}function Ns(n,e){const t=Vn(n,e)<0?-1:1;De.reduceRight((s,r)=>{if(S(e[r]))return s;if(s){const i=e[s]*t,o=n[r][s],l=Math.floor(i/o);e[r]+=l*t,e[s]-=l*o*t}return r},null),De.reduce((s,r)=>{if(S(e[r]))return s;if(s){const i=e[s]%1;e[s]-=i,e[r]+=i*n[s][r]}return r},null)}function uo(n){const e={};for(const[t,s]of Object.entries(n))s!==0&&(e[t]=s);return e}class b{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let s=t?lo:ao;e.matrix&&(s=e.matrix),this.values=e.values,this.loc=e.loc||D.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(e,t){return b.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new L(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new b({values:vt(e,b.normalizeUnit),loc:D.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Se(e))return b.fromMillis(e);if(b.isDuration(e))return e;if(typeof e=="object")return b.fromObject(e);throw new L(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[s]=eo(e);return s?b.fromObject(s,t):b.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[s]=so(e);return s?b.fromObject(s,t):b.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new L("need to specify a reason the Duration is invalid");const s=e instanceof ie?e:new ie(e,t);if(M.throwOnInvalid)throw new Wr(s);return new b({invalid:s})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new Gs(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const s={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?W.create(this.loc,s).formatDurationFromString(this,e):js}toHuman(e={}){if(!this.isValid)return js;const t=De.map(s=>{const r=this.values[s];return S(r)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:s.slice(0,-1)}).format(r)}).filter(s=>s);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=as(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},w.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Vn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=b.fromDurationLike(e),s={};for(const r of De)(Ae(t.values,r)||Ae(this.values,r))&&(s[r]=t.get(r)+this.get(r));return fe(this,{values:s},!0)}minus(e){if(!this.isValid)return this;const t=b.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const s of Object.keys(this.values))t[s]=Dn(e(this.values[s],s));return fe(this,{values:t},!0)}get(e){return this[b.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...vt(e,b.normalizeUnit)};return fe(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:s,matrix:r}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:s};return fe(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Ns(this.matrix,e),fe(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=uo(this.normalize().shiftToAll().toObject());return fe(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>b.normalizeUnit(o));const t={},s={},r=this.toObject();let i;for(const o of De)if(e.indexOf(o)>=0){i=o;let l=0;for(const h in s)l+=this.matrix[h][o]*s[h],s[h]=0;Se(r[o])&&(l+=r[o]);const u=Math.trunc(l);t[o]=u,s[o]=(l*1e3-u*1e3)/1e3}else Se(r[o])&&(s[o]=r[o]);for(const o in s)s[o]!==0&&(t[i]+=o===i?s[o]:s[o]/this.matrix[i][o]);return Ns(this.matrix,t),fe(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return fe(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(s,r){return s===void 0||s===0?r===void 0||r===0:s===r}for(const s of De)if(!t(this.values[s],e.values[s]))return!1;return!0}}const Ee="Invalid Interval";function ho(n,e){return!n||!n.isValid?O.invalid("missing or invalid start"):!e||!e.isValid?O.invalid("missing or invalid end"):e<n?O.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${e.toISO()}`):null}class O{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new L("need to specify a reason the Interval is invalid");const s=e instanceof ie?e:new ie(e,t);if(M.throwOnInvalid)throw new _r(s);return new O({invalid:s})}static fromDateTimes(e,t){const s=Ge(e),r=Ge(t),i=ho(s,r);return i??new O({start:s,end:r})}static after(e,t){const s=b.fromDurationLike(t),r=Ge(e);return O.fromDateTimes(r,r.plus(s))}static before(e,t){const s=b.fromDurationLike(t),r=Ge(e);return O.fromDateTimes(r.minus(s),r)}static fromISO(e,t){const[s,r]=(e||"").split("/",2);if(s&&r){let i,o;try{i=w.fromISO(s,t),o=i.isValid}catch{o=!1}let l,u;try{l=w.fromISO(r,t),u=l.isValid}catch{u=!1}if(o&&u)return O.fromDateTimes(i,l);if(o){const h=b.fromISO(r,t);if(h.isValid)return O.after(i,h)}else if(u){const h=b.fromISO(s,t);if(h.isValid)return O.before(l,h)}}return O.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const s=this.start.startOf(e,t);let r;return t!=null&&t.useLocaleWeeks?r=this.end.reconfigure({locale:s.locale}):r=this.end,r=r.startOf(e,t),Math.floor(r.diff(s,e).get(e))+(r.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?O.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Ge).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=t[i]||this.e,l=+o>+this.e?this.e:o;s.push(O.fromDateTimes(r,l)),r=l,i+=1}return s}splitBy(e){const t=b.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s}=this,r=1,i;const o=[];for(;s<this.e;){const l=this.start.plus(t.mapUnits(u=>u*r));i=+l>+this.e?this.e:l,o.push(O.fromDateTimes(s,i)),s=i,r+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,s=this.e<e.e?this.e:e.e;return t>=s?null:O.fromDateTimes(t,s)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,s=this.e>e.e?this.e:e.e;return O.fromDateTimes(t,s)}static merge(e){const[t,s]=e.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&&t.push(s),t}static xor(e){let t=null,s=0;const r=[],i=e.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),o=Array.prototype.concat(...i),l=o.sort((u,h)=>u.time-h.time);for(const u of l)s+=u.type==="s"?1:-1,s===1?t=u.time:(t&&+t!=+u.time&&r.push(O.fromDateTimes(t,u.time)),t=null);return O.merge(r)}difference(...e){return O.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ee}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=gt,t={}){return this.isValid?W.create(this.s.loc.clone(t),e).formatInterval(this):Ee}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ee}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ee}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ee}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Ee}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):b.invalid(this.invalidReason)}mapEndpoints(e){return O.fromDateTimes(e(this.s),e(this.e))}}class qe{static hasDST(e=M.defaultZone){const t=w.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return le.isValidZone(e)}static normalizeZone(e){return we(e,M.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||D.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||D.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||D.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:s=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||D.create(t,s,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:s=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||D.create(t,s,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:s=null,locObj:r=null}={}){return(r||D.create(t,s,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:s=null,locObj:r=null}={}){return(r||D.create(t,s,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return D.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return D.create(t,null,"gregory").eras(e)}static features(){return{relative:Cn(),localeWeek:bn()}}}function Fs(n,e){const t=r=>r.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=t(e)-t(n);return Math.floor(b.fromMillis(s).as("days"))}function po(n,e,t){const s=[["years",(u,h)=>h.year-u.year],["quarters",(u,h)=>h.quarter-u.quarter+(h.year-u.year)*4],["months",(u,h)=>h.month-u.month+(h.year-u.year)*12],["weeks",(u,h)=>{const m=Fs(u,h);return(m-m%7)/7}],["days",Fs]],r={},i=n;let o,l;for(const[u,h]of s)t.indexOf(u)>=0&&(o=u,r[u]=h(n,e),l=i.plus(r),l>e?(r[u]--,n=i.plus(r),n>e&&(l=n,r[u]--,n=i.plus(r))):n=l);return[n,r,l,o]}function mo(n,e,t,s){let[r,i,o,l]=po(n,e,t);const u=e-r,h=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);h.length===0&&(o<e&&(o=r.plus({[l]:1})),o!==r&&(i[l]=(i[l]||0)+u/(o-r)));const m=b.fromObject(i,s);return h.length>0?b.fromMillis(u,s).shiftTo(...h).plus(m):m}const fo="missing Intl.DateTimeFormat.formatToParts support";function k(n,e=t=>t){return{regex:n,deser:([t])=>e(ni(t))}}const go=" ",Rn=`[ ${go}]`,Pn=new RegExp(Rn,"g");function yo(n){return n.replace(/\./g,"\\.?").replace(Pn,Rn)}function Ls(n){return n.replace(/\./g,"").replace(Pn," ").toLowerCase()}function ne(n,e){return n===null?null:{regex:RegExp(n.map(yo).join("|")),deser:([t])=>n.findIndex(s=>Ls(t)===Ls(s))+e}}function _s(n,e){return{regex:n,deser:([,t,s])=>Ot(t,s),groups:e}}function lt(n){return{regex:n,deser:([e])=>e}}function xo(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function vo(n,e){const t=se(e),s=se(e,"{2}"),r=se(e,"{3}"),i=se(e,"{4}"),o=se(e,"{6}"),l=se(e,"{1,2}"),u=se(e,"{1,3}"),h=se(e,"{1,6}"),m=se(e,"{1,9}"),c=se(e,"{2,4}"),f=se(e,"{4,6}"),p=T=>({regex:RegExp(xo(T.val)),deser:([j])=>j,literal:!0}),F=(T=>{if(n.literal)return p(T);switch(T.val){case"G":return ne(e.eras("short"),0);case"GG":return ne(e.eras("long"),0);case"y":return k(h);case"yy":return k(c,Jt);case"yyyy":return k(i);case"yyyyy":return k(f);case"yyyyyy":return k(o);case"M":return k(l);case"MM":return k(s);case"MMM":return ne(e.months("short",!0),1);case"MMMM":return ne(e.months("long",!0),1);case"L":return k(l);case"LL":return k(s);case"LLL":return ne(e.months("short",!1),1);case"LLLL":return ne(e.months("long",!1),1);case"d":return k(l);case"dd":return k(s);case"o":return k(u);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(u);case"SSS":return k(r);case"u":return lt(m);case"uu":return lt(l);case"uuu":return k(t);case"a":return ne(e.meridiems(),0);case"kkkk":return k(i);case"kk":return k(c,Jt);case"W":return k(l);case"WW":return k(s);case"E":case"c":return k(t);case"EEE":return ne(e.weekdays("short",!1),1);case"EEEE":return ne(e.weekdays("long",!1),1);case"ccc":return ne(e.weekdays("short",!0),1);case"cccc":return ne(e.weekdays("long",!0),1);case"Z":case"ZZ":return _s(new RegExp(`([+-]${l.source})(?::(${s.source}))?`),2);case"ZZZ":return _s(new RegExp(`([+-]${l.source})(${s.source})?`),2);case"z":return lt(/[a-z_+-/]{1,256}?/i);case" ":return lt(/[^\S\n\r]/);default:return p(T)}})(n)||{invalidReason:fo};return F.token=n,F}const wo={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 So(n,e,t){const{type:s,value:r}=n;if(s==="literal"){const u=/^\s+$/.test(r);return{literal:!u,val:u?" ":r}}const i=e[s];let o=s;s==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let l=wo[o];if(typeof l=="object"&&(l=l[i]),l)return{literal:!1,val:l}}function Co(n){return[`^${n.map(t=>t.regex).reduce((t,s)=>`${t}(${s.source})`,"")}$`,n]}function bo(n,e,t){const s=n.match(e);if(s){const r={};let i=1;for(const o in t)if(Ae(t,o)){const l=t[o],u=l.groups?l.groups+1:1;!l.literal&&l.token&&(r[l.token.val[0]]=l.deser(s.slice(i,i+u))),i+=u}return[s,r]}else return[s,{}]}function ko(n){const e=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 t=null,s;return S(n.z)||(t=le.create(n.z)),S(n.Z)||(t||(t=new $(n.Z)),s=n.Z),S(n.q)||(n.M=(n.q-1)*3+1),S(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),S(n.u)||(n.S=os(n.u)),[Object.keys(n).reduce((i,o)=>{const l=e(o);return l&&(i[l]=n[o]),i},{}),t,s]}let Lt=null;function Do(){return Lt||(Lt=w.fromMillis(1555555555555)),Lt}function To(n,e){if(n.literal)return n;const t=W.macroTokenToFormatOpts(n.val),s=Gn(t,e);return s==null||s.includes(void 0)?n:s}function Bn(n,e){return Array.prototype.concat(...n.map(t=>To(t,e)))}class zn{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Bn(W.parseFormat(t),e),this.units=this.tokens.map(s=>vo(s,e)),this.disqualifyingUnit=this.units.find(s=>s.invalidReason),!this.disqualifyingUnit){const[s,r]=Co(this.units);this.regex=RegExp(s,"i"),this.handlers=r}}explainFromTokens(e){if(this.isValid){const[t,s]=bo(e,this.regex,this.handlers),[r,i,o]=s?ko(s):[null,null,void 0];if(Ae(s,"a")&&Ae(s,"H"))throw new Le("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:s,result:r,zone:i,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Un(n,e,t){return new zn(n,t).explainFromTokens(e)}function Oo(n,e,t){const{result:s,zone:r,specificOffset:i,invalidReason:o}=Un(n,e,t);return[s,r,i,o]}function Gn(n,e){if(!n)return null;const s=W.create(e,n).dtFormatter(Do()),r=s.formatToParts(),i=s.resolvedOptions();return r.map(o=>So(o,n,i))}const _t="Invalid DateTime",Mo=864e13;function Xe(n){return new ie("unsupported zone",`the zone "${n.name}" is not supported`)}function Wt(n){return n.weekData===null&&(n.weekData=yt(n.c)),n.weekData}function $t(n){return n.localWeekData===null&&(n.localWeekData=yt(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function ke(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new w({...t,...e,old:t})}function Zn(n,e,t){let s=n-e*60*1e3;const r=t.offset(s);if(e===r)return[s,e];s-=(r-e)*60*1e3;const i=t.offset(s);return r===i?[s,r]:[n-Math.min(r,i)*60*1e3,Math.max(r,i)]}function ct(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function mt(n,e,t){return Zn(Tt(n),e,t)}function Ws(n,e){const t=n.o,s=n.c.year+Math.trunc(e.years),r=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i={...n.c,year:s,month:r,day:Math.min(n.c.day,xt(s,r))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=b.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),l=Tt(i);let[u,h]=Zn(l,t,n.zone);return o!==0&&(u+=o,h=n.zone.offset(u)),{ts:u,o:h}}function je(n,e,t,s,r,i){const{setZone:o,zone:l}=t;if(n&&Object.keys(n).length!==0||e){const u=e||l,h=w.fromObject(n,{...t,zone:u,specificOffset:i});return o?h:h.setZone(l)}else return w.invalid(new ie("unparsable",`the input "${r}" can't be parsed as ${s}`))}function ut(n,e,t=!0){return n.isValid?W.create(D.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function At(n,e){const t=n.c.year>9999||n.c.year<0;let s="";return t&&n.c.year>=0&&(s+="+"),s+=I(n.c.year,t?6:4),e?(s+="-",s+=I(n.c.month),s+="-",s+=I(n.c.day)):(s+=I(n.c.month),s+=I(n.c.day)),s}function $s(n,e,t,s,r,i){let o=I(n.c.hour);return e?(o+=":",o+=I(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=":")):o+=I(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=I(n.c.second),(n.c.millisecond!==0||!s)&&(o+=".",o+=I(n.c.millisecond,3))),r&&(n.isOffsetFixed&&n.offset===0&&!i?o+="Z":n.o<0?(o+="-",o+=I(Math.trunc(-n.o/60)),o+=":",o+=I(Math.trunc(-n.o%60))):(o+="+",o+=I(Math.trunc(n.o/60)),o+=":",o+=I(Math.trunc(n.o%60)))),i&&(o+="["+n.zone.ianaName+"]"),o}const Yn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Io={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Eo={ordinal:1,hour:0,minute:0,second:0,millisecond:0},qn=["year","month","day","hour","minute","second","millisecond"],jo=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],No=["year","ordinal","hour","minute","second","millisecond"];function Fo(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new Gs(n);return e}function As(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Fo(n)}}function Lo(n){if(Je===void 0&&(Je=M.now()),n.type!=="iana")return n.offset(Je);const e=n.name;let t=Qt.get(e);return t===void 0&&(t=n.offset(Je),Qt.set(e,t)),t}function Hs(n,e){const t=we(e.zone,M.defaultZone);if(!t.isValid)return w.invalid(Xe(t));const s=D.fromObject(e);let r,i;if(S(n.year))r=M.now();else{for(const u of qn)S(n[u])&&(n[u]=Yn[u]);const o=wn(n)||Sn(n);if(o)return w.invalid(o);const l=Lo(t);[r,i]=mt(n,l,t)}return new w({ts:r,zone:t,loc:s,o:i})}function Vs(n,e,t){const s=S(t.round)?!0:t.round,r=(o,l)=>(o=as(o,s||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,l)),i=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return r(i(t.unit),t.unit);for(const o of t.units){const l=i(o);if(Math.abs(l)>=1)return r(l,o)}return r(n>e?-0:0,t.units[t.units.length-1])}function Rs(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}let Je;const Qt=new Map;class w{constructor(e){const t=e.zone||M.defaultZone;let s=e.invalid||(Number.isNaN(e.ts)?new ie("invalid input"):null)||(t.isValid?null:Xe(t));this.ts=S(e.ts)?M.now():e.ts;let r=null,i=null;if(!s)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{const l=Se(e.o)&&!e.old?e.o:t.offset(this.ts);r=ct(this.ts,l),s=Number.isNaN(r.year)?new ie("invalid input"):null,r=s?null:r,i=s?null:l}this._zone=t,this.loc=e.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 w({})}static local(){const[e,t]=Rs(arguments),[s,r,i,o,l,u,h]=t;return Hs({year:s,month:r,day:i,hour:o,minute:l,second:u,millisecond:h},e)}static utc(){const[e,t]=Rs(arguments),[s,r,i,o,l,u,h]=t;return e.zone=$.utcInstance,Hs({year:s,month:r,day:i,hour:o,minute:l,second:u,millisecond:h},e)}static fromJSDate(e,t={}){const s=li(e)?e.valueOf():NaN;if(Number.isNaN(s))return w.invalid("invalid input");const r=we(t.zone,M.defaultZone);return r.isValid?new w({ts:s,zone:r,loc:D.fromObject(t)}):w.invalid(Xe(r))}static fromMillis(e,t={}){if(Se(e))return e<-864e13||e>Mo?w.invalid("Timestamp out of range"):new w({ts:e,zone:we(t.zone,M.defaultZone),loc:D.fromObject(t)});throw new L(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Se(e))return new w({ts:e*1e3,zone:we(t.zone,M.defaultZone),loc:D.fromObject(t)});throw new L("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const s=we(t.zone,M.defaultZone);if(!s.isValid)return w.invalid(Xe(s));const r=D.fromObject(t),i=vt(e,As),{minDaysInFirstWeek:o,startOfWeek:l}=Ts(i,r),u=M.now(),h=S(t.specificOffset)?s.offset(u):t.specificOffset,m=!S(i.ordinal),c=!S(i.year),f=!S(i.month)||!S(i.day),p=c||f,x=i.weekYear||i.weekNumber;if((p||m)&&x)throw new Le("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&m)throw new Le("Can't mix ordinal dates with month/day");const F=x||i.weekday&&!p;let T,j,E=ct(u,h);F?(T=jo,j=Io,E=yt(E,o,l)):m?(T=No,j=Eo,E=Ft(E)):(T=qn,j=Yn);let Q=!1;for(const Ue of T){const Jn=i[Ue];S(Jn)?Q?i[Ue]=j[Ue]:i[Ue]=E[Ue]:Q=!0}const K=F?ii(i,o,l):m?oi(i):wn(i),ee=K||Sn(i);if(ee)return w.invalid(ee);const he=F?ks(i,o,l):m?Ds(i):i,[H,Ce]=mt(he,h,s),pe=new w({ts:H,zone:s,o:Ce,loc:r});return i.weekday&&p&&e.weekday!==pe.weekday?w.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${pe.toISO()}`):pe.isValid?pe:w.invalid(pe.invalid)}static fromISO(e,t={}){const[s,r]=Ji(e);return je(s,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[s,r]=Qi(e);return je(s,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[s,r]=Ki(e);return je(s,r,t,"HTTP",t)}static fromFormat(e,t,s={}){if(S(e)||S(t))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,u,h,m]=Oo(o,e,t);return m?w.invalid(m):je(l,u,s,`format ${t}`,e,h)}static fromString(e,t,s={}){return w.fromFormat(e,t,s)}static fromSQL(e,t={}){const[s,r]=oo(e);return je(s,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new L("need to specify a reason the DateTime is invalid");const s=e instanceof ie?e:new ie(e,t);if(M.throwOnInvalid)throw new Lr(s);return new w({invalid:s})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const s=Gn(e,D.fromObject(t));return s?s.map(r=>r?r.val:null).join(""):null}static expandFormat(e,t={}){return Bn(W.parseFormat(e),D.fromObject(t)).map(r=>r.val).join("")}static resetCache(){Je=void 0,Qt.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Wt(this).weekYear:NaN}get weekNumber(){return this.isValid?Wt(this).weekNumber:NaN}get weekday(){return this.isValid?Wt(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?$t(this).weekday:NaN}get localWeekNumber(){return this.isValid?$t(this).weekNumber:NaN}get localWeekYear(){return this.isValid?$t(this).weekYear:NaN}get ordinal(){return this.isValid?Ft(this.c).ordinal:NaN}get monthShort(){return this.isValid?qe.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?qe.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?qe.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?qe.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 e=864e5,t=6e4,s=Tt(this.c),r=this.zone.offset(s-e),i=this.zone.offset(s+e),o=this.zone.offset(s-r*t),l=this.zone.offset(s-i*t);if(o===l)return[this];const u=s-o*t,h=s-l*t,m=ct(u,o),c=ct(h,l);return m.hour===c.hour&&m.minute===c.minute&&m.second===c.second&&m.millisecond===c.millisecond?[ke(this,{ts:u}),ke(this,{ts:h})]:[this]}get isInLeapYear(){return rt(this.year)}get daysInMonth(){return xt(this.year,this.month)}get daysInYear(){return this.isValid?We(this.year):NaN}get weeksInWeekYear(){return this.isValid?et(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?et(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:s,calendar:r}=W.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:s,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone($.instance(e),t)}toLocal(){return this.setZone(M.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:s=!1}={}){if(e=we(e,M.defaultZone),e.equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||s){const i=e.offset(this.ts),o=this.toObject();[r]=mt(o,i,e)}return ke(this,{ts:r,zone:e})}else return w.invalid(Xe(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:s}={}){const r=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:s});return ke(this,{loc:r})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=vt(e,As),{minDaysInFirstWeek:s,startOfWeek:r}=Ts(t,this.loc),i=!S(t.weekYear)||!S(t.weekNumber)||!S(t.weekday),o=!S(t.ordinal),l=!S(t.year),u=!S(t.month)||!S(t.day),h=l||u,m=t.weekYear||t.weekNumber;if((h||o)&&m)throw new Le("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&o)throw new Le("Can't mix ordinal dates with month/day");let c;i?c=ks({...yt(this.c,s,r),...t},s,r):S(t.ordinal)?(c={...this.toObject(),...t},S(t.day)&&(c.day=Math.min(xt(c.year,c.month),c.day))):c=Ds({...Ft(this.c),...t});const[f,p]=mt(c,this.o,this.zone);return ke(this,{ts:f,o:p})}plus(e){if(!this.isValid)return this;const t=b.fromDurationLike(e);return ke(this,Ws(this,t))}minus(e){if(!this.isValid)return this;const t=b.fromDurationLike(e).negate();return ke(this,Ws(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const s={},r=b.normalizeUnit(e);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(t){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(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?W.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):_t}toLocaleString(e=gt,t={}){return this.isValid?W.create(this.loc.clone(t),e).formatDateTime(this):_t}toLocaleParts(e={}){return this.isValid?W.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:s=!1,includeOffset:r=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const o=e==="extended";let l=At(this,o);return l+="T",l+=$s(this,o,t,s,r,i),l}toISODate({format:e="extended"}={}){return this.isValid?At(this,e==="extended"):null}toISOWeekDate(){return ut(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:s=!0,includePrefix:r=!1,extendedZone:i=!1,format:o="extended"}={}){return this.isValid?(r?"T":"")+$s(this,o==="extended",t,e,s,i):null}toRFC2822(){return ut(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return ut(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?At(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:s=!0}={}){let r="HH:mm:ss.SSS";return(t||e)&&(s&&(r+=" "),t?r+="z":e&&(r+="ZZ")),ut(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():_t}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",s={}){if(!this.isValid||!e.isValid)return b.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...s},i=ci(t).map(b.normalizeUnit),o=e.valueOf()>this.valueOf(),l=o?this:e,u=o?e:this,h=mo(l,u,i,r);return o?h.negate():h}diffNow(e="milliseconds",t={}){return this.diff(w.now(),e,t)}until(e){return this.isValid?O.fromDateTimes(this,e):this}hasSame(e,t,s){if(!this.isValid)return!1;const r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,s)<=r&&r<=i.endOf(t,s)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||w.fromObject({},{zone:this.zone}),s=e.padding?this<t?-e.padding:e.padding:0;let r=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(r=e.unit,i=void 0),Vs(t,this.plus(s),{...e,numeric:"always",units:r,unit:i})}toRelativeCalendar(e={}){return this.isValid?Vs(e.base||w.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(w.isDateTime))throw new L("min requires all arguments be DateTimes");return Os(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(w.isDateTime))throw new L("max requires all arguments be DateTimes");return Os(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,s={}){const{locale:r=null,numberingSystem:i=null}=s,o=D.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return Un(o,e,t)}static fromStringExplain(e,t,s={}){return w.fromFormatExplain(e,t,s)}static buildFormatParser(e,t={}){const{locale:s=null,numberingSystem:r=null}=t,i=D.fromOpts({locale:s,numberingSystem:r,defaultToEN:!0});return new zn(i,e)}static fromFormatParser(e,t,s={}){if(S(e)||S(t))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(t.locale))throw new L(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:l,zone:u,specificOffset:h,invalidReason:m}=t.explainFromTokens(e);return m?w.invalid(m):je(l,u,s,`format ${t.format}`,e,h)}static get DATE_SHORT(){return gt}static get DATE_MED(){return Zs}static get DATE_MED_WITH_WEEKDAY(){return $r}static get DATE_FULL(){return Ys}static get DATE_HUGE(){return qs}static get TIME_SIMPLE(){return Xs}static get TIME_WITH_SECONDS(){return Js}static get TIME_WITH_SHORT_OFFSET(){return Qs}static get TIME_WITH_LONG_OFFSET(){return Ks}static get TIME_24_SIMPLE(){return en}static get TIME_24_WITH_SECONDS(){return tn}static get TIME_24_WITH_SHORT_OFFSET(){return sn}static get TIME_24_WITH_LONG_OFFSET(){return nn}static get DATETIME_SHORT(){return rn}static get DATETIME_SHORT_WITH_SECONDS(){return on}static get DATETIME_MED(){return an}static get DATETIME_MED_WITH_SECONDS(){return ln}static get DATETIME_MED_WITH_WEEKDAY(){return Ar}static get DATETIME_FULL(){return cn}static get DATETIME_FULL_WITH_SECONDS(){return un}static get DATETIME_HUGE(){return dn}static get DATETIME_HUGE_WITH_SECONDS(){return hn}}function Ge(n){if(w.isDateTime(n))return n;if(n&&n.valueOf&&Se(n.valueOf()))return w.fromJSDate(n);if(n&&typeof n=="object")return w.fromObject(n);throw new L(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const _o="3.6.1";z.DateTime=w;z.Duration=b;z.FixedOffsetZone=$;z.IANAZone=le;z.Info=qe;z.Interval=O;z.InvalidZone=fn;z.Settings=M;z.SystemZone=nt;z.VERSION=_o;z.Zone=He;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CronDate=n.DAYS_IN_MONTH=n.DateMathOp=n.TimeUnit=void 0;const e=z;var t;(function(i){i.Second="Second",i.Minute="Minute",i.Hour="Hour",i.Day="Day",i.Month="Month",i.Year="Year"})(t||(n.TimeUnit=t={}));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{#e;#s=null;#n=null;#r={add:{[t.Year]:this.addYear.bind(this),[t.Month]:this.addMonth.bind(this),[t.Day]:this.addDay.bind(this),[t.Hour]:this.addHour.bind(this),[t.Minute]:this.addMinute.bind(this),[t.Second]:this.addSecond.bind(this)},subtract:{[t.Year]:this.subtractYear.bind(this),[t.Month]:this.subtractMonth.bind(this),[t.Day]:this.subtractDay.bind(this),[t.Hour]:this.subtractHour.bind(this),[t.Minute]:this.subtractMinute.bind(this),[t.Second]:this.subtractSecond.bind(this)}};constructor(o,l){const u={zone:l};if(o?o instanceof r?(this.#e=o.#e,this.#s=o.#s,this.#n=o.#n):o instanceof Date?this.#e=e.DateTime.fromJSDate(o,u):typeof o=="number"?this.#e=e.DateTime.fromMillis(o,u):(this.#e=e.DateTime.fromISO(o,u),this.#e.isValid||(this.#e=e.DateTime.fromRFC2822(o,u)),this.#e.isValid||(this.#e=e.DateTime.fromSQL(o,u)),this.#e.isValid||(this.#e=e.DateTime.fromFormat(o,"EEE, d MMM yyyy HH:mm:ss",u))):this.#e=e.DateTime.local(),!this.#e.isValid)throw new Error(`CronDate: unhandled timestamp: ${o}`);l&&l!==this.#e.zoneName&&(this.#e=this.#e.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.#e=this.#e.plus({years:1})}addMonth(){this.#e=this.#e.plus({months:1}).startOf("month")}addDay(){this.#e=this.#e.plus({days:1}).startOf("day")}addHour(){this.#e=this.#e.plus({hours:1}).startOf("hour")}addMinute(){this.#e=this.#e.plus({minutes:1}).startOf("minute")}addSecond(){this.#e=this.#e.plus({seconds:1})}subtractYear(){this.#e=this.#e.minus({years:1})}subtractMonth(){this.#e=this.#e.minus({months:1}).endOf("month").startOf("second")}subtractDay(){this.#e=this.#e.minus({days:1}).endOf("day").startOf("second")}subtractHour(){this.#e=this.#e.minus({hours:1}).endOf("hour").startOf("second")}subtractMinute(){this.#e=this.#e.minus({minutes:1}).endOf("minute").startOf("second")}subtractSecond(){this.#e=this.#e.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.#e.day}getFullYear(){return this.#e.year}getDay(){const o=this.#e.weekday;return o===7?0:o}getMonth(){return this.#e.month-1}getHours(){return this.#e.hour}getMinutes(){return this.#e.minute}getSeconds(){return this.#e.second}getMilliseconds(){return this.#e.millisecond}getTime(){return this.#e.valueOf()}getUTCDate(){return this.#t().day}getUTCFullYear(){return this.#t().year}getUTCDay(){const o=this.#t().weekday;return o===7?0:o}getUTCMonth(){return this.#t().month-1}getUTCHours(){return this.#t().hour}getUTCMinutes(){return this.#t().minute}getUTCSeconds(){return this.#t().second}toISOString(){return this.#e.toUTC().toISO()}toJSON(){return this.#e.toJSON()}setDate(o){this.#e=this.#e.set({day:o})}setFullYear(o){this.#e=this.#e.set({year:o})}setDay(o){this.#e=this.#e.set({weekday:o})}setMonth(o){this.#e=this.#e.set({month:o+1})}setHours(o){this.#e=this.#e.set({hour:o})}setMinutes(o){this.#e=this.#e.set({minute:o})}setSeconds(o){this.#e=this.#e.set({second:o})}setMilliseconds(o){this.#e=this.#e.set({millisecond:o})}toString(){return this.toDate().toString()}toDate(){return this.#e.toJSDate()}isLastDayOfMonth(){const{day:o,month:l}=this.#e;if(l===2){const u=r.#i(this.#e.year);return o===n.DAYS_IN_MONTH[l-1]-(u?0:1)}return o===n.DAYS_IN_MONTH[l-1]}isLastWeekdayOfMonth(){const{day:o,month:l}=this.#e;let u;return l===2?u=n.DAYS_IN_MONTH[l-1]-(r.#i(this.#e.year)?0:1):u=n.DAYS_IN_MONTH[l-1],o>u-7}applyDateOperation(o,l,u){if(l===t.Month||l===t.Day){this.invokeDateOperation(o,l);return}const h=this.getHours();this.invokeDateOperation(o,l);const m=this.getHours(),c=m-h;c===2?u!==24&&(this.dstStart=m):c===0&&this.getMinutes()===0&&this.getSeconds()===0&&u!==24&&(this.dstEnd=m)}#t(){return this.#e.toUTC()}}n.CronDate=r,n.default=r})(st);Object.defineProperty(kt,"__esModule",{value:!0});kt.CronMonth=void 0;const Wo=st,$o=ue,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(e,t){super(e,t),this.validate()}get values(){return super.values}}kt.CronMonth=Ro;var It={};Object.defineProperty(It,"__esModule",{value:!0});It.CronSecond=void 0;const Po=ue,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(e,t){super(e,t),this.validate()}get values(){return super.values}}It.CronSecond=Go;(function(n){var e=ve&&ve.__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]}),t=ve&&ve.__exportStar||function(s,r){for(var i in s)i!=="default"&&!Object.prototype.hasOwnProperty.call(r,i)&&e(r,s,i)};Object.defineProperty(n,"__esModule",{value:!0}),t(Us,n),t(wt,n),t(St,n),t(ue,n),t(Ct,n),t(bt,n),t(kt,n),t(It,n)})(ve);Object.defineProperty(tt,"__esModule",{value:!0});tt.CronFieldCollection=void 0;const G=ve;class _e{#e;#s;#n;#r;#i;#t;static from(e,t){return new _e({second:this.resolveField(G.CronSecond,e.second,t.second),minute:this.resolveField(G.CronMinute,e.minute,t.minute),hour:this.resolveField(G.CronHour,e.hour,t.hour),dayOfMonth:this.resolveField(G.CronDayOfMonth,e.dayOfMonth,t.dayOfMonth),month:this.resolveField(G.CronMonth,e.month,t.month),dayOfWeek:this.resolveField(G.CronDayOfWeek,e.dayOfWeek,t.dayOfWeek)})}static resolveField(e,t,s){return s?s instanceof G.CronField?s:new e(s):t}constructor({second:e,minute:t,hour:s,dayOfMonth:r,month:i,dayOfWeek:o}){if(!e)throw new Error("Validation error, Field second is missing");if(!t)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.#e=e,this.#s=t,this.#n=s,this.#i=i,this.#t=o,this.#r=r}get second(){return this.#e}get minute(){return this.#s}get hour(){return this.#n}get dayOfMonth(){return this.#r}get month(){return this.#i}get dayOfWeek(){return this.#t}static compactField(e){if(e.length===0)return[];const t=[];let s;return e.forEach((r,i,o)=>{if(s===void 0){s={start:r,count:1};return}const l=o[i-1]||s.start,u=o[i+1];if(r==="L"||r==="W"){t.push(s),t.push({start:r,count:1}),s=void 0;return}if(s.step===void 0&&u!==void 0){const h=r-l,m=u-r;if(h<=m){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?t.push({start:s.start,count:1}):s.count===2?(t.push({start:s.start,count:1}),t.push({start:s.end??l,count:1})):t.push(s),s={start:r,count:1})}),s&&t.push(s),t}static#o(e,t,s){const r=t.step;return r?r===1&&t.start===e.min&&t.end&&t.end>=s?e.hasQuestionMarkChar?"?":"*":r!==1&&t.start===e.min&&t.end&&t.end>=s-r+1?`*/${r}`:null:null}static#a(e,t){const s=e.step;if(s===1)return`${e.start}-${e.end}`;const r=e.start===0?e.count-1:e.count;if(!s)throw new Error("Unexpected range step");if(!e.end)throw new Error("Unexpected range end");if(s*r>e.end){const i=(l,u)=>{if(typeof e.start!="number")throw new Error("Unexpected range start");return u%s===0?e.start+u:null};if(typeof e.start!="number")throw new Error("Unexpected range start");const o={length:e.end-e.start+1};return Array.from(o,i).filter(l=>l!==null).join(",")}return e.end===t-s+1?`${e.start}/${s}`:`${e.start}-${e.end}/${s}`}stringifyField(e){let t=e.max,s=e.values;if(e instanceof G.CronDayOfWeek){t=6;const i=this.#t.values;s=i[i.length-1]===7?i.slice(0,-1):i}e instanceof G.CronDayOfMonth&&(t=this.#i.values.length===1?G.CronMonth.daysInMonth[this.#i.values[0]-1]:e.max);const r=_e.compactField(s);if(r.length===1){const i=_e.#o(e,r[0],t);if(i)return i}return r.map(i=>{const o=i.count===1?i.start.toString():_e.#a(i,t);return e instanceof G.CronDayOfWeek&&e.nthDay>0?`${o}#${e.nthDay}`:o}).join(",")}stringify(e=!1){const t=[];return e&&t.push(this.stringifyField(this.#e)),t.push(this.stringifyField(this.#s),this.stringifyField(this.#n),this.stringifyField(this.#r),this.stringifyField(this.#i),this.stringifyField(this.#t)),t.join(" ")}serialize(){return{second:this.#e.serialize(),minute:this.#s.serialize(),hour:this.#n.serialize(),dayOfMonth:this.#r.serialize(),month:this.#i.serialize(),dayOfWeek:this.#t.serialize()}}}tt.CronFieldCollection=_e;var ze={};Object.defineProperty(ze,"__esModule",{value:!0});ze.CronExpression=void 0;const N=st,Ps=1e4;class q{#e;#s;#n;#r;#i;#t;constructor(e,t){this.#e=t,this.#s=t.tz,this.#n=new N.CronDate(t.currentDate,this.#s),this.#r=t.startDate?new N.CronDate(t.startDate,this.#s):null,this.#i=t.endDate?new N.CronDate(t.endDate,this.#s):null,this.#t=e}get fields(){return this.#t}static fieldsToExpression(e,t){return new q(e,t||{})}static#o(e,t){return t.some(s=>s===e)}static#a(e,t){const s=t.isLastWeekdayOfMonth();return e.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 t.getDay()===i&&s})}next(){return this.#l()}prev(){return this.#l(!0)}hasNext(){const e=this.#n;try{return this.#l(),!0}catch{return!1}finally{this.#n=e}}hasPrev(){const e=this.#n;try{return this.#l(!0),!0}catch{return!1}finally{this.#n=e}}take(e){const t=[];if(e>=0)for(let s=0;s<e;s++)try{t.push(this.next())}catch{return t}else for(let s=0;s>e;s--)try{t.push(this.prev())}catch{return t}return t}reset(e){this.#n=new N.CronDate(e||this.#e.currentDate)}stringify(e=!1){return this.#t.stringify(e)}includesDate(e){const{second:t,minute:s,hour:r,month:i}=this.#t,o=new N.CronDate(e,this.#s);return!(!t.values.includes(o.getSeconds())||!s.values.includes(o.getMinutes())||!r.values.includes(o.getHours())||!i.values.includes(o.getMonth()+1)||!this.#c(o)||this.#t.dayOfWeek.nthDay>0&&Math.ceil(o.getDate()/7)!==this.#t.dayOfWeek.nthDay)}toString(){return this.#e.expression||this.stringify(!0)}#c(e){const t=this.#t.dayOfMonth.isWildcard,s=!t,r=this.#t.dayOfWeek.isWildcard,i=!r,o=q.#o(e.getDate(),this.#t.dayOfMonth.values)||this.#t.dayOfMonth.hasLastChar&&e.isLastDayOfMonth(),l=q.#o(e.getDay(),this.#t.dayOfWeek.values)||this.#t.dayOfWeek.hasLastChar&&q.#a(this.#t.dayOfWeek.values,e);return!!(s&&i&&(o||l)||o&&!i||t&&!r&&l)}#u(e,t,s){const r=e.getHours(),i=q.#o(r,this.#t.hour.values),o=e.dstStart===r,l=e.dstEnd===r;return!i&&!o?(e.dstStart=null,e.applyDateOperation(t,N.TimeUnit.Hour,this.#t.hour.values.length),!1):o&&!q.#o(r-1,this.#t.hour.values)?(e.invokeDateOperation(t,N.TimeUnit.Hour),!1):l&&!s?(e.dstEnd=null,e.applyDateOperation(N.DateMathOp.Add,N.TimeUnit.Hour,this.#t.hour.values.length),!1):!0}#l(e=!1){const t=e?N.DateMathOp.Subtract:N.DateMathOp.Add,s=new N.CronDate(this.#n),r=this.#r,i=this.#i,o=s.getTime();let l=0;for(;l++<Ps;){if(l>Ps)throw new Error("Invalid expression, loop limit exceeded");if(e&&r&&r.getTime()>s.getTime())throw new Error("Out of the timespan range");if(!e&&i&&s.getTime()>i.getTime())throw new Error("Out of the timespan range");if(!this.#c(s)){s.applyDateOperation(t,N.TimeUnit.Day,this.#t.hour.values.length);continue}if(!(this.#t.dayOfWeek.nthDay<=0||Math.ceil(s.getDate()/7)===this.#t.dayOfWeek.nthDay)){s.applyDateOperation(t,N.TimeUnit.Day,this.#t.hour.values.length);continue}if(!q.#o(s.getMonth()+1,this.#t.month.values)){s.applyDateOperation(t,N.TimeUnit.Month,this.#t.hour.values.length);continue}if(this.#u(s,t,e)){if(!q.#o(s.getMinutes(),this.#t.minute.values)){s.applyDateOperation(t,N.TimeUnit.Minute,this.#t.hour.values.length);continue}if(!q.#o(s.getSeconds(),this.#t.second.values)){s.applyDateOperation(t,N.TimeUnit.Second,this.#t.hour.values.length);continue}if(o===s.getTime()){(t==="Add"||s.getMilliseconds()===0)&&s.applyDateOperation(t,N.TimeUnit.Second,this.#t.hour.values.length);continue}break}}return s.getMilliseconds()!==0&&s.setMilliseconds(0),this.#n=s,s}[Symbol.iterator](){return{next:()=>({value:this.#l(),done:!this.hasNext()})}}}ze.CronExpression=q;ze.default=q;var ds={};Object.defineProperty(ds,"__esModule",{value:!0});ds.seededRandom=qo;function Zo(n){let e=2166136261;for(let t=0;t<n.length;t++)e^=n.charCodeAt(t),e=Math.imul(e,16777619);return()=>e>>>0}function Yo(n){return()=>{let e=n+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function qo(n){const e=n?Zo(n)():Math.floor(Math.random()*1e10);return Yo(e)}Object.defineProperty(P,"__esModule",{value:!0});P.CronExpressionParser=P.DayOfWeek=P.Months=P.CronUnit=P.PredefinedExpressions=void 0;const Xo=tt,Jo=st,Qo=ze,Ko=ds,Z=ve;var Kt;(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"})(Kt||(P.PredefinedExpressions=Kt={}));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 es;(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"})(es||(P.Months=es={}));var ts;(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"})(ts||(P.DayOfWeek=ts={}));class A{static parse(e,t={}){const{strict:s=!1}=t,r=t.currentDate||new Jo.CronDate,i=(0,Ko.seededRandom)(t.hashSeed);e=Kt[e]||e;const o=A.#e(e,s);if(!(o.dayOfMonth==="*"||o.dayOfWeek==="*"||!s))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");const l=A.#s(Y.Second,o.second,Z.CronSecond.constraints,i),u=A.#s(Y.Minute,o.minute,Z.CronMinute.constraints,i),h=A.#s(Y.Hour,o.hour,Z.CronHour.constraints,i),m=A.#s(Y.Month,o.month,Z.CronMonth.constraints,i),c=A.#s(Y.DayOfMonth,o.dayOfMonth,Z.CronDayOfMonth.constraints,i),{dayOfWeek:f,nthDayOfWeek:p}=A.#c(o.dayOfWeek),x=A.#s(Y.DayOfWeek,f,Z.CronDayOfWeek.constraints,i),F=new Xo.CronFieldCollection({second:new Z.CronSecond(l,{rawValue:o.second}),minute:new Z.CronMinute(u,{rawValue:o.minute}),hour:new Z.CronHour(h,{rawValue:o.hour}),dayOfMonth:new Z.CronDayOfMonth(c,{rawValue:o.dayOfMonth}),month:new Z.CronMonth(m,{rawValue:o.month}),dayOfWeek:new Z.CronDayOfWeek(x,{rawValue:o.dayOfWeek,nthDayOfWeek:p})});return new Qo.CronExpression(F,{...t,expression:e,currentDate:r})}static#e(e,t){if(t&&!e.length)throw new Error("Invalid cron expression");e=e||"0 * * * * *";const s=e.trim().split(/\s+/);if(t&&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,u,h,m]=s;return{second:i,minute:o,hour:l,dayOfMonth:u,month:h,dayOfWeek:m}}static#s(e,t,s,r){if((e===Y.Month||e===Y.DayOfWeek)&&(t=t.replace(/[a-z]{3}/gi,i=>{i=i.toLowerCase();const o=es[i]||ts[i];if(o===void 0)throw new Error(`Validation error, cannot resolve alias "${i}"`);return o.toString()})),!s.validChars.test(t))throw new Error(`Invalid characters, got value: ${t}`);return t=t.replace(/[*?]/g,s.min+"-"+s.max),t=t.replace(/H/g,String(Math.floor(r()*(s.max-s.min+1)+s.min))),A.#n(e,t,s)}static#n(e,t,s){const r=[];function i(l,u){if(Array.isArray(l))r.push(...l);else if(A.#u(u,l))r.push(l);else{const h=parseInt(l.toString(),10);if(!(h>=u.min&&h<=u.max))throw new Error(`Constraint error, got value ${l} expected range ${u.min}-${u.max}`);r.push(e===Y.DayOfWeek?h%7:l)}}return t.split(",").forEach(l=>{if(!(l.length>0))throw new Error("Invalid list value format");i(A.#r(e,l,s),s)}),r}static#r(e,t,s){const r=t.split("/");if(r.length>2)throw new Error(`Invalid repeat: ${t}`);return r.length===2?(isNaN(parseInt(r[0],10))||(r[0]=`${r[0]}-${s.max}`),A.#a(e,r[0],parseInt(r[1],10),s)):A.#a(e,t,1,s)}static#i(e,t,s){if(!(!isNaN(e)&&!isNaN(t)&&e>=s.min&&t<=s.max))throw new Error(`Constraint error, got range ${e}-${t} expected range ${s.min}-${s.max}`);if(e>t)throw new Error(`Invalid range: ${e}-${t}, min(${e}) > max(${t})`)}static#t(e){if(!(!isNaN(e)&&e>0))throw new Error(`Constraint error, cannot repeat at every ${e} time.`)}static#o(e,t,s,r){const i=[];e===Y.DayOfWeek&&s%7===0&&i.push(0);for(let o=t;o<=s;o+=r)i.indexOf(o)===-1&&i.push(o);return i}static#a(e,t,s,r){const i=t.split("-");if(i.length<=1)return isNaN(+t)?t:+t;const[o,l]=i.map(u=>parseInt(u,10));return this.#i(o,l,r),this.#t(s),this.#o(e,o,l,s)}static#c(e){const t=e.split("#");if(t.length<=1)return{dayOfWeek:t[0]};const s=+t[t.length-1],r=e.match(/([,-/])/);if(r!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${r==null?void 0:r[0]}\` special characters are incompatible`);if(!(t.length<=2&&!isNaN(s)&&s>=1&&s<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:t[0],nthDayOfWeek:s}}static#u(e,t){return e.chars.some(s=>t.toString().includes(s))}}P.CronExpressionParser=A;var ce={},ea=ce&&ce.__createBinding||(Object.create?function(n,e,t,s){s===void 0&&(s=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,s,r)}:function(n,e,t,s){s===void 0&&(s=t),n[s]=e[t]}),ta=ce&&ce.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),sa=ce&&ce.__importStar||function(){var n=function(e){return n=Object.getOwnPropertyNames||function(t){var s=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(s[s.length]=r);return s},n(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var s=n(e),r=0;r<s.length;r++)s[r]!=="default"&&ea(t,e,s[r]);return ta(t,e),t}}();Object.defineProperty(ce,"__esModule",{value:!0});ce.CronFileParser=void 0;const na=P;class Ke{static async parseFile(e){const{readFile:t}=await Promise.resolve().then(()=>sa(hs)),s=await t(e,"utf8");return Ke.#e(s)}static parseFileSync(e){const{readFileSync:t}=hs,s=t(e,"utf8");return Ke.#e(s)}static#e(e){const t=e.split(`
2
- `),s={variables:{},expressions:[],errors:{}};for(const r of t){const i=r.trim();if(i.length===0||i.startsWith("#"))continue;const o=i.match(/^(.*)=(.*)$/);if(o){const[,l,u]=o;s.variables[l]=u.replace(/["']/g,"");continue}try{const l=Ke.#s(i);s.expressions.push(l.interval)}catch(l){s.errors[i]=l}}return s}static#s(e){const t=e.split(" ");return{interval:na.CronExpressionParser.parse(t.slice(0,5).join(" ")),command:t.slice(5,t.length)}}}ce.CronFileParser=Ke;(function(n){var e=Fe&&Fe.__createBinding||(Object.create?function(h,m,c,f){f===void 0&&(f=c);var p=Object.getOwnPropertyDescriptor(m,c);(!p||("get"in p?!m.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return m[c]}}),Object.defineProperty(h,f,p)}:function(h,m,c,f){f===void 0&&(f=c),h[f]=m[c]}),t=Fe&&Fe.__exportStar||function(h,m){for(var c in h)c!=="default"&&!Object.prototype.hasOwnProperty.call(m,c)&&e(m,h,c)};Object.defineProperty(n,"__esModule",{value:!0}),n.CronFileParser=n.CronExpressionParser=n.CronExpression=n.CronFieldCollection=n.CronDate=void 0;const s=P;var r=st;Object.defineProperty(n,"CronDate",{enumerable:!0,get:function(){return r.CronDate}});var i=tt;Object.defineProperty(n,"CronFieldCollection",{enumerable:!0,get:function(){return i.CronFieldCollection}});var o=ze;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 u=ce;Object.defineProperty(n,"CronFileParser",{enumerable:!0,get:function(){return u.CronFileParser}}),t(ve,n),n.default=s.CronExpressionParser})(Fe);var ra={exports:{}};(function(n,e){(function(s,r){n.exports=r(Bs)})(globalThis,t=>(()=>{var s={93:c=>{c.exports=t}},r={};function i(c){var f=r[c];if(f!==void 0)return f.exports;var p=r[c]={exports:{}};return s[c](p,p.exports,i),p.exports}i.n=c=>{var f=c&&c.__esModule?()=>c.default:()=>c;return i.d(f,{a:f}),f},i.d=(c,f)=>{for(var p in f)i.o(f,p)&&!i.o(c,p)&&Object.defineProperty(c,p,{enumerable:!0,get:f[p]})},i.o=(c,f)=>Object.prototype.hasOwnProperty.call(c,f),i.r=c=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})};var o={};i.r(o);var l=i(93),u=i.n(l),h=o;Object.defineProperty(h,"__esModule",{value:!0}),h.en=void 0;var m=function(){function c(){}return c.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},c.prototype.atX0MinutesPastTheHourGt20=function(){return null},c.prototype.commaMonthX0ThroughMonthX1=function(){return null},c.prototype.commaYearX0ThroughYearX1=function(){return null},c.prototype.use24HourTimeFormatByDefault=function(){return!1},c.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},c.prototype.everyMinute=function(){return"every minute"},c.prototype.everyHour=function(){return"every hour"},c.prototype.atSpace=function(){return"At "},c.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},c.prototype.at=function(){return"At"},c.prototype.spaceAnd=function(){return" and"},c.prototype.everySecond=function(){return"every second"},c.prototype.everyX0Seconds=function(){return"every %s seconds"},c.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},c.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},c.prototype.everyX0Minutes=function(){return"every %s minutes"},c.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},c.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},c.prototype.everyX0Hours=function(){return"every %s hours"},c.prototype.betweenX0AndX1=function(){return"between %s and %s"},c.prototype.atX0=function(){return"at %s"},c.prototype.commaEveryDay=function(){return", every day"},c.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},c.prototype.commaX0ThroughX1=function(){return", %s through %s"},c.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},c.prototype.first=function(){return"first"},c.prototype.second=function(){return"second"},c.prototype.third=function(){return"third"},c.prototype.fourth=function(){return"fourth"},c.prototype.fifth=function(){return"fifth"},c.prototype.commaOnThe=function(){return", on the "},c.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},c.prototype.lastDay=function(){return"the last day"},c.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},c.prototype.commaOnlyOnX0=function(){return", only on %s"},c.prototype.commaAndOnX0=function(){return", and on %s"},c.prototype.commaEveryX0Months=function(){return", every %s months"},c.prototype.commaOnlyInX0=function(){return", only in %s"},c.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},c.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},c.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},c.prototype.firstWeekday=function(){return"first weekday"},c.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},c.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},c.prototype.commaEveryX0Days=function(){return", every %s days"},c.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},c.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},c.prototype.commaEveryHour=function(){return", every hour"},c.prototype.commaEveryX0Years=function(){return", every %s years"},c.prototype.commaStartingX0=function(){return", starting %s"},c.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},c.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},c.prototype.atReboot=function(){return"Run once, at startup"},c}();return h.en=m,u().locales.en=new m,o})())})(ra);var ia={exports:{}};(function(n,e){(function(s,r){n.exports=r(Bs)})(globalThis,t=>(()=>{var s={93:c=>{c.exports=t}},r={};function i(c){var f=r[c];if(f!==void 0)return f.exports;var p=r[c]={exports:{}};return s[c](p,p.exports,i),p.exports}i.n=c=>{var f=c&&c.__esModule?()=>c.default:()=>c;return i.d(f,{a:f}),f},i.d=(c,f)=>{for(var p in f)i.o(f,p)&&!i.o(c,p)&&Object.defineProperty(c,p,{enumerable:!0,get:f[p]})},i.o=(c,f)=>Object.prototype.hasOwnProperty.call(c,f),i.r=c=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})};var o={};i.r(o);var l=i(93),u=i.n(l),h=o;Object.defineProperty(h,"__esModule",{value:!0}),h.nl=void 0;var m=function(){function c(){}return c.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},c.prototype.atX0MinutesPastTheHourGt20=function(){return null},c.prototype.commaMonthX0ThroughMonthX1=function(){return null},c.prototype.commaYearX0ThroughYearX1=function(){return null},c.prototype.use24HourTimeFormatByDefault=function(){return!0},c.prototype.everyMinute=function(){return"elke minuut"},c.prototype.everyHour=function(){return"elk uur"},c.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"Er is een fout opgetreden bij het vertalen van de gegevens. Controleer de gegevens."},c.prototype.atSpace=function(){return"Om "},c.prototype.everyMinuteBetweenX0AndX1=function(){return"Elke minuut tussen %s en %s"},c.prototype.at=function(){return"Om"},c.prototype.spaceAnd=function(){return" en"},c.prototype.everySecond=function(){return"elke seconde"},c.prototype.everyX0Seconds=function(){return"elke %s seconden"},c.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconden %s t/m %s na de minuut"},c.prototype.atX0SecondsPastTheMinute=function(){return"op %s seconden na de minuut"},c.prototype.everyX0Minutes=function(){return"elke %s minuten"},c.prototype.minutesX0ThroughX1PastTheHour=function(){return"minuut %s t/m %s na het uur"},c.prototype.atX0MinutesPastTheHour=function(){return"op %s minuten na het uur"},c.prototype.everyX0Hours=function(){return"elke %s uur"},c.prototype.betweenX0AndX1=function(){return"tussen %s en %s"},c.prototype.atX0=function(){return"om %s"},c.prototype.commaEveryDay=function(){return", elke dag"},c.prototype.commaEveryX0DaysOfTheWeek=function(){return", elke %s dagen van de week"},c.prototype.commaX0ThroughX1=function(){return", %s t/m %s"},c.prototype.commaAndX0ThroughX1=function(){return", en %s t/m %s"},c.prototype.first=function(){return"eerste"},c.prototype.second=function(){return"tweede"},c.prototype.third=function(){return"derde"},c.prototype.fourth=function(){return"vierde"},c.prototype.fifth=function(){return"vijfde"},c.prototype.commaOnThe=function(){return", op de "},c.prototype.spaceX0OfTheMonth=function(){return" %s van de maand"},c.prototype.lastDay=function(){return"de laatste dag"},c.prototype.commaOnTheLastX0OfTheMonth=function(){return", op de laatste %s van de maand"},c.prototype.commaOnlyOnX0=function(){return", alleen op %s"},c.prototype.commaAndOnX0=function(){return", en op %s"},c.prototype.commaEveryX0Months=function(){return", elke %s maanden"},c.prototype.commaOnlyInX0=function(){return", alleen in %s"},c.prototype.commaOnTheLastDayOfTheMonth=function(){return", op de laatste dag van de maand"},c.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", op de laatste werkdag van de maand"},c.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s dagen vóór de laatste dag van de maand"},c.prototype.firstWeekday=function(){return"eerste werkdag"},c.prototype.weekdayNearestDayX0=function(){return"werkdag dichtst bij dag %s"},c.prototype.commaOnTheX0OfTheMonth=function(){return", op de %s van de maand"},c.prototype.commaEveryX0Days=function(){return", elke %s dagen"},c.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", tussen dag %s en %s van de maand"},c.prototype.commaOnDayX0OfTheMonth=function(){return", op dag %s van de maand"},c.prototype.commaEveryX0Years=function(){return", elke %s jaren"},c.prototype.commaStartingX0=function(){return", beginnend %s"},c.prototype.daysOfTheWeek=function(){return["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},c.prototype.monthsOfTheYear=function(){return["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]},c}();return h.nl=m,u().locales.nl=new m,o})())})(ia);const dt={nowrap:{flexFlow:"nowrap",overflow:"hidden"},width:{width:"100%",overflow:"hidden"},tooltip:{pointerEvents:"none"}},re=n=>a.jsxs(d.Grid2,{container:!0,title:n.icon?"":n.tooltip||"",alignItems:"center",direction:"row",spacing:1,style:dt.nowrap,children:[n.icon&&a.jsx(d.Grid2,{style:{minWidth:24},children:a.jsx(d.Tooltip,{title:n.tooltip||"",slotProps:{popper:{sx:dt.tooltip}},children:n.icon})}),a.jsx(d.Grid2,{style:dt.width,children:a.jsx(d.Tooltip,{title:n.tooltip||"",slotProps:{popper:{sx:dt.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 Te.Component{render(){if(!this.props.links||!this.props.links.length)return null;const e=this.props.links[0].port,t=this.props.links.find(s=>s.port!==e);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:pt.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:oe.getText(s.name,de.getLanguage())+(t?` [:${s.port}]`:"")})]},oe.getText(s.name,de.getLanguage())))})]})}}const ca=["silly","debug","info","warn","error"],Ht=[{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)",Xn={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:ht[400],"&:hover":{backgroundColor:ht[200]}},disabled:{color:Ze[400],"&:hover":{backgroundColor:Ze[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:ft[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:ht[700]},red:{color:Ze[700]},grey:{color:Rt[700]},blue:{color:"#0055a9"},orange:{color:ft[400]},transparent:{color:"transparent",backgroundColor:"transparent"},silly:{},debug:{backgroundColor:Rt[700]},info:{backgroundColor:Qn[700]},warn:{backgroundColor:pr[700]},error:{backgroundColor:Ze[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":oe.isTouchDevice()?void 0:{display:"none",maxHeight:32},"&:hover":oe.isTouchDevice()?void 0:{"& .admin-edit-button":{display:"block"}}}};class _ extends Te.Component{componentDidMount(){this.props.context.onRegisterClose(this.props.id,this.commandClose)}componentWillUnmount(){this.props.context.onRegisterClose(this.props.id,null)}getDefaultState(e){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:e.item.logLevel,logOnTheFly:!1,compactGroup:e.item.compactGroup||0,maxCompactGroupNumber:e.context.maxCompactGroupNumber,tier:e.item.tier,host:e.instance.host,deleteCustom:!1,visibleEdit:!1,expanded:!1}}static isCompact(e){var t;return((t=e==null?void 0:e.common)==null?void 0:t.runAsCompactMode)||!1}isSentry(){var e;return!!((e=this.props.context.states[`system.adapter.${this.props.instance.id}.plugins.sentry.enabled`])!=null&&e.val)}static getSchedule(e){var t;return((t=e==null?void 0:e.common)==null?void 0:t.schedule)||""}static isRunning(e){var t,s;return((t=e==null?void 0:e.common)==null?void 0:t.onlyWWW)||((s=e==null?void 0:e.common)==null?void 0:s.enabled)}static isCompactGroup(e){var t;return((t=e==null?void 0:e.common)==null?void 0:t.compactGroup)||null}static getSentrySettings(e){var t,s;return!!((s=(t=e==null?void 0:e.common)==null?void 0:t.plugins)!=null&&s.sentry)}static isModeSchedule(e){var t;return((t=e==null?void 0:e.common)==null?void 0:t.mode)==="schedule"}static getMemoryLimitMB(e){var t;return((t=e==null?void 0:e.common)==null?void 0:t.memoryLimitMB)||0}static getRestartSchedule(e){var t;return(t=e==null?void 0:e.common)!=null&&t.restartSchedule?e.common.restartSchedule:""}async setCommonValue(e,t){try{await this.props.context.socket.extendObject(e,{common:t})}catch(s){window.alert(s)}}commandClose=()=>this.setState({expanded:!1});toggleSentry(){const e=!this.isSentry();this.props.context.socket.setState(`system.adapter.${this.props.instance.id}.plugins.sentry.enabled`,e,!0).catch(t=>window.alert(`Cannot set sentry: ${t}`))}setTier(e,t){this.setCommonValue(`system.adapter.${e.id}`,{tier:t})}setName(e,t){this.setCommonValue(`system.adapter.${e.id}`,{titleLang:t})}setLogLevel(e,t,s){s?this.props.context.socket.setState(`system.adapter.${e.id}.logLevel`,t):this.setCommonValue(`system.adapter.${e.id}`,{loglevel:t})}setSchedule(e,t){t?this.setCommonValue(`system.adapter.${e.id}`,{schedule:t}):this.props.context.socket.getObject(`system.adapter.${e.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(e,t){this.setCommonValue(`system.adapter.${e.id}`,{memoryLimitMB:t})}toggleCompactMode(){this.setCommonValue(`system.adapter.${this.props.instance.id}`,{runAsCompactMode:!_.isCompact(this.props.instance.obj)})}setRestartSchedule(e,t){t?this.setCommonValue(`system.adapter.${e.id}`,{restartSchedule:t}):this.props.context.socket.getObject(`system.adapter.${e.id}`).then(s=>{s.common.restartSchedule!==""&&(s.common.restartSchedule="",this.props.context.socket.setObject(s._id,s))})}setHost(e,t){this.setCommonValue(`system.adapter.${e.id}`,{host:t})}setCompactGroup(e,t){t=t==="controller"?0:t==="default"?1:parseInt(t,10),this.setCommonValue(`system.adapter.${e.id}`,{compactGroup:t}),this.props.context.maxCompactGroupNumber<t&&this.props.context.setMaxCompactGroupNumber(t)}getMemory(){const e=this.props.context.states[`${this.props.id}.memRss`];return(e==null?void 0:e.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:e=>this.setState({deleteCustom:e.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(Me,{theme:this.props.context.theme,title:this.props.context.t("Enter title for %s",this.props.instance.id),disableApplyIfNotChanged:!0,textInput:!0,defaultValue:oe.getText(this.props.item.name,this.props.context.lang),onApply:e=>{this.setName(this.props.instance,e.toString()),this.setState({openDialogName:!1,openDialog:!1})},onClose:()=>this.setState({openDialogName:!1,openDialog:!1})})}renderEditLogLevelDialog(){return a.jsxs(Me,{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:e=>this.setState({logLevel:e.target.value}),children:ca.map(e=>a.jsx(d.MenuItem,{value:e,children:this.props.context.t(e)},e))})]}),a.jsxs(d.FormControl,{variant:"outlined",children:[a.jsx(d.FormControlLabel,{control:a.jsx(d.Checkbox,{checked:this.state.logOnTheFly,onChange:e=>this.setState({logOnTheFly:e.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(Me,{theme:this.props.context.theme,title:this.props.context.t("Edit memory limit rule for %s",this.props.instance.id),onApply:e=>{this.setMemoryLimitMB(this.props.instance,parseFloat(e.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(Me,{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(Kn,{themeType:this.props.context.themeType,value:this.state.host,list:this.props.context.hosts,removePrefix:"system.host.",fullWidth:!0,style:this.styles.hostInfo,onChange:e=>this.setState({host:e}),lang:this.props.context.lang,t:this.props.context.t})})}renderEditCompactGroupDialog(){return a.jsx(Me,{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:e=>this.setState({compactGroup:parseInt(e.target.value,10)}),children:[a.jsx("div",{onClick:e=>{e.preventDefault(),e.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((e,t)=>a.jsx(d.MenuItem,{value:(t+2).toString(),children:t+2},t))]})]})})}renderEditTierDialog(){return a.jsx(Me,{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:e=>this.setState({tier:parseInt(e.target.value,10)}),children:Ht.map(e=>a.jsx(d.MenuItem,{value:e.value,children:this.props.context.t(e.desc)},e.value))})]})})}renderStopAdminDialog(){return this.state.showStopAdminDialog?a.jsx(er,{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:e=>{e&&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(ps,{title:this.props.context.t("Edit restart rule for %s",this.props.instance.id),clearButton:!0,cron:_.getRestartSchedule(this.props.instance.obj),onOk:e=>this.setRestartSchedule(this.props.instance,e),onClose:()=>this.setState({openDialogCron:!1,openDialog:!1})})}renderScheduleDialog(){return a.jsx(ps,{title:this.props.context.t("Edit schedule rule for %s",this.props.instance.id),clearButton:!0,cron:_.getSchedule(this.props.instance.obj),onOk:e=>this.setSchedule(this.props.instance,e),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(e){return a.jsx("div",{style:{...this.styles.smallAvatar,...this.styles.statusIndicator,...this.props.instance.mode==="daemon"||this.props.instance.mode==="schedule"?this.styles[e]: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,e,this.styles[`statusIcon_${e}`],this.props.item.stoppedWhenWebExtension)})}getModeIcon(e,t,s,r){return e==="daemon"?r?a.jsx("div",{style:{...s,...this.styles.okSymbol},children:a.jsx("div",{style:this.styles.okSymbolInner})}):t==="orange"?a.jsx(v.Warning,{style:s}):t==="green"?a.jsx("div",{style:{...s,...this.styles.okSymbol},children:a.jsx("div",{style:this.styles.okSymbolInner})}):a.jsx(v.Settings,{style:s}):e==="schedule"?a.jsx(v.Schedule,{style:s}):null}renderTooltip(){const{instance:e,item:t}=this.props;let s,r,i;if(e.mode==="schedule"&&e.schedule){try{i=tr.toString(e.schedule,{locale:this.props.context.lang})}catch{i=e.schedule}if(e.enabled)try{const o=Fe.CronExpressionParser.parse(e.schedule);s=o.next().toDate(),r=o.prev().toDate()}catch{s=null,r=null}}return[t.stoppedWhenWebExtension!==void 0?a.jsx(te,{state:!0,children:this.props.context.t("Runs as web-extension")},1):"",e.mode==="daemon"&&this.props.item.stoppedWhenWebExtension===void 0?a.jsx(te,{state:t.connectedToHost,children:this.props.context.t("Connected to host")},2):"",e.mode==="daemon"&&this.props.item.stoppedWhenWebExtension===void 0?a.jsx(te,{state:t.alive,children:this.props.context.t("Heartbeat")},3):"",this.props.item.connected!==null&&this.props.item.stoppedWhenWebExtension===void 0?a.jsx(te,{state:!!t.connected,children:typeof t.connected=="string"?`${this.props.context.t("Connected:")} ${t.connected||"-"}`:this.props.context.t("Connected to device or service")},4):"",i?a.jsxs(te,{state:e.enabled,children:["CRON:",i]},5):null,s?a.jsx(te,{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(te,{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(re,{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:e=>{e.stopPropagation(),e.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:e=>e.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:e=>{e.stopPropagation(),e.preventDefault(),this.props.saveScrollPosition(),zs.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:e=>{e.stopPropagation(),e.preventDefault(),this.props.context.socket.extendObject(`system.adapter.${this.props.instance.id}`,{})},onFocus:e=>e.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:e=>{if(e.stopPropagation(),e.preventDefault(),this.props.instance.links.length===1){let t=this.props.instance.links[0].link;t=t.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(t,this.props.instance.id)}else this.setState({showLinks:!0,openDialog:!0})},onFocus:e=>e.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:e=>{e.stopPropagation(),e.preventDefault(),this.setState({openDialogName:!0,openDialog:!0})},children:a.jsx(v.Edit,{})})})}renderInputOutput(){return a.jsx(re,{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(sr,{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:e=>{e.stopPropagation(),e.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:e=>{e.stopPropagation(),e.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?ur: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:e=>{e.stopPropagation(),e.preventDefault(),this.toggleCompactMode()},children:a.jsx(v.ViewCompact,{color:this.props.item.compact?"primary":"inherit"})})})}renderVersion(){return a.jsxs(re,{tooltip:this.props.context.t("Installed"),children:["v",this.props.instance.version]})}renderInfo(e){return a.jsxs(a.Fragment,{children:[e?void 0:a.jsx("span",{style:this.styles.instanceName,children:this.props.instance.id}),this.props.item.stoppedWhenWebExtension!==void 0&&a.jsx(te,{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(te,{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(te,{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(te,{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(re,{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:e=>{e.stopPropagation(),e.preventDefault(),this.setState({openDialogLogLevel:!0,openDialog:!0})},children:a.jsx(v.Edit,{})})})]})}renderSchedule(){return a.jsxs(a.Fragment,{children:[a.jsx(re,{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:e=>{e.stopPropagation(),e.preventDefault(),this.setState({openDialogSchedule:!0,openDialog:!0})},children:a.jsx(v.Edit,{})})})]})}renderRestartSchedule(){return a.jsxs(a.Fragment,{children:[a.jsx(re,{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:e=>{e.stopPropagation(),e.preventDefault(),this.setState({openDialogCron:!0,openDialog:!0})},children:a.jsx(v.Edit,{})})})]})}renderRamLimit(){return a.jsxs(a.Fragment,{children:[a.jsx(re,{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:e=>{e.stopPropagation(),e.preventDefault(),this.setState({openDialogMemoryLimit:!0,openDialog:!0})},children:a.jsx(v.Edit,{})})})]})}renderCompactGroup(){return a.jsxs(a.Fragment,{children:[a.jsx(re,{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:e=>{e.stopPropagation(),e.preventDefault(),this.setState({openDialogCompact:!0,openDialog:!0})},children:a.jsx(v.Edit,{})})})]})}renderTier(){var e;return a.jsxs(a.Fragment,{children:[a.jsx(re,{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(((e=Ht.find(t=>t.value===this.props.item.tier))==null?void 0:e.desc)||Ht[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:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogTier:!0,openDialog:!0})},children:a.jsx(v.Edit,{})})}):null]})}renderHostWithButton(){return a.jsxs(a.Fragment,{children:[a.jsx(re,{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 e=>{e.stopPropagation(),e.preventDefault();const t=await this.props.context.socket.getAdapterInstances(this.props.instance.id.split(".")[0]);this.setState({openDialogDelete:t.length||!0,openDialog:!0})},children:a.jsx(v.Delete,{})})})}render(){return a.jsx("div",{children:this.state.expanded})}}const C={...Xn,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(e){super(e),this.state=Object.assign(this.getDefaultState(e),{mouseOver:!1})}renderSecondCardInfo(){var s;if(this.props.deleting||!this.state.expanded)return null;const{item:e,instance:t}=this.props;return a.jsxs(d.Box,{component:"div",sx:pt.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(),e.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()}),e.modeSchedule&&a.jsx("div",{style:C.displayFlex,children:this.renderSchedule()}),this.props.context.expertMode&&t.mode==="daemon"&&a.jsx("div",{style:C.displayFlex,children:this.renderRestartSchedule()}),this.props.context.expertMode&&e.checkCompact&&e.compact&&e.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)!==t.host?a.jsx("div",{style:C.displayFlex,children:this.renderHostWithButton()}):null,a.jsx(xe,{config:e,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(xe,{config:e,name:"allowInstanceDelete",children:a.jsx("div",{style:C.displayFlex,children:this.renderDeleteButton()})}),this.props.context.expertMode&&e.checkSentry&&a.jsx("div",{style:C.displayFlex,children:this.renderSentry()}),e.supportCompact&&this.props.context.expertMode&&e.checkCompact&&a.jsx("div",{style:C.displayFlex,children:this.renderCompactGroupEnabled()})]})]})}render(){const{item:e,instance:t}=this.props;return a.jsxs(d.Card,{sx:pt.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:pt.getStyle(this.props.context.theme,C.imageBlock,(!e.running||t.mode!=="daemon"||e.stoppedWhenWebExtension!==void 0)&&C.instanceStateNotEnabled1,e.running&&t.mode==="daemon"&&e.stoppedWhenWebExtension===void 0&&(!e.connectedToHost||!e.alive)&&C.instanceStateNotAlive1,e.running&&e.connectedToHost&&e.alive&&e.connected===!1&&C.instanceStateAliveNotConnected1,e.running&&e.connectedToHost&&e.alive&&e.connected!==!1&&C.instanceStateAliveAndConnected1),children:[a.jsx(d.CardMedia,{sx:C.img,component:"img",image:t.image||"img/no-image.svg"}),a.jsx("div",{style:C.adapter,children:t.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:[oe.getText(e.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(xe,{config:e,name:"allowInstanceLink",children:this.renderLink()})]})})]})]})}}const y={...Xn,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(e){super(e),this.state=this.getDefaultState(e)}renderDetails(){var s;const{instance:e,item:t}=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()}),t.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()}),t.modeSchedule&&a.jsx(d.Box,{component:"div",sx:{...y.displayFlex,...y.maxWidth300,...y.editButton},children:this.renderSchedule()}),this.props.context.expertMode&&e.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&&t.checkCompact&&t.compact&&t.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(re,{children:oe.getText(t.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)!==e.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(xe,{config:t,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(xe,{config:t,name:"allowInstanceLink",children:a.jsx(d.Box,{component:"div",sx:{display:{md:"none",xs:"inline-block"}},children:this.renderLink()})}),a.jsx(xe,{config:t,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:e,item:t}=this.props,s=this.props.context.getInstanceStatus(e.obj),r=this.renderTooltip(),i={...y.row,...(!t.running||e.mode!=="daemon"||t.stoppedWhenWebExtension!==void 0)&&(this.props.idx%2===0?y.instanceStateNotEnabled1:y.instanceStateNotEnabled2),...t.running&&e.mode==="daemon"&&t.stoppedWhenWebExtension===void 0&&(!t.connectedToHost||!t.alive)?this.props.idx%2===0?y.instanceStateNotAlive1:y.instanceStateNotAlive2:void 0,...t.running&&t.connectedToHost&&t.alive&&t.connected===!1?this.props.idx%2===0?y.instanceStateAliveNotConnected1:y.instanceStateAliveNotConnected2:void 0,...t.running&&t.connectedToHost&&t.alive&&t.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:e.id,src:e.image,sx:{...y.instanceIcon,...this.desktop?y.desktopIcon:void 0}}),a.jsx(d.Box,{component:"div",sx:y.instanceId,children:e.id})]}),this.renderPlayPause(),a.jsx(xe,{config:t,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(xe,{config:t,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:oe.getText(t.name,this.props.context.lang)}),this.renderEditNameButton()]})}),this.props.context.expertMode&&a.jsx(d.Box,{component:"div",sx:{...y.hidden1250,...e.mode!=="daemon"||!t.running?y.invisible:void 0},children:this.renderInputOutput()}),this.props.context.expertMode&&a.jsx(d.Tooltip,{title:t.logLevelObject===t.logLevel?`${this.props.context.t("loglevel")} ${t.logLevel}`:`${this.props.context.t("saved:")} ${t.logLevelObject} / ${this.props.context.t("actual:")} ${t.logLevel}`,slotProps:{popper:{sx:y.tooltip}},children:a.jsx(d.Avatar,{sx:{...y.smallAvatar,...y.hidden380,...y[t.logLevel]},children:t.loglevelIcon})}),a.jsx(d.Grid2,{sx:{...y.hidden1050,...y.width150,...e.mode!=="daemon"||!t.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)!==e.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 ma="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",V={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:ht[700]},red:{color:Ze[700]},grey:{color:Rt[700]},blue:{color:"#0055a9"},orange:{color:ft[400]},orangeDevice:{color:ft[300]},icon:{width:18,height:18,marginRight:8,display:"inline-block"},menuValue:{whiteSpace:"nowrap"}},fa=["none","daemon","schedule","once"],ga=(n,e)=>n===1?a.jsx(v.Lens,{style:e}):n===2?a.jsx(v.Lens,{style:e}):n===3?a.jsx(v.Warning,{style:e}):n===4?a.jsx(v.Schedule,{style:e}):n===5?a.jsx("div",{style:{...e,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,Vt={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:e,filterStatus:t})=>{const[s,r]=Te.useState(e),[i,o]=Te.useState(t);return a.jsxs(d.Dialog,{onClose:()=>n(),open:!0,sx:{"& .MuiDialog-paper":V.paper},children:[a.jsx(d.DialogTitle,{style:{display:"flex"},children:a.jsxs("div",{style:{display:"flex"},children:[a.jsx(d.Avatar,{variant:"square",style:V.square,src:ma}),de.t("Filter instances")]})}),a.jsx(d.DialogContent,{style:V.overflowHidden,dividers:!0,children:a.jsxs(d.Card,{style:V.root,children:[a.jsxs("div",{style:V.rowBlock,children:[a.jsx(d.FormControlLabel,{style:V.checkbox,control:a.jsx(d.Checkbox,{checked:!!s,onChange:l=>l.target.checked?r("daemon"):r(null)}),label:de.t("Filter by mode")}),a.jsx(d.Select,{disabled:!s,variant:"standard",value:s||"none",style:V.select,onChange:l=>{l.target.value==="none"?r(null):r(l.target.value)},children:fa.map(l=>a.jsx(d.MenuItem,{value:l,children:de.t(l)},l))})]}),a.jsxs("div",{style:V.rowBlock,children:[a.jsx(d.FormControlLabel,{style:V.checkbox,control:a.jsx(d.Checkbox,{checked:!!i,onChange:l=>l.target.checked?o("ok"):o(null)}),label:de.t("Filter by status")}),a.jsx(d.Select,{disabled:!i,variant:"standard",value:i||"none",style:V.select,onChange:l=>{l.target.value==="none"?o(null):o(l.target.value)},children:Object.keys(Vt).map((l,u)=>a.jsx(d.MenuItem,{value:l,children:a.jsxs("div",{style:V.menuWrapper,children:[Vt[l].status?a.jsx("div",{style:V.iconWrapper,children:ga(u,V[`statusIcon_${u}`])}):null,a.jsx("div",{style:V.textWrapper,children:de.t(Vt[l].text)})]})},l))})]})]})}),a.jsxs(d.DialogActions,{children:[a.jsx(d.Button,{variant:"contained",autoFocus:!0,disabled:s===e&&t===i,onClick:()=>{n({filterMode:s,filterStatus:i})},color:"primary",startIcon:a.jsx(v.Check,{}),children:de.t("Apply")}),a.jsx(d.Button,{color:"grey",variant:"contained",onClick:()=>n(),startIcon:a.jsx(v.Close,{}),children:de.t("Close")})]})]})},Ne={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:e,children:t,expanded:s,onExpand:r}){return a.jsxs(d.Accordion,{expanded:!!s,onChange:()=>r(!s),style:Ne.accordion,square:!0,children:[a.jsx(d.AccordionSummary,{style:Ne.row,expandIcon:a.jsx(v.ExpandMore,{}),children:a.jsxs("div",{style:Ne.wrapperName,children:[a.jsx(dr,{iconName:n,style:Ne.iconStyle}),n]})}),a.jsx(d.AccordionDetails,{style:Ne.accordionDetails,children:a.jsx("div",{style:Ne.wrapperChildren,children:t})})]},e)}const R={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 ye extends Te.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(e){super(e),this.localStorage=window._localStorage||window.localStorage;let t=[];if(this.localStorage.getItem("Instances.expandedFolder"))try{t=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:t,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=Te.createRef(),this.refTabContent=Te.createRef()}translate=(e,t,s)=>t!==void 0?this.props.t(e,t,s):(this.wordCache[e]||(this.wordCache[e]=this.props.t(e)),this.wordCache[e]);async componentDidMount(){this.props.instancesWorker.registerHandler(this.getInstances),await this.updateData();const e=await this.props.socket.checkFeatureSupported("DEL_INSTANCE_CUSTOM");e&&this.setState({deleteCustomSupported:e})}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(e){return e&&(this.statePromise=null),this.statePromise instanceof Promise||(this.statePromise=this.props.socket.getForeignStates("system.adapter.*")),this.statePromise}static getDerivedStateFromProps(e,t){const s=zs.getLocation(),r={dialog:s.dialog,dialogProp:s.id};return e.expertMode!==t.expertMode&&(r.expertMode=e.expertMode),r}getInstances=async()=>{const e=Date.now();let t=[];const s=await this.props.instancesWorker.getObjects();if(!s){window.alert("Cannot read instances!");return}t=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 u={};this.props.hosts.forEach(f=>u[f._id]=f);for(let f=0;f<t.length;f++){const p=t[f];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={};t.sort((f,p)=>{const x=f._id.split("."),F=p._id.split("."),T=parseInt(x[x.length-1],10),j=parseInt(F[F.length-1],10),E=x[x.length-2],Q=F[F.length-2];return E===Q?T>j?1:T<j?-1:0:E>Q?1:E<Q?-1:0});let m=1;const c={};for(let f=0;f<t.length;f++){const p=t[f],x=p.common||null,F=parseInt(p._id.split(".").pop(),10);x.compactGroup&&typeof x.compactGroup=="number"&&m<x.compactGroup&&(m=x.compactGroup);const T={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:[]},j=x.localLinks||x.localLink||"";let E=null;j&&typeof j=="string"?E={_default:j}:j&&typeof j=="object"&&(E=j);const Q=E?Object.keys(E):[];if(Q.forEach(K=>{T.links=T.links||[];let ee;typeof E[K]=="string"?ee={link:E[K]}:ee=E[K];const he=rr(ee.link,x.name,F,{instances:s,hostname:this.props.hostname,hosts:u,adminInstance:this.props.adminInstance})||[];let H=ee.name||K;H==="_default"?H=Q.length===1?"":this.t("default"):typeof H=="object"?H=oe.getText(H,this.props.lang):H=this.t(H),he.length===1?T.links.push({name:H,link:he[0].url,port:he[0].port,color:ee.color}):he.length>1&&he.forEach(Ce=>{T.links.push({name:H,link:Ce.url,port:Ce.port,color:ee.color})})}),T.stoppedWhenWebExtension){const K=this.states[`${T.id}.info.extension`]||await this.props.socket.getState(`${T.id}.info.extension`);T.stoppedWhenWebExtension=K?!!K.val:void 0}console.log(p._id),h[p._id]=T}console.log(`getInstances: ${Date.now()-e}`);for(let f=1;f<=m;f++){const p=`${this.state.currentHost}.compactgroup${f}.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}`]&&(c.deleting=null),c.maxCompactGroupNumber=m,c.processes=o,c.mem=Math.round(l),c.instances=h,this._cacheList=null,this.setState(c)};getParamsLocalAndPanel=async()=>{var l,u;let e=!1;try{e=!!((u=(l=(await this.props.socket.readBaseSettings(this.state.currentHost)).config)==null?void 0:l.system)!=null&&u.compact)}catch(h){window.alert(`Cannot read compact mode by host "${this.state.currentHost}": ${h}`)}let t=0,s="All";try{t=JSON.parse(this.localStorage.getItem("Instances.playArrow")),t.toString()==="true"?t=1:t.toString()==="false"&&(t=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:e,onlyCurrentHost:r,playArrow:t,viewMode:i,viewCategory:o})};async getData(e){try{const t=this.props.socket.getAdapters(e),s=this.getStates(),[r,i]=await Promise.all([s,t]);this.adapters=i||[],this.states=r||{}}catch(t){console.log(t)}this.states&&(this.subscribed||(this.subscribed=!0,this.subscribeStates()))}onStateChange=(e,t)=>{const s=this.states[e];this.states[e]=t,(!s&&t||s&&!t||s&&t&&s.val!==t.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(e){const t=e?this.props.socket.unsubscribeState:this.props.socket.subscribeState;t.call(this.props.socket,"system.adapter.*.alive",this.onStateChange),t.call(this.props.socket,"system.adapter.*.connected",this.onStateChange),t.call(this.props.socket,"system.adapter.*.inputCount",this.onStateChange),t.call(this.props.socket,"system.adapter.*.memRss",this.onStateChange),t.call(this.props.socket,"system.adapter.*.outputCount",this.onStateChange),t.call(this.props.socket,"system.adapter.*.logLevel",this.onStateChange),t.call(this.props.socket,"system.adapter.*.plugins.sentry.enabled",this.onStateChange),t.call(this.props.socket,"system.host.*.diskFree",this.onStateChange),t.call(this.props.socket,"system.host.*.diskSize",this.onStateChange),t.call(this.props.socket,"system.host.*.diskWarning",this.onStateChange),t.call(this.props.socket,"system.host.*.freemem",this.onStateChange),t.call(this.props.socket,"*.info.connection",this.onStateChange),t.call(this.props.socket,"*.info.extension",this.onStateChange)}getInstanceStatus=e=>{const t=e?e.common:null,s=(t==null?void 0:t.mode)||"";let r=s==="daemon"?"green":"blue";if(t!=null&&t.enabled&&(!t.webExtension||!e.native.webInstance||s==="daemon")){const i=this.states[`${e._id}.alive`],o=this.states[`${e._id}.connected`],l=this.states[`${e._id.replace("system.adapter.","")}.info.connection`];if(t.webExtension&&e.native.webInstance){const u=this.states[`${e._id.replace("system.adapter.","")}.info.extension`];if(u)return u.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(e){var s;const t=this.adapters.find(({_id:r})=>r===`system.adapter.${e}`);return((s=t==null?void 0:t.common)==null?void 0:s.compact)||!1}getName(e){return e!=null&&e.common?e.common.titleLang?oe.getText(e.common.titleLang,this.props.lang):oe.getText(e.common.title,this.props.lang):""}getInputOutput(e){const t=this.states[`${e}.inputCount`],s=this.states[`${e}.outputCount`];return{stateInput:t!=null&&t.val?t.val:0,stateOutput:s!=null&&s.val?s.val:0}}isAlive(e){const t=this.states[`${e}.alive`];return!!(t!=null&&t.val)}isConnectedToHost(e){const t=this.states[`${e}.connected`];return!!(t!=null&&t.val)&&this.isAlive(e)}getConnected(e){const t=this.state.instances[e];return this.states[`${t.id}.info.connection`]?this.isAlive(e)&&this.states[`${t.id}.info.connection`].val:null}static getStatusFilter(e){switch(e){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(e){return e==="debug"?a.jsx(v.BugReport,{}):e==="info"?a.jsx(v.Info,{}):e==="warn"?a.jsx(v.Warning,{}):e==="error"?a.jsx(v.Error,{}):null}onDeleteInstance=(e,t,s)=>{this.setState({deleting:e.id},()=>this.props.executeCommand(`del ${s?e.id.split(".")[0]:e.id}${t?" --custom":""}${this.props.expertMode?" --debug":""}`))};isSentry(e){var t;return!!((t=this.states[`${e}.plugins.sentry.enabled`])!=null&&t.val)}cacheInstances(){const e=this.state.currentHost.replace(/^system.host./,"");if(this._cacheList=Object.keys(this.state.instances).map(t=>{var H,Ce,pe;const s=this.state.instances[t],r=_.isRunning(s.obj),i=_.isCompactGroup(s.obj),o=this.isCompactGroupCheck(s.adapter)&&this.state.compact,l=_.isCompact(s.obj),u=s.compact||!1,h=this.isAlive(t),m=this.isConnectedToHost(t),c=this.getConnected(t),f=this.getName(s.obj),p=((H=this.states[`${t}.logLevel`])==null?void 0:H.val)||s.loglevel,x=s.loglevel,F=((pe=(Ce=s==null?void 0:s.obj)==null?void 0:Ce.common)==null?void 0:pe.tier)||3,T=ye.getLogLevelIcon(p),j=this.getInputOutput(t),E=_.isModeSchedule(s.obj),Q=_.getMemoryLimitMB(s.obj),K=_.getSentrySettings(s.obj),ee=this.isSentry(t);return{id:t,running:r,host:s.host,nameId:s.id,compactGroup:i,checkCompact:o,mode:s.mode,sentry:ee,category:s.obj.common.type||"other",status:this.getInstanceStatus(s.obj),alive:h,compact:l,supportCompact:u,connectedToHost:m,connected:c,name:f,logLevel:p,logLevelObject:x,tier:F,loglevelIcon:T,inputOutput:j,modeSchedule:E,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:t})=>this.state.playArrow===1?t:!t)),this.state.onlyCurrentHost&&(this._cacheList=this._cacheList.filter(({host:t})=>t===e)),this.state.filterText){const t=this.state.filterText.toLowerCase();this._cacheList=this._cacheList.filter(({name:s,nameId:r})=>s.toLowerCase().includes(t)||r.toLowerCase().includes(t))}if(this.props.expertMode&&(this.state.filterCompactGroup||this.state.filterCompactGroup===0)&&this.state.compact&&(this._cacheList=this._cacheList.filter(({compactGroup:t})=>t===this.state.filterCompactGroup||this.state.filterCompactGroup==="All"||this.state.filterCompactGroup==="default"&&(t===null||t===1)||this.state.filterCompactGroup==="controller"&&t==="0")),this.state.filterMode&&(this._cacheList=this._cacheList.filter(t=>t.mode===this.state.filterMode)),this.state.filterStatus){const t=ye.getStatusFilter(this.state.filterStatus);this._cacheList=this._cacheList.filter(s=>t===s.status)}return this._cacheList}clearAllFilters(){const e={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(e,()=>{this.inputRef.current&&(this.inputRef.current.value=""),this.cacheInstances()})}onMaxCompactGroupNumber=e=>this.setState({maxCompactGroupNumber:e});onRegisterClose=(e,t)=>{this.closeCommands[e]=t};saveScrollPosition=()=>{var e,t;ye.lastScrollPosition=(t=(e=this.refTabContent.current)==null?void 0:e.parentNode)==null?void 0:t.scrollTop};getPanels(){this._cacheList||this.cacheInstances();const e={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},t=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:e},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:e},o.id)}});if(!t.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 t.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:t.filter(({category:i})=>i===r).map(({render:i})=>i)},r))}return t.map(({render:s})=>s)}onToggleExpanded=(e,t)=>{this.expanded!==e&&t&&this.closeCommands[this.expanded]&&this.closeCommands[this.expanded](),this.expanded=t?e: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 e;const t=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(t?e=t:s&&(e=s),e){const i=((r==null?void 0:r.native.hardware.totalmem)||0)/1048576,o=Math.round(e.val/i*100);this._cacheList=null,this.setState({percent:o,memFree:e.val})}}changeStartedStopped=()=>{this._cacheList=null,this.setState(e=>{const t=e.playArrow?e.playArrow===1?2:0:1;return this.localStorage.setItem("Instances.playArrow",JSON.stringify(t)),{playArrow:t}})};changeCompactGroup(e){this._cacheList=null,this.localStorage.setItem("Instances.filterCompactGroup",JSON.stringify(e)),this.setState({filterCompactGroup:e})}handleFilterChange(e){this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout(t=>{this.typingTimer=null,this._cacheList=null,this.setState({filterText:t}),this.localStorage.setItem("instances.filter",t)},300,e.target.value)}renderFilterDialog(){return this.state.showFilterDialog?a.jsx(ya,{filterMode:this.state.filterMode,filterStatus:this.state.filterStatus,onClose:e=>{e&&(this._cacheList=null,this.localStorage.setItem("Instances.filterMode",e.filterMode),this.localStorage.setItem("Instances.filterStatus",e.filterStatus),this.setState(e)),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 t=this.state.instances[this.state.dialogProp]||null;if(t)return a.jsxs(d.Paper,{style:R.paper,children:[this.renderFilterDialog(),a.jsx(cr,{expertMode:this.props.expertMode,adapter:t.id.split(".")[0],adminInstance:this.props.adminInstance,style:R.iframe,configStored:this.props.configStored,dateFormat:this.props.dateFormat,icon:t.image,instance:parseInt(t.id.split(".")[1]),isFloatComma:this.props.isFloatComma,jsonConfig:t.jsonConfig,lang:this.props.lang,materialize:t.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:t.version,onRegisterIframeRef:s=>this.props.onRegisterIframeRef(s),onUnregisterIframeRef:s=>this.props.onUnregisterIframeRef(s),handleNavigation:this.props.handleNavigation})]})}else ye.lastScrollPosition&&(setTimeout(t=>{var s,r;(s=this.refTabContent.current)!=null&&s.parentNode&&(((r=this.refTabContent.current)==null?void 0:r.parentNode).scrollTop=t)},200,ye.lastScrollPosition),ye.lastScrollPosition=0);this.shouldUpdateAfterDialogClosed&&(this.shouldUpdateAfterDialogClosed=!1,this.statesUpdateTimer||this.statesUpdateTimer||(this.statesUpdateTimer=setTimeout(()=>{this.statesUpdateTimer=null,this.forceUpdate()},300)));const e=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(ir,{children:[this.renderFilterDialog(),a.jsxs(or,{children:[a.jsx(d.Tooltip,{title:this.t("Show / hide List"),slotProps:{popper:{sx:R.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:R.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:R.tooltip}},children:a.jsx(d.IconButton,{size:"large",onClick:()=>{const t=[];this._cacheList.forEach(({category:s})=>!t.includes(s)&&t.push(s)),t.sort(),this.localStorage.setItem("Instances.expandedFolder",JSON.stringify(t)),this.setState({expandedFolder:t})},children:a.jsx(v.FolderOpen,{})})}),a.jsx(d.Tooltip,{title:this.t("collapse all"),slotProps:{popper:{sx:R.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:R.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:R.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:R.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:R.tooltip}},children:a.jsx(d.IconButton,{size:"large",onClick:()=>this.setState({showFilterDialog:!0}),sx:this.state.filterMode||this.state.filterStatus?R.filterActive:void 0,children:a.jsx(lr,{style:{width:16,height:16}})})}),this.props.expertMode&&this.state.compact?a.jsx(hr,{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((t,s)=>({name:s+2}))],buttonIcon:a.jsx(v.ViewCompact,{style:{marginRight:4},color:"primary"}),onClick:t=>this.changeCompactGroup(t),value:this.state.filterCompactGroup}):null,a.jsx("div",{style:R.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:t=>this.handleFilterChange(t),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:R.grow}),a.jsx(d.Box,{component:"span",sx:{display:{xs:"none",sm:"inline-block"}},children:e})]}),a.jsx(ar,{overflow:"auto",children:a.jsx("div",{ref:this.refTabContent,style:this.state.viewMode?R.cards:void 0,children:this.getPanels()})})]})}}const Va=nr()(ye);export{Va as default};