homebridge-config-ui-x 5.4.2-beta.22 → 5.4.2-beta.23

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 (60) hide show
  1. package/dist/core/config/config.startup.js +9 -3
  2. package/dist/core/config/config.startup.js.map +1 -1
  3. package/dist/core/spa/spa-html.service.js +4 -8
  4. package/dist/core/spa/spa-html.service.js.map +1 -1
  5. package/package.json +1 -1
  6. package/public/{chunk-IXEXZ6PY.js → chunk-3AS3W2JT.js} +1 -1
  7. package/public/{chunk-3NKXAKQ2.js → chunk-3IGIVFAO.js} +1 -1
  8. package/public/{chunk-GFKGLXPI.js → chunk-3QWJJHAU.js} +1 -1
  9. package/public/{chunk-4MIRL2RQ.js → chunk-44KPC7NW.js} +1 -1
  10. package/public/{chunk-5PRMERAY.js → chunk-4NMGMGZF.js} +1 -1
  11. package/public/{chunk-HKEQH7L3.js → chunk-52ALUNIF.js} +1 -1
  12. package/public/{chunk-DDVFPXU2.js → chunk-5LWWKZGN.js} +1 -1
  13. package/public/{chunk-EDF7OXVT.js → chunk-5RYHRIVX.js} +1 -1
  14. package/public/{chunk-QT4LZWC7.js → chunk-5VD46E2V.js} +1 -1
  15. package/public/{chunk-LV4YRABN.js → chunk-6I5OK7UZ.js} +1 -1
  16. package/public/{chunk-3NFSVYPS.js → chunk-6UEXCRUG.js} +1 -1
  17. package/public/{chunk-IGUIL7RB.js → chunk-7CVX65WW.js} +1 -1
  18. package/public/{chunk-5NT3F6GU.js → chunk-7JNOB42D.js} +1 -1
  19. package/public/{chunk-TB55MGJG.js → chunk-7PLVLWDU.js} +1 -1
  20. package/public/{chunk-5ZJL4HUY.js → chunk-AEL7UA74.js} +1 -1
  21. package/public/chunk-AP2V6WYH.js +1 -0
  22. package/public/{chunk-KM6O5N22.js → chunk-BBPWAZNA.js} +1 -1
  23. package/public/{chunk-5CC3KPVH.js → chunk-BRN4YJET.js} +1 -1
  24. package/public/{chunk-2UPCJ4RZ.js → chunk-CRXCDFGV.js} +1 -1
  25. package/public/{chunk-IMAT3O4H.js → chunk-DA7DFESY.js} +1 -1
  26. package/public/{chunk-VCR7QM3J.js → chunk-DMYTURW6.js} +1 -1
  27. package/public/{chunk-MECZBYZB.js → chunk-DO7P3JHK.js} +1 -1
  28. package/public/{chunk-45EG42JQ.js → chunk-E7N2RQ74.js} +1 -1
  29. package/public/{chunk-5EO4YIAS.js → chunk-GNQG7N2O.js} +1 -1
  30. package/public/{chunk-BIHEWH4L.js → chunk-GSFBIFYG.js} +1 -1
  31. package/public/{chunk-3XEBXTDX.js → chunk-H73F2YG5.js} +1 -1
  32. package/public/{chunk-CT2RWPGF.js → chunk-HODZZ7CF.js} +1 -1
  33. package/public/{chunk-6XU6U2G7.js → chunk-HWHVCFQ3.js} +1 -1
  34. package/public/{chunk-HM43QQRQ.js → chunk-IKCCTXEH.js} +1 -1
  35. package/public/{chunk-DDBGIMER.js → chunk-JTTGQROS.js} +1 -1
  36. package/public/{chunk-D52W2A3R.js → chunk-K6T2NIWT.js} +1 -1
  37. package/public/{chunk-URLS7QKY.js → chunk-LKT3W4VQ.js} +1 -1
  38. package/public/{chunk-GNN6Q4HM.js → chunk-MBCRYZPI.js} +1 -1
  39. package/public/{chunk-SRICMFOV.js → chunk-MODI53YD.js} +1 -1
  40. package/public/{chunk-TRDX5VII.js → chunk-NBYDDORE.js} +1 -1
  41. package/public/{chunk-EAHLR6RC.js → chunk-NO3N2UL5.js} +1 -1
  42. package/public/{chunk-IHUI5TFD.js → chunk-O67URGXE.js} +1 -1
  43. package/public/{chunk-ZHBLCCB6.js → chunk-P5H3A6F2.js} +1 -1
  44. package/public/{chunk-HCLIKLMG.js → chunk-PKUKNT5A.js} +1 -1
  45. package/public/{chunk-HNWNRFVA.js → chunk-Q2CIMOUK.js} +1 -1
  46. package/public/{chunk-BCMB7GW2.js → chunk-Q354EN77.js} +1 -1
  47. package/public/{chunk-4PRXYUSA.js → chunk-QHAXHOEE.js} +1 -1
  48. package/public/{chunk-MWOR4EBD.js → chunk-RJQ5AVJV.js} +1 -1
  49. package/public/{chunk-MR6BLYSJ.js → chunk-RQBBIL4L.js} +1 -1
  50. package/public/{chunk-RQLARDW7.js → chunk-TABKUE4U.js} +1 -1
  51. package/public/{chunk-RKKENOWM.js → chunk-UJ6JMLQC.js} +1 -1
  52. package/public/{chunk-6JOIOSE7.js → chunk-UMIOQGEX.js} +1 -1
  53. package/public/{chunk-PLEWNNVD.js → chunk-URMO766P.js} +1 -1
  54. package/public/{chunk-LKAUKFCZ.js → chunk-USIOJNKF.js} +1 -1
  55. package/public/{chunk-KNHRV6SC.js → chunk-YBVDZA6Y.js} +1 -1
  56. package/public/{chunk-XSXLXWQW.js → chunk-YEUQUAGZ.js} +1 -1
  57. package/public/{chunk-MGN7V42K.js → chunk-YRIU42GG.js} +1 -1
  58. package/public/index.html +1 -1
  59. package/public/{main-RE67AOVC.js → main-WPY27HRP.js} +1 -1
  60. package/public/chunk-JEJVGFYA.js +0 -1
@@ -69,9 +69,15 @@ async function getStartupConfig() {
69
69
  logger.warn(`normalised webroot value: '${webroot}'`);
70
70
  config.webroot = webroot;
71
71
  }
72
- logger.warn(`final index.html file output: ${(0, node_path_1.resolve)(node_process_1.default.env.UIX_BASE_PATH, 'public/index.html')}`);
73
- const fileContent = await (0, fs_extra_1.readFile)((0, node_path_1.resolve)(node_process_1.default.env.UIX_BASE_PATH, 'public/index.html'), 'utf-8');
74
- fileContent.split(/\r?\n/).forEach(line => logger.warn(line));
72
+ const indexPath = (0, node_path_1.resolve)(node_process_1.default.env.UIX_BASE_PATH, 'public/index.html');
73
+ logger.warn(`final index.html file output: ${indexPath}`);
74
+ if (await (0, fs_extra_1.exists)(indexPath)) {
75
+ const fileContent = await (0, fs_extra_1.readFile)((0, node_path_1.resolve)(node_process_1.default.env.UIX_BASE_PATH, 'public/index.html'), 'utf-8');
76
+ fileContent.split(/\r?\n/).forEach(line => logger.warn(line));
77
+ }
78
+ else {
79
+ logger.error('could not find index.html file at expected location');
80
+ }
75
81
  return config;
76
82
  }
77
83
  //# sourceMappingURL=config.startup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.startup.js","sourceRoot":"","sources":["../../../src/core/config/config.startup.ts"],"names":[],"mappings":";;;;;AAaA,4CA6FC;AAxGD,qCAAoD;AACpD,yCAAmC;AACnC,gEAAkC;AAElC,uCAAmD;AAEnD,6DAAiD;AAK1C,KAAK,UAAU,gBAAgB;IACpC,MAAM,MAAM,GAAG,IAAI,uBAAM,EAAE,CAAA;IAE3B,MAAM,UAAU,GAAG,sBAAO,CAAC,GAAG,CAAC,eAAe,IAAI,IAAA,mBAAO,EAAC,IAAA,iBAAO,GAAE,EAAE,yBAAyB,CAAC,CAAA;IAE/F,MAAM,gBAAgB,GAAG,MAAM,IAAA,mBAAQ,EAAC,UAAU,CAAC,CAAA;IACnD,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAEvI,MAAM,MAAM,GAAG,EAWd,CAAA;IAGD,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAA,2BAAiB,GAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,EAAE;QACxE,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAA;IACjD,CAAC,CAAC,CAAC,MAAM,CAAA;IAET,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;IAGrC,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,OAAO,MAAM,CAAA;IACf,CA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A;QACpG,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAC/D,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAA;IACrE,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -28,14 +28,10 @@ class SpaHtmlService {
28
28
  const baseHref = webroot ? `/${webroot}/` : '/';
29
29
  return html
30
30
  .replace(/<base href="[^"]*"(\s*)\/?>/g, `<base href="${baseHref}"$1/>`)
