homebridge-config-ui-x 5.0.0-beta.114 → 5.0.0-beta.115

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 (50) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/dist/modules/plugins/plugins.service.js +6 -4
  3. package/dist/modules/plugins/plugins.service.js.map +1 -1
  4. package/package.json +1 -1
  5. package/public/{chunk-NHEDTFON.js → chunk-2EFII46K.js} +1 -1
  6. package/public/{chunk-FO4GK6XA.js → chunk-2IUXG2EN.js} +1 -1
  7. package/public/{chunk-TJMAEPYQ.js → chunk-3H3N5KRW.js} +1 -1
  8. package/public/{chunk-MXBGXHDT.js → chunk-3S2WTI7E.js} +1 -1
  9. package/public/{chunk-PPYAK5PR.js → chunk-42ME5L3R.js} +1 -1
  10. package/public/{chunk-FSL5WNMT.js → chunk-4GSDDNS4.js} +1 -1
  11. package/public/{chunk-AQZECAZU.js → chunk-4LCIAXO2.js} +1 -1
  12. package/public/{chunk-F2AECNNZ.js → chunk-4QC4PBZL.js} +1 -1
  13. package/public/{chunk-7KG7OR7A.js → chunk-6VTI52J2.js} +1 -1
  14. package/public/{chunk-3ZGLL37E.js → chunk-6Y2OAEVG.js} +1 -1
  15. package/public/{chunk-ZFVZALM4.js → chunk-7UBIRML4.js} +1 -1
  16. package/public/{chunk-STOQHISG.js → chunk-AF3JBKYZ.js} +1 -1
  17. package/public/{chunk-LSK2YKYF.js → chunk-BMP5IKAG.js} +1 -1
  18. package/public/{chunk-O5Z4LOSN.js → chunk-BTHUOI3P.js} +1 -1
  19. package/public/{chunk-WLUDR55Z.js → chunk-C3GSKPPS.js} +1 -1
  20. package/public/{chunk-OME4KX7V.js → chunk-CI2DUK2L.js} +1 -1
  21. package/public/{chunk-EWWD6XPW.js → chunk-CXANN4XV.js} +1 -1
  22. package/public/{chunk-IPZFEWK5.js → chunk-G5V7VNU6.js} +1 -1
  23. package/public/{chunk-3BJKR3ZK.js → chunk-GEO4DT7J.js} +1 -1
  24. package/public/{chunk-7Q2DYYK3.js → chunk-HAE77KT7.js} +1 -1
  25. package/public/{chunk-HWOT3H4M.js → chunk-IJLX5JKF.js} +1 -1
  26. package/public/{chunk-4YQ23MIB.js → chunk-J2D4NQET.js} +1 -1
  27. package/public/{chunk-JIFJ5BCQ.js → chunk-JFX6FD7T.js} +1 -1
  28. package/public/{chunk-M7JEOWNA.js → chunk-K6OAGSPQ.js} +1 -1
  29. package/public/{chunk-MFZRO3LR.js → chunk-KFNXMHXX.js} +1 -1
  30. package/public/{chunk-CETDSZPT.js → chunk-LPOUENXE.js} +1 -1
  31. package/public/{chunk-ANYIDLDI.js → chunk-M5CMDZZD.js} +1 -1
  32. package/public/{chunk-I5SITC4K.js → chunk-MHUXDZEF.js} +1 -1
  33. package/public/{chunk-5VLR4JF4.js → chunk-OWX3CBVC.js} +1 -1
  34. package/public/{chunk-WWTGLYEU.js → chunk-PH3XR7JL.js} +1 -1
  35. package/public/{chunk-3FSMCEWK.js → chunk-PPPQR4O4.js} +1 -1
  36. package/public/{chunk-U4SPMKC6.js → chunk-QR4VLNDI.js} +1 -1
  37. package/public/{chunk-RIHLYE6G.js → chunk-RPHC6QJY.js} +1 -1
  38. package/public/{chunk-ZBPA6DZ2.js → chunk-SCL7UVTQ.js} +1 -1
  39. package/public/{chunk-7FHBLMYO.js → chunk-SE3VEIYB.js} +1 -1
  40. package/public/{chunk-XNKJVMAY.js → chunk-ST6S2EEM.js} +1 -1
  41. package/public/{chunk-CYIXRDJF.js → chunk-TKTXNLQU.js} +1 -1
  42. package/public/{chunk-6MZR2SJM.js → chunk-U3OKAWTP.js} +1 -1
  43. package/public/{chunk-2KXUOZCO.js → chunk-VEGQX5TF.js} +1 -1
  44. package/public/{chunk-OHFAVFRH.js → chunk-VWBW7JSQ.js} +1 -1
  45. package/public/{chunk-GAKL6VTL.js → chunk-WFXCEU4I.js} +1 -1
  46. package/public/{chunk-35UZ4QJQ.js → chunk-XTBMSQM5.js} +1 -1
  47. package/public/{chunk-CCGYEUZN.js → chunk-ZUYGS2P3.js} +1 -1
  48. package/public/{chunk-BJA62E7C.js → chunk-ZXNNCTE2.js} +4 -4
  49. package/public/index.html +1 -1
  50. package/public/{main-DZBEMUC3.js → main-6ZIVRYGV.js} +1 -1
