homebridge-config-ui-x 5.0.0-beta.12 → 5.0.0-beta.14

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 (77) hide show
  1. package/dist/bin/platforms/darwin.js +1 -9
  2. package/dist/bin/platforms/darwin.js.map +1 -1
  3. package/package.json +2 -2
  4. package/public/{chunk-MKAN4DNU.js → chunk-24XVRNKR.js} +1 -1
  5. package/public/{chunk-Y5ZBCCVN.js → chunk-26O66K7D.js} +1 -1
  6. package/public/{chunk-7KBAQBVI.js → chunk-2BCPSPXY.js} +1 -1
  7. package/public/{chunk-NACX75RE.js → chunk-35OVCSBU.js} +1 -1
  8. package/public/chunk-3IA7TQD2.js +1 -0
  9. package/public/{chunk-74NKPNWY.js → chunk-3L47WOJW.js} +1 -1
  10. package/public/{chunk-7QGXLBIL.js → chunk-3PLUV23X.js} +1 -1
  11. package/public/{chunk-CK6XS4O6.js → chunk-43GD43B5.js} +1 -1
  12. package/public/chunk-4C77YQ2X.js +1 -0
  13. package/public/{chunk-FM4RPFZK.js → chunk-5GNCJB4B.js} +1 -1
  14. package/public/{chunk-MELH2CAI.js → chunk-5HXLGX6X.js} +1 -1
  15. package/public/{chunk-UTGEEQ7L.js → chunk-6RX2OQ7H.js} +1 -1
  16. package/public/{chunk-23VV7X4D.js → chunk-73LSHOO4.js} +1 -1
  17. package/public/chunk-7JB5Y4S5.js +1 -0
  18. package/public/{chunk-WTKMTQTF.js → chunk-7QX6LSXE.js} +1 -1
  19. package/public/{chunk-BX6Q4CE4.js → chunk-ACRQM7N2.js} +1 -1
  20. package/public/{chunk-HATYIWAA.js → chunk-B26OUBKR.js} +1 -1
  21. package/public/{chunk-XQNMQ4ZJ.js → chunk-C2OHX25Q.js} +1 -1
  22. package/public/{chunk-EL3DLEQL.js → chunk-CA4VUR75.js} +1 -1
  23. package/public/{chunk-55TMUNO5.js → chunk-CJDKMZVR.js} +1 -1
  24. package/public/{chunk-TNA7SWKO.js → chunk-DW7TXNDF.js} +1 -1
  25. package/public/chunk-FPFDVME4.js +1 -0
  26. package/public/chunk-GXJIM4DP.js +1 -0
  27. package/public/chunk-GZQQLSAW.js +1 -0
  28. package/public/chunk-H2NGFGHL.js +1 -0
  29. package/public/{chunk-TJ3RJQF3.js → chunk-H3INH2HO.js} +1 -1
  30. package/public/{chunk-YOXJTM5X.js → chunk-HFNV47WV.js} +1 -1
  31. package/public/{chunk-CXHZXKFK.js → chunk-ISFBAVAC.js} +1 -1
  32. package/public/{chunk-WSZZMIVV.js → chunk-ITTL5N2J.js} +1 -1
  33. package/public/{chunk-NFE4RXTM.js → chunk-JEWVZOEL.js} +1 -1
  34. package/public/{chunk-QTNWIXER.js → chunk-JJI3SJVE.js} +1 -1
  35. package/public/{chunk-BU4YWLM4.js → chunk-JU52W3EG.js} +1 -1
  36. package/public/{chunk-DAGQLH7O.js → chunk-K3MVV3L4.js} +1 -1
  37. package/public/{chunk-OIYBHL5V.js → chunk-L363LTFB.js} +1 -1
  38. package/public/{chunk-B7VFTQIZ.js → chunk-LPOXJPCE.js} +1 -1
  39. package/public/{chunk-532QHHUR.js → chunk-LXIAUAZE.js} +1 -1
  40. package/public/chunk-MM5GH6BV.js +1 -0
  41. package/public/{chunk-4VCFHI6G.js → chunk-NAO5LSXZ.js} +1 -1
  42. package/public/chunk-OB2W2TVC.js +1 -0
  43. package/public/{chunk-BSGQXDOA.js → chunk-OE473EDI.js} +1 -1
  44. package/public/{chunk-6XGN7AW6.js → chunk-OVCLBTPT.js} +1 -1
  45. package/public/chunk-OYNRPXCL.js +1 -0
  46. package/public/{chunk-I55FKDU5.js → chunk-QPLELM4E.js} +1 -1
  47. package/public/{chunk-QQUIQY6X.js → chunk-RAZDQRCC.js} +1 -1
  48. package/public/chunk-RDI2RSSA.js +1 -0
  49. package/public/{chunk-G5DTLY6B.js → chunk-RHDM5Q2E.js} +1 -1
  50. package/public/{chunk-JJVJJXVF.js → chunk-SJ47BDIK.js} +1 -1
  51. package/public/{chunk-MHSAAIAT.js → chunk-SMBJ36CB.js} +1 -1
  52. package/public/{chunk-I2VPWOPC.js → chunk-SUSZVLJG.js} +1 -1
  53. package/public/{chunk-5JCU7ZPP.js → chunk-UCR62PPN.js} +1 -1
  54. package/public/chunk-UFFMRA4O.js +1 -0
  55. package/public/{chunk-GX3Y4FTH.js → chunk-WTHM7H5Y.js} +1 -1
  56. package/public/{chunk-IO755HDJ.js → chunk-X2R3UME2.js} +1 -1
  57. package/public/{chunk-ILFPJEYT.js → chunk-XIR274W7.js} +1 -1
  58. package/public/{chunk-WYAW7DXP.js → chunk-XTUOQFRB.js} +1 -1
  59. package/public/{chunk-GBBQCTRS.js → chunk-Y4FJJ7T7.js} +1 -1
  60. package/public/chunk-YJNTLU2D.js +1 -0
  61. package/public/{chunk-GDIVZT7I.js → chunk-YT7DHMZM.js} +1 -1
  62. package/public/{chunk-BA5K2UHP.js → chunk-ZDL5FMDD.js} +1 -1
  63. package/public/index.html +1 -1
  64. package/public/{main-IQCCDX4W.js → main-NDZURFSR.js} +1 -1
  65. package/public/chunk-5DDKKJID.js +0 -1
  66. package/public/chunk-72HANXNO.js +0 -1
  67. package/public/chunk-BRMP55RD.js +0 -1
  68. package/public/chunk-DGB7SJHK.js +0 -1
  69. package/public/chunk-MG3RADD2.js +0 -1
  70. package/public/chunk-MK76ULVP.js +0 -1
  71. package/public/chunk-N2T6IYRY.js +0 -1
  72. package/public/chunk-NCSEMGFF.js +0 -1
  73. package/public/chunk-OAUPNCBY.js +0 -1
  74. package/public/chunk-PFO3DXWZ.js +0 -1
  75. package/public/chunk-TTTCHCCI.js +0 -1
  76. package/public/chunk-TVXFXZCH.js +0 -1
  77. package/public/chunk-YDW3PWRD.js +0 -1