31
- .replace(/href="\/[^"]*\/assets\//g, 'href="assets/')
32
- .replace(/href="\/[^"]*\/favicon\.ico"/g, 'href="favicon.ico"')
33
- .replace(/href="\/[^"]*\/([^"/]+\.(png|svg|webmanifest))"/g, 'href="$1"')
34
- .replace(/href="\/assets\//g, 'href="assets/')
35
- .replace(/href="\/favicon\.ico"/g, 'href="favicon.ico"')
36
- .replace(/href="\/([^"/]+\.(png|svg|webmanifest))"/g, 'href="$1"')
37
- .replace(/src="\/[^"]*\/assets\//g, 'src="assets/')
38
- .replace(/src="\/assets\//g, 'src="assets/');
31
+ .replace(/href="\/(?:.*?\/)?assets\//g, 'href="assets/')
32
+ .replace(/href="\/(?:.*?\/)?favicon\.ico"/g, 'href="favicon.ico"')
33
+ .replace(/href="\/(?:.*?\/)?([^"/]+\.(png|svg|webmanifest))"/g, 'href="$1"')
34
+ .replace(/src="\/(?:.*?\/)?assets\//g, 'src="assets/');
39
35
  }
40
36
  }
41
37
  exports.SpaHtmlService = SpaHtmlService;
@@ -1 +1 @@
1
- {"version":3,"file":"spa-html.service.js","sourceRoot":"","sources":["../../../src/core/spa/spa-html.service.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAmC;AACnC,gEAAkC;AAElC,uCAAsD;AAEtD,MAAa,cAAc;IAKzB,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,OAAe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C,8BAA8B,EAAE,eAAe,QAAQ,OAAO,CAAC;aACvE,OAAO,CAAC,6BAA6B,EAAE,eAAe,CAAC;aACvD,OAAO,CAAC,kCAAkC,EAAE,oBAAoB,CAAC;aACjE,OAAO,CAAC,qDAAqD,EAAE,WAAW,CAAC;aAC3E,OAAO,CAAC,4BAA4B,EAAE,cAAc,CAAC,CAAA;IAC1D,CAAC;CACF;AA7CD,wCA6CC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-config-ui-x",
3
3
  "displayName": "Homebridge UI",
4
- "version": "5.4.2-beta.22",
4
+ "version": "5.4.2-beta.23",
5
5
  "description": "A web based management, configuration and control platform for Homebridge.",
6
6
  "author": "oznu <dev@oz.nu>",
7
7
  "license": "MIT",
@@ -1 +1 @@
1
- import{b as u,d,g as s}from"./chunk-MDV2S56W.js";import{k as l,n as p,q as g}from"./chunk-5ZJL4HUY.js";import{Xa as n,ea as m,fa as i,h as c,ja as r,w as f}from"./chunk-3LEW5FOJ.js";var a=(()=>{class t{$api=r(g);$route=r(u);$router=r(d);$toastr=r(p);$translate=r(l);resolve(){return c(this,null,function*(){try{let o=yield f(this.$api.get("/config-editor"));return JSON.stringify(o,null,4)}catch(o){console.error(o),this.$toastr.error(o.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"],{relativeTo:this.$route})}})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=m({token:t,factory:t.\u0275fac})}return t})();var h=[{path:"",loadComponent:()=>import("./chunk-GFKGLXPI.js").then(t=>t.ConfigEditorComponent),resolve:{config:a}}],$=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=n({type:t});static \u0275inj=i({imports:[s.forChild(h),s]})}return t})();var A=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=n({type:t});static \u0275inj=i({providers:[a],imports:[$]})}return t})();export{A as ConfigEditorModule};
1
+ import{b as u,d,g as s}from"./chunk-MDV2S56W.js";import{k as l,n as p,q as g}from"./chunk-AEL7UA74.js";import{Xa as n,ea as m,fa as i,h as c,ja as r,w as f}from"./chunk-3LEW5FOJ.js";var a=(()=>{class t{$api=r(g);$route=r(u);$router=r(d);$toastr=r(p);$translate=r(l);resolve(){return c(this,null,function*(){try{let o=yield f(this.$api.get("/config-editor"));return JSON.stringify(o,null,4)}catch(o){console.error(o),this.$toastr.error(o.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"],{relativeTo:this.$route})}})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=m({token:t,factory:t.\u0275fac})}return t})();var h=[{path:"",loadComponent:()=>import("./chunk-3QWJJHAU.js").then(t=>t.ConfigEditorComponent),resolve:{config:a}}],$=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=n({type:t});static \u0275inj=i({imports:[s.forChild(h),s]})}return t})();var A=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=n({type:t});static \u0275inj=i({providers:[a],imports:[$]})}return t})();export{A as ConfigEditorModule};
@@ -1 +1 @@
1
- import{g as i}from"./chunk-MDV2S56W.js";import{Xa as e,fa as t}from"./chunk-3LEW5FOJ.js";var d=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"docker",loadChildren:()=>import("./chunk-HNWNRFVA.js").then(o=>o.DockerModule)},{path:"linux",loadChildren:()=>import("./chunk-HKEQH7L3.js").then(o=>o.LinuxModule)},{path:"terminal",loadChildren:()=>import("./chunk-5NT3F6GU.js").then(o=>o.TerminalModule)}],l=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[i.forChild(d),i]})}return o})();var p=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[l]})}return o})();export{p as PlatformToolsModule};
1
+ import{g as i}from"./chunk-MDV2S56W.js";import{Xa as e,fa as t}from"./chunk-3LEW5FOJ.js";var d=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"docker",loadChildren:()=>import("./chunk-Q2CIMOUK.js").then(o=>o.DockerModule)},{path:"linux",loadChildren:()=>import("./chunk-52ALUNIF.js").then(o=>o.LinuxModule)},{path:"terminal",loadChildren:()=>import("./chunk-7JNOB42D.js").then(o=>o.TerminalModule)}],l=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[i.forChild(d),i]})}return o})();var p=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[l]})}return o})();export{p as PlatformToolsModule};
@@ -1,4 +1,4 @@
1
- import{a as xe}from"./chunk-5WYRGCHF.js";import{b as B,e as Ce,f as ve,g as Pe}from"./chunk-IMAT3O4H.js";import{a as be,b as _e}from"./chunk-M7Q6VBJE.js";import{a as we}from"./chunk-KNZTEJFP.js";import{a as je}from"./chunk-KXMDG63G.js";import{m as ue,n as he,t as D}from"./chunk-BQMDK4YS.js";import{B as pe,C as ge,c as ce,e as me,l as fe}from"./chunk-AM53KSWA.js";import{b as I,d as O}from"./chunk-MDV2S56W.js";import{b as ye}from"./chunk-EAHLR6RC.js";import{k as R,l as j,n as P,q as H}from"./chunk-5ZJL4HUY.js";import{Db as S,Gb as b,Ib as m,Jc as le,La as r,Pa as ee,Qc as de,Tb as ne,Vb as _,Wa as A,Wb as k,Xb as T,a as G,ac as re,b as Q,bc as se,cc as ae,d as X,g as Z,h as C,hc as z,ja as p,kb as w,lb as v,mb as x,mc as s,nc as l,oa as u,ob as te,oc as K,pa as h,pb as ie,qb as oe,rb as g,sb as a,tb as d,ub as f,w as $}from"./chunk-3LEW5FOJ.js";var $e=Z(Pe(),1);var Ee=Z(je(),1);var Se=(n,y)=>({"fa-trash":n,"fa-cog fa-spin":y});function Oe(n,y){n&1&&(a(0,"div",13),f(1,"i",20),d())}function He(n,y){if(n&1){let e=S();a(0,"li",9)(1,"span"),_(2),s(3,"date"),f(4,"br"),a(5,"span",21),_(6),s(7,"date"),d()(),a(8,"span",22)(9,"button",25),s(10,"translate"),s(11,"translate"),b("click",function(){let i=u(e).$implicit,o=m(2);return h(o.restore(i.id))}),f(12,"i",26),d(),a(13,"button",27),s(14,"translate"),s(15,"translate"),b("click",function(){let i=u(e).$implicit,o=m(2);return h(o.download(i.id))}),f(16,"i",28),d(),a(17,"button",23),s(18,"translate"),s(19,"translate"),b("click",function(){let i=u(e).$implicit,o=m(2);return h(o.delete(i.id))}),f(20,"i",24),d()()()}if(n&2){let e=y.$implicit,t=m(2);r(2),T(" ",K(3,15,e.timestamp,"mediumDate")),r(4),k(K(7,18,e.timestamp,"shortTime")),r(3),g("disabled",t.clicked||t.deleting)("ngbTooltip",l(10,21,"config.restore.copy_to_editor"))("openDelay",150),w("aria-label",l(11,23,"config.restore.copy_to_editor")),r(4),g("disabled",t.clicked||t.deleting)("ngbTooltip",l(14,25,"form.button_download"))("openDelay",150),w("aria-label",l(15,27,"form.button_download")),r(4),g("disabled",t.clicked||t.deleting)("ngbTooltip",l(18,29,"form.button_delete"))("openDelay",150),w("aria-label",l(19,31,"form.button_delete")),r(3),g("ngClass",z(33,Se,e.id!==t.deleting,e.id===t.deleting))}}function Ne(n,y){if(n&1){let e=S();a(0,"ul",14),ie(1,He,21,36,"li",9,te),a(3,"li",9)(4,"span"),_(5),s(6,"translate"),f(7,"br"),a(8,"span",21),_(9),s(10,"translate"),d()(),a(11,"span",22)(12,"button",23),s(13,"translate"),s(14,"translate"),b("click",function(){u(e);let i=m();return h(i.deleteAllBackups())}),f(15,"i",24),d()()()()}if(n&2){let e=m();r(),oe(e.backupList),r(4),T(" ",l(6,7,"form.button_delete_all")),r(4),T(" ",l(10,9,"common.labels.no_confirmation")," "),r(3),g("disabled",e.clicked||e.deleting)("ngbTooltip",l(13,11,"form.button_delete_all"))("openDelay",150),w("aria-label",l(14,13,"form.button_delete")),r(3),g("ngClass",z(15,Se,e.deleting!=="all",e.deleting==="all"))}}var ke=(()=>{class n{$activeModal=p(ue);$api=p(H);$route=p(I);$router=p(O);$toastr=p(P);$translate=p(R);currentConfig;fromSettings=!1;loading=!0;backupList=[];clicked=!1;deleting=null;ngOnInit(){this.getConfigBackups()}getConfigBackups(){return C(this,null,function*(){try{let e=yield $(this.$api.get("/config-editor/backups"));this.loading=!1,this.backupList=e}catch(e){this.loading=!1,console.error(e),this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),this.dismissModal()}})}restore(e){return this.$activeModal.close(e)}download(e){return C(this,null,function*(){this.clicked=!0;try{let t=yield $(this.$api.get(`/config-editor/backups/${e}`)),i=JSON.stringify(t,null,4),o=new Blob([i],{type:"application/json"}),E=`config-backup-${e}.json`;(0,Ee.saveAs)(o,E),this.clicked=!1}catch(t){this.clicked=!1,this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),console.error(t)}})}downloadCurrentConfig(){let e=`data:text/json;charset=utf-8,${encodeURIComponent(this.currentConfig)}`,t=document.createElement("a");t.setAttribute("href",e),t.setAttribute("download","config.json"),document.body.appendChild(t),t.click(),t.remove()}delete(e){return C(this,null,function*(){this.deleting=e;try{yield $(this.$api.delete(`/config-editor/backups/${e}`)),yield this.getConfigBackups(),this.deleting=null}catch(t){this.deleting=null,this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),console.error(t)}})}deleteAllBackups(){return C(this,null,function*(){this.deleting="all";try{yield $(this.$api.delete("/config-editor/backups")),this.$toastr.success(this.$translate.instant("config.restore.toast_backups_deleted"),this.$translate.instant("toast.title_success")),this.backupList=[],this.deleting=null}catch(e){this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),console.error(e),this.deleting=null}})}dismissModal(){this.fromSettings&&this.$router.navigate(["/settings"],{relativeTo:this.$route}),this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=A({type:n,selectors:[["ng-component"]],inputs:{currentConfig:"currentConfig",fromSettings:"fromSettings"},decls:40,vars:31,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-history","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"btn","btn-primary","m-0","ms-3",3,"click","disabled"],[1,"fas","fa-fw","fa-arrow-right"],[1,"text-center","primary-text"],[1,"list-group","list-group-box","mt-3"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-end"],[1,"fa","fa-fw","fa-cog","fa-spin","mt-3",2,"font-size","75px"],[1,"grey-text","small"],[2,"display","flex","flex-wrap","nowrap"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-danger","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw",3,"ngClass"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-3",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","fa-history"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","fa-download"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),_(3),s(4,"translate"),d(),a(5,"button",3),s(6,"translate"),b("click",function(){return i.dismissModal()}),d()(),a(7,"div",4)(8,"div",5),f(9,"i",6),d(),a(10,"ul",7)(11,"li"),_(12),s(13,"translate"),d(),a(14,"li"),_(15),s(16,"translate"),d()(),a(17,"ul",8)(18,"li",9)(19,"div")(20,"span"),_(21),s(22,"translate"),d(),f(23,"br"),a(24,"small",10),_(25),s(26,"translate"),d()(),a(27,"button",11),s(28,"translate"),b("click",function(){return i.downloadCurrentConfig()}),f(29,"i",12),d()()(),v(30,Oe,2,0,"div",13)(31,Ne,16,18,"ul",14),d(),a(32,"div",15),f(33,"div",16),a(34,"div",17)(35,"button",18),s(36,"translate"),b("click",function(){return i.dismissModal()}),_(37),s(38,"translate"),d()(),f(39,"div",19),d()()),t&2&&(r(3),k(l(4,13,"config.restore.title")),r(2),g("disabled",i.clicked||i.deleting),w("aria-label",l(6,15,"form.button_close")),r(7),k(l(13,17,"config.restore.help_1")),r(3),k(l(16,19,"config.restore.help_2")),r(6),k(l(22,21,"form.button_download")),r(4),k(l(26,23,"config.restore.download")),r(2),g("disabled",i.clicked||i.deleting),w("aria-label",l(28,25,"backup.backup_now")),r(3),x(i.loading?30:i.backupList.length?31:-1),r(5),g("disabled",i.clicked||i.deleting),w("aria-label",l(36,27,"form.button_close")),r(2),T(" ",l(38,29,"form.button_close")," "))},dependencies:[D,le,ge,de,j],encapsulation:2})}return n})();function qe(n,y){if(n&1){let e=S();a(0,"button",13),s(1,"translate"),s(2,"translate"),b("click",function(){u(e);let i=m();return h(i.onCancelRestore())}),f(3,"i",14),d()}if(n&2){let e=m();g("disabled",e.saveInProgress)("openDelay",150)("ngbTooltip",l(1,4,"form.button_cancel")),w("aria-label",l(2,6,"form.button_cancel"))}}function Fe(n,y){if(n&1){let e=S();a(0,"button",15),s(1,"translate"),s(2,"translate"),b("click",function(){u(e);let i=m();return h(i.onRestore())}),f(3,"i",16),d()}n&2&&(g("openDelay",150)("ngbTooltip",l(1,3,"form.button_restore")),w("aria-label",l(2,5,"form.button_restore")))}function Je(n,y){if(n&1){let e=S();a(0,"button",15),s(1,"translate"),s(2,"translate"),b("click",function(){u(e);let i=m();return h(i.toggleSideBySide())}),f(3,"i",17),d()}if(n&2){let e=m();g("openDelay",150)("ngbTooltip",l(1,7,e.renderSideBySide?"config.restore.view_inline":"config.restore.view_side_by_side")),w("aria-label",l(2,9,e.renderSideBySide?"config.restore.view_inline":"config.restore.view_side_by_side")),r(3),ne("fa-columns",!e.renderSideBySide)("fa-bars",e.renderSideBySide)}}function Le(n,y){n&1&&f(0,"i",8)}function Ue(n,y){n&1&&f(0,"i",9)}function ze(n,y){if(n&1){let e=S();a(0,"ngx-monaco-editor",18),b("onInit",function(i){u(e);let o=m();return h(o.onEditorInit(i))})("keydown.control.s",function(i){u(e);let o=m();return i.preventDefault(),h(o.onSave())})("keydown.meta.s",function(i){u(e);let o=m();return i.preventDefault(),h(o.onSave())}),d()}if(n&2){let e=m();g("options",e.editorOptions)("model",e.monacoEditorModel)}}function Ke(n,y){if(n&1){let e=S();a(0,"ngx-monaco-diff-editor",19),b("onInit",function(i){u(e);let o=m();return h(o.onInitDiffEditor(i))})("keydown.control.s",function(i){u(e);let o=m();return i.preventDefault(),h(o.onSave())})("keydown.meta.s",function(i){u(e);let o=m();return i.preventDefault(),h(o.onSave())}),d()}if(n&2){let e=m();g("options",e.editorOptions)("originalModel",e.diffOriginalModel)("modifiedModel",e.diffModifiedModel)}}function We(n,y){if(n&1){let e=S();a(0,"textarea",20),ae("ngModelChange",function(i){u(e);let o=m();return se(o.homebridgeConfig,i)||(o.homebridgeConfig=i),h(i)}),_(1," "),d()}if(n&2){let e=m();re("ngModel",e.homebridgeConfig)}}var $t=(()=>{class n{$api=p(H);$md=p(we);$modal=p(he);$monacoEditor=p(xe);$route=p(I);$renderer=p(ee);$router=p(O);$settings=p(ye);$toastr=p(P);$translate=p(R);editorDecorations=[];lastHeight;visualViewPortEventCallback;latestSavedConfig;childBridgesToRestart=[];hbPendingRestart=!1;homebridgeConfig;originalConfig;saveInProgress;isMobile=!1;monacoEditor;editorOptions;monacoEditorModel;diffOriginalModel;diffModifiedModel;renderSideBySide=!1;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"json",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",renderSideBySide:this.renderSideBySide,renderIndicators:!0,ignoreTrimWhitespace:!1,glyphMargin:!0};let e=document.querySelector(".content");this.$renderer.setStyle(e,"height","100%"),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(i=>{this.homebridgeConfig=i.config,this.latestSavedConfig=JSON.parse(i.config),this.diffModifiedModel&&this.updateDiffModels()}),this.monacoEditorModel={value:"{}",language:"json",uri:window.monaco?window.monaco.Uri.parse("a://homebridge/config.json"):void 0},this.diffOriginalModel={code:"",language:"json"},this.diffModifiedModel={code:this.homebridgeConfig||"{}",language:"json"},window.monaco?this.setMonacoEditorModel():this.$monacoEditor.readyEvent.subscribe({next:()=>this.setMonacoEditorModel()});let{action:t}=this.$router.parseUrl(this.$router.url).queryParams;if(t){switch(t){case"restore":{this.onRestore(!0);break}}this.$router.navigate([],{queryParams:{},replaceUrl:!0,queryParamsHandling:"",relativeTo:this.$route})}}onEditorInit(e){window.editor=e,this.monacoEditor=e,this.monacoEditor.getModel().setValue(this.homebridgeConfig)}onInitDiffEditor(e){this.monacoEditor=e.getModifiedEditor(),this.updateDiffModels(),window.editor=e}updateDiffModels(){if(this.diffOriginalModel&&(this.diffOriginalModel.code=this.originalConfig||""),this.diffModifiedModel&&(this.diffModifiedModel.code=this.homebridgeConfig||"{}"),window.editor&&window.editor.getOriginalEditor){let e=window.editor.getOriginalEditor(),t=window.editor.getModifiedEditor();if(e&&t){let i=e.getModel(),o=t.getModel();i&&i.setValue(this.originalConfig||""),o&&o.setValue(this.homebridgeConfig||"{}")}}}onSave(){return C(this,null,function*(){if(!this.saveInProgress){this.monacoEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[])),this.saveInProgress=!0;try{if(!this.isMobile){yield this.monacoEditor.getAction("editor.action.formatDocument").run();let t=window.monaco.editor.getModelMarkers({owner:"json"});for(let i of t)if(i.message==="Duplicate object key"){this.saveInProgress=!1,this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"));return}this.homebridgeConfig=this.monacoEditor.getModel().getValue()}let e=this.parseConfigFromEditor();this.homebridgeConfig=JSON.stringify(e,null,4),typeof e.bridge!="object"?this.$toastr.error(this.$translate.instant("config.config_bridge_missing"),this.$translate.instant("toast.title_error")):/^(?:[0-9A-F]{2}:){5}[0-9A-F]{2}$/i.test(e.bridge.username)?e.accessories&&!Array.isArray(e.accessories)?this.$toastr.error(this.$translate.instant("config.config_accessory_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&!Array.isArray(e.platforms)?this.$toastr.error(this.$translate.instant("config.config_platform_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&Array.isArray(e.platforms)&&!this.validateSection(e.platforms,"platform")||e.accessories&&Array.isArray(e.accessories)&&!this.validateSection(e.accessories,"accessory")||e.plugins&&Array.isArray(e.plugins)&&!this.validatePlugins(e.plugins,"plugins")||e.disabledPlugins&&Array.isArray(e.disabledPlugins)&&!this.validatePlugins(e.disabledPlugins,"disabledPlugins")||(yield this.saveConfig(e),this.originalConfig=""):this.$toastr.error(this.$translate.instant("config.config_username_error"),this.$translate.instant("toast.title_error"))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}onRestore(e=!1){let t=this.$modal.open(ke,{size:"lg",backdrop:"static"});t.componentInstance.currentConfig=this.homebridgeConfig,t.componentInstance.fromSettings=e,t.result.then(i=>{this.originalConfig||(this.originalConfig=this.homebridgeConfig,this.updateDiffModels()),this.$api.get(`/config-editor/backups/${i}`).subscribe({next:o=>{this.$toastr.info(this.$translate.instant("config.restore.confirm"),this.$translate.instant("config.title_backup_loaded")),this.homebridgeConfig=JSON.stringify(o,null,4),this.updateDiffModels(),this.monacoEditor&&window.editor.modifiedEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[]),this.monacoEditor.executeEdits("beautifier",[{identifier:"delete",range:new monaco.Range(1,1,this.monacoEditor.getModel().getLineCount()+10,1),text:"",forceMoveMarkers:!0}]),this.monacoEditor.executeEdits("beautifier",[{identifier:"insert",range:new monaco.Range(1,1,1,1),text:this.homebridgeConfig,forceMoveMarkers:!0}]))},error:o=>{console.error(o),this.$toastr.error(o.error?.message||this.$translate.instant("backup.load_error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}onCancelRestore(){if(window.editor&&window.editor.dispose)try{window.editor.dispose(),window.editor=void 0}catch{}this.homebridgeConfig=this.originalConfig,this.originalConfig="",this.renderSideBySide&&this.toggleSideBySide(),this.updateDiffModels(),this.onRestore()}toggleSideBySide(){this.renderSideBySide=!this.renderSideBySide,this.editorOptions=Q(G({},this.editorOptions),{renderSideBySide:this.renderSideBySide})}ngOnDestroy(){let e=document.querySelector(".content");this.$renderer.removeStyle(e,"height"),window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove());try{if(window.editor&&window.editor.dispose&&(window.editor.dispose(),window.editor=void 0),window.monaco){let t=window.monaco.Uri.parse("file:///original.json"),i=window.monaco.Uri.parse("file:///modified.json"),o=window.monaco.editor.getModel(t);o&&o.dispose();let E=window.monaco.editor.getModel(i);E&&E.dispose()}this.monacoEditor&&this.monacoEditor.dispose()}catch{}}validateSection(e,t){for(let i of e){if(typeof i!="object"||Array.isArray(i))return this.$toastr.error(this.$translate.instant("config.error_blocks_objects",{type:t}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(!i[t])return this.$toastr.error(this.$translate.instant("config.error_blocks_type",{type:t}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(typeof i[t]!="string")return this.$toastr.error(this.$translate.instant("config.error_string_type",{type:t}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1}return!0}validatePlugins(e,t){for(let i of e)if(typeof i!="string")return this.$toastr.error(this.$translate.instant("config.error_string_array",{key:t}),this.$translate.instant("toast.title_error")),!1;return!0}highlightOffendingArrayItem(e){this.monacoEditor&&(e=JSON.stringify(e,null,4).split(`
1
+ import{a as xe}from"./chunk-5WYRGCHF.js";import{b as B,e as Ce,f as ve,g as Pe}from"./chunk-DA7DFESY.js";import{a as be,b as _e}from"./chunk-M7Q6VBJE.js";import{a as we}from"./chunk-KNZTEJFP.js";import{a as je}from"./chunk-KXMDG63G.js";import{m as ue,n as he,t as D}from"./chunk-BQMDK4YS.js";import{B as pe,C as ge,c as ce,e as me,l as fe}from"./chunk-AM53KSWA.js";import{b as I,d as O}from"./chunk-MDV2S56W.js";import{b as ye}from"./chunk-NO3N2UL5.js";import{k as R,l as j,n as P,q as H}from"./chunk-AEL7UA74.js";import{Db as S,Gb as b,Ib as m,Jc as le,La as r,Pa as ee,Qc as de,Tb as ne,Vb as _,Wa as A,Wb as k,Xb as T,a as G,ac as re,b as Q,bc as se,cc as ae,d as X,g as Z,h as C,hc as z,ja as p,kb as w,lb as v,mb as x,mc as s,nc as l,oa as u,ob as te,oc as K,pa as h,pb as ie,qb as oe,rb as g,sb as a,tb as d,ub as f,w as $}from"./chunk-3LEW5FOJ.js";var $e=Z(Pe(),1);var Ee=Z(je(),1);var Se=(n,y)=>({"fa-trash":n,"fa-cog fa-spin":y});function Oe(n,y){n&1&&(a(0,"div",13),f(1,"i",20),d())}function He(n,y){if(n&1){let e=S();a(0,"li",9)(1,"span"),_(2),s(3,"date"),f(4,"br"),a(5,"span",21),_(6),s(7,"date"),d()(),a(8,"span",22)(9,"button",25),s(10,"translate"),s(11,"translate"),b("click",function(){let i=u(e).$implicit,o=m(2);return h(o.restore(i.id))}),f(12,"i",26),d(),a(13,"button",27),s(14,"translate"),s(15,"translate"),b("click",function(){let i=u(e).$implicit,o=m(2);return h(o.download(i.id))}),f(16,"i",28),d(),a(17,"button",23),s(18,"translate"),s(19,"translate"),b("click",function(){let i=u(e).$implicit,o=m(2);return h(o.delete(i.id))}),f(20,"i",24),d()()()}if(n&2){let e=y.$implicit,t=m(2);r(2),T(" ",K(3,15,e.timestamp,"mediumDate")),r(4),k(K(7,18,e.timestamp,"shortTime")),r(3),g("disabled",t.clicked||t.deleting)("ngbTooltip",l(10,21,"config.restore.copy_to_editor"))("openDelay",150),w("aria-label",l(11,23,"config.restore.copy_to_editor")),r(4),g("disabled",t.clicked||t.deleting)("ngbTooltip",l(14,25,"form.button_download"))("openDelay",150),w("aria-label",l(15,27,"form.button_download")),r(4),g("disabled",t.clicked||t.deleting)("ngbTooltip",l(18,29,"form.button_delete"))("openDelay",150),w("aria-label",l(19,31,"form.button_delete")),r(3),g("ngClass",z(33,Se,e.id!==t.deleting,e.id===t.deleting))}}function Ne(n,y){if(n&1){let e=S();a(0,"ul",14),ie(1,He,21,36,"li",9,te),a(3,"li",9)(4,"span"),_(5),s(6,"translate"),f(7,"br"),a(8,"span",21),_(9),s(10,"translate"),d()(),a(11,"span",22)(12,"button",23),s(13,"translate"),s(14,"translate"),b("click",function(){u(e);let i=m();return h(i.deleteAllBackups())}),f(15,"i",24),d()()()()}if(n&2){let e=m();r(),oe(e.backupList),r(4),T(" ",l(6,7,"form.button_delete_all")),r(4),T(" ",l(10,9,"common.labels.no_confirmation")," "),r(3),g("disabled",e.clicked||e.deleting)("ngbTooltip",l(13,11,"form.button_delete_all"))("openDelay",150),w("aria-label",l(14,13,"form.button_delete")),r(3),g("ngClass",z(15,Se,e.deleting!=="all",e.deleting==="all"))}}var ke=(()=>{class n{$activeModal=p(ue);$api=p(H);$route=p(I);$router=p(O);$toastr=p(P);$translate=p(R);currentConfig;fromSettings=!1;loading=!0;backupList=[];clicked=!1;deleting=null;ngOnInit(){this.getConfigBackups()}getConfigBackups(){return C(this,null,function*(){try{let e=yield $(this.$api.get("/config-editor/backups"));this.loading=!1,this.backupList=e}catch(e){this.loading=!1,console.error(e),this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),this.dismissModal()}})}restore(e){return this.$activeModal.close(e)}download(e){return C(this,null,function*(){this.clicked=!0;try{let t=yield $(this.$api.get(`/config-editor/backups/${e}`)),i=JSON.stringify(t,null,4),o=new Blob([i],{type:"application/json"}),E=`config-backup-${e}.json`;(0,Ee.saveAs)(o,E),this.clicked=!1}catch(t){this.clicked=!1,this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),console.error(t)}})}downloadCurrentConfig(){let e=`data:text/json;charset=utf-8,${encodeURIComponent(this.currentConfig)}`,t=document.createElement("a");t.setAttribute("href",e),t.setAttribute("download","config.json"),document.body.appendChild(t),t.click(),t.remove()}delete(e){return C(this,null,function*(){this.deleting=e;try{yield $(this.$api.delete(`/config-editor/backups/${e}`)),yield this.getConfigBackups(),this.deleting=null}catch(t){this.deleting=null,this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),console.error(t)}})}deleteAllBackups(){return C(this,null,function*(){this.deleting="all";try{yield $(this.$api.delete("/config-editor/backups")),this.$toastr.success(this.$translate.instant("config.restore.toast_backups_deleted"),this.$translate.instant("toast.title_success")),this.backupList=[],this.deleting=null}catch(e){this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),console.error(e),this.deleting=null}})}dismissModal(){this.fromSettings&&this.$router.navigate(["/settings"],{relativeTo:this.$route}),this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=A({type:n,selectors:[["ng-component"]],inputs:{currentConfig:"currentConfig",fromSettings:"fromSettings"},decls:40,vars:31,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-history","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"btn","btn-primary","m-0","ms-3",3,"click","disabled"],[1,"fas","fa-fw","fa-arrow-right"],[1,"text-center","primary-text"],[1,"list-group","list-group-box","mt-3"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-end"],[1,"fa","fa-fw","fa-cog","fa-spin","mt-3",2,"font-size","75px"],[1,"grey-text","small"],[2,"display","flex","flex-wrap","nowrap"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-danger","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw",3,"ngClass"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-3",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","fa-history"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","fa-download"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),_(3),s(4,"translate"),d(),a(5,"button",3),s(6,"translate"),b("click",function(){return i.dismissModal()}),d()(),a(7,"div",4)(8,"div",5),f(9,"i",6),d(),a(10,"ul",7)(11,"li"),_(12),s(13,"translate"),d(),a(14,"li"),_(15),s(16,"translate"),d()(),a(17,"ul",8)(18,"li",9)(19,"div")(20,"span"),_(21),s(22,"translate"),d(),f(23,"br"),a(24,"small",10),_(25),s(26,"translate"),d()(),a(27,"button",11),s(28,"translate"),b("click",function(){return i.downloadCurrentConfig()}),f(29,"i",12),d()()(),v(30,Oe,2,0,"div",13)(31,Ne,16,18,"ul",14),d(),a(32,"div",15),f(33,"div",16),a(34,"div",17)(35,"button",18),s(36,"translate"),b("click",function(){return i.dismissModal()}),_(37),s(38,"translate"),d()(),f(39,"div",19),d()()),t&2&&(r(3),k(l(4,13,"config.restore.title")),r(2),g("disabled",i.clicked||i.deleting),w("aria-label",l(6,15,"form.button_close")),r(7),k(l(13,17,"config.restore.help_1")),r(3),k(l(16,19,"config.restore.help_2")),r(6),k(l(22,21,"form.button_download")),r(4),k(l(26,23,"config.restore.download")),r(2),g("disabled",i.clicked||i.deleting),w("aria-label",l(28,25,"backup.backup_now")),r(3),x(i.loading?30:i.backupList.length?31:-1),r(5),g("disabled",i.clicked||i.deleting),w("aria-label",l(36,27,"form.button_close")),r(2),T(" ",l(38,29,"form.button_close")," "))},dependencies:[D,le,ge,de,j],encapsulation:2})}return n})();function qe(n,y){if(n&1){let e=S();a(0,"button",13),s(1,"translate"),s(2,"translate"),b("click",function(){u(e);let i=m();return h(i.onCancelRestore())}),f(3,"i",14),d()}if(n&2){let e=m();g("disabled",e.saveInProgress)("openDelay",150)("ngbTooltip",l(1,4,"form.button_cancel")),w("aria-label",l(2,6,"form.button_cancel"))}}function Fe(n,y){if(n&1){let e=S();a(0,"button",15),s(1,"translate"),s(2,"translate"),b("click",function(){u(e);let i=m();return h(i.onRestore())}),f(3,"i",16),d()}n&2&&(g("openDelay",150)("ngbTooltip",l(1,3,"form.button_restore")),w("aria-label",l(2,5,"form.button_restore")))}function Je(n,y){if(n&1){let e=S();a(0,"button",15),s(1,"translate"),s(2,"translate"),b("click",function(){u(e);let i=m();return h(i.toggleSideBySide())}),f(3,"i",17),d()}if(n&2){let e=m();g("openDelay",150)("ngbTooltip",l(1,7,e.renderSideBySide?"config.restore.view_inline":"config.restore.view_side_by_side")),w("aria-label",l(2,9,e.renderSideBySide?"config.restore.view_inline":"config.restore.view_side_by_side")),r(3),ne("fa-columns",!e.renderSideBySide)("fa-bars",e.renderSideBySide)}}function Le(n,y){n&1&&f(0,"i",8)}function Ue(n,y){n&1&&f(0,"i",9)}function ze(n,y){if(n&1){let e=S();a(0,"ngx-monaco-editor",18),b("onInit",function(i){u(e);let o=m();return h(o.onEditorInit(i))})("keydown.control.s",function(i){u(e);let o=m();return i.preventDefault(),h(o.onSave())})("keydown.meta.s",function(i){u(e);let o=m();return i.preventDefault(),h(o.onSave())}),d()}if(n&2){let e=m();g("options",e.editorOptions)("model",e.monacoEditorModel)}}function Ke(n,y){if(n&1){let e=S();a(0,"ngx-monaco-diff-editor",19),b("onInit",function(i){u(e);let o=m();return h(o.onInitDiffEditor(i))})("keydown.control.s",function(i){u(e);let o=m();return i.preventDefault(),h(o.onSave())})("keydown.meta.s",function(i){u(e);let o=m();return i.preventDefault(),h(o.onSave())}),d()}if(n&2){let e=m();g("options",e.editorOptions)("originalModel",e.diffOriginalModel)("modifiedModel",e.diffModifiedModel)}}function We(n,y){if(n&1){let e=S();a(0,"textarea",20),ae("ngModelChange",function(i){u(e);let o=m();return se(o.homebridgeConfig,i)||(o.homebridgeConfig=i),h(i)}),_(1," "),d()}if(n&2){let e=m();re("ngModel",e.homebridgeConfig)}}var $t=(()=>{class n{$api=p(H);$md=p(we);$modal=p(he);$monacoEditor=p(xe);$route=p(I);$renderer=p(ee);$router=p(O);$settings=p(ye);$toastr=p(P);$translate=p(R);editorDecorations=[];lastHeight;visualViewPortEventCallback;latestSavedConfig;childBridgesToRestart=[];hbPendingRestart=!1;homebridgeConfig;originalConfig;saveInProgress;isMobile=!1;monacoEditor;editorOptions;monacoEditorModel;diffOriginalModel;diffModifiedModel;renderSideBySide=!1;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"json",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",renderSideBySide:this.renderSideBySide,renderIndicators:!0,ignoreTrimWhitespace:!1,glyphMargin:!0};let e=document.querySelector(".content");this.$renderer.setStyle(e,"height","100%"),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(i=>{this.homebridgeConfig=i.config,this.latestSavedConfig=JSON.parse(i.config),this.diffModifiedModel&&this.updateDiffModels()}),this.monacoEditorModel={value:"{}",language:"json",uri:window.monaco?window.monaco.Uri.parse("a://homebridge/config.json"):void 0},this.diffOriginalModel={code:"",language:"json"},this.diffModifiedModel={code:this.homebridgeConfig||"{}",language:"json"},window.monaco?this.setMonacoEditorModel():this.$monacoEditor.readyEvent.subscribe({next:()=>this.setMonacoEditorModel()});let{action:t}=this.$router.parseUrl(this.$router.url).queryParams;if(t){switch(t){case"restore":{this.onRestore(!0);break}}this.$router.navigate([],{queryParams:{},replaceUrl:!0,queryParamsHandling:"",relativeTo:this.$route})}}onEditorInit(e){window.editor=e,this.monacoEditor=e,this.monacoEditor.getModel().setValue(this.homebridgeConfig)}onInitDiffEditor(e){this.monacoEditor=e.getModifiedEditor(),this.updateDiffModels(),window.editor=e}updateDiffModels(){if(this.diffOriginalModel&&(this.diffOriginalModel.code=this.originalConfig||""),this.diffModifiedModel&&(this.diffModifiedModel.code=this.homebridgeConfig||"{}"),window.editor&&window.editor.getOriginalEditor){let e=window.editor.getOriginalEditor(),t=window.editor.getModifiedEditor();if(e&&t){let i=e.getModel(),o=t.getModel();i&&i.setValue(this.originalConfig||""),o&&o.setValue(this.homebridgeConfig||"{}")}}}onSave(){return C(this,null,function*(){if(!this.saveInProgress){this.monacoEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[])),this.saveInProgress=!0;try{if(!this.isMobile){yield this.monacoEditor.getAction("editor.action.formatDocument").run();let t=window.monaco.editor.getModelMarkers({owner:"json"});for(let i of t)if(i.message==="Duplicate object key"){this.saveInProgress=!1,this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"));return}this.homebridgeConfig=this.monacoEditor.getModel().getValue()}let e=this.parseConfigFromEditor();this.homebridgeConfig=JSON.stringify(e,null,4),typeof e.bridge!="object"?this.$toastr.error(this.$translate.instant("config.config_bridge_missing"),this.$translate.instant("toast.title_error")):/^(?:[0-9A-F]{2}:){5}[0-9A-F]{2}$/i.test(e.bridge.username)?e.accessories&&!Array.isArray(e.accessories)?this.$toastr.error(this.$translate.instant("config.config_accessory_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&!Array.isArray(e.platforms)?this.$toastr.error(this.$translate.instant("config.config_platform_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&Array.isArray(e.platforms)&&!this.validateSection(e.platforms,"platform")||e.accessories&&Array.isArray(e.accessories)&&!this.validateSection(e.accessories,"accessory")||e.plugins&&Array.isArray(e.plugins)&&!this.validatePlugins(e.plugins,"plugins")||e.disabledPlugins&&Array.isArray(e.disabledPlugins)&&!this.validatePlugins(e.disabledPlugins,"disabledPlugins")||(yield this.saveConfig(e),this.originalConfig=""):this.$toastr.error(this.$translate.instant("config.config_username_error"),this.$translate.instant("toast.title_error"))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}onRestore(e=!1){let t=this.$modal.open(ke,{size:"lg",backdrop:"static"});t.componentInstance.currentConfig=this.homebridgeConfig,t.componentInstance.fromSettings=e,t.result.then(i=>{this.originalConfig||(this.originalConfig=this.homebridgeConfig,this.updateDiffModels()),this.$api.get(`/config-editor/backups/${i}`).subscribe({next:o=>{this.$toastr.info(this.$translate.instant("config.restore.confirm"),this.$translate.instant("config.title_backup_loaded")),this.homebridgeConfig=JSON.stringify(o,null,4),this.updateDiffModels(),this.monacoEditor&&window.editor.modifiedEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[]),this.monacoEditor.executeEdits("beautifier",[{identifier:"delete",range:new monaco.Range(1,1,this.monacoEditor.getModel().getLineCount()+10,1),text:"",forceMoveMarkers:!0}]),this.monacoEditor.executeEdits("beautifier",[{identifier:"insert",range:new monaco.Range(1,1,1,1),text:this.homebridgeConfig,forceMoveMarkers:!0}]))},error:o=>{console.error(o),this.$toastr.error(o.error?.message||this.$translate.instant("backup.load_error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}onCancelRestore(){if(window.editor&&window.editor.dispose)try{window.editor.dispose(),window.editor=void 0}catch{}this.homebridgeConfig=this.originalConfig,this.originalConfig="",this.renderSideBySide&&this.toggleSideBySide(),this.updateDiffModels(),this.onRestore()}toggleSideBySide(){this.renderSideBySide=!this.renderSideBySide,this.editorOptions=Q(G({},this.editorOptions),{renderSideBySide:this.renderSideBySide})}ngOnDestroy(){let e=document.querySelector(".content");this.$renderer.removeStyle(e,"height"),window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove());try{if(window.editor&&window.editor.dispose&&(window.editor.dispose(),window.editor=void 0),window.monaco){let t=window.monaco.Uri.parse("file:///original.json"),i=window.monaco.Uri.parse("file:///modified.json"),o=window.monaco.editor.getModel(t);o&&o.dispose();let E=window.monaco.editor.getModel(i);E&&E.dispose()}this.monacoEditor&&this.monacoEditor.dispose()}catch{}}validateSection(e,t){for(let i of e){if(typeof i!="object"||Array.isArray(i))return this.$toastr.error(this.$translate.instant("config.error_blocks_objects",{type:t}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(!i[t])return this.$toastr.error(this.$translate.instant("config.error_blocks_type",{type:t}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(typeof i[t]!="string")return this.$toastr.error(this.$translate.instant("config.error_string_type",{type:t}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1}return!0}validatePlugins(e,t){for(let i of e)if(typeof i!="string")return this.$toastr.error(this.$translate.instant("config.error_string_array",{key:t}),this.$translate.instant("toast.title_error")),!1;return!0}highlightOffendingArrayItem(e){this.monacoEditor&&(e=JSON.stringify(e,null,4).split(`
2
2
  `).map(t=>` ${t}`).join(`
3
3
  `),setTimeout(()=>{let t=this.monacoEditor.getModel().findMatches(e);if(t.length){let i=t[0].range,o=new monaco.Range(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn);this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[{range:o,options:{isWholeLine:!0,linesDecorationsClassName:"hb-monaco-editor-line-error"}}])}},200))}setMonacoEditorModel(){if(window.monaco.languages.json.jsonDefaults.diagnosticsOptions.schemas.some(t=>t.uri==="http://homebridge/config.json"))return;let e=monaco.Uri.parse("a://homebridge/config.json");window.monaco.languages.json.jsonDefaults.setDiagnosticsOptions({allowComments:!1,validate:!0,schemas:[{uri:"http://homebridge/config.json",fileMatch:[e.toString()],schema:{type:"object",required:["bridge"],properties:{bridge:{type:"object",required:["name","username","port","pin"],properties:{name:{type:"string",description:`The Homebridge instance name.
4
4
  This should be unique if you are running multiple instances of Homebridge.`,default:"Homebridge"},username:{type:"string",description:`Homebridge username must be 6 pairs of colon-separated hexadecimal characters (A-F 0-9).
@@ -1,2 +1,2 @@
1
- import{B as Y,C as Z,c as G,d as k,e as j,f as D,g as K,j as $,m as A,q as J,r as Q,y as X}from"./chunk-AM53KSWA.js";import{a as ae}from"./chunk-ZHBLCCB6.js";import{b as oe}from"./chunk-5PRMERAY.js";import{b as re}from"./chunk-EAHLR6RC.js";import{k as ee,l as te,n as ie,p as U,q as ne}from"./chunk-5ZJL4HUY.js";import{Db as I,Ga as W,Gb as x,Ib as _,Jc as H,La as n,Mc as N,Sb as O,Vb as l,Wa as V,Wb as f,Wc as R,Xb as g,fc as L,gc as B,gd as q,h as S,hc as E,ja as w,kb as M,lb as z,mb as T,mc as a,nc as s,oa as C,pa as b,rb as m,sb as o,tb as r,ub as u,w as h}from"./chunk-3LEW5FOJ.js";var pe=t=>({background:t}),de=t=>({anim:t}),ce=t=>({"progress-bar-animated":t}),me=()=>["restoring","restarting","restore-complete"],P=(t,d)=>({"is-valid":t,"is-invalid":d});function ue(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),u(4,"div",7),a(5,"translate"),o(6,"button",8),x("click",function(){C(e);let i=_();return b(i.onClickGettingStarted())}),l(7),a(8,"translate"),r(),o(9,"a",9),x("click",function(){C(e);let i=_();return b(i.onClickRestoreBackup())}),l(10),a(11,"translate"),r()()}t&2&&(n(2),f(s(3,4,"setup.welcome_to_homebridge")),n(2),m("innerHTML",s(5,6,"setup.intro"),W),n(3),g(" ",s(8,8,"setup.button_get_started")," "),n(3),f(s(11,10,"setup_wizard_restore")))}function ge(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"div",11)(8,"form",12),x("ngSubmit",function(){C(e);let i=_();return b(i.createFirstUser())}),o(9,"div",13)(10,"span",14),u(11,"i",15),r(),u(12,"input",16),a(13,"translate"),r(),o(14,"div",13)(15,"span",14),u(16,"i",17),r(),u(17,"input",18),a(18,"translate"),r(),o(19,"div",13)(20,"span",14),u(21,"i",17),r(),u(22,"input",19),a(23,"translate"),r(),o(24,"div",20)(25,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(26),a(27,"translate"),r(),o(28,"button",22),l(29),a(30,"translate"),r()()()()()}if(t&2){let e=_();n(2),f(s(3,16,"setup.create_account")),n(3),f(s(6,18,"setup_wizard_create_info")),n(3),m("formGroup",e.createUserForm),n(4),m("readonly",e.loading)("ngClass",E(30,P,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.valid,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.invalid))("placeholder",s(13,20,"users.label_username")),n(5),m("readonly",e.loading)("ngClass",E(33,P,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.valid,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.errors))("placeholder",s(18,22,"users.label_password")),n(5),m("readonly",e.loading)("ngClass",E(36,P,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.valid,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.errors))("placeholder",s(23,24,"users.label_confirm_password")),n(3),m("disabled",e.restoreUploading),n(),g(" ",s(27,26,"form.button_back")," "),n(2),m("disabled",e.createUserForm.invalid||e.loading),n(),g(" ",s(30,28,"form.button_continue")," ")}}function _e(t,d){t&1&&(u(0,"i",25),l(1),a(2,"translate")),t&2&&(n(),g(" ",s(2,1,"backup.label_uploading")," "))}function fe(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"form.button_continue")," ")}function he(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"input",23),x("change",function(i){C(e);let F=_();return b(F.handleRestoreFileInput(i.target.files))}),r(),o(8,"div",20)(9,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(10),a(11,"translate"),r(),o(12,"button",24),x("click",function(){C(e);let i=_();return b(i.onRestoreBackupClick())}),z(13,_e,3,3)(14,fe,2,3),r()()()}if(t&2){let e=_();n(2),f(s(3,6,"setup_wizard_restore")),n(3),f(s(6,8,"backup.restore_help_one")),n(4),m("disabled",e.restoreUploading),n(),g(" ",s(11,10,"form.button_back")," "),n(2),m("disabled",e.restoreUploading||!e.selectedFile),n(),T(e.restoreUploading?13:14)}}function we(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_restoring")," ")}function Ce(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_starting")," ")}function be(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_complete")," ")}function xe(t,d){t&1&&(o(0,"a",27),l(1),a(2,"translate"),r()),t&2&&(n(),g(" ",s(2,1,"form.button_continue")," "))}function ve(t,d){if(t&1&&(o(0,"div",5)(1,"h4",6),z(2,we,2,3)(3,Ce,2,3)(4,be,2,3),r(),u(5,"div",26),z(6,xe,3,3,"a",27),r()),t&2){let e=_();n(2),T(e.step==="restoring"?2:e.step==="restarting"?3:e.step==="restore-complete"?4:-1),n(4),T(e.step==="restore-complete"?6:-1)}}function ye(t,d){t&1&&(o(0,"div",5)(1,"h4",28),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"a",29),l(8),a(9,"translate"),r()()),t&2&&(n(2),f(s(3,3,"setup_wizard_complete_title")),n(3),f(s(6,5,"setup_wizard_completed")),n(3),g(" ",s(9,7,"form.button_continue")," "))}var He=(()=>{class t{$api=w(ne);$auth=w(oe);$settings=w(re);$title=w(q);$toastr=w(ie);$translate=w(ee);$ws=w(ae);io;step="welcome";backgroundStyle;progress=1;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;loading=!1;selectedFile;restoreUploading=!1;createUserForm=new K({username:new $("",[k.required]),password:new $("",[k.compose([k.required,k.minLength(4)])]),passwordConfirm:new $("",[k.required])},this.matchPassword);ngOnInit(){return S(this,null,function*(){this.$title.setTitle(this.$translate.instant("setup_wizard_page_title")),yield this.setBackground()})}onClickGettingStarted(){this.step="create-account",this.progress=50}onClickRestoreBackup(){this.step="restore-backup",this.progress=20}onClickCancelRestore(){this.selectedFile=null,this.step="welcome",this.progress=1}createFirstUser(){return S(this,null,function*(){this.loading=!0,this.progress=75;let e=this.createUserForm.getRawValue();e.name=e.username;try{yield h(this.$api.post("/setup-wizard/create-first-user",e)),this.$settings.env.setupWizardComplete=!0,this.progress=100,this.loading=!1,yield this.$auth.login({username:e.username,password:e.password}),this.step="setup-complete"}catch(p){this.loading=!1,this.progress=50,console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.progress=40):(delete this.selectedFile,this.progress=20)}onRestoreBackupClick(){return S(this,null,function*(){this.restoreUploading=!0,this.step="restoring",this.progress=60;try{let e=yield h(this.$api.get("/setup-wizard/get-setup-wizard-token"));window.localStorage.setItem(U.jwt.tokenKey,e.access_token),this.$auth.token=e.access_token,this.progress=65;let p=new FormData;p.append("restoreArchive",this.selectedFile,this.selectedFile.name),yield h(this.$api.post("/backup/restore",p)),this.progress=70,this.io=this.$ws.connectToNamespace("backup");let i=document.getElementById("output");this.io.socket.on("stdout",c=>{c.split(`
1
+ import{B as Y,C as Z,c as G,d as k,e as j,f as D,g as K,j as $,m as A,q as J,r as Q,y as X}from"./chunk-AM53KSWA.js";import{a as ae}from"./chunk-P5H3A6F2.js";import{b as oe}from"./chunk-4NMGMGZF.js";import{b as re}from"./chunk-NO3N2UL5.js";import{k as ee,l as te,n as ie,p as U,q as ne}from"./chunk-AEL7UA74.js";import{Db as I,Ga as W,Gb as x,Ib as _,Jc as H,La as n,Mc as N,Sb as O,Vb as l,Wa as V,Wb as f,Wc as R,Xb as g,fc as L,gc as B,gd as q,h as S,hc as E,ja as w,kb as M,lb as z,mb as T,mc as a,nc as s,oa as C,pa as b,rb as m,sb as o,tb as r,ub as u,w as h}from"./chunk-3LEW5FOJ.js";var pe=t=>({background:t}),de=t=>({anim:t}),ce=t=>({"progress-bar-animated":t}),me=()=>["restoring","restarting","restore-complete"],P=(t,d)=>({"is-valid":t,"is-invalid":d});function ue(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),u(4,"div",7),a(5,"translate"),o(6,"button",8),x("click",function(){C(e);let i=_();return b(i.onClickGettingStarted())}),l(7),a(8,"translate"),r(),o(9,"a",9),x("click",function(){C(e);let i=_();return b(i.onClickRestoreBackup())}),l(10),a(11,"translate"),r()()}t&2&&(n(2),f(s(3,4,"setup.welcome_to_homebridge")),n(2),m("innerHTML",s(5,6,"setup.intro"),W),n(3),g(" ",s(8,8,"setup.button_get_started")," "),n(3),f(s(11,10,"setup_wizard_restore")))}function ge(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"div",11)(8,"form",12),x("ngSubmit",function(){C(e);let i=_();return b(i.createFirstUser())}),o(9,"div",13)(10,"span",14),u(11,"i",15),r(),u(12,"input",16),a(13,"translate"),r(),o(14,"div",13)(15,"span",14),u(16,"i",17),r(),u(17,"input",18),a(18,"translate"),r(),o(19,"div",13)(20,"span",14),u(21,"i",17),r(),u(22,"input",19),a(23,"translate"),r(),o(24,"div",20)(25,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(26),a(27,"translate"),r(),o(28,"button",22),l(29),a(30,"translate"),r()()()()()}if(t&2){let e=_();n(2),f(s(3,16,"setup.create_account")),n(3),f(s(6,18,"setup_wizard_create_info")),n(3),m("formGroup",e.createUserForm),n(4),m("readonly",e.loading)("ngClass",E(30,P,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.valid,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.invalid))("placeholder",s(13,20,"users.label_username")),n(5),m("readonly",e.loading)("ngClass",E(33,P,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.valid,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.errors))("placeholder",s(18,22,"users.label_password")),n(5),m("readonly",e.loading)("ngClass",E(36,P,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.valid,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.errors))("placeholder",s(23,24,"users.label_confirm_password")),n(3),m("disabled",e.restoreUploading),n(),g(" ",s(27,26,"form.button_back")," "),n(2),m("disabled",e.createUserForm.invalid||e.loading),n(),g(" ",s(30,28,"form.button_continue")," ")}}function _e(t,d){t&1&&(u(0,"i",25),l(1),a(2,"translate")),t&2&&(n(),g(" ",s(2,1,"backup.label_uploading")," "))}function fe(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"form.button_continue")," ")}function he(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"input",23),x("change",function(i){C(e);let F=_();return b(F.handleRestoreFileInput(i.target.files))}),r(),o(8,"div",20)(9,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(10),a(11,"translate"),r(),o(12,"button",24),x("click",function(){C(e);let i=_();return b(i.onRestoreBackupClick())}),z(13,_e,3,3)(14,fe,2,3),r()()()}if(t&2){let e=_();n(2),f(s(3,6,"setup_wizard_restore")),n(3),f(s(6,8,"backup.restore_help_one")),n(4),m("disabled",e.restoreUploading),n(),g(" ",s(11,10,"form.button_back")," "),n(2),m("disabled",e.restoreUploading||!e.selectedFile),n(),T(e.restoreUploading?13:14)}}function we(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_restoring")," ")}function Ce(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_starting")," ")}function be(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_complete")," ")}function xe(t,d){t&1&&(o(0,"a",27),l(1),a(2,"translate"),r()),t&2&&(n(),g(" ",s(2,1,"form.button_continue")," "))}function ve(t,d){if(t&1&&(o(0,"div",5)(1,"h4",6),z(2,we,2,3)(3,Ce,2,3)(4,be,2,3),r(),u(5,"div",26),z(6,xe,3,3,"a",27),r()),t&2){let e=_();n(2),T(e.step==="restoring"?2:e.step==="restarting"?3:e.step==="restore-complete"?4:-1),n(4),T(e.step==="restore-complete"?6:-1)}}function ye(t,d){t&1&&(o(0,"div",5)(1,"h4",28),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"a",29),l(8),a(9,"translate"),r()()),t&2&&(n(2),f(s(3,3,"setup_wizard_complete_title")),n(3),f(s(6,5,"setup_wizard_completed")),n(3),g(" ",s(9,7,"form.button_continue")," "))}var He=(()=>{class t{$api=w(ne);$auth=w(oe);$settings=w(re);$title=w(q);$toastr=w(ie);$translate=w(ee);$ws=w(ae);io;step="welcome";backgroundStyle;progress=1;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;loading=!1;selectedFile;restoreUploading=!1;createUserForm=new K({username:new $("",[k.required]),password:new $("",[k.compose([k.required,k.minLength(4)])]),passwordConfirm:new $("",[k.required])},this.matchPassword);ngOnInit(){return S(this,null,function*(){this.$title.setTitle(this.$translate.instant("setup_wizard_page_title")),yield this.setBackground()})}onClickGettingStarted(){this.step="create-account",this.progress=50}onClickRestoreBackup(){this.step="restore-backup",this.progress=20}onClickCancelRestore(){this.selectedFile=null,this.step="welcome",this.progress=1}createFirstUser(){return S(this,null,function*(){this.loading=!0,this.progress=75;let e=this.createUserForm.getRawValue();e.name=e.username;try{yield h(this.$api.post("/setup-wizard/create-first-user",e)),this.$settings.env.setupWizardComplete=!0,this.progress=100,this.loading=!1,yield this.$auth.login({username:e.username,password:e.password}),this.step="setup-complete"}catch(p){this.loading=!1,this.progress=50,console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.progress=40):(delete this.selectedFile,this.progress=20)}onRestoreBackupClick(){return S(this,null,function*(){this.restoreUploading=!0,this.step="restoring",this.progress=60;try{let e=yield h(this.$api.get("/setup-wizard/get-setup-wizard-token"));window.localStorage.setItem(U.jwt.tokenKey,e.access_token),this.$auth.token=e.access_token,this.progress=65;let p=new FormData;p.append("restoreArchive",this.selectedFile,this.selectedFile.name),yield h(this.$api.post("/backup/restore",p)),this.progress=70,this.io=this.$ws.connectToNamespace("backup");let i=document.getElementById("output");this.io.socket.on("stdout",c=>{c.split(`
2
2
  \r`).forEach(v=>{if(v&&!/^[⠇⠏⠋⠙⠹⠸]+$/.test(v)){let y=document.createElement("div"),le=/\x1B\[(\d{1,2}(;\d{1,2})?)?[mGK]/g;y.innerHTML=v.replace(le,""),v.includes("[0;31m")?y.classList.add("red-text"):v.includes("[0;32m")?y.classList.add("green-text"):v.includes("[0;33m")?y.classList.add("orange-text"):v.includes("[0;36m")&&y.classList.add("cyan-text"),i.appendChild(y),i.scrollTop=i.scrollHeight}})}),this.restoreStarted=!0,this.restoreInProgress=!0,this.progress=75,yield h(this.io.request("do-restore")),this.progress=80,this.restoreInProgress=!1,yield h(this.$api.put("/backup/restart",{})),this.step="restarting",this.progress=85,window.localStorage.removeItem(U.jwt.tokenKey),this.$auth.token=null;let F=document.createElement("div");F.classList.add("orange-text"),F.innerHTML="Starting Homebridge, please wait...",i.appendChild(F),i.scrollTop=i.scrollHeight,yield new Promise(c=>setTimeout(c,3e3)),this.progress=88,yield new Promise(c=>setTimeout(c,3e3)),this.progress=91,yield new Promise(c=>setTimeout(c,3e3)),this.progress=94,yield new Promise(c=>setTimeout(c,3e3)),this.progress=97,yield new Promise(c=>setTimeout(c,3e3)),this.progress=99;let se=setInterval(()=>S(this,null,function*(){try{yield h(this.$api.get("/auth/settings")),clearInterval(se),this.progress=100,this.restoreUploading=!1,this.step="restore-complete"}catch{}}),1e3)}catch(e){console.error(e),this.restoreUploading=!1,this.restoreFailed=!0,this.progress=20,this.step="restore-backup",this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}finally{this.io&&this.io.end()}})}setBackground(){return S(this,null,function*(){if(this.$settings.settingsLoaded||(yield h(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash){let e=`${U.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`;this.backgroundStyle=`url('${e}') center/cover`}})}matchPassword(e){let p=e.get("password").value,i=e.get("passwordConfirm").value;if(p!==i)e.get("passwordConfirm").setErrors({matchPassword:!0});else return null}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=V({type:t,selectors:[["ng-component"]],decls:10,vars:14,consts:[[1,"setup-container","gradient","d-flex","align-items-start","justify-content-center",3,"ngStyle","ngClass"],[1,"w-100","setup-card","d-flex","py-4","flex-column"],["ngSrc","assets/homebridge-color-round.svg","alt","Homebridge Logo","height","100","width","100","priority","true",1,"homebridge-logo","mx-auto","my-3"],[1,"progress","w-100","my-4"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",1,"progress-bar","progress-bar-striped","bg-success",3,"ngClass"],[1,"w-100","d-flex","flex-column","align-items-center","mb-2"],[1,"mb-3","text-center"],[1,"mb-4","small","grey-text","text-center",3,"innerHTML"],["type","button",1,"btn","btn-lg","btn-primary","mb-4",3,"click"],["href","javascript:void(0)",1,"grey-text",3,"click"],[1,"mb-4","small","grey-text","text-center"],[1,"w-100"],["novalidate","",3,"ngSubmit","formGroup"],[1,"input-group","mb-4"],[1,"input-group-text","custom-input"],[1,"fas","fa-fw","fa-user","primary-text","fa-lg"],["formControlName","username","type","text","id","form-username","autocomplete","username","autocapitalize","none","tabindex","1","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],[1,"fas","fa-fw","fa-lock","primary-text","fa-lg"],["formControlName","password","type","password","id","form-pass","autocomplete","new-password","tabindex","2","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],["formControlName","passwordConfirm","type","password","id","form-pass-confirm","autocomplete","new-password","tabindex","2","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],[1,"mt-3","w-100","d-flex","justify-content-between"],["type","button",1,"btn","btn-elegant","ms-0",3,"click","disabled"],["type","submit",1,"btn","btn-primary",3,"disabled"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz",1,"form-control","custom-input","mb-3",3,"change"],["type","button",1,"btn","btn-primary","me-0",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],["id","output",1,"font-monospace","small","alert","alert-info","w-100","text-start","mt-1","mb-0"],["href","/login",1,"btn","btn-lg","btn-primary","mt-4"],[1,"mb-3"],["href","/",1,"btn","btn-lg","btn-primary"]],template:function(p,i){p&1&&(o(0,"div",0)(1,"div",1),u(2,"img",2),o(3,"div",3),u(4,"div",4),r(),z(5,ue,12,12,"div",5)(6,ge,31,39,"div",5)(7,he,15,12,"div",5)(8,ve,7,2,"div",5)(9,ye,10,9,"div",5),r()()),p&2&&(m("ngStyle",B(7,pe,i.backgroundStyle))("ngClass",B(9,de,!i.backgroundStyle)),n(4),O("width",i.progress+"%"),m("ngClass",B(11,ce,i.loading||i.restoreUploading)),M("aria-valuenow",i.progress),n(),T(i.step==="welcome"?5:i.step==="create-account"?6:i.step==="restore-backup"?7:L(13,me).includes(i.step)?8:i.step==="setup-complete"?9:-1))},dependencies:[H,R,Y,A,G,j,D,X,Z,J,Q,N,te],styles:["body{overflow:scroll!important} body.dark-mode .setup-card{background-color:#2b2b2b;color:#fff}.setup-container[_ngcontent-%COMP%]{z-index:-1;padding-top:2em;padding-bottom:2em;min-height:100%;background-size:300% 300%}.anim[_ngcontent-%COMP%]{-webkit-animation:_ngcontent-%COMP%_gradient 20s ease infinite;-moz-animation:gradient 20s ease infinite;-o-animation:gradient 20s ease infinite;animation:_ngcontent-%COMP%_gradient 20s ease infinite}@keyframes _ngcontent-%COMP%_gradient{0%{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}.setup-card[_ngcontent-%COMP%]{max-width:550px;border-radius:1rem;padding-right:25px;padding-left:25px;background-color:#ffffffe6}.setup-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 575px){.setup-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}}.homebridge-logo[_ngcontent-%COMP%]{margin-bottom:10px}.progress[_ngcontent-%COMP%]{background-color:#ddd}#output[_ngcontent-%COMP%]{height:200px;overflow-y:scroll;white-space:pre-wrap}"]})}return t})();export{He as SetupWizardComponent};
@@ -1 +1 @@
1
- import{a as _,b as D}from"./chunk-EAHLR6RC.js";import{p as c,q as S}from"./chunk-5ZJL4HUY.js";import{$c as x,C as v,Xa as I,ea as h,fa as E,g as O,h as a,ha as y,ia as l,ja as f,r as p,ta as j,w as d,x as T,z as w}from"./chunk-3LEW5FOJ.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&6)):0)n=t.indexOf(n);return o}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return r.\u0275fac=function(e){return new(e||r)(l(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{constructor(e,t,o){this.jwtHelper=t,this.document=o,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===o:i instanceof RegExp?i.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(l(g),l(m),l(j))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(l(r,12))},r.\u0275mod=I({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(c.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(c.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(c.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(c.jwt.tokenKey);e&&this.validateToken(e)})}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(c.jwt.tokenKey),this.token=null,!1}}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{F as a,q as b};
1
+ import{a as _,b as D}from"./chunk-NO3N2UL5.js";import{p as c,q as S}from"./chunk-AEL7UA74.js";import{$c as x,C as v,Xa as I,ea as h,fa as E,g as O,h as a,ha as y,ia as l,ja as f,r as p,ta as j,w as d,x as T,z as w}from"./chunk-3LEW5FOJ.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&6)):0)n=t.indexOf(n);return o}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return r.\u0275fac=function(e){return new(e||r)(l(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{constructor(e,t,o){this.jwtHelper=t,this.document=o,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===o:i instanceof RegExp?i.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(l(g),l(m),l(j))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(l(r,12))},r.\u0275mod=I({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(c.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(c.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(c.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(c.jwt.tokenKey);e&&this.validateToken(e)})}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(c.jwt.tokenKey),this.token=null,!1}}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{F as a,q as b};
@@ -1 +1 @@
1
- import{g as i}from"./chunk-MDV2S56W.js";import{Xa as e,fa as o}from"./chunk-3LEW5FOJ.js";var m=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"restart-server",loadComponent:()=>import("./chunk-45EG42JQ.js").then(t=>t.RestartLinuxComponent)},{path:"shutdown-server",loadComponent:()=>import("./chunk-IHUI5TFD.js").then(t=>t.ShutdownLinuxComponent)}],n=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[i.forChild(m),i]})}return t})();var c=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[n]})}return t})();export{c as LinuxModule};
1
+ import{g as i}from"./chunk-MDV2S56W.js";import{Xa as e,fa as o}from"./chunk-3LEW5FOJ.js";var m=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"restart-server",loadComponent:()=>import("./chunk-E7N2RQ74.js").then(t=>t.RestartLinuxComponent)},{path:"shutdown-server",loadComponent:()=>import("./chunk-O67URGXE.js").then(t=>t.ShutdownLinuxComponent)}],n=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[i.forChild(m),i]})}return t})();var c=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[n]})}return t})();export{c as LinuxModule};