@@ -1 +1 @@
1
- import{g as r}from"./chunk-GEIS2BWE.js";import"./chunk-Q4CZ7LVK.js";import{ha as o,nb as e}from"./chunk-ULJPS3WS.js";var l=[{path:"",loadComponent:()=>import("./chunk-NHEDTFON.js").then(t=>t.TerminalComponent)}],n=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[r.forChild(l),r]})}return t})();var p=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[n]})}return t})();export{p as TerminalModule};
1
+ import{g as r}from"./chunk-GEIS2BWE.js";import"./chunk-Q4CZ7LVK.js";import{ha as o,nb as e}from"./chunk-ULJPS3WS.js";var l=[{path:"",loadComponent:()=>import("./chunk-2EFII46K.js").then(t=>t.TerminalComponent)}],n=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[r.forChild(l),r]})}return t})();var p=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[n]})}return t})();export{p as TerminalModule};
@@ -1 +1 @@
1
- import{a as s}from"./chunk-EWWD6XPW.js";import"./chunk-OME4KX7V.js";import"./chunk-7FHBLMYO.js";import"./chunk-J7Q5BUJW.js";import"./chunk-C3HWKB2Q.js";import"./chunk-WFYBML4S.js";import"./chunk-PPYAK5PR.js";import"./chunk-U4SPMKC6.js";import{g as i}from"./chunk-GEIS2BWE.js";import"./chunk-3ZGLL37E.js";import"./chunk-M7JEOWNA.js";import"./chunk-R3563DDE.js";import"./chunk-Q4CZ7LVK.js";import{ha as e,nb as t}from"./chunk-ULJPS3WS.js";var u=[{path:"",loadComponent:()=>import("./chunk-JIFJ5BCQ.js").then(o=>o.AccessoriesComponent)}],c=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=t({type:o});static \u0275inj=e({imports:[i.forChild(u),i]})}return o})();var l=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=t({type:o});static \u0275inj=e({imports:[s,c]})}return o})();export{l as AccessoriesModule};
1
+ import{a as s}from"./chunk-CXANN4XV.js";import"./chunk-CI2DUK2L.js";import"./chunk-SE3VEIYB.js";import"./chunk-J7Q5BUJW.js";import"./chunk-C3HWKB2Q.js";import"./chunk-WFYBML4S.js";import"./chunk-42ME5L3R.js";import"./chunk-QR4VLNDI.js";import{g as i}from"./chunk-GEIS2BWE.js";import"./chunk-6Y2OAEVG.js";import"./chunk-K6OAGSPQ.js";import"./chunk-R3563DDE.js";import"./chunk-Q4CZ7LVK.js";import{ha as e,nb as t}from"./chunk-ULJPS3WS.js";var u=[{path:"",loadComponent:()=>import("./chunk-JFX6FD7T.js").then(o=>o.AccessoriesComponent)}],c=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=t({type:o});static \u0275inj=e({imports:[i.forChild(u),i]})}return o})();var l=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=t({type:o});static \u0275inj=e({imports:[s,c]})}return o})();export{l as AccessoriesModule};
@@ -1 +1 @@
1
- import{k as et,n as it}from"./chunk-M7JEOWNA.js";import{a as tt}from"./chunk-R3563DDE.js";import{l as X}from"./chunk-Q4CZ7LVK.js";import{T as G,e as ut,g as ct,ga as R,h as P,la as Y,n as Q,w as N}from"./chunk-ULJPS3WS.js";var st=ut((J,q)=>{(function(L,T){typeof J=="object"&&typeof q<"u"?q.exports=T():typeof define=="function"&&define.amd?define(T):(L=typeof globalThis<"u"?globalThis:L||self).dayjs=T()})(J,function(){"use strict";var L=1e3,T=6e4,n=36e5,h="millisecond",d="second",l="minute",p="hour",v="day",y="week",S="month",Z="quarter",b="year",x="date",z="Invalid Date",nt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,rt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ot={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var i=["th","st","nd","rd"],t=r%100;return"["+r+(i[(t-20)%10]||i[t]||i[0])+"]"}},F=function(r,i,t){var s=String(r);return!s||s.length>=i?r:""+Array(i+1-s.length).join(t)+r},at={s:F,z:function(r){var i=-r.utcOffset(),t=Math.abs(i),s=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+F(s,2,"0")+":"+F(e,2,"0")},m:function r(i,t){if(i.date()<t.date())return-r(t,i);var s=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(s,S),o=t-e<0,a=i.clone().add(s+(o?-1:1),S);return+(-(s+(t-e)/(o?e-a:a-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:S,y:b,w:y,d:v,D:x,h:p,m:l,s:d,ms:h,Q:Z}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},A="en",k={};k[A]=ot;var B="$isDayjsObject",U=function(r){return r instanceof W||!(!r||!r[B])},V=function r(i,t,s){var e;if(!i)return A;if(typeof i=="string"){var o=i.toLowerCase();k[o]&&(e=o),t&&(k[o]=t,e=o);var a=i.split("-");if(!e&&a.length>1)return r(a[0])}else{var c=i.name;k[c]=i,e=c}return!s&&e&&(A=e),e||!s&&A},m=function(r,i){if(U(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new W(t)},u=at;u.l=V,u.i=U,u.w=function(r,i){return m(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var W=function(){function r(t){this.$L=V(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[B]=!0}var i=r.prototype;return i.parse=function(t){this.$d=function(s){var e=s.date,o=s.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(nt);if(a){var c=a[2]-1||0,f=(a[7]||"0").substring(0,3);return o?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,f)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,f)}}return new Date(e)}(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return u},i.isValid=function(){return this.$d.toString()!==z},i.isSame=function(t,s){var e=m(t);return this.startOf(s)<=e&&e<=this.endOf(s)},i.isAfter=function(t,s){return m(t)<this.startOf(s)},i.isBefore=function(t,s){return this.endOf(s)<m(t)},i.$g=function(t,s,e){return u.u(t)?this[s]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,s){var e=this,o=!!u.u(s)||s,a=u.p(t),c=function(_,M){var D=u.w(e.$u?Date.UTC(e.$y,M,_):new Date(e.$y,M,_),e);return o?D:D.endOf(v)},f=function(_,M){return u.w(e.toDate()[_].apply(e.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(M)),e)},g=this.$W,$=this.$M,w=this.$D,j="set"+(this.$u?"UTC":"");switch(a){case b:return o?c(1,0):c(31,11);case S:return o?c(1,$):c(0,$+1);case y:var O=this.$locale().weekStart||0,H=(g<O?g+7:g)-O;return c(o?w-H:w+(6-H),$);case v:case x:return f(j+"Hours",0);case p:return f(j+"Minutes",1);case l:return f(j+"Seconds",2);case d:return f(j+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,s){var e,o=u.p(t),a="set"+(this.$u?"UTC":""),c=(e={},e[v]=a+"Date",e[x]=a+"Date",e[S]=a+"Month",e[b]=a+"FullYear",e[p]=a+"Hours",e[l]=a+"Minutes",e[d]=a+"Seconds",e[h]=a+"Milliseconds",e)[o],f=o===v?this.$D+(s-this.$W):s;if(o===S||o===b){var g=this.clone().set(x,1);g.$d[c](f),g.init(),this.$d=g.set(x,Math.min(this.$D,g.daysInMonth())).$d}else c&&this.$d[c](f);return this.init(),this},i.set=function(t,s){return this.clone().$set(t,s)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,s){var e,o=this;t=Number(t);var a=u.p(s),c=function($){var w=m(o);return u.w(w.date(w.date()+Math.round($*t)),o)};if(a===S)return this.set(S,this.$M+t);if(a===b)return this.set(b,this.$y+t);if(a===v)return c(1);if(a===y)return c(7);var f=(e={},e[l]=T,e[p]=n,e[d]=L,e)[a]||1,g=this.$d.getTime()+t*f;return u.w(g,this)},i.subtract=function(t,s){return this.add(-1*t,s)},i.format=function(t){var s=this,e=this.$locale();if(!this.isValid())return e.invalidDate||z;var o=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,f=this.$m,g=this.$M,$=e.weekdays,w=e.months,j=e.meridiem,O=function(M,D,I,C){return M&&(M[D]||M(s,o))||I[D].slice(0,C)},H=function(M){return u.s(c%12||12,M,"0")},_=j||function(M,D,I){var C=M<12?"AM":"PM";return I?C.toLowerCase():C};return o.replace(rt,function(M,D){return D||function(I){switch(I){case"YY":return String(s.$y).slice(-2);case"YYYY":return u.s(s.$y,4,"0");case"M":return g+1;case"MM":return u.s(g+1,2,"0");case"MMM":return O(e.monthsShort,g,w,3);case"MMMM":return O(w,g);case"D":return s.$D;case"DD":return u.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return O(e.weekdaysMin,s.$W,$,2);case"ddd":return O(e.weekdaysShort,s.$W,$,3);case"dddd":return $[s.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return H(1);case"hh":return H(2);case"a":return _(c,f,!0);case"A":return _(c,f,!1);case"m":return String(f);case"mm":return u.s(f,2,"0");case"s":return String(s.$s);case"ss":return u.s(s.$s,2,"0");case"SSS":return u.s(s.$ms,3,"0");case"Z":return a}return null}(M)||a.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,s,e){var o,a=this,c=u.p(s),f=m(t),g=(f.utcOffset()-this.utcOffset())*T,$=this-f,w=function(){return u.m(a,f)};switch(c){case b:o=w()/12;break;case S:o=w();break;case Z:o=w()/3;break;case y:o=($-g)/6048e5;break;case v:o=($-g)/864e5;break;case p:o=$/n;break;case l:o=$/T;break;case d:o=$/L;break;default:o=$}return e?o:u.a(o)},i.daysInMonth=function(){return this.endOf(S).$D},i.$locale=function(){return k[this.$L]},i.locale=function(t,s){if(!t)return this.$L;var e=this.clone(),o=V(t,s,!0);return o&&(e.$L=o),e},i.clone=function(){return u.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},r}(),K=W.prototype;return m.prototype=K,[["$ms",h],["$s",d],["$m",l],["$H",p],["$W",v],["$M",S],["$y",b],["$D",x]].forEach(function(r){K[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),m.extend=function(r,i){return r.$i||(r(i,W,m),r.$i=!0),m},m.locale=V,m.isDayjs=U,m.unix=function(r){return m(1e3*r)},m.en=k[A],m.Ls=k,m.p={},m})});var E=ct(st(),1);var vt=(()=>{class L{$api=Y(it);$title=Y(X);$toastr=Y(et);$translate=Y(tt);settingsLoadedSubject=new Q;defaultTheme="deep-purple";forbiddenKeys=["__proto__","constructor","prototype"];env={};formAuth=!0;sessionTimeout=28800;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;wallpaper;serverTimeOffset=0;rtl=!1;onSettingsLoaded=this.settingsLoadedSubject.pipe(G());settingsLoaded=!1;themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];constructor(){this.getAppSettings()}getAppSettings(){return P(this,null,function*(){let n=yield N(this.$api.get("/auth/settings"));this.formAuth=n.formAuth,this.sessionTimeout=n.sessionTimeout,this.env=n.env,this.lightingMode=n.lightingMode,this.wallpaper=n.wallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(n.theme),this.setMenuMode(n.menuMode),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(n.serverTimestamp),this.setUiVersion(n.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0)})}setBrowserLightingMode(n){this.browserLightingMode=n,this.lightingMode==="auto"&&this.setLightingMode(n,"browser")}setLightingMode(n,h){h==="user"&&(this.lightingMode=n),this.currentLightingMode=n,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(n){(!n||!this.themeList.includes(n))&&(n=this.defaultTheme,N(this.$api.put("/config-editor/ui",{key:"theme",value:n})).catch(l=>console.error("Error saving setTheme:",l)));let h=window.document.querySelector("body");h.classList.remove(`config-ui-x-${this.theme}`),h.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=n,this.actualLightingMode==="dark"?(h.classList.add(`config-ui-x-dark-mode-${this.theme}`),h.classList.contains("dark-mode")||h.classList.add("dark-mode")):(h.classList.add(`config-ui-x-${this.theme}`),h.classList.contains("dark-mode")&&h.classList.remove("dark-mode")),window.document.querySelectorAll("iframe").forEach((l,p)=>{try{let v=l.contentDocument;if(v){let y=v.body;y.classList.remove(`config-ui-x-${this.theme}`),y.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.actualLightingMode==="dark"?(y.classList.add(`config-ui-x-dark-mode-${this.theme}`),y.classList.contains("dark-mode")||y.classList.add("dark-mode")):(y.classList.add(`config-ui-x-${this.theme}`),y.classList.contains("dark-mode")&&y.classList.remove("dark-mode")),l.contentWindow.postMessage({type:"theme-update",isDark:this.actualLightingMode==="dark",theme:n},window.location.origin)}}catch(v){console.warn(`Iframe ${p}: Access denied (cross-origin?)`,{error:v,src:l.src})}})}setMenuMode(n){this.menuMode=n}setLang(n){n?this.$translate.use(n):n="auto",this.env.lang=n}setItem(n,h){this[n]=h}setEnvItem(n,h){if(n.includes(".")){let d=n.split("."),l=this.env;for(let p=0;p<d.length-1;p++){if(this.forbiddenKeys.includes(d[p]))return;l[d[p]]||(l[d[p]]={}),l=l[d[p]]}this.forbiddenKeys.includes(d[d.length-1])||(l[d[d.length-1]]=h)}else this.env[n]=h}checkServerTime(n){let d=(0,E.default)(n).diff((0,E.default)(),"hour");this.serverTimeOffset=d*60*60,(d>=8||d<=-8)&&this.$toastr.warning(this.$translate.instant("settings.datetime.incorrect"),this.$translate.instant("toast.title_warning"),{timeOut:2e4,tapToDismiss:!1}).onTap.subscribe(()=>{window.open("https://homebridge.io/w/JqTFs","_blank")})}setUiVersion(n){this.uiVersion||(this.uiVersion=n)}setTitle(n){this.$title.setTitle(n||"Homebridge")}static \u0275fac=function(h){return new(h||L)};static \u0275prov=R({token:L,factory:L.\u0275fac,providedIn:"root"})}return L})();export{st as a,vt as b};
1
+ import{k as et,n as it}from"./chunk-K6OAGSPQ.js";import{a as tt}from"./chunk-R3563DDE.js";import{l as X}from"./chunk-Q4CZ7LVK.js";import{T as G,e as ut,g as ct,ga as R,h as P,la as Y,n as Q,w as N}from"./chunk-ULJPS3WS.js";var st=ut((J,q)=>{(function(L,T){typeof J=="object"&&typeof q<"u"?q.exports=T():typeof define=="function"&&define.amd?define(T):(L=typeof globalThis<"u"?globalThis:L||self).dayjs=T()})(J,function(){"use strict";var L=1e3,T=6e4,n=36e5,h="millisecond",d="second",l="minute",p="hour",v="day",y="week",S="month",Z="quarter",b="year",x="date",z="Invalid Date",nt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,rt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ot={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var i=["th","st","nd","rd"],t=r%100;return"["+r+(i[(t-20)%10]||i[t]||i[0])+"]"}},F=function(r,i,t){var s=String(r);return!s||s.length>=i?r:""+Array(i+1-s.length).join(t)+r},at={s:F,z:function(r){var i=-r.utcOffset(),t=Math.abs(i),s=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+F(s,2,"0")+":"+F(e,2,"0")},m:function r(i,t){if(i.date()<t.date())return-r(t,i);var s=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(s,S),o=t-e<0,a=i.clone().add(s+(o?-1:1),S);return+(-(s+(t-e)/(o?e-a:a-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:S,y:b,w:y,d:v,D:x,h:p,m:l,s:d,ms:h,Q:Z}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},A="en",k={};k[A]=ot;var B="$isDayjsObject",U=function(r){return r instanceof W||!(!r||!r[B])},V=function r(i,t,s){var e;if(!i)return A;if(typeof i=="string"){var o=i.toLowerCase();k[o]&&(e=o),t&&(k[o]=t,e=o);var a=i.split("-");if(!e&&a.length>1)return r(a[0])}else{var c=i.name;k[c]=i,e=c}return!s&&e&&(A=e),e||!s&&A},m=function(r,i){if(U(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new W(t)},u=at;u.l=V,u.i=U,u.w=function(r,i){return m(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var W=function(){function r(t){this.$L=V(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[B]=!0}var i=r.prototype;return i.parse=function(t){this.$d=function(s){var e=s.date,o=s.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(nt);if(a){var c=a[2]-1||0,f=(a[7]||"0").substring(0,3);return o?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,f)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,f)}}return new Date(e)}(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return u},i.isValid=function(){return this.$d.toString()!==z},i.isSame=function(t,s){var e=m(t);return this.startOf(s)<=e&&e<=this.endOf(s)},i.isAfter=function(t,s){return m(t)<this.startOf(s)},i.isBefore=function(t,s){return this.endOf(s)<m(t)},i.$g=function(t,s,e){return u.u(t)?this[s]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,s){var e=this,o=!!u.u(s)||s,a=u.p(t),c=function(_,M){var D=u.w(e.$u?Date.UTC(e.$y,M,_):new Date(e.$y,M,_),e);return o?D:D.endOf(v)},f=function(_,M){return u.w(e.toDate()[_].apply(e.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(M)),e)},g=this.$W,$=this.$M,w=this.$D,j="set"+(this.$u?"UTC":"");switch(a){case b:return o?c(1,0):c(31,11);case S:return o?c(1,$):c(0,$+1);case y:var O=this.$locale().weekStart||0,H=(g<O?g+7:g)-O;return c(o?w-H:w+(6-H),$);case v:case x:return f(j+"Hours",0);case p:return f(j+"Minutes",1);case l:return f(j+"Seconds",2);case d:return f(j+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,s){var e,o=u.p(t),a="set"+(this.$u?"UTC":""),c=(e={},e[v]=a+"Date",e[x]=a+"Date",e[S]=a+"Month",e[b]=a+"FullYear",e[p]=a+"Hours",e[l]=a+"Minutes",e[d]=a+"Seconds",e[h]=a+"Milliseconds",e)[o],f=o===v?this.$D+(s-this.$W):s;if(o===S||o===b){var g=this.clone().set(x,1);g.$d[c](f),g.init(),this.$d=g.set(x,Math.min(this.$D,g.daysInMonth())).$d}else c&&this.$d[c](f);return this.init(),this},i.set=function(t,s){return this.clone().$set(t,s)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,s){var e,o=this;t=Number(t);var a=u.p(s),c=function($){var w=m(o);return u.w(w.date(w.date()+Math.round($*t)),o)};if(a===S)return this.set(S,this.$M+t);if(a===b)return this.set(b,this.$y+t);if(a===v)return c(1);if(a===y)return c(7);var f=(e={},e[l]=T,e[p]=n,e[d]=L,e)[a]||1,g=this.$d.getTime()+t*f;return u.w(g,this)},i.subtract=function(t,s){return this.add(-1*t,s)},i.format=function(t){var s=this,e=this.$locale();if(!this.isValid())return e.invalidDate||z;var o=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,f=this.$m,g=this.$M,$=e.weekdays,w=e.months,j=e.meridiem,O=function(M,D,I,C){return M&&(M[D]||M(s,o))||I[D].slice(0,C)},H=function(M){return u.s(c%12||12,M,"0")},_=j||function(M,D,I){var C=M<12?"AM":"PM";return I?C.toLowerCase():C};return o.replace(rt,function(M,D){return D||function(I){switch(I){case"YY":return String(s.$y).slice(-2);case"YYYY":return u.s(s.$y,4,"0");case"M":return g+1;case"MM":return u.s(g+1,2,"0");case"MMM":return O(e.monthsShort,g,w,3);case"MMMM":return O(w,g);case"D":return s.$D;case"DD":return u.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return O(e.weekdaysMin,s.$W,$,2);case"ddd":return O(e.weekdaysShort,s.$W,$,3);case"dddd":return $[s.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return H(1);case"hh":return H(2);case"a":return _(c,f,!0);case"A":return _(c,f,!1);case"m":return String(f);case"mm":return u.s(f,2,"0");case"s":return String(s.$s);case"ss":return u.s(s.$s,2,"0");case"SSS":return u.s(s.$ms,3,"0");case"Z":return a}return null}(M)||a.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,s,e){var o,a=this,c=u.p(s),f=m(t),g=(f.utcOffset()-this.utcOffset())*T,$=this-f,w=function(){return u.m(a,f)};switch(c){case b:o=w()/12;break;case S:o=w();break;case Z:o=w()/3;break;case y:o=($-g)/6048e5;break;case v:o=($-g)/864e5;break;case p:o=$/n;break;case l:o=$/T;break;case d:o=$/L;break;default:o=$}return e?o:u.a(o)},i.daysInMonth=function(){return this.endOf(S).$D},i.$locale=function(){return k[this.$L]},i.locale=function(t,s){if(!t)return this.$L;var e=this.clone(),o=V(t,s,!0);return o&&(e.$L=o),e},i.clone=function(){return u.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},r}(),K=W.prototype;return m.prototype=K,[["$ms",h],["$s",d],["$m",l],["$H",p],["$W",v],["$M",S],["$y",b],["$D",x]].forEach(function(r){K[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),m.extend=function(r,i){return r.$i||(r(i,W,m),r.$i=!0),m},m.locale=V,m.isDayjs=U,m.unix=function(r){return m(1e3*r)},m.en=k[A],m.Ls=k,m.p={},m})});var E=ct(st(),1);var vt=(()=>{class L{$api=Y(it);$title=Y(X);$toastr=Y(et);$translate=Y(tt);settingsLoadedSubject=new Q;defaultTheme="deep-purple";forbiddenKeys=["__proto__","constructor","prototype"];env={};formAuth=!0;sessionTimeout=28800;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;wallpaper;serverTimeOffset=0;rtl=!1;onSettingsLoaded=this.settingsLoadedSubject.pipe(G());settingsLoaded=!1;themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];constructor(){this.getAppSettings()}getAppSettings(){return P(this,null,function*(){let n=yield N(this.$api.get("/auth/settings"));this.formAuth=n.formAuth,this.sessionTimeout=n.sessionTimeout,this.env=n.env,this.lightingMode=n.lightingMode,this.wallpaper=n.wallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(n.theme),this.setMenuMode(n.menuMode),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(n.serverTimestamp),this.setUiVersion(n.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0)})}setBrowserLightingMode(n){this.browserLightingMode=n,this.lightingMode==="auto"&&this.setLightingMode(n,"browser")}setLightingMode(n,h){h==="user"&&(this.lightingMode=n),this.currentLightingMode=n,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(n){(!n||!this.themeList.includes(n))&&(n=this.defaultTheme,N(this.$api.put("/config-editor/ui",{key:"theme",value:n})).catch(l=>console.error("Error saving setTheme:",l)));let h=window.document.querySelector("body");h.classList.remove(`config-ui-x-${this.theme}`),h.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=n,this.actualLightingMode==="dark"?(h.classList.add(`config-ui-x-dark-mode-${this.theme}`),h.classList.contains("dark-mode")||h.classList.add("dark-mode")):(h.classList.add(`config-ui-x-${this.theme}`),h.classList.contains("dark-mode")&&h.classList.remove("dark-mode")),window.document.querySelectorAll("iframe").forEach((l,p)=>{try{let v=l.contentDocument;if(v){let y=v.body;y.classList.remove(`config-ui-x-${this.theme}`),y.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.actualLightingMode==="dark"?(y.classList.add(`config-ui-x-dark-mode-${this.theme}`),y.classList.contains("dark-mode")||y.classList.add("dark-mode")):(y.classList.add(`config-ui-x-${this.theme}`),y.classList.contains("dark-mode")&&y.classList.remove("dark-mode")),l.contentWindow.postMessage({type:"theme-update",isDark:this.actualLightingMode==="dark",theme:n},window.location.origin)}}catch(v){console.warn(`Iframe ${p}: Access denied (cross-origin?)`,{error:v,src:l.src})}})}setMenuMode(n){this.menuMode=n}setLang(n){n?this.$translate.use(n):n="auto",this.env.lang=n}setItem(n,h){this[n]=h}setEnvItem(n,h){if(n.includes(".")){let d=n.split("."),l=this.env;for(let p=0;p<d.length-1;p++){if(this.forbiddenKeys.includes(d[p]))return;l[d[p]]||(l[d[p]]={}),l=l[d[p]]}this.forbiddenKeys.includes(d[d.length-1])||(l[d[d.length-1]]=h)}else this.env[n]=h}checkServerTime(n){let d=(0,E.default)(n).diff((0,E.default)(),"hour");this.serverTimeOffset=d*60*60,(d>=8||d<=-8)&&this.$toastr.warning(this.$translate.instant("settings.datetime.incorrect"),this.$translate.instant("toast.title_warning"),{timeOut:2e4,tapToDismiss:!1}).onTap.subscribe(()=>{window.open("https://homebridge.io/w/JqTFs","_blank")})}setUiVersion(n){this.uiVersion||(this.uiVersion=n)}setTitle(n){this.$title.setTitle(n||"Homebridge")}static \u0275fac=function(h){return new(h||L)};static \u0275prov=R({token:L,factory:L.\u0275fac,providedIn:"root"})}return L})();export{st as a,vt as b};