@@ -204,15 +204,7 @@ class DarwinInstaller extends base_platform_1.BasePlatform {
204
204
  await this.hbService.removeNpmPackage((0, node_path_1.resolve)(targetPath, 'lib', 'node_modules', 'npm'));
205
205
  await this.hbService.extractNodejs(job.target, extractConfig);
206
206
  await (0, fs_extra_1.remove)(archivePath);
207
- const rebuildResult = (0, node_child_process_1.spawnSync)('node', ['./dist/bin/hb-service.js', 'rebuild', '-all'], {
208
- cwd: node_process_1.default.env.UIX_BASE_PATH,
209
- stdio: 'inherit',
210
- shell: true,
211
- });
212
- if (rebuildResult.status !== 0) {
213
- this.hbService.logger(`Failed to update Node.js: ${rebuildResult.stderr}`, 'fail');
214
- node_process_1.default.exit(1);
215
- }
207
+ await this.rebuild(true);
216
208
  if (await (0, fs_extra_1.pathExists)(this.plistPath)) {
217
209
  await this.restart();
218
210
  }
@@ -1 +1 @@
1
- {"version":3,"file":"darwin.js","sourceRoot":"","sources":["../../../src/bin/platforms/darwin.ts"],"names":[],"mappings":";;;;;;AACA,2DAAwD;AAExD,qCAAoD;AACpD,yCAA4C;AAC5C,gEAAkC;AAElC,uCAAgF;AAChF,mCAAgC;AAEhC,oDAA+C;AAE/C,MAAa,eAAgB,SAAQ,4BAAY;IAG/C,IAAY,SAAS;QACnB,OAAO,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,WAAW,EAAE,SAAS,CAAA;IACjE,CAAC;IAED,IAAY,SAAS;QACnB,OAAO,IAAA,mBAAO,EAAC,yBAAyB,EAAE,GAAG,IAAI,CAAC,SAAS,QAAQ,CAAC,CAAA;IACtE,CAAC;IAKM,KAAK,CAAC,OAAO;QAClB,IAAI,CAAC,YAAY,EAAE,CAAA;QACnB,IAAI,CAAC,cAAc,EAAE,CAAA;QACrB,MAAM,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,CAAA;QAChC,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAA;QACjC,MAAM,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAA;QACvC,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAA;QAElC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAA;YAC9B,MAAM,IAAI,CAAC,KAAK,EAAE,CAA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BAAiB;YACjB,sBAAsB;YACtB,mBAAmB,IAAI,CAAC,SAAS,WAAW;YAC5C,iCAAiC;YACjC,iBAAiB;YACjB,wBAAwB,sBAAO,CAAC,QAAQ,WAAW;YACnD,wBAAwB,IAAI,CAAC,SAAS,CAAC,QAAQ,WAAW;YAC1D,mCAAmC;YACnC,kCAAkC;YAClC,kCAAkC;YAClC,wBAAwB,IAAI,CAAC,SAAS,CAAC,WAAW,WAAW;YAC7D,kBAAkB;YAClB,iCAAiC;YACjC,oBAAoB,IAAI,CAAC,SAAS,CAAC,WAAW,WAAW;YACzD,gCAAgC;YAChC,mBAAmB,IAAI,CAAC,SAAS,CAAC,WAAW,0BAA0B;YACvE,kCAAkC;YAClC,mBAAmB,IAAI,CAAC,SAAS,CAAC,WAAW,0BAA0B;YACvE,yBAAyB;YACzB,mBAAmB,IAAI,CAAC,IAAI,WAAW;YACvC,qCAAqC;YACrC,gBAAgB;YAChB,6BAA6B;YAC7B,2BAA2B,sBAAO,CAAC,GAAG,CAAC,IAAI,WAAW;YACtD,6BAA6B;YAC7B,2BAA2B,IAAI,CAAC,cAAc,EAAE,WAAW;YAC3D,yCAAyC;YACzC,2BAA2B,IAAI,CAAC,SAAS,CAAC,WAAW,WAAW;YAChE,sDAAsD;YACtD,oCAAoC;YACpC,iBAAiB;YACjB,SAAS;YACT,UAAU;SACX,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAE3B,MAAM,IAAA,oBAAS,EAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAA;IACpD,CAAC;CACF;AAhYD,0CAgYC"}
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.0.0-beta.12",
4
+ "version": "5.0.0-beta.14",
5
5
  "description": "A web based management, configuration and control platform for Homebridge.",
6
6
  "author": "oznu <dev@oz.nu>",
7
7
  "license": "MIT",
@@ -83,7 +83,7 @@
83
83
  "@fastify/multipart": "8.3.0",
84
84
  "@fastify/static": "7.0.4",
85
85
  "@homebridge/hap-client": "2.0.5-beta.0",
86
- "@homebridge/node-pty-prebuilt-multiarch": "0.12.0-beta.2",
86
+ "@homebridge/node-pty-prebuilt-multiarch": "0.12.0-beta.5",
87
87
  "@nestjs/axios": "3.1.2",
88
88
  "@nestjs/common": "10.4.8",
89
89
  "@nestjs/core": "10.4.8",
@@ -1,4 +1,4 @@
1
- import{a as O}from"./chunk-7EUQWCP5.js";import{a as L}from"./chunk-JZZQRLNW.js";import{c as P,e as I,l as D,y as H}from"./chunk-QHPDGSZ6.js";import{b as T}from"./chunk-NZNNTHFQ.js";import{b as $}from"./chunk-BA5K2UHP.js";import{b as y,j as k}from"./chunk-NFE4RXTM.js";import{a as E}from"./chunk-3IX3CLER.js";import{$b as g,Kb as h,Mb as f,Rb as d,Wb as m,Xb as l,Yb as w,cc as _,dc as a,h as S,ib as s,na as r,nc as v,rb as x,sc as b,tc as M,uc as V,w as C,xa as c,ya as p}from"./chunk-TXOB7R5K.js";function z(i,u){i&1&&w(0,"i",6)}function A(i,u){i&1&&w(0,"i",7)}function F(i,u){if(i&1){let t=g();m(0,"ngx-monaco-editor",10),_("onInit",function(e){c(t);let o=a();return p(o.onEditorInit(e))})("keydown.control.s",function(e){c(t);let o=a();return e.preventDefault(),p(o.onSave())})("keydown.meta.s",function(e){c(t);let o=a();return e.preventDefault(),p(o.onSave())}),l()}if(i&2){let t=a();f("options",t.editorOptions)("model",t.monacoEditorModel)}}function W(i,u){if(i&1){let t=g();m(0,"textarea",11),V("ngModelChange",function(e){c(t);let o=a();return M(o.startupScript,e)||(o.startupScript=e),p(e)}),v(1," "),l()}if(i&2){let t=a();b("ngModel",t.startupScript)}}var tt=(()=>{class i{$api=r(y);$md=r(L);$route=r(T);$settings=r($);$toastr=r(k);$translate=r(E);startupScript;saveInProgress;isMobile=!1;options={printMargin:!1};monacoEditor;editorOptions;monacoEditorModel;lastHeight;visualViewPortEventCallback;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"shell",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",automaticLayout:!0},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(t=>{this.startupScript=t.startupScript.script}),this.monacoEditorModel={value:"",language:"shell"}}onEditorInit(t){this.monacoEditor=t,this.monacoEditor.getModel().setValue(this.startupScript)}onSave(){return S(this,null,function*(){if(!this.saveInProgress){if(this.saveInProgress=!0,this.isMobile||(yield this.monacoEditor.getAction("editor.action.formatDocument").run(),this.startupScript=this.monacoEditor.getModel().getValue()),!["#!/bin/sh","#!/bin/bash"].includes(this.startupScript.split(`
1
+ import{a as O}from"./chunk-7EUQWCP5.js";import{a as L}from"./chunk-JZZQRLNW.js";import{c as P,e as I,l as D,y as H}from"./chunk-QHPDGSZ6.js";import{b as T}from"./chunk-NZNNTHFQ.js";import{b as $}from"./chunk-ZDL5FMDD.js";import{b as y,j as k}from"./chunk-JEWVZOEL.js";import{a as E}from"./chunk-3IX3CLER.js";import{$b as g,Kb as h,Mb as f,Rb as d,Wb as m,Xb as l,Yb as w,cc as _,dc as a,h as S,ib as s,na as r,nc as v,rb as x,sc as b,tc as M,uc as V,w as C,xa as c,ya as p}from"./chunk-TXOB7R5K.js";function z(i,u){i&1&&w(0,"i",6)}function A(i,u){i&1&&w(0,"i",7)}function F(i,u){if(i&1){let t=g();m(0,"ngx-monaco-editor",10),_("onInit",function(e){c(t);let o=a();return p(o.onEditorInit(e))})("keydown.control.s",function(e){c(t);let o=a();return e.preventDefault(),p(o.onSave())})("keydown.meta.s",function(e){c(t);let o=a();return e.preventDefault(),p(o.onSave())}),l()}if(i&2){let t=a();f("options",t.editorOptions)("model",t.monacoEditorModel)}}function W(i,u){if(i&1){let t=g();m(0,"textarea",11),V("ngModelChange",function(e){c(t);let o=a();return M(o.startupScript,e)||(o.startupScript=e),p(e)}),v(1," "),l()}if(i&2){let t=a();b("ngModel",t.startupScript)}}var tt=(()=>{class i{$api=r(y);$md=r(L);$route=r(T);$settings=r($);$toastr=r(k);$translate=r(E);startupScript;saveInProgress;isMobile=!1;options={printMargin:!1};monacoEditor;editorOptions;monacoEditorModel;lastHeight;visualViewPortEventCallback;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"shell",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",automaticLayout:!0},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(t=>{this.startupScript=t.startupScript.script}),this.monacoEditorModel={value:"",language:"shell"}}onEditorInit(t){this.monacoEditor=t,this.monacoEditor.getModel().setValue(this.startupScript)}onSave(){return S(this,null,function*(){if(!this.saveInProgress){if(this.saveInProgress=!0,this.isMobile||(yield this.monacoEditor.getAction("editor.action.formatDocument").run(),this.startupScript=this.monacoEditor.getModel().getValue()),!["#!/bin/sh","#!/bin/bash"].includes(this.startupScript.split(`
2
2
  `)[0].trim())){this.$toastr.error(this.$translate.instant("platform.docker.must_use_hashbang"),this.$translate.instant("toast.title_error")),this.startupScript=`#!/bin/sh
3
3
 
4
4
  ${this.startupScript}`,this.isMobile||this.monacoEditor.getModel().setValue(this.startupScript),this.saveInProgress=!1;return}try{yield C(this.$api.put("/platform-tools/docker/startup-script",{script:this.startupScript})),this.$toastr.success(this.$translate.instant("platform.docker.restart_required"),this.$translate.instant("platform.docker.script_saved"))}catch(t){console.error(t),this.$toastr.error(t.message,this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}visualViewPortChanged(){this.lastHeight<window.visualViewport.height&&document.activeElement.blur(),window.visualViewport.height<window.innerHeight?(this.$md.enableTouchMove(),this.lastHeight=window.visualViewport.height):window.visualViewport.height===window.innerHeight&&(this.$md.disableTouchMove(),this.lastHeight=window.visualViewport.height)}ngOnDestroy(){window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove()),this.monacoEditor&&this.monacoEditor.dispose()}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=x({type:i,selectors:[["ng-component"]],decls:11,vars:5,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0","text-monospace"],[1,"col-6","text-right"],[1,"btn","btn-primary","waves-effect","m-0",3,"click","disabled"],[1,"fas","fa-fw","fa-floppy-disk"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],[1,"flex-grow-1","h-100","w-100","my-2",3,"options","model"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-2",3,"ngModel"],[1,"flex-grow-1","h-100","w-100","my-2",3,"onInit","keydown.control.s","keydown.meta.s","options","model"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-2",3,"ngModelChange","ngModel"]],template:function(n,e){n&1&&(m(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),v(4,"startup.sh"),l()(),m(5,"div",4)(6,"button",5),_("click",function(){return e.onSave()}),h(7,z,1,0,"i",6)(8,A,1,0,"i",7),l()()(),h(9,F,1,2,"ngx-monaco-editor",8)(10,W,2,1,"textarea",9),l()),n&2&&(s(6),f("disabled",e.saveInProgress),s(),d(e.saveInProgress?-1:7),s(),d(e.saveInProgress?8:-1),s(),d(e.isMobile?-1:9),s(),d(e.isMobile?10:-1))},dependencies:[O,H,P,I,D],encapsulation:2})}return i})();export{tt as a};
@@ -1 +1 @@
1
- import{a as R}from"./chunk-MKAN4DNU.js";import"./chunk-I2VPWOPC.js";import{c as g}from"./chunk-7EUQWCP5.js";import"./chunk-JZZQRLNW.js";import{q as C}from"./chunk-ORPWYWCL.js";import{y as S,z as v}from"./chunk-QHPDGSZ6.js";import"./chunk-HATYIWAA.js";import{d as h,g as n}from"./chunk-NZNNTHFQ.js";import"./chunk-74NKPNWY.js";import"./chunk-BA5K2UHP.js";import{b as f,j as M}from"./chunk-NFE4RXTM.js";import"./chunk-UG5DK2RQ.js";import{a as u,c as d}from"./chunk-3IX3CLER.js";import{h as p,ha as c,ia as i,md as l,na as e,sb as a,w as s}from"./chunk-TXOB7R5K.js";var m=(()=>{class t{$api=e(f);$router=e(h);$toastr=e(M);$translate=e(u);resolve(){return p(this,null,function*(){try{return yield s(this.$api.get("/platform-tools/docker/startup-script"))}catch(r){console.error(r),this.$toastr.error(r.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(o){return new(o||t)};static \u0275prov=c({token:t,factory:t.\u0275fac})}return t})();var j=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"startup-script",loadComponent:()=>import("./chunk-YDW3PWRD.js").then(t=>t.StartupScriptComponent),resolve:{startupScript:m}},{path:"restart-container",loadComponent:()=>import("./chunk-72HANXNO.js").then(t=>t.ContainerRestartComponent)}],$=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({imports:[n.forChild(j),n]})}return t})();var Q=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({providers:[m],imports:[l,S,v,g,C,d.forChild(),$,R]})}return t})();export{Q as DockerModule};
1
+ import{a as R}from"./chunk-24XVRNKR.js";import"./chunk-SUSZVLJG.js";import{c as g}from"./chunk-7EUQWCP5.js";import"./chunk-JZZQRLNW.js";import{q as C}from"./chunk-ORPWYWCL.js";import{y as S,z as v}from"./chunk-QHPDGSZ6.js";import"./chunk-B26OUBKR.js";import{d as h,g as n}from"./chunk-NZNNTHFQ.js";import"./chunk-3L47WOJW.js";import"./chunk-ZDL5FMDD.js";import{b as f,j as M}from"./chunk-JEWVZOEL.js";import"./chunk-UG5DK2RQ.js";import{a as u,c as d}from"./chunk-3IX3CLER.js";import{h as p,ha as c,ia as i,md as l,na as e,sb as a,w as s}from"./chunk-TXOB7R5K.js";var m=(()=>{class t{$api=e(f);$router=e(h);$toastr=e(M);$translate=e(u);resolve(){return p(this,null,function*(){try{return yield s(this.$api.get("/platform-tools/docker/startup-script"))}catch(r){console.error(r),this.$toastr.error(r.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(o){return new(o||t)};static \u0275prov=c({token:t,factory:t.\u0275fac})}return t})();var j=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"startup-script",loadComponent:()=>import("./chunk-4C77YQ2X.js").then(t=>t.StartupScriptComponent),resolve:{startupScript:m}},{path:"restart-container",loadComponent:()=>import("./chunk-GZQQLSAW.js").then(t=>t.ContainerRestartComponent)}],$=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({imports:[n.forChild(j),n]})}return t})();var Q=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({providers:[m],imports:[l,S,v,g,C,d.forChild(),$,R]})}return t})();export{Q as DockerModule};
@@ -1 +1 @@
1
- import{a as N,b as U}from"./chunk-BKUGARB4.js";import{m as H}from"./chunk-ORPWYWCL.js";import{a as D}from"./chunk-HATYIWAA.js";import{d as V}from"./chunk-NZNNTHFQ.js";import{b as E,j as z}from"./chunk-NFE4RXTM.js";import{c as I,d as w}from"./chunk-UG5DK2RQ.js";import{a as P,b as A}from"./chunk-3IX3CLER.js";import{$b as R,Bc as l,Cc as d,Dc as F,Kb as f,Lb as S,Mb as b,Rb as c,Wb as a,Xb as o,Yb as u,cc as x,dc as p,g as $,h as k,ib as i,na as _,nc as s,oc as h,pc as v,rb as y,xa as C,xc as B,ya as g}from"./chunk-TXOB7R5K.js";var M=$(N(),1),W=$(U(),1);var j=t=>({maxBackupSizeText:t});function q(t,m){if(t&1&&(a(0,"div"),u(1,"input",11),o()),t&2){let e=p(2);i(),b("value",e.selectedBackup.fileName)}}function O(t,m){if(t&1){let e=R();a(0,"div",10)(1,"input",12),x("change",function(n){C(e);let T=p(2);return g(T.handleRestoreFileInput(n.target.files))}),o(),a(2,"label",13),s(3),l(4,"translate"),o()()}if(t&2){let e=p(2);i(3),v(" ",d(4,1,(e.selectedFile==null?null:e.selectedFile.name)||"backup.label_choose_backup_file_to_restore")," ")}}function G(t,m){if(t&1&&(a(0,"div",5)(1,"div",8),u(2,"i",9),o(),a(3,"p"),s(4),l(5,"translate"),o(),a(6,"ul")(7,"li"),s(8),l(9,"translate"),o(),a(10,"li"),s(11),l(12,"translate"),o(),a(13,"li"),s(14),l(15,"translate"),o()(),f(16,q,2,1,"div")(17,O,5,3,"div",10),o()),t&2){let e=p();i(4),h(d(5,6,"backup.restore_help_one")),i(4),h(d(9,8,"backup.restore_help_two")),i(3),h(F(12,10,"backup.restore_max_size",B(15,j,e.maxFileSizeText))),i(3),h(d(15,13,"backup.restore_warning")),i(2),c(e.selectedBackup?16:-1),i(),c(e.selectedBackup?-1:17)}}function J(t,m){t&1&&u(0,"i",19)}function K(t,m){if(t&1&&(a(0,"span"),s(1),o()),t&2){let e=p(3);i(),v("",e.uploadPercent,"% - ")}}function L(t,m){t&1&&(a(0,"span"),s(1," Extracting Archive"),o())}function Q(t,m){t&1&&(a(0,"span"),s(1),l(2,"translate"),o()),t&2&&(i(),v(" ",d(2,1,"backup.label_uploading"),""))}function X(t,m){if(t&1&&(a(0,"span"),f(1,J,1,0,"i",19)(2,K,2,1,"span")(3,L,2,0,"span")(4,Q,3,3,"span"),o()),t&2){let e=p(2);i(),c(!e.uploadPercent||e.uploadPercent===100?1:-1),i(),c(e.uploadPercent&&e.uploadPercent!==100?2:-1),i(),c(e.uploadPercent===100?3:-1),i(),c(e.uploadPercent!==100?4:-1)}}function Y(t,m){t&1&&(a(0,"span"),s(1),l(2,"translate"),o()),t&2&&(i(),h(d(2,1,"form.button_restore")))}function Z(t,m){if(t&1){let e=R();a(0,"div",7)(1,"div",14)(2,"button",15),l(3,"translate"),x("click",function(){C(e);let n=p();return g(n.$activeModal.dismiss("Dismiss"))}),s(4),l(5,"translate"),o()(),u(6,"div",16),a(7,"div",17)(8,"button",18),x("click",function(){C(e);let n=p();return g(n.onRestoreBackupClick())}),f(9,X,5,4,"span")(10,Y,3,3,"span"),o()()()}if(t&2){let e=p();i(2),b("disabled",e.clicked),S("aria-label",d(3,6,"form.button_close")),i(2),v(" ",d(5,8,"form.button_close")," "),i(4),b("disabled",!e.selectedBackup&&!e.selectedFile||e.clicked),i(),c(e.clicked?9:-1),i(),c(e.clicked?-1:10)}}function ee(t,m){if(t&1){let e=R();a(0,"div",7),u(1,"div",14),a(2,"div",16)(3,"button",20),x("click",function(){C(e);let n=p();return g(n.postBackupRestart())}),s(4),l(5,"translate"),o()(),u(6,"div",17),o()}t&2&&(i(4),v(" ",d(5,1,"menu.hbrestart.title")," "))}var me=(()=>{class t{$activeModal=_(H);$api=_(E);$route=_(V);$toastr=_(z);$translate=_(P);$ws=_(D);setupWizardRestore=!1;selectedBackup=null;clicked=!1;maxFileSizeText=globalThis.backup.maxBackupSizeText;selectedFile;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;restoreArchiveType="homebridge";uploadPercent=0;term=new M.Terminal;termTarget;fitAddon=new W.FitAddon;io;ngOnInit(){return k(this,null,function*(){this.io=this.$ws.connectToNamespace("backup"),this.termTarget=document.getElementById("plugin-log-output"),this.term.open(this.termTarget),this.fitAddon.fit(),this.io.socket.on("stdout",e=>{this.term.write(e)}),this.setupWizardRestore&&(this.restoreStarted=!0,this.restoreInProgress=!0,this.startRestore())})}onRestoreBackupClick(){this.selectedBackup?this.restoreScheduledBackup():this.restoreArchiveType==="homebridge"?this.uploadHomebridgeArchive():this.restoreArchiveType==="hbfx"&&this.uploadHbfxArchive()}uploadHomebridgeArchive(){this.term.reset(),this.clicked=!0;let e=new FormData;e.append("restoreArchive",this.selectedFile,this.selectedFile.name),this.$api.post("/backup/restore",e).subscribe({next:()=>{this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startRestore()},500),this.clicked=!1},error:r=>{var n;console.error(r),this.$toastr.error(((n=r.error)==null?void 0:n.message)||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error")),this.clicked=!1}})}restoreScheduledBackup(){return k(this,null,function*(){this.term.reset(),this.clicked=!0,this.$api.post(`/backup/scheduled-backups/${this.selectedBackup.id}/restore`,{}).subscribe({next:()=>{this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startRestore()},500),this.clicked=!1},error:e=>{var r;console.error(e),this.$toastr.error(((r=e.error)==null?void 0:r.message)||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error")),this.clicked=!1}})})}startRestore(){return k(this,null,function*(){this.io.request("do-restore").subscribe({next:()=>{this.restoreInProgress=!1,this.$toastr.success(this.$translate.instant("backup.backup_restored"),this.$translate.instant("toast.title_success")),this.setupWizardRestore&&this.postBackupRestart()},error:e=>{this.restoreFailed=!0,console.error(e),this.$toastr.error(this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})})}uploadHbfxArchive(){this.term.reset(),this.clicked=!0;let e=new FormData;e.append("restoreArchive",this.selectedFile,this.selectedFile.name),this.$api.post("/backup/restore/hbfx",e,{reportProgress:!0,observe:"events"}).subscribe({next:r=>{r.type===I.UploadProgress?this.uploadPercent=Math.round(100*r.loaded/r.total):r instanceof w&&(this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startHbfxRestore()},500),this.clicked=!1)},error:r=>{var n;this.clicked=!1,console.error(r),this.$toastr.error(((n=r.error)==null?void 0:n.message)||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})}startHbfxRestore(){return k(this,null,function*(){this.io.request("do-restore-hbfx").subscribe({next:()=>{this.restoreInProgress=!1,this.$toastr.success(this.$translate.instant("backup.backup_restored"),this.$translate.instant("toast.title_success"))},error:e=>{this.restoreFailed=!0,console.error(e),this.$toastr.error(this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})})}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.selectedFile.name.endsWith(".hbfx")?this.restoreArchiveType="hbfx":this.restoreArchiveType="homebridge"):delete this.selectedFile}postBackupRestart(){this.$api.put("/backup/restart",{}).subscribe({next:()=>{this.$activeModal.close(!0),this.$route.navigate(["/"])},error:()=>{}})}ngOnDestroy(){this.io.end()}static \u0275fac=function(r){return new(r||t)};static \u0275cmp=y({type:t,selectors:[["ng-component"]],inputs:{setupWizardRestore:"setupWizardRestore",selectedBackup:"selectedBackup"},decls:13,vars:11,consts:[[1,"modal-content","hb-backup-modal"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click","disabled"],["aria-hidden","true"],[1,"modal-body"],["id","plugin-log-output",1,"modal-body",3,"hidden"],[1,"modal-footer","justify-content-between"],[1,"text-center","mt-2","mb-3"],[1,"fas","fa-fw","fa-hard-drive","primary-text",2,"font-size","75px"],[1,"custom-file"],["type","text","disabled","",1,"form-control","custom-input",3,"value"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz, .hbfx",1,"custom-file-input",3,"change"],["for","restoreFileUpload",1,"custom-file-label"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-right"],["type","button","data-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"],[1,"fa","fa-fw","fa-circle-notch","fa-spin"],["type","button","data-dismiss","modal",1,"btn","btn-primary",3,"click"]],template:function(r,n){r&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),s(3),l(4,"translate"),o(),a(5,"button",3),l(6,"translate"),x("click",function(){return n.$activeModal.dismiss("Dismiss")}),a(7,"span",4),s(8,"\xD7"),o()()(),f(9,G,18,17,"div",5),u(10,"div",6),f(11,Z,11,10,"div",7)(12,ee,7,3,"div",7),o()),r&2&&(i(3),h(d(4,7,"form.button_restore")),i(2),b("disabled",n.restoreInProgress),S("aria-label",d(6,9,"form.button_close")),i(4),c(!n.restoreStarted&&!n.setupWizardRestore?9:-1),i(),b("hidden",!n.restoreStarted),i(),c(!n.restoreStarted||n.restoreFailed===!0?11:-1),i(),c(!n.restoreInProgress&&n.restoreStarted?12:-1))},dependencies:[A],encapsulation:2})}return t})();export{me as a};
1
+ import{a as N,b as U}from"./chunk-BKUGARB4.js";import{m as H}from"./chunk-ORPWYWCL.js";import{a as D}from"./chunk-B26OUBKR.js";import{d as V}from"./chunk-NZNNTHFQ.js";import{b as E,j as z}from"./chunk-JEWVZOEL.js";import{c as I,d as w}from"./chunk-UG5DK2RQ.js";import{a as P,b as A}from"./chunk-3IX3CLER.js";import{$b as R,Bc as l,Cc as d,Dc as F,Kb as f,Lb as S,Mb as b,Rb as c,Wb as a,Xb as o,Yb as u,cc as x,dc as p,g as $,h as k,ib as i,na as _,nc as s,oc as h,pc as v,rb as y,xa as C,xc as B,ya as g}from"./chunk-TXOB7R5K.js";var M=$(N(),1),W=$(U(),1);var j=t=>({maxBackupSizeText:t});function q(t,m){if(t&1&&(a(0,"div"),u(1,"input",11),o()),t&2){let e=p(2);i(),b("value",e.selectedBackup.fileName)}}function O(t,m){if(t&1){let e=R();a(0,"div",10)(1,"input",12),x("change",function(n){C(e);let T=p(2);return g(T.handleRestoreFileInput(n.target.files))}),o(),a(2,"label",13),s(3),l(4,"translate"),o()()}if(t&2){let e=p(2);i(3),v(" ",d(4,1,(e.selectedFile==null?null:e.selectedFile.name)||"backup.label_choose_backup_file_to_restore")," ")}}function G(t,m){if(t&1&&(a(0,"div",5)(1,"div",8),u(2,"i",9),o(),a(3,"p"),s(4),l(5,"translate"),o(),a(6,"ul")(7,"li"),s(8),l(9,"translate"),o(),a(10,"li"),s(11),l(12,"translate"),o(),a(13,"li"),s(14),l(15,"translate"),o()(),f(16,q,2,1,"div")(17,O,5,3,"div",10),o()),t&2){let e=p();i(4),h(d(5,6,"backup.restore_help_one")),i(4),h(d(9,8,"backup.restore_help_two")),i(3),h(F(12,10,"backup.restore_max_size",B(15,j,e.maxFileSizeText))),i(3),h(d(15,13,"backup.restore_warning")),i(2),c(e.selectedBackup?16:-1),i(),c(e.selectedBackup?-1:17)}}function J(t,m){t&1&&u(0,"i",19)}function K(t,m){if(t&1&&(a(0,"span"),s(1),o()),t&2){let e=p(3);i(),v("",e.uploadPercent,"% - ")}}function L(t,m){t&1&&(a(0,"span"),s(1," Extracting Archive"),o())}function Q(t,m){t&1&&(a(0,"span"),s(1),l(2,"translate"),o()),t&2&&(i(),v(" ",d(2,1,"backup.label_uploading"),""))}function X(t,m){if(t&1&&(a(0,"span"),f(1,J,1,0,"i",19)(2,K,2,1,"span")(3,L,2,0,"span")(4,Q,3,3,"span"),o()),t&2){let e=p(2);i(),c(!e.uploadPercent||e.uploadPercent===100?1:-1),i(),c(e.uploadPercent&&e.uploadPercent!==100?2:-1),i(),c(e.uploadPercent===100?3:-1),i(),c(e.uploadPercent!==100?4:-1)}}function Y(t,m){t&1&&(a(0,"span"),s(1),l(2,"translate"),o()),t&2&&(i(),h(d(2,1,"form.button_restore")))}function Z(t,m){if(t&1){let e=R();a(0,"div",7)(1,"div",14)(2,"button",15),l(3,"translate"),x("click",function(){C(e);let n=p();return g(n.$activeModal.dismiss("Dismiss"))}),s(4),l(5,"translate"),o()(),u(6,"div",16),a(7,"div",17)(8,"button",18),x("click",function(){C(e);let n=p();return g(n.onRestoreBackupClick())}),f(9,X,5,4,"span")(10,Y,3,3,"span"),o()()()}if(t&2){let e=p();i(2),b("disabled",e.clicked),S("aria-label",d(3,6,"form.button_close")),i(2),v(" ",d(5,8,"form.button_close")," "),i(4),b("disabled",!e.selectedBackup&&!e.selectedFile||e.clicked),i(),c(e.clicked?9:-1),i(),c(e.clicked?-1:10)}}function ee(t,m){if(t&1){let e=R();a(0,"div",7),u(1,"div",14),a(2,"div",16)(3,"button",20),x("click",function(){C(e);let n=p();return g(n.postBackupRestart())}),s(4),l(5,"translate"),o()(),u(6,"div",17),o()}t&2&&(i(4),v(" ",d(5,1,"menu.hbrestart.title")," "))}var me=(()=>{class t{$activeModal=_(H);$api=_(E);$route=_(V);$toastr=_(z);$translate=_(P);$ws=_(D);setupWizardRestore=!1;selectedBackup=null;clicked=!1;maxFileSizeText=globalThis.backup.maxBackupSizeText;selectedFile;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;restoreArchiveType="homebridge";uploadPercent=0;term=new M.Terminal;termTarget;fitAddon=new W.FitAddon;io;ngOnInit(){return k(this,null,function*(){this.io=this.$ws.connectToNamespace("backup"),this.termTarget=document.getElementById("plugin-log-output"),this.term.open(this.termTarget),this.fitAddon.fit(),this.io.socket.on("stdout",e=>{this.term.write(e)}),this.setupWizardRestore&&(this.restoreStarted=!0,this.restoreInProgress=!0,this.startRestore())})}onRestoreBackupClick(){this.selectedBackup?this.restoreScheduledBackup():this.restoreArchiveType==="homebridge"?this.uploadHomebridgeArchive():this.restoreArchiveType==="hbfx"&&this.uploadHbfxArchive()}uploadHomebridgeArchive(){this.term.reset(),this.clicked=!0;let e=new FormData;e.append("restoreArchive",this.selectedFile,this.selectedFile.name),this.$api.post("/backup/restore",e).subscribe({next:()=>{this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startRestore()},500),this.clicked=!1},error:r=>{var n;console.error(r),this.$toastr.error(((n=r.error)==null?void 0:n.message)||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error")),this.clicked=!1}})}restoreScheduledBackup(){return k(this,null,function*(){this.term.reset(),this.clicked=!0,this.$api.post(`/backup/scheduled-backups/${this.selectedBackup.id}/restore`,{}).subscribe({next:()=>{this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startRestore()},500),this.clicked=!1},error:e=>{var r;console.error(e),this.$toastr.error(((r=e.error)==null?void 0:r.message)||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error")),this.clicked=!1}})})}startRestore(){return k(this,null,function*(){this.io.request("do-restore").subscribe({next:()=>{this.restoreInProgress=!1,this.$toastr.success(this.$translate.instant("backup.backup_restored"),this.$translate.instant("toast.title_success")),this.setupWizardRestore&&this.postBackupRestart()},error:e=>{this.restoreFailed=!0,console.error(e),this.$toastr.error(this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})})}uploadHbfxArchive(){this.term.reset(),this.clicked=!0;let e=new FormData;e.append("restoreArchive",this.selectedFile,this.selectedFile.name),this.$api.post("/backup/restore/hbfx",e,{reportProgress:!0,observe:"events"}).subscribe({next:r=>{r.type===I.UploadProgress?this.uploadPercent=Math.round(100*r.loaded/r.total):r instanceof w&&(this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startHbfxRestore()},500),this.clicked=!1)},error:r=>{var n;this.clicked=!1,console.error(r),this.$toastr.error(((n=r.error)==null?void 0:n.message)||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})}startHbfxRestore(){return k(this,null,function*(){this.io.request("do-restore-hbfx").subscribe({next:()=>{this.restoreInProgress=!1,this.$toastr.success(this.$translate.instant("backup.backup_restored"),this.$translate.instant("toast.title_success"))},error:e=>{this.restoreFailed=!0,console.error(e),this.$toastr.error(this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})})}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.selectedFile.name.endsWith(".hbfx")?this.restoreArchiveType="hbfx":this.restoreArchiveType="homebridge"):delete this.selectedFile}postBackupRestart(){this.$api.put("/backup/restart",{}).subscribe({next:()=>{this.$activeModal.close(!0),this.$route.navigate(["/"])},error:()=>{}})}ngOnDestroy(){this.io.end()}static \u0275fac=function(r){return new(r||t)};static \u0275cmp=y({type:t,selectors:[["ng-component"]],inputs:{setupWizardRestore:"setupWizardRestore",selectedBackup:"selectedBackup"},decls:13,vars:11,consts:[[1,"modal-content","hb-backup-modal"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click","disabled"],["aria-hidden","true"],[1,"modal-body"],["id","plugin-log-output",1,"modal-body",3,"hidden"],[1,"modal-footer","justify-content-between"],[1,"text-center","mt-2","mb-3"],[1,"fas","fa-fw","fa-hard-drive","primary-text",2,"font-size","75px"],[1,"custom-file"],["type","text","disabled","",1,"form-control","custom-input",3,"value"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz, .hbfx",1,"custom-file-input",3,"change"],["for","restoreFileUpload",1,"custom-file-label"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-right"],["type","button","data-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"],[1,"fa","fa-fw","fa-circle-notch","fa-spin"],["type","button","data-dismiss","modal",1,"btn","btn-primary",3,"click"]],template:function(r,n){r&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),s(3),l(4,"translate"),o(),a(5,"button",3),l(6,"translate"),x("click",function(){return n.$activeModal.dismiss("Dismiss")}),a(7,"span",4),s(8,"\xD7"),o()()(),f(9,G,18,17,"div",5),u(10,"div",6),f(11,Z,11,10,"div",7)(12,ee,7,3,"div",7),o()),r&2&&(i(3),h(d(4,7,"form.button_restore")),i(2),b("disabled",n.restoreInProgress),S("aria-label",d(6,9,"form.button_close")),i(4),c(!n.restoreStarted&&!n.setupWizardRestore?9:-1),i(),b("hidden",!n.restoreStarted),i(),c(!n.restoreStarted||n.restoreFailed===!0?11:-1),i(),c(!n.restoreInProgress&&n.restoreStarted?12:-1))},dependencies:[A],encapsulation:2})}return t})();export{me as a};
@@ -1 +1 @@
1
- import{a as G}from"./chunk-WHJSVGC7.js";import{a as W}from"./chunk-BPMSJ2VF.js";import{a as Z}from"./chunk-WHJOLAED.js";import{a as X}from"./chunk-JZZQRLNW.js";import{a as H}from"./chunk-KQJ7ONUG.js";import{n as B}from"./chunk-ORPWYWCL.js";import"./chunk-QHPDGSZ6.js";import{a as R}from"./chunk-HATYIWAA.js";import{a as q,c as N,d as T,e as D,f as j}from"./chunk-NZNNTHFQ.js";import{c as $}from"./chunk-74NKPNWY.js";import{b as L}from"./chunk-BA5K2UHP.js";import{a as P}from"./chunk-NFE4RXTM.js";import"./chunk-UG5DK2RQ.js";import{a as M,b as U}from"./chunk-3IX3CLER.js";import{$b as y,Bc as d,Cc as l,Kb as E,Lb as u,Mb as m,Rb as w,Wb as n,Xb as a,Yb as p,ad as V,cc as _,dc as C,g as Y,h as z,ib as o,na as c,nc as f,oc as v,pb as F,rb as O,sd as K,w as A,wc as g,xa as b,xc as k,ya as x}from"./chunk-TXOB7R5K.js";var Q=Y(Z(),1);var I=()=>["/"],te=i=>({"hamburger-icon-cross":i}),ne=i=>({expanded:i}),ie=()=>({exact:!0}),oe=()=>["/accessories"],re=()=>["/support"],ae=()=>["/power-options"],se=()=>["/plugins"],de=()=>["/logs"],le=()=>["/platform-tools/terminal"],pe=()=>["/config"],ce=()=>["/settings"];function me(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",19),d(2,"translate"),d(3,"translate"),_("click",function(){b(e);let t=C();return x(t.openUnderVoltageModal())})("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(4,"div",12),p(5,"i",20),a(),n(6,"div",14),f(7),d(8,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"rpi.throttled.undervoltage_title")+" - "+l(3,4,"rpi.throttled.undervoltage_description")),o(6),v(l(8,6,"rpi.throttled.undervoltage_title")))}function ue(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",21),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,se))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_plugins")),o(5),v(l(7,6,"menu.label_plugins")))}function _e(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",22),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,de))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_logs")),o(5),v(l(7,6,"menu.linux.label_logs")))}function fe(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",23),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,le))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_terminal")),o(5),v(l(7,6,"menu.linux.label_terminal")))}function ge(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",24),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,pe))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.config_json_editor")),o(5),v(l(7,6,"menu.config_json_editor")))}function ve(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",25),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,ce))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_settings")),o(5),v(l(7,6,"menu.label_settings")))}function he(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",19),d(2,"translate"),_("click",function(){b(e);let t=C();return x(t.$auth.logout())})("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",26),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"menu.tooltip_logout")),o(5),v(l(7,4,"menu.tooltip_logout")))}var J=(()=>{class i{router=c(T);translate=c(M);$auth=c($);$settings=c(L);$md=c(X);$modal=c(B);$notification=c(G);$translate=c(M);renderer=c(F);isExpanded=!1;rPiCurrentlyUnderVoltage=!1;rPiWasUnderVoltage=!1;isMobile=!1;freezeMenu=!1;constructor(){let e=this.router;this.isMobile=this.$md.detect.mobile(),e.events.subscribe(s=>{s instanceof q&&(this.closeSidebar(),this.freezeMenu=!0,setTimeout(()=>{this.freezeMenu=!1},500))})}ngOnInit(){this.$notification.raspberryPiThrottled.subscribe(r=>{r["Under Voltage"]&&(this.rPiCurrentlyUnderVoltage=!0),r["Under-voltage has occurred"]&&(this.rPiWasUnderVoltage=!0)});let e=document.querySelector(".sidebar"),s=document.querySelector(".m-header"),t=document.querySelector(".content");this.isMobile?document.addEventListener("touchstart",r=>{if(t.contains(r.target)&&this.isExpanded){r.preventDefault(),this.toggleSidebar();return}!e.contains(r.target)&&!s.contains(r.target)&&this.isExpanded&&(r.preventDefault(),this.closeSidebar())},{passive:!1}):(e.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),s.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),e.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),s.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),document.addEventListener("click",r=>{e.contains(r.target)&&r.clientX>60&&this.closeSidebar()},{passive:!1})),this.updateContentStyles()}openSidebar(){this.freezeMenu||(this.isExpanded=!0,this.updateContentStyles())}closeSidebar(){this.freezeMenu||(this.isExpanded=!1,this.updateContentStyles())}toggleSidebar(){this.freezeMenu||(this.isExpanded=!this.isExpanded,this.updateContentStyles())}updateContentStyles(){let e=document.querySelector(".content");this.isExpanded?(this.renderer.setStyle(e,"opacity","20%"),this.renderer.setStyle(e,"pointer-events","none"),this.renderer.setStyle(e,"overflow","hidden")):(this.renderer.removeStyle(e,"opacity"),this.renderer.removeStyle(e,"pointer-events"),this.renderer.removeStyle(e,"overflow"))}openUnderVoltageModal(){let e=this.$modal.open(W,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("rpi.throttled.undervoltage_title"),e.componentInstance.message=this.$translate.instant(this.rPiCurrentlyUnderVoltage?"rpi.throttled.currently_message":"rpi.throttled.previously_message"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.faIconClass="fas fa-fw fa-bolt yellow-text",e.componentInstance.ctaButtonLink="https://pimylifeup.com/raspberry-pi-low-voltage-warning"}handleKeydown(e){if(e.key==="Enter"){let s=e.target;["menuitem","button"].includes(s.getAttribute("role"))&&s.click()}}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-sidebar"]],inputs:{isExpanded:"isExpanded"},decls:60,vars:66,consts:[["tabindex","0","role","button",1,"m-header","text-right",3,"click","keydown"],[1,"mr-2","d-block","d-lg-none",2,"font-size","0.9rem","color","#dddddd"],[3,"routerLink"],["ngSrc","../../../../assets/homebridge-logo.svg","alt","HB Logo","height","35","width","35",2,"height","35px","width","35px"],[1,"hb-logo-text-mobile"],[1,"hamburger-icon",3,"ngClass"],["role","navigation","id","sidebar",1,"sidebar",3,"ngClass"],["tabindex","0","role","button",1,"header",3,"click","keydown"],[1,"hb-logo-text"],[1,"link-wrapper"],[1,"link"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive","routerLinkActiveOptions"],[1,"icon"],[1,"fa","fa-fw","fa-house"],[1,"title"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive"],[1,"fa","fa-fw","fa-lightbulb"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"fa","fa-fw","fa-power-off"],["role","menuitem","tabindex","0",1,"link-row",3,"click","keydown"],[1,"fas","fa-fw","fa-bolt","fa-beat","yellow-text",2,"--fa-beat-scale","1.5"],[1,"fa","fa-fw","fa-plug"],[1,"fa","fa-fw","fa-wave-square"],[1,"fa","fa-fw","fa-terminal"],[1,"fa","fa-fw","fa-code"],[1,"fa","fa-fw","fa-cog"],[1,"fa","fa-fw","fa-right-from-bracket"]],template:function(s,t){s&1&&(n(0,"div",0),d(1,"translate"),_("click",function(){return t.toggleSidebar()})("keydown",function(h){return t.handleKeydown(h)}),p(2,"span",1),n(3,"a",2),d(4,"translate"),p(5,"img",3),n(6,"div",4),f(7,"Homebridge"),a()(),n(8,"div",5),p(9,"span")(10,"span")(11,"span")(12,"span"),a()(),n(13,"div",6)(14,"div",7),_("click",function(){return t.toggleSidebar()})("keydown",function(h){return t.handleKeydown(h)}),n(15,"a",2),d(16,"translate"),p(17,"img",3),n(18,"div",8),f(19,"Homebridge"),a()()(),n(20,"div",9)(21,"div",10)(22,"div",11),d(23,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(24,"div",12),p(25,"i",13),a(),n(26,"div",14),f(27),d(28,"translate"),a()()(),E(29,me,9,8,"div",10)(30,ue,8,9,"div",10),n(31,"div",10)(32,"div",15),d(33,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(34,"div",12),p(35,"i",16),a(),n(36,"div",14),f(37),d(38,"translate"),a()()(),E(39,_e,8,9,"div",10)(40,fe,8,9,"div",10)(41,ge,8,9,"div",10)(42,ve,8,9,"div",10),n(43,"div",10)(44,"div",15),d(45,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(46,"div",12),p(47,"i",17),a(),n(48,"div",14),f(49),d(50,"translate"),a()()(),n(51,"div",10)(52,"div",15),d(53,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(54,"div",12),p(55,"i",18),a(),n(56,"div",14),f(57),d(58,"translate"),a()()(),E(59,he,8,6,"div",10),a()()),s&2&&(u("aria-expanded",t.isExpanded?"true":"false")("aria-controls","sidebar")("aria-label",l(1,33,"menu.sidebar.aria_menu")),o(3),m("routerLink",g(55,I)),u("aria-label",l(4,35,"menu.label_status")),o(5),m("ngClass",k(56,te,t.isExpanded)),o(5),m("ngClass",k(58,ne,t.isExpanded)),o(2),m("routerLink",g(60,I)),u("aria-label",l(16,37,"menu.label_status")),o(7),m("routerLink",g(61,I))("routerLinkActive","active")("routerLinkActiveOptions",g(62,ie)),u("aria-label",l(23,39,"menu.label_status")),o(5),v(l(28,41,"menu.label_status")),o(2),w(t.rPiWasUnderVoltage||t.rPiCurrentlyUnderVoltage?29:-1),o(),w(t.$auth.user.admin?30:-1),o(2),m("routerLink",g(63,oe))("routerLinkActive","active"),u("aria-label",l(33,43,"menu.label_accessories")),o(5),v(l(38,45,"menu.label_accessories")),o(2),w(t.$auth.user.admin?39:-1),o(),w(t.$settings.env.enableTerminalAccess&&t.$auth.user.admin?40:-1),o(),w(t.$auth.user.admin?41:-1),o(),w(t.$auth.user.admin?42:-1),o(2),m("routerLink",g(64,re))("routerLinkActive","active"),u("aria-label",l(45,47,"support.title")),o(5),v(l(50,49,"support.title")),o(3),m("routerLink",g(65,ae))("routerLinkActive","active"),u("aria-label",l(53,51,"menu.restart.title")),o(5),v(l(58,53,"menu.restart.title")),o(2),w(t.$settings.formAuth?59:-1))},dependencies:[K,V,D,j,U],styles:[".m-header[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:65px;z-index:510;display:flex;align-items:center;padding-left:3px;padding-right:3px}.m-header[_ngcontent-%COMP%]:hover{cursor:pointer}@media (min-width: 768px){.m-header[_ngcontent-%COMP%]{display:none}}.sidebar[_ngcontent-%COMP%]{position:fixed;left:0;top:0;height:100vh;transition:.3s;width:60px;z-index:500}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;padding:15px 10px 15px 11px;font-size:.85rem}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]:hover{cursor:pointer}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{overflow-y:auto;max-height:calc(100vh - 80px)!important}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%]{display:flex;align-items:center;padding:15px 10px;cursor:pointer;transition:.2s;font-size:17px}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{flex:0 0 38px;display:flex;align-items:center;justify-content:center}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{flex:1;transition:.3s;max-width:0;overflow:hidden;white-space:nowrap}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%]{width:0}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:none}}.sidebar.expanded[_ngcontent-%COMP%]{width:210px}@media (max-width: 767px){.sidebar.expanded[_ngcontent-%COMP%]{width:210px}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:block}}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{max-width:150px;padding-left:10px}.hamburger-icon[_ngcontent-%COMP%]{margin:-7px 0 0 25px}@media (min-width: 768px){.hb-logo-text[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px}.sidebar.expanded[_ngcontent-%COMP%] .hb-logo-text[_ngcontent-%COMP%]{opacity:1;left:55px;transition:.3s}.sidebar[_ngcontent-%COMP%]:not(.expanded) .hb-logo-text[_ngcontent-%COMP%]{opacity:0;left:40px;transition:.3s}.hb-logo-text-mobile[_ngcontent-%COMP%], .hamburger-icon[_ngcontent-%COMP%]{display:none!important}}@media (max-width: 767px){.hb-logo-text[_ngcontent-%COMP%]{display:none!important}.hb-logo-text-mobile[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px;opacity:1;left:55px}.hamburger-icon[_ngcontent-%COMP%]{position:absolute;right:10px;top:28px;width:30px;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.5s ease-in-out;-moz-transition:.5s ease-in-out;-o-transition:.5s ease-in-out;transition:.5s ease-in-out;cursor:pointer}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;position:absolute;height:2px;width:100%;background-color:#fff;border-radius:9px;opacity:1;left:0;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.25s ease-in-out;-moz-transition:.25s ease-in-out;-o-transition:.25s ease-in-out;transition:.25s ease-in-out}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:0}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2), .hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){top:10px}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:20px}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:10px;width:0;left:50%}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:10px;width:0;left:50%}}"]})}return i})();var be=i=>({sidebarExpanded:i}),He=(()=>{class i{$auth=c($);$modal=c(B);$router=c(T);$settings=c(L);$translate=c(M);$ws=c(R);sidebarExpanded=!1;io;ngOnInit(){this.io=this.$ws.connectToNamespace("app"),this.io.socket.on("reconnect",()=>{this.$auth.checkToken()}),this.compareServerUiVersion()}compareServerUiVersion(){return z(this,null,function*(){if(this.$settings.settingsLoaded||(yield A(this.$settings.onSettingsLoaded)),(0,Q.lt)(this.$settings.uiVersion,P.serverTarget)){console.log(`Server restart required. UI Version: ${P.serverTarget} - Server Version: ${this.$settings.uiVersion} `);let e=this.$modal.open(H,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("platform.version.service_restart_required"),e.componentInstance.message=this.$translate.instant("platform.version.restart_required",{serverVersion:this.$settings.uiVersion,uiVersion:P.serverTarget}),e.componentInstance.confirmButtonLabel=this.$translate.instant("menu.tooltip_restart"),e.componentInstance.faIconClass="fas fa-fw-power-off",e.result.then(()=>{this.$router.navigate(["/restart"])}).catch(()=>{})}})}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-layout"]],decls:3,vars:4,consts:[[3,"isExpanded"],[1,"content","px-3","p-md-4",3,"ngClass"]],template:function(s,t){s&1&&(p(0,"app-sidebar",0),n(1,"div",1),p(2,"router-outlet"),a()),s&2&&(m("isExpanded",t.sidebarExpanded),o(),m("ngClass",k(2,be,t.sidebarExpanded)))},dependencies:[J,V,N],styles:[".content[_ngcontent-%COMP%]{margin-left:60px;transition:.3s;height:100%}@media (max-width: 767px){.content[_ngcontent-%COMP%]{margin-left:0;padding-top:85px!important}}@media (min-width: 768px){.content[_ngcontent-%COMP%]{height:100%}}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return i})();export{He as LayoutComponent};
1
+ import{a as G}from"./chunk-WHJSVGC7.js";import{a as W}from"./chunk-BPMSJ2VF.js";import{a as Z}from"./chunk-WHJOLAED.js";import{a as X}from"./chunk-JZZQRLNW.js";import{a as H}from"./chunk-KQJ7ONUG.js";import{n as B}from"./chunk-ORPWYWCL.js";import"./chunk-QHPDGSZ6.js";import{a as R}from"./chunk-B26OUBKR.js";import{a as q,c as N,d as T,e as D,f as j}from"./chunk-NZNNTHFQ.js";import{c as $}from"./chunk-3L47WOJW.js";import{b as L}from"./chunk-ZDL5FMDD.js";import{a as P}from"./chunk-JEWVZOEL.js";import"./chunk-UG5DK2RQ.js";import{a as M,b as U}from"./chunk-3IX3CLER.js";import{$b as y,Bc as d,Cc as l,Kb as E,Lb as u,Mb as m,Rb as w,Wb as n,Xb as a,Yb as p,ad as V,cc as _,dc as C,g as Y,h as z,ib as o,na as c,nc as f,oc as v,pb as F,rb as O,sd as K,w as A,wc as g,xa as b,xc as k,ya as x}from"./chunk-TXOB7R5K.js";var Q=Y(Z(),1);var I=()=>["/"],te=i=>({"hamburger-icon-cross":i}),ne=i=>({expanded:i}),ie=()=>({exact:!0}),oe=()=>["/accessories"],re=()=>["/support"],ae=()=>["/power-options"],se=()=>["/plugins"],de=()=>["/logs"],le=()=>["/platform-tools/terminal"],pe=()=>["/config"],ce=()=>["/settings"];function me(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",19),d(2,"translate"),d(3,"translate"),_("click",function(){b(e);let t=C();return x(t.openUnderVoltageModal())})("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(4,"div",12),p(5,"i",20),a(),n(6,"div",14),f(7),d(8,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"rpi.throttled.undervoltage_title")+" - "+l(3,4,"rpi.throttled.undervoltage_description")),o(6),v(l(8,6,"rpi.throttled.undervoltage_title")))}function ue(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",21),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,se))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_plugins")),o(5),v(l(7,6,"menu.label_plugins")))}function _e(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",22),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,de))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_logs")),o(5),v(l(7,6,"menu.linux.label_logs")))}function fe(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",23),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,le))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_terminal")),o(5),v(l(7,6,"menu.linux.label_terminal")))}function ge(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",24),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,pe))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.config_json_editor")),o(5),v(l(7,6,"menu.config_json_editor")))}function ve(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",25),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,ce))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_settings")),o(5),v(l(7,6,"menu.label_settings")))}function he(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",19),d(2,"translate"),_("click",function(){b(e);let t=C();return x(t.$auth.logout())})("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",26),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"menu.tooltip_logout")),o(5),v(l(7,4,"menu.tooltip_logout")))}var J=(()=>{class i{router=c(T);translate=c(M);$auth=c($);$settings=c(L);$md=c(X);$modal=c(B);$notification=c(G);$translate=c(M);renderer=c(F);isExpanded=!1;rPiCurrentlyUnderVoltage=!1;rPiWasUnderVoltage=!1;isMobile=!1;freezeMenu=!1;constructor(){let e=this.router;this.isMobile=this.$md.detect.mobile(),e.events.subscribe(s=>{s instanceof q&&(this.closeSidebar(),this.freezeMenu=!0,setTimeout(()=>{this.freezeMenu=!1},500))})}ngOnInit(){this.$notification.raspberryPiThrottled.subscribe(r=>{r["Under Voltage"]&&(this.rPiCurrentlyUnderVoltage=!0),r["Under-voltage has occurred"]&&(this.rPiWasUnderVoltage=!0)});let e=document.querySelector(".sidebar"),s=document.querySelector(".m-header"),t=document.querySelector(".content");this.isMobile?document.addEventListener("touchstart",r=>{if(t.contains(r.target)&&this.isExpanded){r.preventDefault(),this.toggleSidebar();return}!e.contains(r.target)&&!s.contains(r.target)&&this.isExpanded&&(r.preventDefault(),this.closeSidebar())},{passive:!1}):(e.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),s.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),e.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),s.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),document.addEventListener("click",r=>{e.contains(r.target)&&r.clientX>60&&this.closeSidebar()},{passive:!1})),this.updateContentStyles()}openSidebar(){this.freezeMenu||(this.isExpanded=!0,this.updateContentStyles())}closeSidebar(){this.freezeMenu||(this.isExpanded=!1,this.updateContentStyles())}toggleSidebar(){this.freezeMenu||(this.isExpanded=!this.isExpanded,this.updateContentStyles())}updateContentStyles(){let e=document.querySelector(".content");this.isExpanded?(this.renderer.setStyle(e,"opacity","20%"),this.renderer.setStyle(e,"pointer-events","none"),this.renderer.setStyle(e,"overflow","hidden")):(this.renderer.removeStyle(e,"opacity"),this.renderer.removeStyle(e,"pointer-events"),this.renderer.removeStyle(e,"overflow"))}openUnderVoltageModal(){let e=this.$modal.open(W,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("rpi.throttled.undervoltage_title"),e.componentInstance.message=this.$translate.instant(this.rPiCurrentlyUnderVoltage?"rpi.throttled.currently_message":"rpi.throttled.previously_message"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.faIconClass="fas fa-fw fa-bolt yellow-text",e.componentInstance.ctaButtonLink="https://pimylifeup.com/raspberry-pi-low-voltage-warning"}handleKeydown(e){if(e.key==="Enter"){let s=e.target;["menuitem","button"].includes(s.getAttribute("role"))&&s.click()}}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-sidebar"]],inputs:{isExpanded:"isExpanded"},decls:60,vars:66,consts:[["tabindex","0","role","button",1,"m-header","text-right",3,"click","keydown"],[1,"mr-2","d-block","d-lg-none",2,"font-size","0.9rem","color","#dddddd"],[3,"routerLink"],["ngSrc","../../../../assets/homebridge-logo.svg","alt","HB Logo","height","35","width","35",2,"height","35px","width","35px"],[1,"hb-logo-text-mobile"],[1,"hamburger-icon",3,"ngClass"],["role","navigation","id","sidebar",1,"sidebar",3,"ngClass"],["tabindex","0","role","button",1,"header",3,"click","keydown"],[1,"hb-logo-text"],[1,"link-wrapper"],[1,"link"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive","routerLinkActiveOptions"],[1,"icon"],[1,"fa","fa-fw","fa-house"],[1,"title"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive"],[1,"fa","fa-fw","fa-lightbulb"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"fa","fa-fw","fa-power-off"],["role","menuitem","tabindex","0",1,"link-row",3,"click","keydown"],[1,"fas","fa-fw","fa-bolt","fa-beat","yellow-text",2,"--fa-beat-scale","1.5"],[1,"fa","fa-fw","fa-plug"],[1,"fa","fa-fw","fa-wave-square"],[1,"fa","fa-fw","fa-terminal"],[1,"fa","fa-fw","fa-code"],[1,"fa","fa-fw","fa-cog"],[1,"fa","fa-fw","fa-right-from-bracket"]],template:function(s,t){s&1&&(n(0,"div",0),d(1,"translate"),_("click",function(){return t.toggleSidebar()})("keydown",function(h){return t.handleKeydown(h)}),p(2,"span",1),n(3,"a",2),d(4,"translate"),p(5,"img",3),n(6,"div",4),f(7,"Homebridge"),a()(),n(8,"div",5),p(9,"span")(10,"span")(11,"span")(12,"span"),a()(),n(13,"div",6)(14,"div",7),_("click",function(){return t.toggleSidebar()})("keydown",function(h){return t.handleKeydown(h)}),n(15,"a",2),d(16,"translate"),p(17,"img",3),n(18,"div",8),f(19,"Homebridge"),a()()(),n(20,"div",9)(21,"div",10)(22,"div",11),d(23,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(24,"div",12),p(25,"i",13),a(),n(26,"div",14),f(27),d(28,"translate"),a()()(),E(29,me,9,8,"div",10)(30,ue,8,9,"div",10),n(31,"div",10)(32,"div",15),d(33,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(34,"div",12),p(35,"i",16),a(),n(36,"div",14),f(37),d(38,"translate"),a()()(),E(39,_e,8,9,"div",10)(40,fe,8,9,"div",10)(41,ge,8,9,"div",10)(42,ve,8,9,"div",10),n(43,"div",10)(44,"div",15),d(45,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(46,"div",12),p(47,"i",17),a(),n(48,"div",14),f(49),d(50,"translate"),a()()(),n(51,"div",10)(52,"div",15),d(53,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(54,"div",12),p(55,"i",18),a(),n(56,"div",14),f(57),d(58,"translate"),a()()(),E(59,he,8,6,"div",10),a()()),s&2&&(u("aria-expanded",t.isExpanded?"true":"false")("aria-controls","sidebar")("aria-label",l(1,33,"menu.sidebar.aria_menu")),o(3),m("routerLink",g(55,I)),u("aria-label",l(4,35,"menu.label_status")),o(5),m("ngClass",k(56,te,t.isExpanded)),o(5),m("ngClass",k(58,ne,t.isExpanded)),o(2),m("routerLink",g(60,I)),u("aria-label",l(16,37,"menu.label_status")),o(7),m("routerLink",g(61,I))("routerLinkActive","active")("routerLinkActiveOptions",g(62,ie)),u("aria-label",l(23,39,"menu.label_status")),o(5),v(l(28,41,"menu.label_status")),o(2),w(t.rPiWasUnderVoltage||t.rPiCurrentlyUnderVoltage?29:-1),o(),w(t.$auth.user.admin?30:-1),o(2),m("routerLink",g(63,oe))("routerLinkActive","active"),u("aria-label",l(33,43,"menu.label_accessories")),o(5),v(l(38,45,"menu.label_accessories")),o(2),w(t.$auth.user.admin?39:-1),o(),w(t.$settings.env.enableTerminalAccess&&t.$auth.user.admin?40:-1),o(),w(t.$auth.user.admin?41:-1),o(),w(t.$auth.user.admin?42:-1),o(2),m("routerLink",g(64,re))("routerLinkActive","active"),u("aria-label",l(45,47,"support.title")),o(5),v(l(50,49,"support.title")),o(3),m("routerLink",g(65,ae))("routerLinkActive","active"),u("aria-label",l(53,51,"menu.restart.title")),o(5),v(l(58,53,"menu.restart.title")),o(2),w(t.$settings.formAuth?59:-1))},dependencies:[K,V,D,j,U],styles:[".m-header[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:65px;z-index:510;display:flex;align-items:center;padding-left:3px;padding-right:3px}.m-header[_ngcontent-%COMP%]:hover{cursor:pointer}@media (min-width: 768px){.m-header[_ngcontent-%COMP%]{display:none}}.sidebar[_ngcontent-%COMP%]{position:fixed;left:0;top:0;height:100vh;transition:.3s;width:60px;z-index:500}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;padding:15px 10px 15px 11px;font-size:.85rem}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]:hover{cursor:pointer}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{overflow-y:auto;max-height:calc(100vh - 80px)!important}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%]{display:flex;align-items:center;padding:15px 10px;cursor:pointer;transition:.2s;font-size:17px}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{flex:0 0 38px;display:flex;align-items:center;justify-content:center}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{flex:1;transition:.3s;max-width:0;overflow:hidden;white-space:nowrap}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%]{width:0}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:none}}.sidebar.expanded[_ngcontent-%COMP%]{width:210px}@media (max-width: 767px){.sidebar.expanded[_ngcontent-%COMP%]{width:210px}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:block}}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{max-width:150px;padding-left:10px}.hamburger-icon[_ngcontent-%COMP%]{margin:-7px 0 0 25px}@media (min-width: 768px){.hb-logo-text[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px}.sidebar.expanded[_ngcontent-%COMP%] .hb-logo-text[_ngcontent-%COMP%]{opacity:1;left:55px;transition:.3s}.sidebar[_ngcontent-%COMP%]:not(.expanded) .hb-logo-text[_ngcontent-%COMP%]{opacity:0;left:40px;transition:.3s}.hb-logo-text-mobile[_ngcontent-%COMP%], .hamburger-icon[_ngcontent-%COMP%]{display:none!important}}@media (max-width: 767px){.hb-logo-text[_ngcontent-%COMP%]{display:none!important}.hb-logo-text-mobile[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px;opacity:1;left:55px}.hamburger-icon[_ngcontent-%COMP%]{position:absolute;right:10px;top:28px;width:30px;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.5s ease-in-out;-moz-transition:.5s ease-in-out;-o-transition:.5s ease-in-out;transition:.5s ease-in-out;cursor:pointer}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;position:absolute;height:2px;width:100%;background-color:#fff;border-radius:9px;opacity:1;left:0;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.25s ease-in-out;-moz-transition:.25s ease-in-out;-o-transition:.25s ease-in-out;transition:.25s ease-in-out}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:0}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2), .hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){top:10px}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:20px}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:10px;width:0;left:50%}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:10px;width:0;left:50%}}"]})}return i})();var be=i=>({sidebarExpanded:i}),He=(()=>{class i{$auth=c($);$modal=c(B);$router=c(T);$settings=c(L);$translate=c(M);$ws=c(R);sidebarExpanded=!1;io;ngOnInit(){this.io=this.$ws.connectToNamespace("app"),this.io.socket.on("reconnect",()=>{this.$auth.checkToken()}),this.compareServerUiVersion()}compareServerUiVersion(){return z(this,null,function*(){if(this.$settings.settingsLoaded||(yield A(this.$settings.onSettingsLoaded)),(0,Q.lt)(this.$settings.uiVersion,P.serverTarget)){console.log(`Server restart required. UI Version: ${P.serverTarget} - Server Version: ${this.$settings.uiVersion} `);let e=this.$modal.open(H,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("platform.version.service_restart_required"),e.componentInstance.message=this.$translate.instant("platform.version.restart_required",{serverVersion:this.$settings.uiVersion,uiVersion:P.serverTarget}),e.componentInstance.confirmButtonLabel=this.$translate.instant("menu.tooltip_restart"),e.componentInstance.faIconClass="fas fa-fw-power-off",e.result.then(()=>{this.$router.navigate(["/restart"])}).catch(()=>{})}})}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-layout"]],decls:3,vars:4,consts:[[3,"isExpanded"],[1,"content","px-3","p-md-4",3,"ngClass"]],template:function(s,t){s&1&&(p(0,"app-sidebar",0),n(1,"div",1),p(2,"router-outlet"),a()),s&2&&(m("isExpanded",t.sidebarExpanded),o(),m("ngClass",k(2,be,t.sidebarExpanded)))},dependencies:[J,V,N],styles:[".content[_ngcontent-%COMP%]{margin-left:60px;transition:.3s;height:100%}@media (max-width: 767px){.content[_ngcontent-%COMP%]{margin-left:0;padding-top:85px!important}}@media (min-width: 768px){.content[_ngcontent-%COMP%]{height:100%}}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return i})();export{He as LayoutComponent};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-6RX2OQ7H.js";import"./chunk-ZT23DWNL.js";import"./chunk-6TCHCTXZ.js";import"./chunk-7QX6LSXE.js";import"./chunk-WTHM7H5Y.js";import"./chunk-7EUQWCP5.js";import"./chunk-WNWWUCCZ.js";import"./chunk-JJI3SJVE.js";import"./chunk-CCUID66K.js";import"./chunk-QE7DO6J3.js";import"./chunk-BKUGARB4.js";import"./chunk-BPMSJ2VF.js";import"./chunk-WHJOLAED.js";import"./chunk-JZZQRLNW.js";import"./chunk-KQJ7ONUG.js";import"./chunk-ORPWYWCL.js";import"./chunk-QHPDGSZ6.js";import"./chunk-B26OUBKR.js";import"./chunk-NZNNTHFQ.js";import"./chunk-3L47WOJW.js";import"./chunk-ZDL5FMDD.js";import"./chunk-JEWVZOEL.js";import"./chunk-UG5DK2RQ.js";import"./chunk-3IX3CLER.js";import"./chunk-TXOB7R5K.js";export{a as PluginsComponent};
@@ -1 +1 @@
1
- import{a as _,b as D}from"./chunk-BA5K2UHP.js";import{a as l,b as S}from"./chunk-NFE4RXTM.js";import{f as x}from"./chunk-UG5DK2RQ.js";import{C as v,Sc as I,g as O,h as a,ha as h,ia as E,ka as y,ma as c,na as f,r as p,sb as j,w as d,x as T,z as w}from"./chunk-TXOB7R5K.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)(c(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)(c(g),c(m),c(I))},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)(c(r,12))},r.\u0275mod=j({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(l.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(l.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(l.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(l.jwt.tokenKey);e&&this.validateToken(e)})}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(l.jwt.tokenKey),this.token=null,!1}}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())}})}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))}}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)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{m as a,F as b,q as c};
1
+ import{a as _,b as D}from"./chunk-ZDL5FMDD.js";import{a as l,b as S}from"./chunk-JEWVZOEL.js";import{f as x}from"./chunk-UG5DK2RQ.js";import{C as v,Sc as I,g as O,h as a,ha as h,ia as E,ka as y,ma as c,na as f,r as p,sb as j,w as d,x as T,z as w}from"./chunk-TXOB7R5K.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)(c(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)(c(g),c(m),c(I))},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)(c(r,12))},r.\u0275mod=j({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(l.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(l.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(l.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(l.jwt.tokenKey);e&&this.validateToken(e)})}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(l.jwt.tokenKey),this.token=null,!1}}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())}})}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))}}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)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{m as a,F as b,q as c};
@@ -1 +1 @@
1
- import{d as s}from"./chunk-NZNNTHFQ.js";import{c as i}from"./chunk-74NKPNWY.js";import{j as o}from"./chunk-NFE4RXTM.js";import{a}from"./chunk-3IX3CLER.js";import{ha as e,na as r}from"./chunk-TXOB7R5K.js";var v=(()=>{class t{$auth=r(i);$router=r(s);$translate=r(a);$toastr=r(o);canActivate(){return this.$auth.user&&this.$auth.user.admin?!0:(this.$toastr.error(this.$translate.instant("toast.no_auth"),this.$translate.instant("toast.title_error")),this.$router.navigate(["/"]),!1)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=e({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{v as a};
1
+ import{d as s}from"./chunk-NZNNTHFQ.js";import{c as i}from"./chunk-3L47WOJW.js";import{j as o}from"./chunk-JEWVZOEL.js";import{a}from"./chunk-3IX3CLER.js";import{ha as e,na as r}from"./chunk-TXOB7R5K.js";var v=(()=>{class t{$auth=r(i);$router=r(s);$translate=r(a);$toastr=r(o);canActivate(){return this.$auth.user&&this.$auth.user.admin?!0:(this.$toastr.error(this.$translate.instant("toast.no_auth"),this.$translate.instant("toast.title_error")),this.$router.navigate(["/"]),!1)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=e({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{v as a};
@@ -1 +1 @@
1
- import{a as f,b as l}from"./chunk-JJVJJXVF.js";import{a as d}from"./chunk-YOXJTM5X.js";import{f as p}from"./chunk-ILFPJEYT.js";import"./chunk-WNWWUCCZ.js";import"./chunk-JZZQRLNW.js";import{q as c}from"./chunk-ORPWYWCL.js";import{y as n}from"./chunk-QHPDGSZ6.js";import"./chunk-HATYIWAA.js";import{g as i}from"./chunk-NZNNTHFQ.js";import"./chunk-74NKPNWY.js";import"./chunk-BA5K2UHP.js";import"./chunk-NFE4RXTM.js";import"./chunk-UG5DK2RQ.js";import{c as s}from"./chunk-3IX3CLER.js";import{ia as r,md as m,sb as e}from"./chunk-TXOB7R5K.js";var g=[{path:"",loadComponent:()=>import("./chunk-TVXFXZCH.js").then(o=>o.AccessoriesComponent)}],u=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=e({type:o});static \u0275inj=r({imports:[i.forChild(g),i]})}return o})();var H=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=e({type:o});static \u0275inj=r({imports:[m,n,c,p,s.forChild(),d,u,l,f]})}return o})();export{H as AccessoriesModule};
1
+ import{a as f,b as l}from"./chunk-SJ47BDIK.js";import{a as d}from"./chunk-HFNV47WV.js";import{f as p}from"./chunk-XIR274W7.js";import"./chunk-WNWWUCCZ.js";import"./chunk-JZZQRLNW.js";import{q as c}from"./chunk-ORPWYWCL.js";import{y as n}from"./chunk-QHPDGSZ6.js";import"./chunk-B26OUBKR.js";import{g as i}from"./chunk-NZNNTHFQ.js";import"./chunk-3L47WOJW.js";import"./chunk-ZDL5FMDD.js";import"./chunk-JEWVZOEL.js";import"./chunk-UG5DK2RQ.js";import{c as s}from"./chunk-3IX3CLER.js";import{ia as r,md as m,sb as e}from"./chunk-TXOB7R5K.js";var g=[{path:"",loadComponent:()=>import("./chunk-GXJIM4DP.js").then(o=>o.AccessoriesComponent)}],u=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=e({type:o});static \u0275inj=r({imports:[i.forChild(g),i]})}return o})();var H=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=e({type:o});static \u0275inj=r({imports:[m,n,c,p,s.forChild(),d,u,l,f]})}return o})();export{H as AccessoriesModule};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-24XVRNKR.js";import"./chunk-7EUQWCP5.js";import"./chunk-JZZQRLNW.js";import"./chunk-QHPDGSZ6.js";import"./chunk-NZNNTHFQ.js";import"./chunk-ZDL5FMDD.js";import"./chunk-JEWVZOEL.js";import"./chunk-UG5DK2RQ.js";import"./chunk-3IX3CLER.js";import"./chunk-TXOB7R5K.js";export{a as StartupScriptComponent};
@@ -1 +1 @@
1
- import{o as V}from"./chunk-ORPWYWCL.js";import{d as O}from"./chunk-NZNNTHFQ.js";import{b as P}from"./chunk-BA5K2UHP.js";import{b as k,j as T}from"./chunk-NFE4RXTM.js";import{a as y,b as $}from"./chunk-3IX3CLER.js";import{$b as v,Bc as a,Cc as s,Kb as g,Mb as C,Rb as f,Wb as o,Xb as r,Yb as h,cc as m,dc as b,ib as i,na as c,nc as l,oc as S,pc as d,rb as w,xa as u,ya as _}from"./chunk-TXOB7R5K.js";function B(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.restartServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_restart_server")," "))}function I(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.shutdownServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_shutdown_server")," "))}function H(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.dockerRestartContainer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.docker.restart_container")," "))}var G=(()=>{class t{$api=c(k);$router=c(O);$settings=c(P);$toastr=c(T);$translate=c(y);restartHomebridge(){this.$router.navigate(["/restart"])}restartHomebridgeService(){this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>{this.$router.navigate(["/restart"])},error:n=>{console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error"))}})}restartServer(){this.$router.navigate(["/platform-tools/linux/restart-server"])}shutdownServer(){this.$router.navigate(["/platform-tools/linux/shutdown-server"])}dockerRestartContainer(){this.$router.navigate(["/platform-tools/docker/restart-container"])}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=w({type:t,selectors:[["ng-component"]],decls:19,vars:15,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"w-100","text-center","my-5"],["type","button",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click"],["type","button","container","body","openDelay","150","triggers","hover",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click","ngbTooltip"]],template:function(p,e){p&1&&(o(0,"div",0)(1,"h3",1),l(2),a(3,"translate"),r()(),o(4,"div",2)(5,"div",3),h(6,"i",4),r(),o(7,"p",5)(8,"button",6),m("click",function(){return e.restartHomebridge()}),l(9),a(10,"translate"),r()(),o(11,"p",5)(12,"button",7),a(13,"translate"),m("click",function(){return e.restartHomebridgeService()}),l(14),a(15,"translate"),r()(),g(16,B,4,3,"p",5)(17,I,4,3,"p",5)(18,H,4,3,"p",5),r()),p&2&&(i(2),S(s(3,7,"menu.restart.title")),i(7),d(" ",s(10,9,"menu.hbrestart.confirm_hb")," "),i(3),C("ngbTooltip",s(13,11,"reset.force_restart_hb_help_text")),i(2),d(" ",s(15,13,"menu.hbrestart.confirm_ui")," "),i(2),f(e.$settings.env.canShutdownRestartHost?16:-1),i(),f(e.$settings.env.canShutdownRestartHost?17:-1),i(),f(e.$settings.env.runningInDocker?18:-1))},dependencies:[V,$],encapsulation:2})}return t})();export{G as a};
1
+ import{o as V}from"./chunk-ORPWYWCL.js";import{d as O}from"./chunk-NZNNTHFQ.js";import{b as P}from"./chunk-ZDL5FMDD.js";import{b as k,j as T}from"./chunk-JEWVZOEL.js";import{a as y,b as $}from"./chunk-3IX3CLER.js";import{$b as v,Bc as a,Cc as s,Kb as g,Mb as C,Rb as f,Wb as o,Xb as r,Yb as h,cc as m,dc as b,ib as i,na as c,nc as l,oc as S,pc as d,rb as w,xa as u,ya as _}from"./chunk-TXOB7R5K.js";function B(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.restartServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_restart_server")," "))}function I(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.shutdownServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_shutdown_server")," "))}function H(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.dockerRestartContainer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.docker.restart_container")," "))}var G=(()=>{class t{$api=c(k);$router=c(O);$settings=c(P);$toastr=c(T);$translate=c(y);restartHomebridge(){this.$router.navigate(["/restart"])}restartHomebridgeService(){this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>{this.$router.navigate(["/restart"])},error:n=>{console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error"))}})}restartServer(){this.$router.navigate(["/platform-tools/linux/restart-server"])}shutdownServer(){this.$router.navigate(["/platform-tools/linux/shutdown-server"])}dockerRestartContainer(){this.$router.navigate(["/platform-tools/docker/restart-container"])}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=w({type:t,selectors:[["ng-component"]],decls:19,vars:15,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"w-100","text-center","my-5"],["type","button",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click"],["type","button","container","body","openDelay","150","triggers","hover",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click","ngbTooltip"]],template:function(p,e){p&1&&(o(0,"div",0)(1,"h3",1),l(2),a(3,"translate"),r()(),o(4,"div",2)(5,"div",3),h(6,"i",4),r(),o(7,"p",5)(8,"button",6),m("click",function(){return e.restartHomebridge()}),l(9),a(10,"translate"),r()(),o(11,"p",5)(12,"button",7),a(13,"translate"),m("click",function(){return e.restartHomebridgeService()}),l(14),a(15,"translate"),r()(),g(16,B,4,3,"p",5)(17,I,4,3,"p",5)(18,H,4,3,"p",5),r()),p&2&&(i(2),S(s(3,7,"menu.restart.title")),i(7),d(" ",s(10,9,"menu.hbrestart.confirm_hb")," "),i(3),C("ngbTooltip",s(13,11,"reset.force_restart_hb_help_text")),i(2),d(" ",s(15,13,"menu.hbrestart.confirm_ui")," "),i(2),f(e.$settings.env.canShutdownRestartHost?16:-1),i(),f(e.$settings.env.canShutdownRestartHost?17:-1),i(),f(e.$settings.env.runningInDocker?18:-1))},dependencies:[V,$],encapsulation:2})}return t})();export{G as a};
@@ -1 +1 @@
1
- import{c as Q,d as x,e as z,f as D,g as H,j as w,m as j,p as A,q as W,w as U,y as J,z as K}from"./chunk-QHPDGSZ6.js";import{d as G}from"./chunk-NZNNTHFQ.js";import{c as q}from"./chunk-74NKPNWY.js";import{b as T}from"./chunk-BA5K2UHP.js";import{a as P}from"./chunk-NFE4RXTM.js";import{b as O}from"./chunk-3IX3CLER.js";import{Bc as l,Cc as p,Gb as v,Kb as S,M as k,Mb as m,Rb as c,Wb as a,Xb as r,Yb as h,ad as R,cc as $,dc as I,gd as N,h as y,ib as i,kc as C,lc as L,na as g,nc as s,oc as d,pc as B,rb as M,w as V,xc as f}from"./chunk-TXOB7R5K.js";var X=["password"],Y=["username"],Z=["otp"],ee=e=>({background:e}),F=e=>({"is-invalid":e});function te(e,_){if(e&1&&(a(0,"div")(1,"div",10),h(2,"i",11)(3,"input",12,0),a(5,"label",13),s(6),l(7,"translate"),r()(),a(8,"div",10),h(9,"i",14)(10,"input",15,1),a(12,"label",16),s(13),l(14,"translate"),r()()()),e&2){let t=I();i(3),m("ngClass",f(8,F,t.form.controls.username.dirty&&t.form.controls.username.errors)),i(3),d(p(7,4,"login.label_username")),i(4),m("ngClass",f(10,F,t.form.controls.password.dirty&&t.form.controls.password.errors)),i(3),d(p(14,6,"login.label_password"))}}function ne(e,_){if(e&1&&(a(0,"div")(1,"p",7),s(2),l(3,"translate"),r(),a(4,"div",10),h(5,"i",17)(6,"input",18,2),a(8,"label",19),s(9),l(10,"translate"),r()()()),e&2){let t=I();i(2),d(p(3,3,"users.setup_2fa_enter_code")),i(4),m("ngClass",f(7,F,t.form.controls.otp.dirty&&t.form.controls.otp.errors)),i(3),d(p(10,5,"login.label_2fa_code"))}}function ie(e,_){e&1&&(a(0,"p",8)(1,"small"),s(2),l(3,"translate"),r()()),e&2&&(i(2),d(p(3,1,"login.invalid_credentials")))}function oe(e,_){e&1&&(a(0,"p",8)(1,"small"),s(2),l(3,"translate"),r()()),e&2&&(i(2),d(p(3,1,"login.message_invalid_2fa_code")))}var Ce=(()=>{class e{$auth=g(q);$router=g(G);$settings=g(T);passwordInput=v("password");usernameInput=v("username");otpInput=v("otp");form;backgroundStyle;invalidCredentials=!1;invalid2faCode=!1;twoFactorCodeRequired=!1;inProgress=!1;targetRoute;ngOnInit(){this.form=new H({username:new w(""),password:new w("")}),this.form.valueChanges.pipe(k(500)).subscribe(t=>{var n;let o=(n=this.passwordInput())==null?void 0:n.nativeElement.value;o&&o!==t.password&&this.form.controls.password.setValue(o)}),this.targetRoute=window.sessionStorage.getItem("target_route")||"",this.setBackground()}setBackground(){return y(this,null,function*(){if(this.$settings.settingsLoaded||(yield V(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash){let t=this.$settings.env.customWallpaperHash?`${P.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`:"/assets/snapshot.jpg";this.backgroundStyle=`url('${t}') center/cover`}})}onSubmit(){return y(this,null,function*(){var n,b,E;this.invalidCredentials=!1,this.invalid2faCode=!1,this.inProgress=!0;let t=(n=this.passwordInput())==null?void 0:n.nativeElement.value;t&&t!==this.form.get("password").value&&this.form.controls.password.setValue(t);let o=(b=this.usernameInput())==null?void 0:b.nativeElement.value;if(o&&o!==this.form.get("username").value&&this.form.controls.username.setValue(o),this.twoFactorCodeRequired){let u=(E=this.otpInput())==null?void 0:E.nativeElement.value;u&&u!==this.form.get("otp").value&&this.form.controls.username.setValue(u)}yield this.$auth.login(this.form.getRawValue()).then(()=>{this.$router.navigateByUrl(this.targetRoute),window.sessionStorage.removeItem("target_route")}).catch(u=>{u.status===412?(this.form.controls.otp?(this.form.controls.otp.setErrors(["Invalid Code"]),this.invalid2faCode=!0):this.form.addControl("otp",new w("",[x.required,x.minLength(6),x.maxLength(6)])),this.twoFactorCodeRequired=!0,setTimeout(()=>{document.getElementById("form-ota").focus()},100)):this.invalidCredentials=!0}),this.inProgress=!1})}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=M({type:e,selectors:[["ng-component"]],viewQuery:function(o,n){o&1&&(C(n.passwordInput,X,5),C(n.usernameInput,Y,5),C(n.otpInput,Z,5)),o&2&&L(3)},decls:13,vars:12,consts:[["username",""],["password",""],["otp",""],[1,"login-container","d-flex","align-items-center","justify-content-center",3,"ngStyle"],[1,"card","card-body","mx-2","login-card"],["novalidate","",3,"ngSubmit","formGroup"],[1,"h4","text-center","mb-4"],[1,"text-center"],[1,"red-text"],["tabindex","3","type","submit",1,"btn","btn-primary",3,"disabled"],[1,"md-form"],[1,"fas","fa-fw","fa-user","prefix","grey-text"],["formControlName","username","type","text","id","form-username","autofocus","","autocomplete","username","autocapitalize","none","tabindex","1",1,"form-control","px-0",3,"ngClass"],["for","form-username"],[1,"fas","fa-fw","fa-lock","prefix","grey-text"],["formControlName","password","type","password","id","form-pass","autocomplete","current-password","tabindex","2",1,"form-control","px-0",3,"ngClass"],["for","form-pass"],[1,"fas","fa-fw","fa-key","prefix","grey-text"],["formControlName","otp","type","text","id","form-ota","autocomplete","one-time-code","autocapitalize","none","inputmode","numeric","pattern","[0-9]*","tabindex","1",1,"form-control","px-0",3,"ngClass"],["for","form-ota"]],template:function(o,n){o&1&&(a(0,"div",3)(1,"div",4)(2,"form",5),$("ngSubmit",function(){return n.onSubmit()}),a(3,"p",6),s(4,"Homebridge"),r(),S(5,te,15,12,"div")(6,ne,11,9,"div"),a(7,"div",7),S(8,ie,4,3,"p",8)(9,oe,4,3,"p",8),a(10,"button",9),s(11),l(12,"translate"),r()()()()()),o&2&&(m("ngStyle",f(10,ee,n.backgroundStyle)),i(2),m("formGroup",n.form),i(3),c(n.twoFactorCodeRequired?-1:5),i(),c(n.twoFactorCodeRequired?6:-1),i(2),c(n.invalidCredentials?8:-1),i(),c(n.invalid2faCode?9:-1),i(),m("disabled",n.form.invalid),i(),B(" ",p(12,8,"login.button_login")," "))},dependencies:[N,J,j,Q,z,D,U,K,A,W,R,O],styles:[".login-container[_ngcontent-%COMP%]{background-color:#f4f4f4;background-size:cover;position:absolute;top:0;bottom:0;right:0;left:0}.login-card[_ngcontent-%COMP%]{max-width:500px;background-color:#ffffffe6}.login-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (min-height: 800px){.login-card[_ngcontent-%COMP%]{margin-bottom:12em}}.login-logo[_ngcontent-%COMP%]{position:absolute;top:-35%;z-index:2000;max-width:450px}@media screen and (max-width: 450px){.login-logo[_ngcontent-%COMP%]{max-width:320px;top:-25%}}@media screen and (max-width: 320px){.login-logo[_ngcontent-%COMP%]{max-width:280px}}@media screen and (max-height: 450px){.login-logo[_ngcontent-%COMP%]{display:none}}"]})}return e})();export{Ce as a};
1
+ import{c as Q,d as x,e as z,f as D,g as H,j as w,m as j,p as A,q as W,w as U,y as J,z as K}from"./chunk-QHPDGSZ6.js";import{d as G}from"./chunk-NZNNTHFQ.js";import{c as q}from"./chunk-3L47WOJW.js";import{b as T}from"./chunk-ZDL5FMDD.js";import{a as P}from"./chunk-JEWVZOEL.js";import{b as O}from"./chunk-3IX3CLER.js";import{Bc as l,Cc as p,Gb as v,Kb as S,M as k,Mb as m,Rb as c,Wb as a,Xb as r,Yb as h,ad as R,cc as $,dc as I,gd as N,h as y,ib as i,kc as C,lc as L,na as g,nc as s,oc as d,pc as B,rb as M,w as V,xc as f}from"./chunk-TXOB7R5K.js";var X=["password"],Y=["username"],Z=["otp"],ee=e=>({background:e}),F=e=>({"is-invalid":e});function te(e,_){if(e&1&&(a(0,"div")(1,"div",10),h(2,"i",11)(3,"input",12,0),a(5,"label",13),s(6),l(7,"translate"),r()(),a(8,"div",10),h(9,"i",14)(10,"input",15,1),a(12,"label",16),s(13),l(14,"translate"),r()()()),e&2){let t=I();i(3),m("ngClass",f(8,F,t.form.controls.username.dirty&&t.form.controls.username.errors)),i(3),d(p(7,4,"login.label_username")),i(4),m("ngClass",f(10,F,t.form.controls.password.dirty&&t.form.controls.password.errors)),i(3),d(p(14,6,"login.label_password"))}}function ne(e,_){if(e&1&&(a(0,"div")(1,"p",7),s(2),l(3,"translate"),r(),a(4,"div",10),h(5,"i",17)(6,"input",18,2),a(8,"label",19),s(9),l(10,"translate"),r()()()),e&2){let t=I();i(2),d(p(3,3,"users.setup_2fa_enter_code")),i(4),m("ngClass",f(7,F,t.form.controls.otp.dirty&&t.form.controls.otp.errors)),i(3),d(p(10,5,"login.label_2fa_code"))}}function ie(e,_){e&1&&(a(0,"p",8)(1,"small"),s(2),l(3,"translate"),r()()),e&2&&(i(2),d(p(3,1,"login.invalid_credentials")))}function oe(e,_){e&1&&(a(0,"p",8)(1,"small"),s(2),l(3,"translate"),r()()),e&2&&(i(2),d(p(3,1,"login.message_invalid_2fa_code")))}var Ce=(()=>{class e{$auth=g(q);$router=g(G);$settings=g(T);passwordInput=v("password");usernameInput=v("username");otpInput=v("otp");form;backgroundStyle;invalidCredentials=!1;invalid2faCode=!1;twoFactorCodeRequired=!1;inProgress=!1;targetRoute;ngOnInit(){this.form=new H({username:new w(""),password:new w("")}),this.form.valueChanges.pipe(k(500)).subscribe(t=>{var n;let o=(n=this.passwordInput())==null?void 0:n.nativeElement.value;o&&o!==t.password&&this.form.controls.password.setValue(o)}),this.targetRoute=window.sessionStorage.getItem("target_route")||"",this.setBackground()}setBackground(){return y(this,null,function*(){if(this.$settings.settingsLoaded||(yield V(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash){let t=this.$settings.env.customWallpaperHash?`${P.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`:"/assets/snapshot.jpg";this.backgroundStyle=`url('${t}') center/cover`}})}onSubmit(){return y(this,null,function*(){var n,b,E;this.invalidCredentials=!1,this.invalid2faCode=!1,this.inProgress=!0;let t=(n=this.passwordInput())==null?void 0:n.nativeElement.value;t&&t!==this.form.get("password").value&&this.form.controls.password.setValue(t);let o=(b=this.usernameInput())==null?void 0:b.nativeElement.value;if(o&&o!==this.form.get("username").value&&this.form.controls.username.setValue(o),this.twoFactorCodeRequired){let u=(E=this.otpInput())==null?void 0:E.nativeElement.value;u&&u!==this.form.get("otp").value&&this.form.controls.username.setValue(u)}yield this.$auth.login(this.form.getRawValue()).then(()=>{this.$router.navigateByUrl(this.targetRoute),window.sessionStorage.removeItem("target_route")}).catch(u=>{u.status===412?(this.form.controls.otp?(this.form.controls.otp.setErrors(["Invalid Code"]),this.invalid2faCode=!0):this.form.addControl("otp",new w("",[x.required,x.minLength(6),x.maxLength(6)])),this.twoFactorCodeRequired=!0,setTimeout(()=>{document.getElementById("form-ota").focus()},100)):this.invalidCredentials=!0}),this.inProgress=!1})}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=M({type:e,selectors:[["ng-component"]],viewQuery:function(o,n){o&1&&(C(n.passwordInput,X,5),C(n.usernameInput,Y,5),C(n.otpInput,Z,5)),o&2&&L(3)},decls:13,vars:12,consts:[["username",""],["password",""],["otp",""],[1,"login-container","d-flex","align-items-center","justify-content-center",3,"ngStyle"],[1,"card","card-body","mx-2","login-card"],["novalidate","",3,"ngSubmit","formGroup"],[1,"h4","text-center","mb-4"],[1,"text-center"],[1,"red-text"],["tabindex","3","type","submit",1,"btn","btn-primary",3,"disabled"],[1,"md-form"],[1,"fas","fa-fw","fa-user","prefix","grey-text"],["formControlName","username","type","text","id","form-username","autofocus","","autocomplete","username","autocapitalize","none","tabindex","1",1,"form-control","px-0",3,"ngClass"],["for","form-username"],[1,"fas","fa-fw","fa-lock","prefix","grey-text"],["formControlName","password","type","password","id","form-pass","autocomplete","current-password","tabindex","2",1,"form-control","px-0",3,"ngClass"],["for","form-pass"],[1,"fas","fa-fw","fa-key","prefix","grey-text"],["formControlName","otp","type","text","id","form-ota","autocomplete","one-time-code","autocapitalize","none","inputmode","numeric","pattern","[0-9]*","tabindex","1",1,"form-control","px-0",3,"ngClass"],["for","form-ota"]],template:function(o,n){o&1&&(a(0,"div",3)(1,"div",4)(2,"form",5),$("ngSubmit",function(){return n.onSubmit()}),a(3,"p",6),s(4,"Homebridge"),r(),S(5,te,15,12,"div")(6,ne,11,9,"div"),a(7,"div",7),S(8,ie,4,3,"p",8)(9,oe,4,3,"p",8),a(10,"button",9),s(11),l(12,"translate"),r()()()()()),o&2&&(m("ngStyle",f(10,ee,n.backgroundStyle)),i(2),m("formGroup",n.form),i(3),c(n.twoFactorCodeRequired?-1:5),i(),c(n.twoFactorCodeRequired?6:-1),i(2),c(n.invalidCredentials?8:-1),i(),c(n.invalid2faCode?9:-1),i(),m("disabled",n.form.invalid),i(),B(" ",p(12,8,"login.button_login")," "))},dependencies:[N,J,j,Q,z,D,U,K,A,W,R,O],styles:[".login-container[_ngcontent-%COMP%]{background-color:#f4f4f4;background-size:cover;position:absolute;top:0;bottom:0;right:0;left:0}.login-card[_ngcontent-%COMP%]{max-width:500px;background-color:#ffffffe6}.login-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (min-height: 800px){.login-card[_ngcontent-%COMP%]{margin-bottom:12em}}.login-logo[_ngcontent-%COMP%]{position:absolute;top:-35%;z-index:2000;max-width:450px}@media screen and (max-width: 450px){.login-logo[_ngcontent-%COMP%]{max-width:320px;top:-25%}}@media screen and (max-width: 320px){.login-logo[_ngcontent-%COMP%]{max-width:280px}}@media screen and (max-height: 450px){.login-logo[_ngcontent-%COMP%]{display:none}}"]})}return e})();export{Ce as a};