homebridge-config-ui-x 5.4.2-beta.4 → 5.4.2-beta.40

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 (219) hide show
  1. package/CHANGELOG.md +36 -13
  2. package/dist/bin/hb-service.js +1 -1
  3. package/dist/bin/hb-service.js.map +1 -1
  4. package/dist/core/auth/auth.controller.d.ts +2 -0
  5. package/dist/core/config/config.interfaces.d.ts +64 -0
  6. package/dist/core/config/config.interfaces.js +3 -0
  7. package/dist/core/config/config.interfaces.js.map +1 -0
  8. package/dist/core/config/config.service.d.ts +7 -22
  9. package/dist/core/config/config.service.js +7 -2
  10. package/dist/core/config/config.service.js.map +1 -1
  11. package/dist/core/config/config.startup.d.ts +2 -12
  12. package/dist/core/config/config.startup.js +11 -3
  13. package/dist/core/config/config.startup.js.map +1 -1
  14. package/dist/core/spa/spa-html.service.d.ts +5 -0
  15. package/dist/core/spa/spa-html.service.js +38 -0
  16. package/dist/core/spa/spa-html.service.js.map +1 -0
  17. package/dist/core/spa/spa.filter.d.ts +3 -0
  18. package/dist/core/spa/spa.filter.js +22 -2
  19. package/dist/core/spa/spa.filter.js.map +1 -1
  20. package/dist/globalDefaults.js +3 -0
  21. package/dist/globalDefaults.js.map +1 -1
  22. package/dist/main.js +18 -3
  23. package/dist/main.js.map +1 -1
  24. package/dist/modules/accessories/accessories.service.js +5 -1
  25. package/dist/modules/accessories/accessories.service.js.map +1 -1
  26. package/dist/modules/backup/backup.service.js +4 -1
  27. package/dist/modules/backup/backup.service.js.map +1 -1
  28. package/dist/modules/config-editor/config-editor.controller.d.ts +3 -3
  29. package/dist/modules/config-editor/config-editor.service.d.ts +3 -2
  30. package/dist/modules/config-editor/config-editor.service.js +38 -15
  31. package/dist/modules/config-editor/config-editor.service.js.map +1 -1
  32. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.d.ts +1 -1
  33. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js +2 -1
  34. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js.map +1 -1
  35. package/dist/modules/log/log.gateway.d.ts +1 -1
  36. package/dist/modules/log/log.interfaces.d.ts +4 -0
  37. package/dist/modules/log/log.interfaces.js +3 -0
  38. package/dist/modules/log/log.interfaces.js.map +1 -0
  39. package/dist/modules/log/log.service.d.ts +1 -4
  40. package/dist/modules/log/log.service.js.map +1 -1
  41. package/dist/modules/platform-tools/terminal/terminal.gateway.d.ts +1 -1
  42. package/dist/modules/platform-tools/terminal/terminal.interfaces.d.ts +8 -0
  43. package/dist/modules/platform-tools/terminal/terminal.interfaces.js +3 -0
  44. package/dist/modules/platform-tools/terminal/terminal.interfaces.js.map +1 -0
  45. package/dist/modules/platform-tools/terminal/terminal.service.d.ts +1 -8
  46. package/dist/modules/platform-tools/terminal/terminal.service.js.map +1 -1
  47. package/dist/modules/plugins/plugins.controller.d.ts +5 -5
  48. package/dist/modules/plugins/plugins.interfaces.d.ts +211 -0
  49. package/dist/modules/plugins/plugins.interfaces.js +3 -0
  50. package/dist/modules/plugins/plugins.interfaces.js.map +1 -0
  51. package/dist/modules/plugins/plugins.service.d.ts +2 -1
  52. package/dist/modules/plugins/plugins.service.js +33 -15
  53. package/dist/modules/plugins/plugins.service.js.map +1 -1
  54. package/dist/modules/server/server.controller.d.ts +3 -0
  55. package/dist/modules/server/server.controller.js +13 -0
  56. package/dist/modules/server/server.controller.js.map +1 -1
  57. package/dist/modules/server/server.service.js +6 -4
  58. package/dist/modules/server/server.service.js.map +1 -1
  59. package/dist/modules/status/status.controller.d.ts +2 -2
  60. package/dist/modules/status/status.gateway.d.ts +5 -5
  61. package/dist/modules/status/status.interfaces.d.ts +27 -0
  62. package/dist/modules/status/status.interfaces.js +10 -0
  63. package/dist/modules/status/status.interfaces.js.map +1 -0
  64. package/dist/modules/status/status.service.d.ts +2 -29
  65. package/dist/modules/status/status.service.js +4 -9
  66. package/dist/modules/status/status.service.js.map +1 -1
  67. package/package.json +16 -11
  68. package/public/3rdpartylicenses.txt +16 -40
  69. package/public/assets/monaco/ThirdPartyNotices.txt +448 -0
  70. package/public/assets/monaco/min/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  71. package/public/assets/monaco/min/vs/base/worker/workerMain.js +31 -0
  72. package/public/assets/monaco/min/vs/basic-languages/shell/shell.js +10 -0
  73. package/public/assets/monaco/min/vs/editor/editor.main.css +8 -0
  74. package/public/assets/monaco/min/vs/editor/editor.main.js +798 -0
  75. package/public/assets/monaco/min/vs/language/json/jsonMode.js +19 -0
  76. package/public/assets/monaco/min/vs/language/json/jsonWorker.js +42 -0
  77. package/public/assets/monaco/min/vs/loader.js +11 -0
  78. package/public/chunk-2DNOEBYN.js +1 -0
  79. package/public/chunk-32NC3IVK.js +16 -0
  80. package/public/chunk-354C3X7T.js +19 -0
  81. package/public/chunk-3G7IDMFU.js +1 -0
  82. package/public/{chunk-U6ROY5ZN.js → chunk-3YOGUN4W.js} +1 -1
  83. package/public/chunk-42EXBOPA.js +1 -0
  84. package/public/chunk-4FC5JCBA.js +1 -0
  85. package/public/{chunk-6N2SOTOL.js → chunk-4HJOARLT.js} +2 -2
  86. package/public/chunk-4QZG5IBV.js +1 -0
  87. package/public/chunk-4YMIOPY5.js +1 -0
  88. package/public/chunk-5AW36TN3.js +1 -0
  89. package/public/chunk-5BAB4FLA.js +1 -0
  90. package/public/{chunk-CQKCDD3I.js → chunk-5YEYAEII.js} +1 -1
  91. package/public/{chunk-BEYU5GMW.js → chunk-6DTD6NF3.js} +2 -2
  92. package/public/chunk-6TWUTMWM.js +40 -0
  93. package/public/{chunk-P5LYIXY6.js → chunk-A7SU4MHQ.js} +1 -1
  94. package/public/chunk-AACIDDLQ.js +9 -0
  95. package/public/chunk-BG3D2DZW.js +1 -0
  96. package/public/chunk-CWZT5DC3.js +1 -0
  97. package/public/{chunk-OPYWX2UT.js → chunk-D2HNCCB6.js} +1 -1
  98. package/public/{chunk-3DFE4GXY.js → chunk-EOXVJQVC.js} +1 -1
  99. package/public/chunk-FON7X6PI.js +1 -0
  100. package/public/chunk-FSS52C6M.js +1 -0
  101. package/public/chunk-GBKV42JT.js +1 -0
  102. package/public/chunk-GC5ZVIAR.js +1 -0
  103. package/public/chunk-HNJPAXQ5.js +1 -0
  104. package/public/{chunk-QNF5ENQG.js → chunk-HQBRFFPL.js} +1 -1
  105. package/public/chunk-I32XNZAC.js +1 -0
  106. package/public/{chunk-FVSVQWIM.js → chunk-IDS6CACH.js} +1 -1
  107. package/public/{chunk-G3CSSNW3.js → chunk-IL6JW6PB.js} +1 -1
  108. package/public/chunk-JPNMUW6S.js +1 -0
  109. package/public/{chunk-WMIMAPZH.js → chunk-KCLLEPG3.js} +1 -1
  110. package/public/chunk-NC7XPNIV.js +1 -0
  111. package/public/{chunk-DD4UIDDU.js → chunk-NHATITBP.js} +1 -1
  112. package/public/chunk-NLE7I54S.js +1 -0
  113. package/public/{chunk-E5M5VUTV.js → chunk-NNGM3PUS.js} +1 -1
  114. package/public/chunk-NW5L2FIY.js +1 -0
  115. package/public/chunk-ONSFSQPA.js +1 -0
  116. package/public/{chunk-ZVJPMFYX.js → chunk-PHIVEHY2.js} +1 -1
  117. package/public/chunk-PRNMO4E2.js +5 -0
  118. package/public/chunk-QKQFWEQY.js +3 -0
  119. package/public/{chunk-NFD7N6TO.js → chunk-QTUF3RXY.js} +1 -1
  120. package/public/{chunk-JWSIULJX.js → chunk-R6ROHI5E.js} +1 -1
  121. package/public/chunk-R7VTFW66.js +1 -0
  122. package/public/{chunk-WCMFALUQ.js → chunk-RJ7DGOUE.js} +1 -1
  123. package/public/chunk-RMBCZ6PE.js +1 -0
  124. package/public/chunk-RR2V2D4G.js +1 -0
  125. package/public/chunk-RTZVASBV.js +1 -0
  126. package/public/chunk-S2UVMNTQ.js +1 -0
  127. package/public/chunk-S4DTLIZU.js +1 -0
  128. package/public/{chunk-LIIIEDKB.js → chunk-SGMZN62K.js} +1 -1
  129. package/public/chunk-SLFDMPM6.js +49 -0
  130. package/public/chunk-TGMT2CPD.js +4 -0
  131. package/public/chunk-TTSDYAR7.js +1 -0
  132. package/public/chunk-TUN7H57E.js +1 -0
  133. package/public/chunk-UOOMSN4Q.js +1 -0
  134. package/public/chunk-USGWBGHR.js +1 -0
  135. package/public/{chunk-LOC52TG7.js → chunk-UWI7PQIM.js} +1 -1
  136. package/public/chunk-VCWEPDEP.js +1 -0
  137. package/public/chunk-VIHCQCPQ.js +1 -0
  138. package/public/{chunk-5KZJLK3B.js → chunk-VOI666RM.js} +4 -4
  139. package/public/chunk-VSX4HMXR.js +1 -0
  140. package/public/chunk-W5NNVVIP.js +1 -0
  141. package/public/chunk-WALOI7QT.js +1 -0
  142. package/public/chunk-XEMTN2GZ.js +1 -0
  143. package/public/chunk-XLPPT7E7.js +4 -0
  144. package/public/chunk-YIXIXCO4.js +2 -0
  145. package/public/chunk-ZX7APSEP.js +1 -0
  146. package/public/index.html +2 -2
  147. package/public/main-WMR4TUCJ.js +1 -0
  148. package/public/polyfills-5KWHJ7II.js +2 -0
  149. package/public/styles-643WFJRY.css +1 -0
  150. package/config.schema.json +0 -590
  151. package/public/assets/hap-icons/light-bulb.svg +0 -25
  152. package/public/assets/hap-icons/outlet.svg +0 -25
  153. package/public/assets/hap-icons/switch.svg +0 -25
  154. package/public/assets/hap-icons/unknown.svg +0 -25
  155. package/public/assets/monaco-0.21.3/README.md +0 -96
  156. package/public/assets/monaco-0.21.3/ThirdPartyNotices.txt +0 -283
  157. package/public/assets/monaco-0.21.3/min/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  158. package/public/assets/monaco-0.21.3/min/vs/base/worker/workerMain.js +0 -160
  159. package/public/assets/monaco-0.21.3/min/vs/basic-languages/shell/shell.js +0 -7
  160. package/public/assets/monaco-0.21.3/min/vs/editor/editor.main.css +0 -6
  161. package/public/assets/monaco-0.21.3/min/vs/editor/editor.main.js +0 -2368
  162. package/public/assets/monaco-0.21.3/min/vs/editor/editor.main.nls.js +0 -39
  163. package/public/assets/monaco-0.21.3/min/vs/language/json/jsonMode.js +0 -7
  164. package/public/assets/monaco-0.21.3/min/vs/language/json/jsonWorker.js +0 -7
  165. package/public/assets/monaco-0.21.3/min/vs/loader.js +0 -38
  166. package/public/assets/monaco-0.21.3/package.json +0 -38
  167. package/public/chunk-2ETJ2W67.js +0 -1
  168. package/public/chunk-2IPYU27V.js +0 -20
  169. package/public/chunk-4IS25CEL.js +0 -1
  170. package/public/chunk-4ZMTZF3W.js +0 -1
  171. package/public/chunk-5J7OMTCR.js +0 -1
  172. package/public/chunk-5KFQUVTY.js +0 -1
  173. package/public/chunk-6FXNHKMA.js +0 -1
  174. package/public/chunk-6MRWZBRB.js +0 -1
  175. package/public/chunk-A76CGVLE.js +0 -1
  176. package/public/chunk-ABEVAIAL.js +0 -1
  177. package/public/chunk-ABOVGRBT.js +0 -1
  178. package/public/chunk-AIKHSPDS.js +0 -1
  179. package/public/chunk-CV5P3VHY.js +0 -1
  180. package/public/chunk-D32NWYHS.js +0 -1
  181. package/public/chunk-EUPINTFY.js +0 -3
  182. package/public/chunk-EUQRX7LQ.js +0 -1
  183. package/public/chunk-H6CYTQYR.js +0 -1
  184. package/public/chunk-M5HYAGSQ.js +0 -1
  185. package/public/chunk-MCRAOLRB.js +0 -1
  186. package/public/chunk-NRU4C4QO.js +0 -1
  187. package/public/chunk-NRVKNZMW.js +0 -14
  188. package/public/chunk-NVSHJ7LK.js +0 -1
  189. package/public/chunk-OIV4KXSV.js +0 -1
  190. package/public/chunk-OUS4RGQP.js +0 -1
  191. package/public/chunk-PFU546XJ.js +0 -1
  192. package/public/chunk-PMVD4FUJ.js +0 -9
  193. package/public/chunk-PP5MH7GY.js +0 -2
  194. package/public/chunk-QABGEKAZ.js +0 -2
  195. package/public/chunk-QBGF33DL.js +0 -1
  196. package/public/chunk-QK7Z3CEZ.js +0 -1
  197. package/public/chunk-RPTZSO5O.js +0 -1
  198. package/public/chunk-RT24VDZP.js +0 -1
  199. package/public/chunk-S6BASE5W.js +0 -1
  200. package/public/chunk-S6W546ZE.js +0 -4
  201. package/public/chunk-SD2QP7RK.js +0 -1
  202. package/public/chunk-SMCVOWDV.js +0 -1
  203. package/public/chunk-T3KHQZNL.js +0 -1
  204. package/public/chunk-TG5OFUMM.js +0 -1
  205. package/public/chunk-UNUGLKWP.js +0 -1
  206. package/public/chunk-UT3VB4SC.js +0 -49
  207. package/public/chunk-VWR3K52A.js +0 -1
  208. package/public/chunk-WBMAWHKA.js +0 -12
  209. package/public/chunk-XEXJIDEI.js +0 -4
  210. package/public/chunk-XWYKEZQQ.js +0 -4
  211. package/public/chunk-YERWTYFA.js +0 -1
  212. package/public/chunk-YSZKQXWK.js +0 -1
  213. package/public/chunk-ZKETDQ54.js +0 -1
  214. package/public/chunk-ZM5B4KXN.js +0 -1
  215. package/public/chunk-ZNONDSJT.js +0 -1
  216. package/public/main-MRP2WE3O.js +0 -1
  217. package/public/polyfills-WE4HA5DL.js +0 -2
  218. package/public/styles-LKRXKJ7O.css +0 -1
  219. /package/public/assets/{monaco-0.21.3 → monaco}/LICENSE +0 -0
@@ -1,2 +0,0 @@
1
- import{$ as Ze,Ab as ut,Bb as oe,Ca as _e,Cb as se,Db as Ae,H as Je,Ha as et,Ia as De,Ja as tt,Ka as J,L as Ye,Ma as Oe,Na as Se,Oa as L,Pa as U,Qa as nt,Ra as rt,S as Re,Sa as ot,Ta as st,Ua as it,Va as at,Wa as ct,Xa as k,Yc as ht,Zc as ft,a as x,bd as j,cb as Y,cd as pt,da as v,dd as mt,ea as O,fb as dt,ga as g,h as Ee,ha as ne,ja as T,k as Te,ka as h,la as w,ma as Me,oa as We,ob as re,pa as Ke,qa as qe,r as we,ub as lt,ud as yt,vd as ie,wa as M,wb as S,wd as ae,x as G,xa as Qe,ya as be,yd as gt}from"./chunk-XWYKEZQQ.js";var B=class{},z=class{},_=class r{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(t){t?typeof t=="string"?this.lazyInit=()=>{this.headers=new Map,t.split(`
2
- `).forEach(e=>{let n=e.indexOf(":");if(n>0){let o=e.slice(0,n),s=e.slice(n+1).trim();this.addHeaderEntry(o,s)}})}:typeof Headers<"u"&&t instanceof Headers?(this.headers=new Map,t.forEach((e,n)=>{this.addHeaderEntry(n,e)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(t).forEach(([e,n])=>{this.setHeaderEntries(e,n)})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();let e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof r?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){let e=new r;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof r?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){let e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if(typeof n=="string"&&(n=[n]),n.length===0)return;this.maybeSetNormalizedName(t.name,e);let o=(t.op==="a"?this.headers.get(e):void 0)||[];o.push(...n),this.headers.set(e,o);break;case"d":let s=t.value;if(!s)this.headers.delete(e),this.normalizedNames.delete(e);else{let i=this.headers.get(e);if(!i)return;i=i.filter(c=>s.indexOf(c)===-1),i.length===0?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,i)}break}}addHeaderEntry(t,e){let n=t.toLowerCase();this.maybeSetNormalizedName(t,n),this.headers.has(n)?this.headers.get(n).push(e):this.headers.set(n,[e])}setHeaderEntries(t,e){let n=(Array.isArray(e)?e:[e]).map(s=>s.toString()),o=t.toLowerCase();this.headers.set(o,n),this.maybeSetNormalizedName(t,o)}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}};var le=class{encodeKey(t){return vt(t)}encodeValue(t){return vt(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}};function Xt(r,t){let e=new Map;return r.length>0&&r.replace(/^\?/,"").split("&").forEach(o=>{let s=o.indexOf("="),[i,c]=s==-1?[t.decodeKey(o),""]:[t.decodeKey(o.slice(0,s)),t.decodeValue(o.slice(s+1))],a=e.get(i)||[];a.push(c),e.set(i,a)}),e}var Gt=/%(\d[a-f0-9])/gi,Jt={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function vt(r){return encodeURIComponent(r).replace(Gt,(t,e)=>Jt[e]??t)}function ce(r){return`${r}`}var A=class r{map;encoder;updates=null;cloneFrom=null;constructor(t={}){if(this.encoder=t.encoder||new le,t.fromString){if(t.fromObject)throw new v(2805,!1);this.map=Xt(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{let n=t.fromObject[e],o=Array.isArray(n)?n.map(ce):[ce(n)];this.map.set(e,o)})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();let e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}appendAll(t){let e=[];return Object.keys(t).forEach(n=>{let o=t[n];Array.isArray(o)?o.forEach(s=>{e.push({param:n,value:s,op:"a"})}):e.push({param:n,value:o,op:"a"})}),this.clone(e)}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{let e=this.encoder.encodeKey(t);return this.map.get(t).map(n=>e+"="+this.encoder.encodeValue(n)).join("&")}).filter(t=>t!=="").join("&")}clone(t){let e=new r({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(t),e}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":let e=(t.op==="a"?this.map.get(t.param):void 0)||[];e.push(ce(t.value)),this.map.set(t.param,e);break;case"d":if(t.value!==void 0){let n=this.map.get(t.param)||[],o=n.indexOf(ce(t.value));o!==-1&&n.splice(o,1),n.length>0?this.map.set(t.param,n):this.map.delete(t.param)}else{this.map.delete(t.param);break}}}),this.cloneFrom=this.updates=null)}};var ue=class{map=new Map;set(t,e){return this.map.set(t,e),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}has(t){return this.map.has(t)}keys(){return this.map.keys()}};function Yt(r){switch(r){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function Et(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer}function Tt(r){return typeof Blob<"u"&&r instanceof Blob}function wt(r){return typeof FormData<"u"&&r instanceof FormData}function Zt(r){return typeof URLSearchParams<"u"&&r instanceof URLSearchParams}var Z="Content-Type",he="Accept",xe="X-Request-URL",bt="text/plain",_t="application/json",Dt=`${_t}, ${bt}, */*`,F=class r{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;credentials;keepalive=!1;cache;priority;mode;redirect;responseType="json";method;params;urlWithParams;transferCache;timeout;constructor(t,e,n,o){this.url=e,this.method=t.toUpperCase();let s;if(Yt(this.method)||o?(this.body=n!==void 0?n:null,s=o):s=n,s){if(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,this.keepalive=!!s.keepalive,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params),s.priority&&(this.priority=s.priority),s.cache&&(this.cache=s.cache),s.credentials&&(this.credentials=s.credentials),typeof s.timeout=="number"){if(s.timeout<1||!Number.isInteger(s.timeout))throw new Error("");this.timeout=s.timeout}s.mode&&(this.mode=s.mode),s.redirect&&(this.redirect=s.redirect),this.transferCache=s.transferCache}if(this.headers??=new _,this.context??=new ue,!this.params)this.params=new A,this.urlWithParams=e;else{let i=this.params.toString();if(i.length===0)this.urlWithParams=e;else{let c=e.indexOf("?"),a=c===-1?"?":c<e.length-1?"&":"";this.urlWithParams=e+a+i}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||Et(this.body)||Tt(this.body)||wt(this.body)||Zt(this.body)?this.body:this.body instanceof A?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||wt(this.body)?null:Tt(this.body)?this.body.type||null:Et(this.body)?null:typeof this.body=="string"?bt:this.body instanceof A?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?_t:null}clone(t={}){let e=t.method||this.method,n=t.url||this.url,o=t.responseType||this.responseType,s=t.keepalive??this.keepalive,i=t.priority||this.priority,c=t.cache||this.cache,a=t.mode||this.mode,l=t.redirect||this.redirect,d=t.credentials||this.credentials,y=t.transferCache??this.transferCache,E=t.timeout??this.timeout,m=t.body!==void 0?t.body:this.body,I=t.withCredentials??this.withCredentials,N=t.reportProgress??this.reportProgress,u=t.headers||this.headers,f=t.params||this.params,R=t.context??this.context;return t.setHeaders!==void 0&&(u=Object.keys(t.setHeaders).reduce((D,p)=>D.set(p,t.setHeaders[p]),u)),t.setParams&&(f=Object.keys(t.setParams).reduce((D,p)=>D.set(p,t.setParams[p]),f)),new r(e,n,m,{params:f,headers:u,context:R,reportProgress:N,responseType:o,withCredentials:I,transferCache:y,keepalive:s,cache:c,priority:i,timeout:E,mode:a,redirect:l,credentials:d})}},P=function(r){return r[r.Sent=0]="Sent",r[r.UploadProgress=1]="UploadProgress",r[r.ResponseHeader=2]="ResponseHeader",r[r.DownloadProgress=3]="DownloadProgress",r[r.Response=4]="Response",r[r.User=5]="User",r}(P||{}),H=class{headers;status;statusText;url;ok;type;constructor(t,e=200,n="OK"){this.headers=t.headers||new _,this.status=t.status!==void 0?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}},W=class r extends H{constructor(t={}){super(t)}type=P.ResponseHeader;clone(t={}){return new r({headers:t.headers||this.headers,status:t.status!==void 0?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}},V=class r extends H{body;constructor(t={}){super(t),this.body=t.body!==void 0?t.body:null}type=P.Response;clone(t={}){return new r({body:t.body!==void 0?t.body:this.body,headers:t.headers||this.headers,status:t.status!==void 0?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}},b=class extends H{name="HttpErrorResponse";message;error;ok=!1;constructor(t){super(t,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${t.url||"(unknown url)"}`:this.message=`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}},Ot=200,Wt=204;function Pe(r,t){return{body:t,headers:r.headers,context:r.context,observe:r.observe,params:r.params,reportProgress:r.reportProgress,responseType:r.responseType,withCredentials:r.withCredentials,transferCache:r.transferCache,keepalive:r.keepalive,priority:r.priority,cache:r.cache,mode:r.mode,redirect:r.redirect}}var St=(()=>{class r{handler;constructor(e){this.handler=e}request(e,n,o={}){let s;if(e instanceof F)s=e;else{let a;o.headers instanceof _?a=o.headers:a=new _(o.headers);let l;o.params&&(o.params instanceof A?l=o.params:l=new A({fromObject:o.params})),s=new F(e,n,o.body!==void 0?o.body:null,{headers:a,context:o.context,params:l,reportProgress:o.reportProgress,responseType:o.responseType||"json",withCredentials:o.withCredentials,transferCache:o.transferCache,keepalive:o.keepalive,priority:o.priority,cache:o.cache,mode:o.mode,redirect:o.redirect,credentials:o.credentials})}let i=we(s).pipe(Ye(a=>this.handler.handle(a)));if(e instanceof F||o.observe==="events")return i;let c=i.pipe(Je(a=>a instanceof V));switch(o.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return c.pipe(G(a=>{if(a.body!==null&&!(a.body instanceof ArrayBuffer))throw new v(2806,!1);return a.body}));case"blob":return c.pipe(G(a=>{if(a.body!==null&&!(a.body instanceof Blob))throw new v(2807,!1);return a.body}));case"text":return c.pipe(G(a=>{if(a.body!==null&&typeof a.body!="string")throw new v(2808,!1);return a.body}));case"json":default:return c.pipe(G(a=>a.body))}case"response":return c;default:throw new v(2809,!1)}}delete(e,n={}){return this.request("DELETE",e,n)}get(e,n={}){return this.request("GET",e,n)}head(e,n={}){return this.request("HEAD",e,n)}jsonp(e,n){return this.request("JSONP",e,{params:new A().append(n,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,n={}){return this.request("OPTIONS",e,n)}patch(e,n,o={}){return this.request("PATCH",e,Pe(o,n))}post(e,n,o={}){return this.request("POST",e,Pe(o,n))}put(e,n,o={}){return this.request("PUT",e,Pe(o,n))}static \u0275fac=function(n){return new(n||r)(h(B))};static \u0275prov=g({token:r,factory:r.\u0275fac})}return r})(),Kt=/^\)\]\}',?\n/;function Rt(r){if(r.url)return r.url;let t=xe.toLocaleLowerCase();return r.headers.get(t)}var At=new T(""),de=(()=>{class r{fetchImpl=w(Ie,{optional:!0})?.fetch??((...e)=>globalThis.fetch(...e));ngZone=w(S);destroyRef=w(Qe);destroyed=!1;constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0})}handle(e){return new Te(n=>{let o=new AbortController;this.doRequest(e,o.signal,n).then(Ne,i=>n.error(new b({error:i})));let s;return e.timeout&&(s=this.ngZone.runOutsideAngular(()=>setTimeout(()=>{o.signal.aborted||o.abort(new DOMException("signal timed out","TimeoutError"))},e.timeout))),()=>{s!==void 0&&clearTimeout(s),o.abort()}})}doRequest(e,n,o){return Ee(this,null,function*(){let s=this.createRequestInit(e),i;try{let m=this.ngZone.runOutsideAngular(()=>this.fetchImpl(e.urlWithParams,x({signal:n},s)));qt(m),o.next({type:P.Sent}),i=yield m}catch(m){o.error(new b({error:m,status:m.status??0,statusText:m.statusText,url:e.urlWithParams,headers:m.headers}));return}let c=new _(i.headers),a=i.statusText,l=Rt(i)??e.urlWithParams,d=i.status,y=null;if(e.reportProgress&&o.next(new W({headers:c,status:d,statusText:a,url:l})),i.body){let m=i.headers.get("content-length"),I=[],N=i.body.getReader(),u=0,f,R,D=typeof Zone<"u"&&Zone.current,p=!1;if(yield this.ngZone.runOutsideAngular(()=>Ee(this,null,function*(){for(;;){if(this.destroyed){yield N.cancel(),p=!0;break}let{done:C,value:X}=yield N.read();if(C)break;if(I.push(X),u+=X.length,e.reportProgress){R=e.responseType==="text"?(R??"")+(f??=new TextDecoder).decode(X,{stream:!0}):void 0;let Ge=()=>o.next({type:P.DownloadProgress,total:m?+m:void 0,loaded:u,partialText:R});D?D.run(Ge):Ge()}}})),p){o.complete();return}let $=this.concatChunks(I,u);try{let C=i.headers.get(Z)??"";y=this.parseBody(e,$,C,d)}catch(C){o.error(new b({error:C,headers:new _(i.headers),status:i.status,statusText:i.statusText,url:Rt(i)??e.urlWithParams}));return}}d===0&&(d=y?Ot:0),d>=200&&d<300?(o.next(new V({body:y,headers:c,status:d,statusText:a,url:l})),o.complete()):o.error(new b({error:y,headers:c,status:d,statusText:a,url:l}))})}parseBody(e,n,o,s){switch(e.responseType){case"json":let i=new TextDecoder().decode(n).replace(Kt,"");if(i==="")return null;try{return JSON.parse(i)}catch(c){if(s<200||s>=300)return i;throw c}case"text":return new TextDecoder().decode(n);case"blob":return new Blob([n],{type:o});case"arraybuffer":return n.buffer}}createRequestInit(e){let n={},o;if(o=e.credentials,e.withCredentials&&(o="include"),e.headers.forEach((s,i)=>n[s]=i.join(",")),e.headers.has(he)||(n[he]=Dt),!e.headers.has(Z)){let s=e.detectContentTypeHeader();s!==null&&(n[Z]=s)}return{body:e.serializeBody(),method:e.method,headers:n,credentials:o,keepalive:e.keepalive,cache:e.cache,priority:e.priority,mode:e.mode,redirect:e.redirect}}concatChunks(e,n){let o=new Uint8Array(n),s=0;for(let i of e)o.set(i,s),s+=i.length;return o}static \u0275fac=function(n){return new(n||r)};static \u0275prov=g({token:r,factory:r.\u0275fac})}return r})(),Ie=class{};function Ne(){}function qt(r){r.then(Ne,Ne)}function Pt(r,t){return t(r)}function Qt(r,t){return(e,n)=>t.intercept(e,{handle:o=>r(o,n)})}function en(r,t,e){return(n,o)=>qe(e,()=>t(n,s=>r(s,o)))}var It=new T(""),Le=new T(""),Nt=new T(""),Ue=new T("",{providedIn:"root",factory:()=>!0});function tn(){let r=null;return(t,e)=>{r===null&&(r=(w(It,{optional:!0})??[]).reduceRight(Qt,Pt));let n=w(_e);if(w(Ue)){let s=n.add();return r(t,e).pipe(Re(s))}else return r(t,e)}}var fe=(()=>{class r extends B{backend;injector;chain=null;pendingTasks=w(_e);contributeToStability=w(Ue);constructor(e,n){super(),this.backend=e,this.injector=n}handle(e){if(this.chain===null){let n=Array.from(new Set([...this.injector.get(Le),...this.injector.get(Nt,[])]));this.chain=n.reduceRight((o,s)=>en(o,s,this.injector),Pt)}if(this.contributeToStability){let n=this.pendingTasks.add();return this.chain(e,o=>this.backend.handle(o)).pipe(Re(n))}else return this.chain(e,n=>this.backend.handle(n))}static \u0275fac=function(n){return new(n||r)(h(z),h(Ke))};static \u0275prov=g({token:r,factory:r.\u0275fac})}return r})();var nn=/^\)\]\}',?\n/,rn=RegExp(`^${xe}:`,"m");function on(r){return"responseURL"in r&&r.responseURL?r.responseURL:rn.test(r.getAllResponseHeaders())?r.getResponseHeader(xe):null}var Ce=(()=>{class r{xhrFactory;constructor(e){this.xhrFactory=e}handle(e){if(e.method==="JSONP")throw new v(-2800,!1);let n=this.xhrFactory;return we(null).pipe(Ze(()=>new Te(s=>{let i=n.build();if(i.open(e.method,e.urlWithParams),e.withCredentials&&(i.withCredentials=!0),e.headers.forEach((u,f)=>i.setRequestHeader(u,f.join(","))),e.headers.has(he)||i.setRequestHeader(he,Dt),!e.headers.has(Z)){let u=e.detectContentTypeHeader();u!==null&&i.setRequestHeader(Z,u)}if(e.timeout&&(i.timeout=e.timeout),e.responseType){let u=e.responseType.toLowerCase();i.responseType=u!=="json"?u:"text"}let c=e.serializeBody(),a=null,l=()=>{if(a!==null)return a;let u=i.statusText||"OK",f=new _(i.getAllResponseHeaders()),R=on(i)||e.url;return a=new W({headers:f,status:i.status,statusText:u,url:R}),a},d=()=>{let{headers:u,status:f,statusText:R,url:D}=l(),p=null;f!==Wt&&(p=typeof i.response>"u"?i.responseText:i.response),f===0&&(f=p?Ot:0);let $=f>=200&&f<300;if(e.responseType==="json"&&typeof p=="string"){let C=p;p=p.replace(nn,"");try{p=p!==""?JSON.parse(p):null}catch(X){p=C,$&&($=!1,p={error:X,text:p})}}$?(s.next(new V({body:p,headers:u,status:f,statusText:R,url:D||void 0})),s.complete()):s.error(new b({error:p,headers:u,status:f,statusText:R,url:D||void 0}))},y=u=>{let{url:f}=l(),R=new b({error:u,status:i.status||0,statusText:i.statusText||"Unknown Error",url:f||void 0});s.error(R)},E=y;e.timeout&&(E=u=>{let{url:f}=l(),R=new b({error:new DOMException("Request timed out","TimeoutError"),status:i.status||0,statusText:i.statusText||"Request timeout",url:f||void 0});s.error(R)});let m=!1,I=u=>{m||(s.next(l()),m=!0);let f={type:P.DownloadProgress,loaded:u.loaded};u.lengthComputable&&(f.total=u.total),e.responseType==="text"&&i.responseText&&(f.partialText=i.responseText),s.next(f)},N=u=>{let f={type:P.UploadProgress,loaded:u.loaded};u.lengthComputable&&(f.total=u.total),s.next(f)};return i.addEventListener("load",d),i.addEventListener("error",y),i.addEventListener("timeout",E),i.addEventListener("abort",y),e.reportProgress&&(i.addEventListener("progress",I),c!==null&&i.upload&&i.upload.addEventListener("progress",N)),i.send(c),s.next({type:P.Sent}),()=>{i.removeEventListener("error",y),i.removeEventListener("abort",y),i.removeEventListener("load",d),i.removeEventListener("timeout",E),e.reportProgress&&(i.removeEventListener("progress",I),c!==null&&i.upload&&i.upload.removeEventListener("progress",N)),i.readyState!==i.DONE&&i.abort()}})))}static \u0275fac=function(n){return new(n||r)(h(ae))};static \u0275prov=g({token:r,factory:r.\u0275fac})}return r})(),Ct=new T(""),sn="XSRF-TOKEN",an=new T("",{providedIn:"root",factory:()=>sn}),cn="X-XSRF-TOKEN",dn=new T("",{providedIn:"root",factory:()=>cn}),K=class{},ln=(()=>{class r{doc;cookieName;lastCookieString="";lastToken=null;parseCount=0;constructor(e,n){this.doc=e,this.cookieName=n}getToken(){let e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=ie(e,this.cookieName),this.lastCookieString=e),this.lastToken}static \u0275fac=function(n){return new(n||r)(h(M),h(an))};static \u0275prov=g({token:r,factory:r.\u0275fac})}return r})();function un(r,t){let e=r.url.toLowerCase();if(!w(Ct)||r.method==="GET"||r.method==="HEAD"||e.startsWith("http://")||e.startsWith("https://"))return t(r);let n=w(K).getToken(),o=w(dn);return n!=null&&!r.headers.has(o)&&(r=r.clone({headers:r.headers.set(o,n)})),t(r)}var pe=function(r){return r[r.Interceptors=0]="Interceptors",r[r.LegacyInterceptors=1]="LegacyInterceptors",r[r.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",r[r.NoXsrfProtection=3]="NoXsrfProtection",r[r.JsonpSupport=4]="JsonpSupport",r[r.RequestsMadeViaParent=5]="RequestsMadeViaParent",r[r.Fetch=6]="Fetch",r}(pe||{});function kt(r,t){return{\u0275kind:r,\u0275providers:t}}function hn(...r){let t=[St,Ce,fe,{provide:B,useExisting:fe},{provide:z,useFactory:()=>w(At,{optional:!0})??w(Ce)},{provide:Le,useValue:un,multi:!0},{provide:Ct,useValue:!0},{provide:K,useClass:ln}];for(let e of r)t.push(...e.\u0275providers);return Me(t)}var Mt=new T("");function fn(){return kt(pe.LegacyInterceptors,[{provide:Mt,useFactory:tn},{provide:Le,useExisting:Mt,multi:!0}])}function pn(){return kt(pe.Fetch,[de,{provide:At,useExisting:de},{provide:z,useExisting:de}])}var ye=new T(""),He=(()=>{class r{_zone;_plugins;_eventNameToPlugin=new Map;constructor(e,n){this._zone=n,e.forEach(o=>{o.manager=this}),this._plugins=e.slice().reverse()}addEventListener(e,n,o,s){return this._findPluginFor(n).addEventListener(e,n,o,s)}getZone(){return this._zone}_findPluginFor(e){let n=this._eventNameToPlugin.get(e);if(n)return n;if(n=this._plugins.find(s=>s.supports(e)),!n)throw new v(5101,!1);return this._eventNameToPlugin.set(e,n),n}static \u0275fac=function(n){return new(n||r)(h(ye),h(S))};static \u0275prov=g({token:r,factory:r.\u0275fac})}return r})(),q=class{_doc;constructor(t){this._doc=t}manager},je="ng-app-id";function xt(r){for(let t of r)t.remove()}function Lt(r,t){let e=t.createElement("style");return e.textContent=r,e}function mn(r,t,e,n){let o=r.head?.querySelectorAll(`style[${je}="${t}"],link[${je}="${t}"]`);if(o)for(let s of o)s.removeAttribute(je),s instanceof HTMLLinkElement?n.set(s.href.slice(s.href.lastIndexOf("/")+1),{usage:0,elements:[s]}):s.textContent&&e.set(s.textContent,{usage:0,elements:[s]})}function Be(r,t){let e=t.createElement("link");return e.setAttribute("rel","stylesheet"),e.setAttribute("href",r),e}var Ve=(()=>{class r{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(e,n,o,s={}){this.doc=e,this.appId=n,this.nonce=o,mn(e,n,this.inline,this.external),this.hosts.add(e.head)}addStyles(e,n){for(let o of e)this.addUsage(o,this.inline,Lt);n?.forEach(o=>this.addUsage(o,this.external,Be))}removeStyles(e,n){for(let o of e)this.removeUsage(o,this.inline);n?.forEach(o=>this.removeUsage(o,this.external))}addUsage(e,n,o){let s=n.get(e);s?s.usage++:n.set(e,{usage:1,elements:[...this.hosts].map(i=>this.addElement(i,o(e,this.doc)))})}removeUsage(e,n){let o=n.get(e);o&&(o.usage--,o.usage<=0&&(xt(o.elements),n.delete(e)))}ngOnDestroy(){for(let[,{elements:e}]of[...this.inline,...this.external])xt(e);this.hosts.clear()}addHost(e){this.hosts.add(e);for(let[n,{elements:o}]of this.inline)o.push(this.addElement(e,Lt(n,this.doc)));for(let[n,{elements:o}]of this.external)o.push(this.addElement(e,Be(n,this.doc)))}removeHost(e){this.hosts.delete(e)}addElement(e,n){return this.nonce&&n.setAttribute("nonce",this.nonce),e.appendChild(n)}static \u0275fac=function(n){return new(n||r)(h(M),h(De),h(Oe,8),h(J))};static \u0275prov=g({token:r,factory:r.\u0275fac})}return r})(),Fe={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},$e=/%COMP%/g;var jt="%COMP%",yn=`_nghost-${jt}`,gn=`_ngcontent-${jt}`,vn=!0,En=new T("",{providedIn:"root",factory:()=>vn});function Tn(r){return gn.replace($e,r)}function wn(r){return yn.replace($e,r)}function Ft(r,t){return t.map(e=>e.replace($e,r))}var Xe=(()=>{class r{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;platformId;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;constructor(e,n,o,s,i,c,a,l=null,d=null){this.eventManager=e,this.sharedStylesHost=n,this.appId=o,this.removeStylesOnCompDestroy=s,this.doc=i,this.platformId=c,this.ngZone=a,this.nonce=l,this.tracingService=d,this.platformIsServer=!1,this.defaultRenderer=new Q(e,i,a,this.platformIsServer,this.tracingService)}createRenderer(e,n){if(!e||!n)return this.defaultRenderer;let o=this.getOrCreateRenderer(e,n);return o instanceof me?o.applyToHost(e):o instanceof ee&&o.applyStyles(),o}getOrCreateRenderer(e,n){let o=this.rendererByCompId,s=o.get(n.id);if(!s){let i=this.doc,c=this.ngZone,a=this.eventManager,l=this.sharedStylesHost,d=this.removeStylesOnCompDestroy,y=this.platformIsServer,E=this.tracingService;switch(n.encapsulation){case Se.Emulated:s=new me(a,l,n,this.appId,d,i,c,y,E);break;case Se.ShadowDom:return new ze(a,l,e,n,i,c,this.nonce,y,E);default:s=new ee(a,l,n,d,i,c,y,E);break}o.set(n.id,s)}return s}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(e){this.rendererByCompId.delete(e)}static \u0275fac=function(n){return new(n||r)(h(He),h(Ve),h(De),h(En),h(M),h(J),h(S),h(Oe),h(lt,8))};static \u0275prov=g({token:r,factory:r.\u0275fac})}return r})(),Q=class{eventManager;doc;ngZone;platformIsServer;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(t,e,n,o,s){this.eventManager=t,this.doc=e,this.ngZone=n,this.platformIsServer=o,this.tracingService=s}destroy(){}destroyNode=null;createElement(t,e){return e?this.doc.createElementNS(Fe[e]||e,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,e){(Ut(t)?t.content:t).appendChild(e)}insertBefore(t,e,n){t&&(Ut(t)?t.content:t).insertBefore(e,n)}removeChild(t,e){e.remove()}selectRootElement(t,e){let n=typeof t=="string"?this.doc.querySelector(t):t;if(!n)throw new v(-5104,!1);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,o){if(o){e=o+":"+e;let s=Fe[o];s?t.setAttributeNS(s,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){let o=Fe[n];o?t.removeAttributeNS(o,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,o){o&(Y.DashCase|Y.Important)?t.style.setProperty(e,n,o&Y.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&Y.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t!=null&&(t[e]=n)}setValue(t,e){t.nodeValue=e}listen(t,e,n,o){if(typeof t=="string"&&(t=j().getGlobalEventTarget(this.doc,t),!t))throw new v(5102,!1);let s=this.decoratePreventDefault(n);return this.tracingService?.wrapEventListener&&(s=this.tracingService.wrapEventListener(t,e,s)),this.eventManager.addEventListener(t,e,s,o)}decoratePreventDefault(t){return e=>{if(e==="__ngUnwrap__")return t;t(e)===!1&&e.preventDefault()}}};function Ut(r){return r.tagName==="TEMPLATE"&&r.content!==void 0}var ze=class extends Q{sharedStylesHost;hostEl;shadowRoot;constructor(t,e,n,o,s,i,c,a,l){super(t,s,i,a,l),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let d=o.styles;d=Ft(o.id,d);for(let E of d){let m=document.createElement("style");c&&m.setAttribute("nonce",c),m.textContent=E,this.shadowRoot.appendChild(m)}let y=o.getExternalStyles?.();if(y)for(let E of y){let m=Be(E,s);c&&m.setAttribute("nonce",c),this.shadowRoot.appendChild(m)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}appendChild(t,e){return super.appendChild(this.nodeOrShadowRoot(t),e)}insertBefore(t,e,n){return super.insertBefore(this.nodeOrShadowRoot(t),e,n)}removeChild(t,e){return super.removeChild(null,e)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},ee=class extends Q{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(t,e,n,o,s,i,c,a,l){super(t,s,i,c,a),this.sharedStylesHost=e,this.removeStylesOnCompDestroy=o;let d=n.styles;this.styles=l?Ft(l,d):d,this.styleUrls=n.getExternalStyles?.(l)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},me=class extends ee{contentAttr;hostAttr;constructor(t,e,n,o,s,i,c,a,l){let d=o+"-"+n.id;super(t,e,n,s,i,c,a,l,d),this.contentAttr=Tn(d),this.hostAttr=wn(d)}applyToHost(t){this.applyStyles(),this.setAttribute(t,this.hostAttr,"")}createElement(t,e){let n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}};var ge=class r extends mt{supportsDOMEvents=!0;static makeCurrent(){pt(new r)}onAndCancel(t,e,n,o){return t.addEventListener(e,n,o),()=>{t.removeEventListener(e,n,o)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){t.remove()}createElement(t,e){return e=e||this.getDefaultDocument(),e.createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return e==="window"?window:e==="document"?t:e==="body"?t.body:null}getBaseHref(t){let e=Rn();return e==null?null:Mn(e)}resetBaseElement(){te=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return ie(document.cookie,t)}},te=null;function Rn(){return te=te||document.head.querySelector("base"),te?te.getAttribute("href"):null}function Mn(r){return new URL(r,document.baseURI).pathname}var ve=class{addToWindow(t){O.getAngularTestability=(n,o=!0)=>{let s=t.findTestabilityInTree(n,o);if(s==null)throw new v(5103,!1);return s},O.getAllAngularTestabilities=()=>t.getAllTestabilities(),O.getAllAngularRootElements=()=>t.getAllRootElements();let e=n=>{let o=O.getAllAngularTestabilities(),s=o.length,i=function(){s--,s==0&&n()};o.forEach(c=>{c.whenStable(i)})};O.frameworkStabilizers||(O.frameworkStabilizers=[]),O.frameworkStabilizers.push(e)}findTestabilityInTree(t,e,n){if(e==null)return null;let o=t.getTestability(e);return o??(n?j().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null)}},bn=(()=>{class r{build(){return new XMLHttpRequest}static \u0275fac=function(n){return new(n||r)};static \u0275prov=g({token:r,factory:r.\u0275fac})}return r})(),zt=(()=>{class r extends q{constructor(e){super(e)}supports(e){return!0}addEventListener(e,n,o,s){return e.addEventListener(n,o,s),()=>this.removeEventListener(e,n,o,s)}removeEventListener(e,n,o,s){return e.removeEventListener(n,o,s)}static \u0275fac=function(n){return new(n||r)(h(M))};static \u0275prov=g({token:r,factory:r.\u0275fac})}return r})(),Bt=["alt","control","meta","shift"],_n={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},Dn={alt:r=>r.altKey,control:r=>r.ctrlKey,meta:r=>r.metaKey,shift:r=>r.shiftKey},Ht=(()=>{class r extends q{constructor(e){super(e)}supports(e){return r.parseEventName(e)!=null}addEventListener(e,n,o,s){let i=r.parseEventName(n),c=r.eventCallback(i.fullKey,o,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>j().onAndCancel(e,i.domEventName,c,s))}static parseEventName(e){let n=e.toLowerCase().split("."),o=n.shift();if(n.length===0||!(o==="keydown"||o==="keyup"))return null;let s=r._normalizeKey(n.pop()),i="",c=n.indexOf("code");if(c>-1&&(n.splice(c,1),i="code."),Bt.forEach(l=>{let d=n.indexOf(l);d>-1&&(n.splice(d,1),i+=l+".")}),i+=s,n.length!=0||s.length===0)return null;let a={};return a.domEventName=o,a.fullKey=i,a}static matchEventFullKeyCode(e,n){let o=_n[e.key]||e.key,s="";return n.indexOf("code.")>-1&&(o=e.code,s="code."),o==null||!o?!1:(o=o.toLowerCase(),o===" "?o="space":o==="."&&(o="dot"),Bt.forEach(i=>{if(i!==o){let c=Dn[i];c(e)&&(s+=i+".")}}),s+=o,s===n)}static eventCallback(e,n,o){return s=>{r.matchEventFullKeyCode(s,e)&&o.runGuarded(()=>n(s))}}static _normalizeKey(e){return e==="esc"?"escape":e}static \u0275fac=function(n){return new(n||r)(h(M))};static \u0275prov=g({token:r,factory:r.\u0275fac})}return r})();function On(r,t){let e=x({rootComponent:r},Sn(t));return ft(e)}function Sn(r){return{appProviders:[...Vt,...r?.providers??[]],platformProviders:Nn}}function An(){ge.makeCurrent()}function Pn(){return new be}function In(){return et(document),document}var Nn=[{provide:J,useValue:gt},{provide:tt,useValue:An,multi:!0},{provide:M,useFactory:In}];var Cn=[{provide:oe,useClass:ve},{provide:ut,useClass:se,deps:[S,Ae,oe]},{provide:se,useClass:se,deps:[S,Ae,oe]}],Vt=[{provide:We,useValue:"root"},{provide:be,useFactory:Pn},{provide:ye,useClass:zt,multi:!0,deps:[M]},{provide:ye,useClass:Ht,multi:!0,deps:[M]},Xe,Ve,He,{provide:dt,useExisting:Xe},{provide:ae,useClass:bn},[]],kn=(()=>{class r{constructor(){}static \u0275fac=function(n){return new(n||r)};static \u0275mod=re({type:r});static \u0275inj=ne({providers:[...Vt,...Cn],imports:[yt,ht]})}return r})();var qr=(()=>{class r{_doc;constructor(e){this._doc=e}getTitle(){return this._doc.title}setTitle(e){this._doc.title=e||""}static \u0275fac=function(n){return new(n||r)(h(M))};static \u0275prov=g({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var Ln=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275prov=g({token:r,factory:function(n){let o=null;return n?o=new(n||r):o=h(Un),o},providedIn:"root"})}return r})(),Un=(()=>{class r extends Ln{_doc;constructor(e){super(),this._doc=e}sanitize(e,n){if(n==null)return null;switch(e){case k.NONE:return n;case k.HTML:return U(n,"HTML")?L(n):ct(this._doc,String(n)).toString();case k.STYLE:return U(n,"Style")?L(n):n;case k.SCRIPT:if(U(n,"Script"))return L(n);throw new v(5200,!1);case k.URL:return U(n,"URL")?L(n):at(String(n));case k.RESOURCE_URL:if(U(n,"ResourceURL"))return L(n);throw new v(5201,!1);default:throw new v(5202,!1)}}bypassSecurityTrustHtml(e){return nt(e)}bypassSecurityTrustStyle(e){return rt(e)}bypassSecurityTrustScript(e){return ot(e)}bypassSecurityTrustUrl(e){return st(e)}bypassSecurityTrustResourceUrl(e){return it(e)}static \u0275fac=function(n){return new(n||r)(h(M))};static \u0275prov=g({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{z as a,A as b,P as c,V as d,St as e,It as f,hn as g,fn as h,pn as i,Xe as j,On as k,kn as l,qr as m,Ln as n};
@@ -1,2 +0,0 @@
1
- import{B as Y,C as Z,c as G,d as k,e as j,f as D,g as K,j as $,m as A,q as J,r as Q,y as X}from"./chunk-WMIMAPZH.js";import{a as ae}from"./chunk-OIV4KXSV.js";import{b as oe}from"./chunk-5J7OMTCR.js";import{b as re}from"./chunk-2ETJ2W67.js";import{k as ie,m as U,n as ne}from"./chunk-6MRWZBRB.js";import{a as ee,b as te}from"./chunk-6FXNHKMA.js";import{m as q}from"./chunk-PP5MH7GY.js";import{$b as I,Cd as R,Dc as L,Ec as B,Fc as E,Ib as M,Jb as z,Kb as T,Kc as a,Lc as s,Pb as m,Qb as o,Rb as r,Sb as u,Ya as W,bb as n,cc as x,ec as _,h as S,la as w,ld as H,nb as V,oc as O,od as N,ra as C,rc as l,sa as b,sc as f,tc as g,w as h}from"./chunk-XWYKEZQQ.js";var pe=t=>({background:t}),de=t=>({anim:t}),ce=t=>({"progress-bar-animated":t}),me=()=>["restoring","restarting","restore-complete"],P=(t,d)=>({"is-valid":t,"is-invalid":d});function ue(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),u(4,"div",7),a(5,"translate"),o(6,"button",8),x("click",function(){C(e);let i=_();return b(i.onClickGettingStarted())}),l(7),a(8,"translate"),r(),o(9,"a",9),x("click",function(){C(e);let i=_();return b(i.onClickRestoreBackup())}),l(10),a(11,"translate"),r()()}t&2&&(n(2),f(s(3,4,"setup.welcome_to_homebridge")),n(2),m("innerHTML",s(5,6,"setup.intro"),W),n(3),g(" ",s(8,8,"setup.button_get_started")," "),n(3),f(s(11,10,"setup_wizard_restore")))}function ge(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"div",11)(8,"form",12),x("ngSubmit",function(){C(e);let i=_();return b(i.createFirstUser())}),o(9,"div",13)(10,"span",14),u(11,"i",15),r(),u(12,"input",16),a(13,"translate"),r(),o(14,"div",13)(15,"span",14),u(16,"i",17),r(),u(17,"input",18),a(18,"translate"),r(),o(19,"div",13)(20,"span",14),u(21,"i",17),r(),u(22,"input",19),a(23,"translate"),r(),o(24,"div",20)(25,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(26),a(27,"translate"),r(),o(28,"button",22),l(29),a(30,"translate"),r()()()()()}if(t&2){let e=_();n(2),f(s(3,16,"setup.create_account")),n(3),f(s(6,18,"setup_wizard_create_info")),n(3),m("formGroup",e.createUserForm),n(4),m("readonly",e.loading)("ngClass",E(30,P,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.valid,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.invalid))("placeholder",s(13,20,"users.label_username")),n(5),m("readonly",e.loading)("ngClass",E(33,P,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.valid,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.errors))("placeholder",s(18,22,"users.label_password")),n(5),m("readonly",e.loading)("ngClass",E(36,P,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.valid,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.errors))("placeholder",s(23,24,"users.label_confirm_password")),n(3),m("disabled",e.restoreUploading),n(),g(" ",s(27,26,"form.button_back")," "),n(2),m("disabled",e.createUserForm.invalid||e.loading),n(),g(" ",s(30,28,"form.button_continue")," ")}}function _e(t,d){t&1&&(u(0,"i",25),l(1),a(2,"translate")),t&2&&(n(),g(" ",s(2,1,"backup.label_uploading")," "))}function fe(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"form.button_continue")," ")}function he(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"input",23),x("change",function(i){C(e);let F=_();return b(F.handleRestoreFileInput(i.target.files))}),r(),o(8,"div",20)(9,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(10),a(11,"translate"),r(),o(12,"button",24),x("click",function(){C(e);let i=_();return b(i.onRestoreBackupClick())}),z(13,_e,3,3)(14,fe,2,3),r()()()}if(t&2){let e=_();n(2),f(s(3,6,"setup_wizard_restore")),n(3),f(s(6,8,"backup.restore_help_one")),n(4),m("disabled",e.restoreUploading),n(),g(" ",s(11,10,"form.button_back")," "),n(2),m("disabled",e.restoreUploading||!e.selectedFile),n(),T(e.restoreUploading?13:14)}}function we(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_restoring")," ")}function Ce(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_starting")," ")}function be(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_complete")," ")}function xe(t,d){t&1&&(o(0,"a",27),l(1),a(2,"translate"),r()),t&2&&(n(),g(" ",s(2,1,"form.button_continue")," "))}function ve(t,d){if(t&1&&(o(0,"div",5)(1,"h4",6),z(2,we,2,3)(3,Ce,2,3)(4,be,2,3),r(),u(5,"div",26),z(6,xe,3,3,"a",27),r()),t&2){let e=_();n(2),T(e.step==="restoring"?2:e.step==="restarting"?3:e.step==="restore-complete"?4:-1),n(4),T(e.step==="restore-complete"?6:-1)}}function ye(t,d){t&1&&(o(0,"div",5)(1,"h4",28),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"a",29),l(8),a(9,"translate"),r()()),t&2&&(n(2),f(s(3,3,"setup_wizard_complete_title")),n(3),f(s(6,5,"setup_wizard_completed")),n(3),g(" ",s(9,7,"form.button_continue")," "))}var He=(()=>{class t{$api=w(ne);$auth=w(oe);$settings=w(re);$title=w(q);$toastr=w(ie);$translate=w(ee);$ws=w(ae);io;step="welcome";backgroundStyle;progress=1;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;loading=!1;selectedFile;restoreUploading=!1;createUserForm=new K({username:new $("",[k.required]),password:new $("",[k.compose([k.required,k.minLength(4)])]),passwordConfirm:new $("",[k.required])},this.matchPassword);ngOnInit(){return S(this,null,function*(){this.$title.setTitle(this.$translate.instant("setup_wizard_page_title")),yield this.setBackground()})}onClickGettingStarted(){this.step="create-account",this.progress=50}onClickRestoreBackup(){this.step="restore-backup",this.progress=20}onClickCancelRestore(){this.selectedFile=null,this.step="welcome",this.progress=1}createFirstUser(){return S(this,null,function*(){this.loading=!0,this.progress=75;let e=this.createUserForm.getRawValue();e.name=e.username;try{yield h(this.$api.post("/setup-wizard/create-first-user",e)),this.$settings.env.setupWizardComplete=!0,this.progress=100,this.loading=!1,yield this.$auth.login({username:e.username,password:e.password}),this.step="setup-complete"}catch(p){this.loading=!1,this.progress=50,console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.progress=40):(delete this.selectedFile,this.progress=20)}onRestoreBackupClick(){return S(this,null,function*(){this.restoreUploading=!0,this.step="restoring",this.progress=60;try{let e=yield h(this.$api.get("/setup-wizard/get-setup-wizard-token"));window.localStorage.setItem(U.jwt.tokenKey,e.access_token),this.$auth.token=e.access_token,this.progress=65;let p=new FormData;p.append("restoreArchive",this.selectedFile,this.selectedFile.name),yield h(this.$api.post("/backup/restore",p)),this.progress=70,this.io=this.$ws.connectToNamespace("backup");let i=document.getElementById("output");this.io.socket.on("stdout",c=>{c.split(`
2
- \r`).forEach(v=>{if(v&&!/^[⠇⠏⠋⠙⠹⠸]+$/.test(v)){let y=document.createElement("div"),le=/\x1B\[(\d{1,2}(;\d{1,2})?)?[mGK]/g;y.innerHTML=v.replace(le,""),v.includes("[0;31m")?y.classList.add("red-text"):v.includes("[0;32m")?y.classList.add("green-text"):v.includes("[0;33m")?y.classList.add("orange-text"):v.includes("[0;36m")&&y.classList.add("cyan-text"),i.appendChild(y),i.scrollTop=i.scrollHeight}})}),this.restoreStarted=!0,this.restoreInProgress=!0,this.progress=75,yield h(this.io.request("do-restore")),this.progress=80,this.restoreInProgress=!1,yield h(this.$api.put("/backup/restart",{})),this.step="restarting",this.progress=85,window.localStorage.removeItem(U.jwt.tokenKey),this.$auth.token=null;let F=document.createElement("div");F.classList.add("orange-text"),F.innerHTML="Starting Homebridge, please wait...",i.appendChild(F),i.scrollTop=i.scrollHeight,yield new Promise(c=>setTimeout(c,3e3)),this.progress=88,yield new Promise(c=>setTimeout(c,3e3)),this.progress=91,yield new Promise(c=>setTimeout(c,3e3)),this.progress=94,yield new Promise(c=>setTimeout(c,3e3)),this.progress=97,yield new Promise(c=>setTimeout(c,3e3)),this.progress=99;let se=setInterval(()=>S(this,null,function*(){try{yield h(this.$api.get("/auth/settings")),clearInterval(se),this.progress=100,this.restoreUploading=!1,this.step="restore-complete"}catch{}}),1e3)}catch(e){console.error(e),this.restoreUploading=!1,this.restoreFailed=!0,this.progress=20,this.step="restore-backup",this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}finally{this.io&&this.io.end()}})}setBackground(){return S(this,null,function*(){if(this.$settings.settingsLoaded||(yield h(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash){let e=`${U.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`;this.backgroundStyle=`url('${e}') center/cover`}})}matchPassword(e){let p=e.get("password").value,i=e.get("passwordConfirm").value;if(p!==i)e.get("passwordConfirm").setErrors({matchPassword:!0});else return null}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=V({type:t,selectors:[["ng-component"]],decls:10,vars:14,consts:[[1,"setup-container","gradient","d-flex","align-items-start","justify-content-center",3,"ngStyle","ngClass"],[1,"w-100","setup-card","d-flex","py-4","flex-column"],["ngSrc","/assets/homebridge-color-round.svg","alt","Homebridge Logo","height","100","width","100","priority","true",1,"homebridge-logo","mx-auto","my-3"],[1,"progress","w-100","my-4"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",1,"progress-bar","progress-bar-striped","bg-success",3,"ngClass"],[1,"w-100","d-flex","flex-column","align-items-center","mb-2"],[1,"mb-3","text-center"],[1,"mb-4","small","grey-text","text-center",3,"innerHTML"],["type","button",1,"btn","btn-lg","btn-primary","mb-4",3,"click"],["href","javascript:void(0)",1,"grey-text",3,"click"],[1,"mb-4","small","grey-text","text-center"],[1,"w-100"],["novalidate","",3,"ngSubmit","formGroup"],[1,"input-group","mb-4"],[1,"input-group-text","custom-input"],[1,"fas","fa-fw","fa-user","primary-text","fa-lg"],["formControlName","username","type","text","id","form-username","autocomplete","username","autocapitalize","none","tabindex","1","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],[1,"fas","fa-fw","fa-lock","primary-text","fa-lg"],["formControlName","password","type","password","id","form-pass","autocomplete","new-password","tabindex","2","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],["formControlName","passwordConfirm","type","password","id","form-pass-confirm","autocomplete","new-password","tabindex","2","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],[1,"mt-3","w-100","d-flex","justify-content-between"],["type","button",1,"btn","btn-elegant","ms-0",3,"click","disabled"],["type","submit",1,"btn","btn-primary",3,"disabled"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz",1,"form-control","custom-input","mb-3",3,"change"],["type","button",1,"btn","btn-primary","me-0",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],["id","output",1,"font-monospace","small","alert","alert-info","w-100","text-start","mt-1","mb-0"],["href","/login",1,"btn","btn-lg","btn-primary","mt-4"],[1,"mb-3"],["href","/",1,"btn","btn-lg","btn-primary"]],template:function(p,i){p&1&&(o(0,"div",0)(1,"div",1),u(2,"img",2),o(3,"div",3),u(4,"div",4),r(),z(5,ue,12,12,"div",5)(6,ge,31,39,"div",5)(7,he,15,12,"div",5)(8,ve,7,2,"div",5)(9,ye,10,9,"div",5),r()()),p&2&&(m("ngStyle",B(7,pe,i.backgroundStyle))("ngClass",B(9,de,!i.backgroundStyle)),n(4),O("width",i.progress+"%"),m("ngClass",B(11,ce,i.loading||i.restoreUploading)),M("aria-valuenow",i.progress),n(),T(i.step==="welcome"?5:i.step==="create-account"?6:i.step==="restore-backup"?7:L(13,me).includes(i.step)?8:i.step==="setup-complete"?9:-1))},dependencies:[H,R,Y,A,G,j,D,X,Z,J,Q,N,te],styles:["body{overflow:scroll!important} body.dark-mode .setup-card{background-color:#2b2b2b;color:#fff}.setup-container[_ngcontent-%COMP%]{z-index:-1;padding-top:2em;padding-bottom:2em;min-height:100%;background-size:300% 300%}.anim[_ngcontent-%COMP%]{-webkit-animation:_ngcontent-%COMP%_gradient 20s ease infinite;-moz-animation:gradient 20s ease infinite;-o-animation:gradient 20s ease infinite;animation:_ngcontent-%COMP%_gradient 20s ease infinite}@keyframes _ngcontent-%COMP%_gradient{0%{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}.setup-card[_ngcontent-%COMP%]{max-width:550px;border-radius:1rem;padding-right:25px;padding-left:25px;background-color:#ffffffe6}.setup-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 575px){.setup-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}}.homebridge-logo[_ngcontent-%COMP%]{margin-bottom:10px}.progress[_ngcontent-%COMP%]{background-color:#ddd}#output[_ngcontent-%COMP%]{height:200px;overflow-y:scroll;white-space:pre-wrap}"]})}return t})();export{He as SetupWizardComponent};
@@ -1 +0,0 @@
1
- import{d as u,g as s}from"./chunk-5KFQUVTY.js";import{k as l,n as d}from"./chunk-6MRWZBRB.js";import{a as p}from"./chunk-6FXNHKMA.js";import"./chunk-PP5MH7GY.js";import{ga as c,h as f,ha as i,la as e,ob as n,w as m}from"./chunk-XWYKEZQQ.js";var a=(()=>{class t{$api=e(d);$router=e(u);$toastr=e(l);$translate=e(p);resolve(){return f(this,null,function*(){try{let o=yield m(this.$api.get("/config-editor"));return JSON.stringify(o,null,4)}catch(o){console.error(o),this.$toastr.error(o.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(r){return new(r||t)};static \u0275prov=c({token:t,factory:t.\u0275fac})}return t})();var y=[{path:"",loadComponent:()=>import("./chunk-2IPYU27V.js").then(t=>t.ConfigEditorComponent),resolve:{config:a}}],v=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=n({type:t});static \u0275inj=i({imports:[s.forChild(y),s]})}return t})();var T=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=n({type:t});static \u0275inj=i({providers:[a],imports:[v]})}return t})();export{T as ConfigEditorModule};
@@ -1 +0,0 @@
1
- import{g as r}from"./chunk-5KFQUVTY.js";import"./chunk-PP5MH7GY.js";import{ha as t,ob as e}from"./chunk-XWYKEZQQ.js";var u=[{path:"",loadComponent:()=>import("./chunk-VWR3K52A.js").then(o=>o.LogsComponent)}],n=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[r.forChild(u),r]})}return o})();var p=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[n]})}return o})();export{p as LogsModule};
@@ -1 +0,0 @@
1
- import{a as Ke}from"./chunk-LIIIEDKB.js";import{a as Ge}from"./chunk-CV5P3VHY.js";import{a as Ue}from"./chunk-G3CSSNW3.js";import{a as We}from"./chunk-NFD7N6TO.js";import{a as je}from"./chunk-PFU546XJ.js";import{a as pt,c as dt}from"./chunk-PMVD4FUJ.js";import{a as ct}from"./chunk-QNF5ENQG.js";import{a as He}from"./chunk-FVSVQWIM.js";import{g as de,m as A,n as re,t as ce}from"./chunk-BEYU5GMW.js";import{B as ae,C as oe,b as ie,c as le,e as ne,j as w,k as $e,l as Fe,n as Pe,p as pe,s as Re,t as Ae,v as Ve,w as Me,x as De,z as Ne}from"./chunk-WMIMAPZH.js";import{a as Oe}from"./chunk-OIV4KXSV.js";import"./chunk-5J7OMTCR.js";import{d as U,e as Le}from"./chunk-5KFQUVTY.js";import{b as Y}from"./chunk-2ETJ2W67.js";import{c as Te,d as _e,f as se,g as ge,k as M,m as ze,n as D}from"./chunk-6MRWZBRB.js";import{a as V,b as R}from"./chunk-6FXNHKMA.js";import{c as we,d as Be}from"./chunk-PP5MH7GY.js";import{$b as E,Ac as ke,Ec as N,Fc as F,Gc as ee,Ib as f,Jb as h,Kb as _,Kc as r,Lc as s,M as k,Mb as L,Mc as G,Nb as z,Ob as O,Pb as m,Qb as a,Rb as o,Sb as d,Tb as T,Ub as B,Vb as H,Ya as he,Za as ve,ac as K,bb as t,cc as x,dc as W,ec as b,g as ue,h as v,ic as Ce,jc as xe,kc as Se,la as C,ld as j,nb as P,qd as te,ra as S,rc as l,sa as I,sc as u,sd as Ee,tc as g,w as $,yc as Ie,zc as ye}from"./chunk-XWYKEZQQ.js";var qe=(i,c)=>({"green-text":i,"grey-text":c});function mt(i,c){if(i&1){let e=E();a(0,"li",9)(1,"div",10),l(2),d(3,"br"),a(4,"small",11),d(5,"i",12),r(6,"translate"),l(7," \xB7 "),a(8,"span",13),l(9),o(),l(10),r(11,"titlecase"),o()(),a(12,"div",14)(13,"input",23),r(14,"translate"),x("click",function(){let p=S(e).$implicit,y=b();return I(y.toggleList(p._username))}),o(),d(15,"label",24),o()()}if(i&2){let e=c.$implicit,n=b();t(2),g(" ",e.name," "),t(3),m("ngbTooltip",s(6,11,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired"))("openDelay",150)("ngClass",F(17,qe,e._isPaired,!e._isPaired)),t(4),u(e._username),t(),g(" \xB7 ",s(11,13,e._category)," "),t(3),m("id","hidePluginUpdates_"+e._username)("checked",!n.isInList(e._username))("disabled",n.clicked),f("aria-label",s(14,15,"form.button_allow")+" "+e.name),t(2),m("for","hidePluginUpdates_"+e._username)}}function ut(i,c){i&1&&(l(0),r(1,"translate")),i&2&&g(" ",s(1,1,"form.button_save")," ")}function ht(i,c){i&1&&d(0,"i",22)}var Qe=(()=>{class i{$activeModal=C(A);$api=C(D);$settings=C(Y);$toastr=C(M);$translate=C(V);originalBlacklist=[];updatedBlacklist=[];existingBlacklist=[];clicked=!1;mainPairing={};pairings=[];get blacklistHasUpdated(){return this.updatedBlacklist.join(",")!==this.originalBlacklist.join(",")}ngOnInit(){return v(this,null,function*(){this.updatedBlacklist=this.existingBlacklist.map(e=>e.trim().toUpperCase()).sort((e,n)=>e.localeCompare(n)),this.originalBlacklist=[...this.updatedBlacklist];try{let e=yield $(this.$api.get("/server/pairings"));this.mainPairing=e.find(n=>n._main),this.pairings=e.filter(n=>!n._main).sort((n,p)=>n.name.localeCompare(p.name))}catch(e){console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}toggleList(e){this.updatedBlacklist.includes(e)?this.updatedBlacklist=this.updatedBlacklist.filter(n=>n!==e):(this.updatedBlacklist.push(e),this.updatedBlacklist.sort((n,p)=>n.localeCompare(p)))}isInList(e){return this.updatedBlacklist.includes(e)}updateBlacklist(){return v(this,null,function*(){this.clicked=!0;try{yield $(this.$api.put("/config-editor/ui/accessory-control/instance-blacklist",{body:this.updatedBlacklist})),this.$settings.setEnvItem("accessoryControl.instanceBlacklist",this.updatedBlacklist),this.$activeModal.close()}catch(e){this.clicked=!1,console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],inputs:{existingBlacklist:"existingBlacklist"},decls:45,vars:35,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-list-check","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mt-3","mb-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center","flex-row","pb-2"],[1,"text-start"],[1,"grey-text"],["container","body","triggers","hover","placement","left",1,"fas","fa-fw","fa-link",3,"ngbTooltip","openDelay","ngClass"],[1,"font-monospace"],[1,"text-end","grey-text","d-flex","align-items-center"],["type","checkbox","id","controlMainBridge",1,"rendux-input",3,"click","checked","disabled"],["for","controlMainBridge",1,"rendux-label","ms-3"],[1,"modal-footer","justify-content-between"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],["type","checkbox",1,"rendux-input",3,"click","id","checked","disabled"],[1,"rendux-label","ms-3",3,"for"]],template:function(n,p){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),o(),a(5,"button",3),r(6,"translate"),x("click",function(){return p.dismissModal()}),o()(),a(7,"div",4)(8,"div",5),d(9,"i",6),o(),a(10,"ul",7)(11,"li"),l(12),r(13,"translate"),o(),a(14,"li"),l(15),r(16,"translate"),o()(),a(17,"ul",8)(18,"li",9)(19,"div",10),l(20),d(21,"br"),a(22,"small",11),d(23,"i",12),r(24,"translate"),l(25," \xB7 "),a(26,"span",13),l(27),o(),l(28," \xB7 Homebridge "),o()(),a(29,"div",14)(30,"input",15),r(31,"translate"),x("click",function(){return p.toggleList(p.mainPairing._username)}),o(),d(32,"label",16),o()(),z(33,mt,16,20,"li",9,L),o()(),a(35,"div",17)(36,"div",10)(37,"button",18),x("click",function(){return p.dismissModal()}),l(38),r(39,"translate"),o()(),d(40,"div",19),a(41,"div",20)(42,"button",21),x("click",function(){return p.updateBlacklist()}),h(43,ut,2,3),h(44,ht,1,0,"i",22),o()()()()),n&2&&(t(3),u(s(4,18,"settings.security.ui_control")),t(2),m("disabled",p.clicked),f("aria-label",s(6,20,"form.button_close")),t(7),u(s(13,22,"settings.security.ui_control_desc")),t(3),u(s(16,24,"settings.security.ui_control_desc_2")),t(5),g(" ",p.mainPairing.name),t(3),m("ngbTooltip",s(24,26,p.mainPairing._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired"))("openDelay",150)("ngClass",F(32,qe,p.mainPairing._isPaired,!p.mainPairing._isPaired)),t(4),u(p.mainPairing._username),t(3),m("checked",!p.isInList(p.mainPairing._username))("disabled",p.clicked),f("aria-label",s(31,28,"plugins.manage.hide_updates")),t(3),O(p.pairings),t(4),m("disabled",p.clicked),t(),g(" ",s(39,30,"form.button_close")," "),t(4),m("disabled",!p.blacklistHasUpdated||p.clicked),t(),_(p.clicked?-1:43),t(),_(p.clicked?44:-1))},dependencies:[j,ae,ce,R,te],encapsulation:2})}return i})();var tt=ue(ct(),1);var Je=ue(pt(),1),Xe=ue(dt(),1);var _t=i=>({maxBackupSizeText:i});function gt(i,c){if(i&1&&H(0,"input",10),i&2){let e=b(2);K("value",e.selectedBackup.fileName)}}function bt(i,c){if(i&1){let e=E();T(0,"input",12),W("change",function(p){S(e);let y=b(2);return I(y.handleRestoreFileInput(p.target.files))}),B()}}function ft(i,c){if(i&1&&(T(0,"div",4)(1,"div",7),H(2,"i",8),B(),T(3,"ul",9)(4,"li"),l(5),r(6,"translate"),B(),T(7,"li"),l(8),r(9,"translate"),B(),T(10,"li"),l(11),r(12,"translate"),B(),T(13,"li"),l(14),r(15,"translate"),B()(),h(16,gt,1,1,"input",10),h(17,bt,1,0,"input",11),B()),i&2){let e=b();t(5),u(s(6,6,"backup.restore_help_one")),t(3),u(s(9,8,"backup.restore_help_two")),t(3),u(G(12,10,"backup.restore_max_size",N(15,_t,e.maxFileSizeText))),t(3),u(s(15,13,"backup.restore_warning")),t(2),_(e.selectedBackup?16:-1),t(),_(e.selectedBackup?-1:17)}}function vt(i,c){if(i&1){let e=E();T(0,"button",18),r(1,"translate"),W("click",function(){S(e);let p=b(2);return I(p.dismissModal())}),l(2),r(3,"translate"),B()}if(i&2){let e=b(2);K("disabled",e.clicked),f("aria-label",s(1,3,"form.button_close")),t(2),g(" ",s(3,5,"form.button_close")," ")}}function Ct(i,c){if(i&1){let e=E();T(0,"button",18),r(1,"translate"),W("click",function(){S(e);let p=b(2);return I(p.reopenBackupModal())}),l(2),r(3,"translate"),B()}if(i&2){let e=b(2);K("disabled",e.clicked),f("aria-label",s(1,3,"form.button_back")),t(2),g(" ",s(3,5,"form.button_back")," ")}}function xt(i,c){i&1&&H(0,"i",19)}function St(i,c){if(i&1&&(T(0,"span"),l(1),B()),i&2){let e=b(3);t(),g("",e.uploadPercent,"% - ")}}function It(i,c){i&1&&(T(0,"span"),l(1," Extracting Archive"),B())}function yt(i,c){i&1&&(T(0,"span"),l(1),r(2,"translate"),B()),i&2&&(t(),g(" ",s(2,1,"backup.label_uploading")))}function kt(i,c){if(i&1&&(T(0,"span"),h(1,xt,1,0,"i",19),h(2,St,2,1,"span"),h(3,It,2,0,"span"),h(4,yt,3,3,"span"),B()),i&2){let e=b(2);t(),_(!e.uploadPercent||e.uploadPercent===100?1:-1),t(),_(e.uploadPercent&&e.uploadPercent!==100?2:-1),t(),_(e.uploadPercent===100?3:-1),t(),_(e.uploadPercent!==100?4:-1)}}function Et(i,c){i&1&&(l(0),r(1,"translate")),i&2&&g(" ",s(1,1,"form.button_restore")," ")}function wt(i,c){if(i&1){let e=E();T(0,"div",6)(1,"div",13),h(2,vt,4,7,"button",14),h(3,Ct,4,7,"button",14),B(),H(4,"div",15),T(5,"div",16)(6,"button",17),W("click",function(){S(e);let p=b();return I(p.onRestoreBackupClick())}),h(7,kt,5,4,"span"),h(8,Et,2,3),B()()()}if(i&2){let e=b();t(2),_(e.setupWizardRestore?2:-1),t(),_(e.setupWizardRestore?-1:3),t(3),K("disabled",!e.selectedBackup&&!e.selectedFile||e.clicked),t(),_(e.clicked?7:-1),t(),_(e.clicked?-1:8)}}function Bt(i,c){if(i&1){let e=E();T(0,"div",6),H(1,"div",13),T(2,"div",15)(3,"button",20),W("click",function(){S(e);let p=b();return I(p.postBackupRestart())}),l(4),r(5,"translate"),B()(),H(6,"div",16),B()}i&2&&(t(4),g(" ",s(5,1,"menu.hbrestart.title")," "))}var Ye=(()=>{class i{$activeModal=C(A);$api=C(D);$modal=C(re);$route=C(U);$toastr=C(M);$translate=C(V);$ws=C(Oe);io;term=new Xe.Terminal;termTarget;fitAddon=new Je.FitAddon;setupWizardRestore=!1;selectedBackup=null;clicked=!1;maxFileSizeText=globalThis.backup.maxBackupSizeText;selectedFile;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;restoreArchiveType="homebridge";uploadPercent=0;ngOnInit(){return v(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()}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:()=>{}})}reopenBackupModal(){this.$activeModal.dismiss(),this.$modal.open(me,{size:"lg",backdrop:"static"})}ngOnDestroy(){this.io.end()}dismissModal(){this.$activeModal.dismiss("Dismiss")}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:n=>{console.error(n),this.$toastr.error(n.error?.message||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error")),this.clicked=!1}})}restoreScheduledBackup(){return v(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=>{console.error(e),this.$toastr.error(e.error?.message||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error")),this.clicked=!1}})})}startRestore(){return v(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:n=>{n.type===we.UploadProgress?this.uploadPercent=Math.round(100*n.loaded/n.total):n instanceof Be&&(this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startHbfxRestore()},500),this.clicked=!1)},error:n=>{this.clicked=!1,console.error(n),this.$toastr.error(n.error?.message||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})}startHbfxRestore(){return v(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"))}})})}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],inputs:{setupWizardRestore:"setupWizardRestore",selectedBackup:"selectedBackup"},decls:11,vars:11,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],["id","plugin-log-output",1,"modal-body",3,"hidden"],[1,"modal-footer","justify-content-between"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-hard-drive","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","text","disabled","",1,"form-control","custom-input",3,"value"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz, .hbfx",1,"form-control"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz, .hbfx",1,"form-control",3,"change"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"fa","fa-fw","fa-circle-notch","fa-spin"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click"]],template:function(n,p){n&1&&(T(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),B(),T(5,"button",3),r(6,"translate"),W("click",function(){return p.dismissModal()}),B()(),h(7,ft,18,17,"div",4),H(8,"div",5),h(9,wt,9,5,"div",6),h(10,Bt,7,3,"div",6),B()),n&2&&(t(3),u(s(4,7,"backup.title_backup")),t(2),K("disabled",p.restoreInProgress),f("aria-label",s(6,9,"form.button_close")),t(2),_(!p.restoreStarted&&!p.setupWizardRestore?7:-1),t(),K("hidden",!p.restoreStarted),t(),_(!p.restoreStarted||p.restoreFailed===!0?9:-1),t(),_(!p.restoreInProgress&&p.restoreStarted?10:-1))},dependencies:[R],encapsulation:2})}return i})();var Ze=(i,c)=>({"fa-arrow-right":i,"fa-cog fa-spin":c}),Tt=i=>({backupTime:i,dayCount:7}),$t=(i,c)=>({"fa-trash":i,"fa-cog fa-spin":c}),Ft=(i,c)=>({backupSize:i,maxBackupSizeText:c});function Pt(i,c){if(i&1&&(l(0),r(1,"date"),r(2,"translate")),i&2){let e=b(2);g(" ",G(2,4,"backup.scheduled_backup_time",N(7,Tt,G(1,1,e.backupTime,"shortTime")))," ")}}function Rt(i,c){i&1&&(l(0),r(1,"translate")),i&2&&g(" ",s(1,1,"plugins.settings.restart_required")," ")}function At(i,c){if(i&1&&h(0,Pt,3,9)(1,Rt,2,3),i&2){let e=b();_(e.backupTime?0:1)}}function Vt(i,c){if(i&1&&(l(0),r(1,"translate")),i&2){let e=b();g(" ",s(1,1,e.backupTime?"plugins.settings.restart_required":"backup.scheduled_backup_disabled")," ")}}function Mt(i,c){if(i&1&&(a(0,"span",33),r(1,"translate"),d(2,"i",40),l(3),o()),i&2){let e=b().$implicit;m("ngbTooltip",G(1,3,"backup.backup_exceeds_max_size",F(6,Ft,e.size+"MB",e.maxBackupSizeText)))("openDelay",150),t(3),g(" ",e.size,"MB ")}}function Dt(i,c){if(i&1&&(a(0,"span"),l(1),o()),i&2){let e=b().$implicit;t(),g(" ",e.size,"MB ")}}function Nt(i,c){if(i&1){let e=E();a(0,"li",22)(1,"span")(2,"span",32),l(3),r(4,"date"),o(),d(5,"br"),a(6,"small",23),l(7),r(8,"date"),h(9,Mt,4,9,"span",33),h(10,Dt,2,1,"span"),o()(),a(11,"span",34)(12,"button",35),r(13,"translate"),r(14,"translate"),x("click",function(){let p=S(e).$implicit,y=b(2);return I(y.restore(p))}),d(15,"i",36),o(),a(16,"button",37),r(17,"translate"),r(18,"translate"),x("click",function(){let p=S(e).$implicit,y=b(2);return I(y.download(p))}),d(19,"i",38),o(),a(20,"button",39),r(21,"translate"),r(22,"translate"),x("click",function(){let p=S(e).$implicit,y=b(2);return I(y.delete(p))}),d(23,"i",25),o()()()}if(i&2){let e=c.$implicit,n=b(2);t(2),m("ngbTooltip",e.fileName)("openDelay",150),t(),g(" ",G(4,19,e.timestamp,"mediumDate")," "),t(4),g(" ",G(8,22,e.timestamp,"shortTime")," \xB7 "),t(2),_(e.size>e.maxBackupSize?9:-1),t(),_(e.size<=e.maxBackupSize?10:-1),t(2),m("disabled",n.clicked||n.deleting||e.size>e.maxBackupSize)("ngbTooltip",s(13,25,"form.button_restore"))("openDelay",150),f("aria-label",s(14,27,"form.button_restore")),t(4),m("disabled",n.clicked||n.deleting)("ngbTooltip",s(17,29,"form.button_download"))("openDelay",150),f("aria-label",s(18,31,"form.button_download")),t(4),m("disabled",n.clicked||n.deleting)("ngbTooltip",s(21,33,"form.button_delete"))("openDelay",150),f("aria-label",s(22,35,"form.button_delete")),t(3),m("ngClass",F(37,$t,e.id!==n.deleting,e.id===n.deleting))}}function Lt(i,c){if(i&1&&(a(0,"ul",27)(1,"li",9)(2,"h6",10),l(3),r(4,"translate"),o()(),z(5,Nt,24,40,"li",22,L),o()),i&2){let e=b();t(3),u(s(4,1,"backup.files_auto")),t(2),O(e.scheduledBackups)}}var me=(()=>{class i{$activeModal=C(A);$api=C(D);$backup=C(je);$modal=C(re);$router=C(U);$settings=C(Y);$toastr=C(M);$translate=C(V);restartToastIsShown=!1;Date=Date;clicked=!1;scheduledBackups=[];backupTime;deleting=null;currentSettingEnabled=!1;currentSettingPath="";enabledFormControl=new w(!1);pathFormControl=new w("");ngOnInit(){this.getScheduledBackups(),this.getNextBackup(),this.currentSettingEnabled=!this.$settings.env.scheduledBackupDisable,this.currentSettingPath=this.$settings.env.scheduledBackupPath,this.enabledFormControl.patchValue(this.currentSettingEnabled),this.pathFormControl.patchValue(this.currentSettingPath),this.enabledFormControl.valueChanges.pipe(k(750)).subscribe(e=>v(this,null,function*(){this.currentSettingEnabled=e,yield this.saveUiSettingChange("scheduledBackupDisable",!this.currentSettingEnabled)})),this.pathFormControl.valueChanges.pipe(k(1500)).subscribe(e=>v(this,null,function*(){this.currentSettingPath=e,yield this.saveUiSettingChange("scheduledBackupPath",this.currentSettingPath)}))}download(e){this.$api.get(`/backup/scheduled-backups/${e.id}`,{observe:"response",responseType:"blob"}).subscribe({next:n=>{let p=e.fileName||"homebridge-backup.tar.gz",y=n.body.size;if(y>globalThis.backup.maxBackupSize){let X=this.$translate.instant("backup.backup_exceeds_max_size",{maxBackupSizeText:globalThis.backup.maxBackupSizeText,size:`${(y/1048576).toFixed(1)}MB`});this.$toastr.warning(X,this.$translate.instant("toast.title_warning"))}(0,tt.saveAs)(n.body,p)},error:n=>{console.error(n),this.$toastr.error(this.$translate.instant("backup.backup_download_failed"),this.$translate.instant("toast.title_error"))}})}restore(e){this.$activeModal.close();let n=this.$modal.open(Ye,{size:"lg",backdrop:"static"});n.componentInstance.selectedBackup=e}delete(e){this.deleting=e.id,this.$api.delete(`/backup/scheduled-backups/${e.id}`).subscribe({next:()=>{this.getScheduledBackups(),this.deleting=null},error:n=>{this.deleting=null,console.error(n),this.$toastr.error(this.$translate.instant("backup.backup_delete_failed"),this.$translate.instant("toast.title_error"))}})}onDownloadBackupClick(){return v(this,null,function*(){this.clicked=!0;try{yield this.$backup.downloadBackup(),this.clicked=!1}catch(e){this.clicked=!1,console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}onCreateBackupClick(){return v(this,null,function*(){this.clicked=!0;try{yield $(this.$api.post("/backup",{})),this.clicked=!1,this.getScheduledBackups()}catch(e){this.clicked=!1,console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}saveUiSettingChange(e,n){return v(this,null,function*(){try{yield $(this.$api.put("/config-editor/ui",{key:e,value:n})),this.$settings.setEnvItem(e,n),this.showRestartToast()}catch(p){console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}getScheduledBackups(){this.$api.get("/backup/scheduled-backups").subscribe({next:e=>{this.scheduledBackups=e},error:e=>console.error(e)})}getNextBackup(){this.$api.get("/backup/scheduled-backups/next").subscribe({next:e=>{this.backupTime=e.next},error:e=>{console.error(e)}})}showRestartToast(){if(!this.restartToastIsShown){this.restartToastIsShown=!0;let e=this.$toastr.info(this.$translate.instant("settings.changes.saved"),this.$translate.instant("menu.hbrestart.title"),{timeOut:0,tapToDismiss:!0,disableTimeOut:!0,positionClass:"toast-bottom-right",enableHtml:!0});e&&e.onTap&&e.onTap.subscribe(()=>{this.$router.navigate(["/restart"])})}}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],decls:92,vars:80,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-hard-drive","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item"],[1,"mb-0","text-center"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],[1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"grey-text","small"],[1,"text-start","text-md-end","w-100","w-md-50"],["type","text","placeholder","/home/pi/homebridge-backups",1,"form-control","custom-input",3,"formControl"],[1,"list-group-item","d-flex","justify-content-between","align-items-center","flex-row","pb-2"],[1,"text-start"],[1,"small","grey-text"],[1,"text-end","grey-text","d-flex","align-items-center"],["type","checkbox","id","disableScheduledBackups",1,"rendux-input",3,"formControl"],["for","disableScheduledBackups",1,"rendux-label"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"btn","btn-primary","m-0","ms-3",3,"click","disabled"],[1,"fas","fa-fw",3,"ngClass"],[1,"fas","fa-fw","fa-arrow-right"],[1,"list-group","list-group-box","mt-3","mb-0"],[1,"modal-footer","justify-content-between"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-end"],["container","modal","triggers","hover",3,"ngbTooltip","openDelay"],["container","modal","triggers","hover",1,"red-text",3,"ngbTooltip","openDelay"],[2,"display","flex","flex-wrap","nowrap"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-3",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","fa-history"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","fa-download"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-danger","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","fa-exclamation-circle"]],template:function(n,p){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),o(),a(5,"button",3),r(6,"translate"),x("click",function(){return p.dismissModal()}),o()(),a(7,"div",4)(8,"div",5),d(9,"i",6),o(),a(10,"ul",7)(11,"li"),l(12),r(13,"translate"),o(),a(14,"li"),l(15),r(16,"translate"),o(),a(17,"li"),l(18),r(19,"translate"),o()(),a(20,"ul",8)(21,"li",9)(22,"h6",10),l(23),r(24,"translate"),o()(),a(25,"li",11)(26,"div",12),l(27),r(28,"translate"),d(29,"br"),a(30,"span",13),l(31),r(32,"translate"),o()(),a(33,"div",14),d(34,"input",15),r(35,"translate"),o()(),a(36,"li",16)(37,"div",17),l(38),r(39,"translate"),d(40,"br"),a(41,"span",18),h(42,At,2,1)(43,Vt,2,3),o()(),a(44,"div",19),d(45,"input",20),r(46,"translate"),d(47,"label",21),o()(),a(48,"li",22)(49,"div")(50,"span"),l(51),r(52,"translate"),o(),d(53,"br"),a(54,"small",23),l(55),r(56,"translate"),o()(),a(57,"button",24),r(58,"translate"),x("click",function(){return p.onDownloadBackupClick()}),d(59,"i",25),o()(),a(60,"li",22)(61,"div")(62,"span"),l(63),r(64,"translate"),o(),d(65,"br"),a(66,"small",23),l(67),r(68,"translate"),o()(),a(69,"button",24),r(70,"translate"),x("click",function(){return p.onCreateBackupClick()}),d(71,"i",25),o()(),a(72,"li",22)(73,"div")(74,"span"),l(75),r(76,"translate"),o(),d(77,"br"),a(78,"small",23),l(79),r(80,"translate"),o()(),a(81,"button",24),r(82,"translate"),x("click",function(){return p.restore(null)}),d(83,"i",26),o()()(),h(84,Lt,7,3,"ul",27),o(),a(85,"div",28),d(86,"div",17),a(87,"div",29)(88,"button",30),x("click",function(){return p.dismissModal()}),l(89),r(90,"translate"),o()(),d(91,"div",31),o()()),n&2&&(t(3),u(s(4,32,"backup.title_backup")),t(2),m("disabled",p.clicked||p.deleting),f("aria-label",s(6,34,"form.button_close")),t(7),u(s(13,36,"backup.backup_help_one")),t(3),u(s(16,38,"backup.backup_help_two")),t(3),u(s(19,40,"backup.backup_warning")),t(5),u(s(24,42,"backup.settings_title")),t(4),g(" ",s(28,44,"backup.settings_path")),t(4),u(s(32,46,"backup.settings_path_desc")),t(3),m("formControl",p.pathFormControl),f("aria-label",s(35,48,"backup.settings_path")),t(4),g(" ",s(39,50,"backup.settings_enable")),t(4),_(p.enabledFormControl.value?42:43),t(3),m("formControl",p.enabledFormControl),f("aria-label",s(46,52,"backup.settings_enable")),t(6),u(s(52,54,"backup.backup_now")),t(4),u(s(56,56,"backup.backup_now_desc")),t(2),m("disabled",p.clicked),f("aria-label",s(58,58,"backup.backup_now")),t(2),m("ngClass",F(74,Ze,!p.clicked,p.clicked)),t(4),u(s(64,60,"backup.backup_now")),t(4),u(s(68,62,"backup.backup_now_save_desc")),t(2),m("disabled",p.clicked),f("aria-label",s(70,64,"backup.backup_now")),t(2),m("ngClass",F(77,Ze,!p.clicked,p.clicked)),t(4),u(s(76,66,"backup.restore_now")),t(4),u(s(80,68,"backup.restore_now_desc")),t(2),m("disabled",p.clicked),f("aria-label",s(82,70,"backup.restore_now")),t(3),_(p.scheduledBackups.length?84:-1),t(4),m("disabled",p.clicked||p.deleting),t(),g(" ",s(90,72,"form.button_close")," "))},dependencies:[ce,j,oe,le,ie,ne,pe,Ee,R],encapsulation:2})}return i})();function zt(i,c){i&1&&(a(0,"div",12),d(1,"i",13),o(),a(2,"p",14),l(3),r(4,"translate"),o()),i&2&&(t(3),u(s(4,1,"reset.no_accessories")))}function Ot(i,c){i&1&&(a(0,"div",12),d(1,"i",15),o(),a(2,"ul",16)(3,"li"),l(4),r(5,"translate"),o(),a(6,"li"),l(7),r(8,"translate"),o(),a(9,"li"),l(10),r(11,"translate"),o()(),a(12,"ngb-alert",17)(13,"p",18),l(14),r(15,"translate"),o()()),i&2&&(t(4),u(s(5,5,"reset.accessory_all.list_1")),t(3),u(s(8,7,"reset.accessory_all.list_2")),t(3),u(s(11,9,"reset.accessory_all.list_3")),t(2),m("dismissible",!1),t(2),u(s(15,11,"reset.action_is_irreversible")))}function Ht(i,c){if(i&1){let e=E();a(0,"button",19),r(1,"translate"),x("click",function(){S(e);let p=b();return I(p.dismissModal())}),l(2),r(3,"translate"),o()}if(i&2){let e=b();m("disabled",e.clicked),f("aria-label",s(1,3,"form.button_close")),t(2),g(" ",s(3,5,"form.button_close")," ")}}function Ut(i,c){if(i&1){let e=E();a(0,"button",20),r(1,"translate"),x("click",function(){S(e);let p=b();return I(p.dismissModal())}),l(2),r(3,"translate"),o()}i&2&&(f("aria-label",s(1,2,"form.button_close")),t(2),g(" ",s(3,4,"form.button_close")," "))}function Wt(i,c){i&1&&(l(0),r(1,"translate")),i&2&&g(" ",s(1,1,"form.button_remove")," ")}function Kt(i,c){i&1&&d(0,"i",22)}function Gt(i,c){if(i&1){let e=E();a(0,"button",21),x("click",function(){S(e);let p=b();return I(p.onResetCachedAccessoriesClick())}),h(1,Wt,2,3),h(2,Kt,1,0,"i",22),o()}if(i&2){let e=b();m("disabled",e.clicked),t(),_(e.clicked?-1:1),t(),_(e.clicked?2:-1)}}var it=(()=>{class i{$activeModal=C(A);$api=C(D);$router=C(U);$toastr=C(M);$translate=C(V);clicked=!1;cachedAccessories=[];ngOnInit(){this.loadCachedAccessories()}onResetCachedAccessoriesClick(){return this.clicked=!0,this.$api.put("/server/reset-cached-accessories",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.delete_success"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.failed_to_reset"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}loadCachedAccessories(){return v(this,null,function*(){try{this.cachedAccessories=yield $(this.$api.get("/server/cached-accessories"))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("reset.error_message"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-fw","fa-network-wired","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","error",1,"mb-0",3,"dismissible"],[1,"text-center","mb-0"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(n,p){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),o(),a(5,"button",3),r(6,"translate"),x("click",function(){return p.dismissModal()}),o()(),a(7,"div",4),h(8,zt,5,3),h(9,Ot,16,13),o(),a(10,"div",5)(11,"div",6),h(12,Ht,4,7,"button",7),o(),a(13,"div",8),h(14,Ut,4,6,"button",9),o(),a(15,"div",10),h(16,Gt,3,3,"button",11),o()()()),n&2&&(t(3),u(s(4,8,"reset.accessory_all.title")),t(2),m("disabled",p.clicked),f("aria-label",s(6,10,"form.button_close")),t(3),_(p.cachedAccessories.length===0?8:-1),t(),_(p.cachedAccessories.length>0?9:-1),t(3),_(p.cachedAccessories.length>0?12:-1),t(2),_(p.cachedAccessories.length===0?14:-1),t(2),_(p.cachedAccessories.length>0?16:-1))},dependencies:[de,R],encapsulation:2})}return i})();var jt=(i,c)=>({"green-text":i,"grey-text":c}),qt=(i,c)=>({"btn-danger":i,"btn-elegant":c}),Qt=(i,c,e)=>({"fa-broom":i,"fa-undo":c,"fa-spinner fa-pulse":e});function Jt(i,c){i&1&&(a(0,"div",12),d(1,"i",13),o(),a(2,"p",14),l(3),r(4,"translate"),o()),i&2&&(t(3),u(s(4,1,"reset.bridge_accessories.empty")))}function Xt(i,c){if(i&1){let e=E();a(0,"li",18)(1,"span"),l(2),d(3,"br"),a(4,"small",19),d(5,"i",20),l(6),r(7,"translate"),a(8,"span",21),l(9),o()()(),a(10,"button",22),r(11,"translate"),x("click",function(){let p=S(e).$implicit,y=b(2);return I(y.toggleList(p._id))}),d(12,"i",23),o()()}if(i&2){let e=c.$implicit,n=b(2);t(2),g(" ",e.name," "),t(3),m("ngClass",F(12,jt,e._isPaired,!e._isPaired)),t(),g(" ",s(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),u(e._username),t(),m("disabled",n.clicked)("ngClass",F(15,qt,!n.toDelete.includes(e._id),n.toDelete.includes(e._id))),f("aria-label",s(11,10,"form.button_delete")),t(2),m("ngClass",ee(18,Qt,!n.toDelete.includes(e._id),n.toDelete.includes(e._id)&&!n.clicked,n.toDelete.includes(e._id)&&n.clicked))}}function Yt(i,c){if(i&1&&(a(0,"div",12),d(1,"i",15),o(),a(2,"ul",16)(3,"li"),l(4),r(5,"translate"),o(),a(6,"li"),l(7),r(8,"translate"),o(),a(9,"li"),l(10),r(11,"translate"),o()(),a(12,"ul",17),z(13,Xt,13,22,"li",18,L),o()),i&2){let e=b();t(4),u(s(5,3,"reset.bridge_accessories.list_1")),t(3),u(s(8,5,"reset.clear_cache_single.list_3")),t(3),u(s(11,7,"reset.bridge_accessories.list_2")),t(3),O(e.pairings)}}function Zt(i,c){if(i&1){let e=E();a(0,"button",24),x("click",function(){S(e);let p=b();return I(p.dismissModal())}),l(1),r(2,"translate"),o()}if(i&2){let e=b();m("disabled",e.clicked),t(),g(" ",s(2,2,"form.button_close")," ")}}function ei(i,c){if(i&1){let e=E();a(0,"button",25),x("click",function(){S(e);let p=b();return I(p.dismissModal())}),l(1),r(2,"translate"),o()}i&2&&(t(),g(" ",s(2,1,"form.button_close")," "))}function ti(i,c){i&1&&d(0,"i",27)}function ii(i,c){if(i&1&&l(0),i&2){let e=b(3);g(" (",e.toDelete.length,") ")}}function ni(i,c){if(i&1&&(l(0),r(1,"translate"),h(2,ii,1,1)),i&2){let e=b(2);g(" ",s(1,2,"form.button_remove")," "),t(2),_(e.toDelete.length>0?2:-1)}}function ai(i,c){if(i&1){let e=E();a(0,"button",26),x("click",function(){S(e);let p=b();return I(p.cleanBridges())}),h(1,ti,1,0,"i",27)(2,ni,3,4),o()}if(i&2){let e=b();m("disabled",!e.toDelete.length||e.clicked),t(),_(e.clicked?1:2)}}var nt=(()=>{class i{$activeModal=C(A);$api=C(D);$router=C(U);$toastr=C(M);$translate=C(V);clicked=!1;pairings=[];toDelete=[];ngOnInit(){this.loadPairings()}cleanBridges(){return this.clicked=!0,this.$api.delete("/server/pairings/accessories",{body:this.toDelete.map(e=>({id:e}))}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.accessory_ind.fail"),this.$translate.instant("toast.title_error"))}})}toggleList(e){this.toDelete.includes(e)?this.toDelete=this.toDelete.filter(n=>n!==e):this.toDelete.push(e)}dismissModal(){this.$activeModal.dismiss("Dismiss")}loadPairings(){return v(this,null,function*(){try{this.pairings=(yield $(this.$api.get("/server/pairings"))).filter(e=>e._category==="bridge"&&!e._main).sort((e,n)=>e.name.localeCompare(n.name))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.load_error"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-fw","fa-broom","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"fas","fa-fw","fa-link",3,"ngClass"],[1,"font-monospace"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas","fa-fw",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(n,p){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),o(),a(5,"button",3),r(6,"translate"),x("click",function(){return p.dismissModal()}),o()(),a(7,"div",4),h(8,Jt,5,3),h(9,Yt,15,9),o(),a(10,"div",5)(11,"div",6),h(12,Zt,3,4,"button",7),o(),a(13,"div",8),h(14,ei,3,3,"button",9),o(),a(15,"div",10),h(16,ai,3,2,"button",11),o()()()),n&2&&(t(3),u(s(4,8,"reset.bridge_accessories.title")),t(2),m("disabled",p.clicked),f("aria-label",s(6,10,"form.button_close")),t(3),_(p.pairings.length===0?8:-1),t(),_(p.pairings.length>0?9:-1),t(3),_(p.pairings.length>0?12:-1),t(2),_(p.pairings.length===0?14:-1),t(2),_(p.pairings.length>0?16:-1))},dependencies:[j,R],encapsulation:2})}return i})();function oi(i,c){i&1&&(l(0),r(1,"translate")),i&2&&g(" ",s(1,1,"form.button_reset")," ")}function ri(i,c){i&1&&d(0,"i",16)}var at=(()=>{class i{$activeModal=C(A);$api=C(D);$route=C(U);$toastr=C(M);$translate=C(V);clicked;onResetHomebridgeAccessoryClick(){return this.clicked=!0,this.$api.put("/server/reset-homebridge-accessory",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_reset"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$route.navigate(["/restart"])},error:e=>{console.error(e),this.$toastr.error(this.$translate.instant("reset.failed_to_reset"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],decls:38,vars:33,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-bridge","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","error",1,"mb-0",3,"dismissible"],[1,"text-center","mb-0"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(n,p){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),o(),a(5,"button",3),r(6,"translate"),x("click",function(){return p.dismissModal()}),o()(),a(7,"div",4)(8,"div",5),d(9,"i",6),o(),a(10,"ul",7)(11,"li"),l(12),r(13,"translate"),o(),a(14,"li"),l(15),r(16,"translate"),o(),a(17,"li"),l(18),r(19,"translate"),o(),a(20,"li"),l(21),r(22,"translate"),o()(),a(23,"ngb-alert",8)(24,"p",9),l(25),r(26,"translate"),o()()(),a(27,"div",10)(28,"div",11)(29,"button",12),r(30,"translate"),x("click",function(){return p.dismissModal()}),l(31),r(32,"translate"),o()(),d(33,"div",13),a(34,"div",14)(35,"button",15),x("click",function(){return p.onResetHomebridgeAccessoryClick()}),h(36,oi,2,3),h(37,ri,1,0,"i",16),o()()()()),n&2&&(t(3),u(s(4,15,"reset.bridge_all.title")),t(2),m("disabled",p.clicked),f("aria-label",s(6,17,"form.button_close")),t(7),u(s(13,19,"reset.bridge_all.list_1")),t(3),u(s(16,21,"reset.bridge_all.list_2")),t(3),u(s(19,23,"reset.bridge_all.list_3")),t(3),u(s(22,25,"reset.bridge_all.list_4")),t(2),m("dismissible",!1),t(2),u(s(26,27,"reset.action_is_irreversible")),t(4),m("disabled",p.clicked),f("aria-label",s(30,29,"form.button_close")),t(2),g(" ",s(32,31,"form.button_close")," "),t(4),m("disabled",p.clicked),t(),_(p.clicked?-1:36),t(),_(p.clicked?37:-1))},dependencies:[de,R],encapsulation:2})}return i})();var be=(i,c)=>({"green-text":i,"grey-text":c}),fe=(i,c)=>({"btn-danger":i,"btn-elegant":c}),ot=(i,c,e)=>({"fa-refresh":i,"fa-undo":c,"fa-spinner fa-pulse":e}),si=(i,c,e)=>({"fa-trash":i,"fa-undo":c,"fa-spinner fa-pulse":e});function li(i,c){i&1&&(a(0,"div",12),d(1,"i",13),o(),a(2,"p",14),l(3),r(4,"translate"),o()),i&2&&(t(3),u(s(4,1,"reset.bridges.empty")))}function pi(i,c){if(i&1){let e=E();a(0,"li",20)(1,"span"),l(2),d(3,"br"),a(4,"small",21),d(5,"i",22),l(6),r(7,"translate"),a(8,"span",23),l(9),o(),l(10),r(11,"titlecase"),o()(),a(12,"button",24),r(13,"translate"),x("click",function(){let p=S(e).$implicit,y=b(3);return I(y.toggleList(p._id,!1))}),d(14,"i",25),o()()}if(i&2){let e=c.$implicit,n=b(3);t(2),g(" ",e.name," "),t(3),m("ngClass",F(15,be,e._isPaired,!e._isPaired)),t(),g(" ",s(7,9,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),u(e._username),t(),g(" \xB7 ",e._main?"Homebridge":s(11,11,e._category)," "),t(2),m("disabled",n.clicked)("ngClass",F(18,fe,!n.isInList(e._id),n.isInList(e._id))),f("aria-label",s(13,13,"form.button_unpair")),t(2),m("ngClass",ee(21,ot,!n.isInList(e._id),n.isInList(e._id)&&!n.clicked,n.isInList(e._id)&&n.clicked))}}function di(i,c){if(i&1&&(a(0,"ul",16)(1,"li",17)(2,"h6",18),l(3),r(4,"translate"),o(),a(5,"p",19),l(6),r(7,"translate"),o()(),z(8,pi,15,25,"li",20,L),o()),i&2){let e=b(2);t(3),u(s(4,2,"reset.bridge_ind.head_non_child")),t(3),u(s(7,4,"reset.bridge_ind.desc_non_child")),t(2),O(e.pairingsNonChild)}}function ci(i,c){if(i&1){let e=E();a(0,"li",20)(1,"span"),l(2),d(3,"br"),a(4,"small",21),d(5,"i",22),l(6),r(7,"translate"),a(8,"span",23),l(9),o()()(),a(10,"button",24),r(11,"translate"),x("click",function(){let p=S(e).$implicit,y=b(3);return I(y.toggleList(p._id,!0))}),d(12,"i",25),o()()}if(i&2){let e=c.$implicit,n=b(3);t(2),g(" ",e.name," "),t(3),m("ngClass",F(12,be,e._isPaired,!e._isPaired)),t(),g(" ",s(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),u(e._username),t(),m("disabled",n.clicked)("ngClass",F(15,fe,!n.isInList(e._id),n.isInList(e._id))),f("aria-label",s(11,10,"form.button_unpair")),t(2),m("ngClass",ee(18,ot,!n.isInList(e._id),n.isInList(e._id)&&!n.clicked,n.isInList(e._id)&&n.clicked))}}function mi(i,c){if(i&1&&(a(0,"ul",16)(1,"li",17)(2,"h6",18),l(3),r(4,"translate"),o(),a(5,"p",19),l(6),r(7,"translate"),o()(),z(8,ci,13,22,"li",20,L),o()),i&2){let e=b(2);t(3),u(s(4,2,"reset.bridge_ind.head_child_active")),t(3),u(s(7,4,"reset.bridge_ind.desc_child_active")),t(2),O(e.pairingsChildActive)}}function ui(i,c){if(i&1){let e=E();a(0,"li",20)(1,"span"),l(2),d(3,"br"),a(4,"small",21),d(5,"i",22),l(6),r(7,"translate"),a(8,"span",23),l(9),o()()(),a(10,"button",24),r(11,"translate"),x("click",function(){let p=S(e).$implicit,y=b(3);return I(y.toggleList(p._id,!1))}),d(12,"i",25),o()()}if(i&2){let e=c.$implicit,n=b(3);t(2),g(" ",e.name," "),t(3),m("ngClass",F(12,be,e._isPaired,!e._isPaired)),t(),g(" ",s(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),u(e._username),t(),m("disabled",n.clicked)("ngClass",F(15,fe,!n.isInList(e._id),n.isInList(e._id))),f("aria-label",s(11,10,"form.button_unpair")),t(2),m("ngClass",ee(18,si,!n.isInList(e._id),n.isInList(e._id)&&!n.clicked,n.isInList(e._id)&&n.clicked))}}function hi(i,c){if(i&1&&(a(0,"ul",16)(1,"li",17)(2,"h6",18),l(3),r(4,"translate"),o(),a(5,"p",19),l(6),r(7,"translate"),o()(),z(8,ui,13,22,"li",20,L),o()),i&2){let e=b(2);t(3),u(s(4,2,"reset.bridge_ind.head_child_stale")),t(3),u(s(7,4,"reset.bridge_ind.desc_child_stale")),t(2),O(e.pairingsChildStale)}}function _i(i,c){if(i&1&&(a(0,"div",12),d(1,"i",15),o(),h(2,di,10,6,"ul",16),h(3,mi,10,6,"ul",16),h(4,hi,10,6,"ul",16)),i&2){let e=b();t(2),_(e.pairingsNonChild.length>0?2:-1),t(),_(e.pairingsChildActive.length>0?3:-1),t(),_(e.pairingsChildStale.length>0?4:-1)}}function gi(i,c){if(i&1){let e=E();a(0,"button",26),x("click",function(){S(e);let p=b();return I(p.dismissModal())}),l(1),r(2,"translate"),o()}if(i&2){let e=b();m("disabled",e.clicked),t(),g(" ",s(2,2,"form.button_close")," ")}}function bi(i,c){if(i&1){let e=E();a(0,"button",27),x("click",function(){S(e);let p=b();return I(p.dismissModal())}),l(1),r(2,"translate"),o()}i&2&&(t(),g(" ",s(2,1,"form.button_close")," "))}function fi(i,c){if(i&1&&l(0),i&2){let e=b(3);g(" (",e.toDelete.length,") ")}}function vi(i,c){if(i&1&&(l(0),r(1,"translate"),h(2,fi,1,1)),i&2){let e=b(2);g(" ",s(1,2,"form.button_reset")," "),t(2),_(e.toDelete.length>0?2:-1)}}function Ci(i,c){i&1&&d(0,"i",29)}function xi(i,c){if(i&1){let e=E();a(0,"button",28),x("click",function(){S(e);let p=b();return I(p.removeBridges())}),h(1,vi,3,4),h(2,Ci,1,0,"i",29),o()}if(i&2){let e=b();m("disabled",!e.toDelete.length||e.clicked),t(),_(e.clicked?-1:1),t(),_(e.clicked?2:-1)}}var rt=(()=>{class i{$activeModal=C(A);$api=C(D);$router=C(U);$toastr=C(M);$translate=C(V);clicked=!1;pairingsNonChild=[];pairingsChildActive=[];pairingsChildStale=[];toDelete=[];ngOnInit(){this.loadPairings()}toggleList(e,n=!1){this.toDelete.some(p=>p.id===e)?this.toDelete=this.toDelete.filter(p=>p.id!==e):this.toDelete.push({id:e,resetPairingInfo:n})}isInList(e){return this.toDelete.some(n=>n.id===e)}removeBridges(){return this.clicked=!0,this.$api.delete("/server/pairings",{body:this.toDelete}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.bridge_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.bridge_ind.fail"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}loadPairings(){return v(this,null,function*(){try{let e=(yield $(this.$api.get("/server/pairings"))).filter(n=>!n._main).sort((n,p)=>n.name.localeCompare(p.name));this.pairingsChildActive=e.filter(n=>n._category==="bridge"&&!n._couldBeStale),this.pairingsNonChild=e.filter(n=>n._category!=="bridge"),this.pairingsChildStale=e.filter(n=>n._category==="bridge"&&n._couldBeStale)}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.load_error"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"text-center","mb-0"],[1,"fas","fa-fw","fa-bridge","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box","mt-3","mb-0"],[1,"list-group-item"],[1,"mb-1","text-center"],[1,"mb-0","small","grey-text","text-center"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"fas","fa-fw","fa-link",3,"ngClass"],[1,"font-monospace"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas","fa-fw",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(n,p){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),o(),a(5,"button",3),r(6,"translate"),x("click",function(){return p.dismissModal()}),o()(),a(7,"div",4),h(8,li,5,3),h(9,_i,5,3),o(),a(10,"div",5)(11,"div",6),h(12,gi,3,4,"button",7),o(),a(13,"div",8),h(14,bi,3,3,"button",9),o(),a(15,"div",10),h(16,xi,3,3,"button",11),o()()()),n&2&&(t(3),u(s(4,8,"reset.bridge_ind.title")),t(2),m("disabled",p.clicked),f("aria-label",s(6,10,"form.button_close")),t(3),_(p.pairingsChildActive.length===0&&p.pairingsChildStale.length===0&&p.pairingsNonChild.length===0?8:-1),t(),_(p.pairingsChildActive.length>0||p.pairingsChildStale.length>0||p.pairingsNonChild.length>0?9:-1),t(3),_(p.pairingsChildActive.length>0||p.pairingsChildStale.length>0||p.pairingsNonChild.length>0?12:-1),t(2),_(p.pairingsChildActive.length===0&&p.pairingsChildStale.length===0&&p.pairingsNonChild.length===0?14:-1),t(2),_(p.pairingsChildActive.length>0||p.pairingsChildStale.length>0||p.pairingsNonChild.length>0?16:-1))},dependencies:[j,te,R],encapsulation:2})}return i})();function Si(i,c){if(i&1){let e=E();a(0,"li",9)(1,"div")(2,"span",16),l(3),o(),d(4,"br"),a(5,"span",17),l(6),o()(),a(7,"span")(8,"input",18),ke("ngModelChange",function(p){let y=S(e).$implicit;return ye(y.selected,p)||(y.selected=p),I(p)}),x("ngModelChange",function(){S(e);let p=b();return I(p.onAdapterSelectionChange())}),o(),d(9,"label",19),o()()}if(i&2){let e=c.$implicit;t(3),u(e.ip4||e.ip6),t(3),u(e.iface),t(2),m("id","adapter"+e.iface),Ie("ngModel",e.selected),t(),m("for","adapter"+e.iface)}}var st=(()=>{class i{$activeModal=C(A);adaptersOriginal=[];adaptersAvailable=[];adaptersSelected=[];isUnchanged=!0;ngOnInit(){this.adaptersAvailable.forEach(e=>{e.selected=this.adaptersSelected.some(n=>n.iface===e.iface)}),this.adaptersOriginal=this.adaptersSelected.map(e=>e.iface)}onAdapterSelectionChange(){this.isUnchanged=this.adaptersOriginal.length===this.adaptersAvailable.filter(e=>e.selected).length&&this.adaptersOriginal.every(e=>this.adaptersAvailable.some(n=>n.iface===e&&n.selected))}submit(){this.$activeModal.close(this.adaptersAvailable.filter(e=>e.selected).map(e=>e.iface))}closeAndReset(){this.adaptersAvailable.forEach(e=>{e.selected=this.adaptersOriginal.includes(e.iface)}),this.isUnchanged=!0,this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],inputs:{adaptersAvailable:"adaptersAvailable",adaptersSelected:"adaptersSelected"},decls:28,vars:19,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-ethernet","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box"],[1,"list-group-item","d-flex","justify-content-between","align-items-center","flex-row","pb-2"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"],[1,"font-monospace"],[1,"font-monospace","grey-text"],["type","checkbox",1,"rendux-input",3,"ngModelChange","id","ngModel"],[1,"rendux-label","ms-3",3,"for"]],template:function(n,p){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),o(),a(5,"button",3),r(6,"translate"),x("click",function(){return p.closeAndReset()}),o()(),a(7,"div",4)(8,"div",5),d(9,"i",6),o(),a(10,"ul",7)(11,"li"),l(12),r(13,"translate"),o()(),a(14,"ul",8),z(15,Si,10,5,"li",9,L),o()(),a(17,"div",10)(18,"div",11)(19,"button",12),r(20,"translate"),x("click",function(){return p.closeAndReset()}),l(21),r(22,"translate"),o()(),d(23,"div",13),a(24,"div",14)(25,"button",15),x("click",function(){return p.submit()}),l(26),r(27,"translate"),o()()()()),n&2&&(t(3),u(s(4,7,"settings.network.title_network_interfaces")),t(2),f("aria-label",s(6,9,"form.button_close")),t(7),u(s(13,11,"settings.network.message_network_interface")),t(3),O(p.adaptersAvailable),t(4),f("aria-label",s(20,13,"form.button_close")),t(2),g(" ",s(22,15,"form.button_close")," "),t(4),m("disabled",p.isUnchanged),t(),g(" ",s(27,17,"form.button_save")," "))},dependencies:[ae,ie,ne,Fe,R],encapsulation:2})}return i})();var Ii=["wallpaperInput"],yi=i=>({maxFileSizeText:i});function ki(i,c){if(i&1){let e=E();T(0,"div",10),H(1,"img",20),T(2,"button",21),r(3,"translate"),W("click",function(){S(e);let p=b();return I(p.clearWallpaper())}),H(4,"i",22),B()()}if(i&2){let e=b();t(),K("src",e.wallpaperUrl,ve),t(),f("aria-label",s(3,2,"form.button_delete"))}}function Ei(i,c){i&1&&H(0,"div",11)}var lt=(()=>{class i{$activeModal=C(A);$api=C(D);$settings=C(Y);$toastr=C(M);$translate=C(V);clicked=!1;maxFileSizeText=globalThis.backup.maxBackupSizeText;selectedFile;wallpaperUrl=null;originalWallpaperUrl=null;wallpaperInput;ngOnInit(){this.$settings.env.customWallpaperHash&&(this.wallpaperUrl=`${ze.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`,this.originalWallpaperUrl=this.wallpaperUrl)}onFileChange(e){if(e.length){this.selectedFile=e[0];let n=new FileReader;n.onload=p=>{this.wallpaperUrl=p.target.result},n.readAsDataURL(this.selectedFile)}else delete this.selectedFile,this.wallpaperUrl=this.originalWallpaperUrl}saveWallpaper(){if(this.clicked=!0,this.selectedFile){let e=new FormData;e.append("wallpaper",this.selectedFile,this.selectedFile.name),this.$api.post("/server/wallpaper",e).subscribe({next:()=>{this.$settings.setItem("wallpaper",`ui-wallpaper.${this.selectedFile.name.split(".").pop()}`),this.$activeModal.close(),this.$toastr.success(this.$translate.instant("settings.display.wallpaper_success"),this.$translate.instant("toast.title_success"))},error:n=>{console.error(n),this.$toastr.error(n.error?.message,this.$translate.instant("toast.title_error")),this.clicked=!1}})}else this.$api.delete("/server/wallpaper").subscribe({next:()=>{this.$activeModal.close()},error:e=>{console.error(e),this.$toastr.error(e.error?.message,this.$translate.instant("toast.title_error")),this.clicked=!1}})}clearWallpaper(){this.selectedFile=null,this.wallpaperUrl=this.wallpaperUrl===this.originalWallpaperUrl?null:this.originalWallpaperUrl,this.wallpaperInput.nativeElement.value=""}dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],viewQuery:function(n,p){if(n&1&&Ce(Ii,5),n&2){let y;xe(y=Se())&&(p.wallpaperInput=y.first)}},decls:36,vars:28,consts:[["wallpaperInput",""],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-image","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"mb-3","text-center"],[1,"position-relative","d-inline-block"],[1,"gradient","anim","rounded",2,"height","200px","width","350px","margin","0 auto"],[1,"mb-0"],["type","file","id","wallpaper","accept","image/*",1,"form-control",3,"change"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"],["alt","Current Wallpaper",1,"img-fluid","rounded","mx-auto","d-block",2,"height","200px",3,"src"],[1,"btn","btn-danger","position-absolute",2,"top","10px","right","10px",3,"click"],[1,"fas","fa-fw","fa-trash"]],template:function(n,p){if(n&1){let y=E();T(0,"div",1)(1,"div",2)(2,"h5",3),l(3),r(4,"translate"),B(),T(5,"button",4),r(6,"translate"),W("click",function(){return S(y),I(p.dismissModal())}),B()(),T(7,"div",5)(8,"div",6),H(9,"i",7),B(),T(10,"ul",8)(11,"li"),l(12),r(13,"translate"),B(),T(14,"li"),l(15),r(16,"translate"),B(),T(17,"li"),l(18),r(19,"translate"),B()(),T(20,"div",9),h(21,ki,5,4,"div",10)(22,Ei,1,0,"div",11),B(),T(23,"div",12)(24,"input",13,0),W("change",function(q){return S(y),I(p.onFileChange(q.target.files))}),B()()(),T(26,"div",14)(27,"div",15)(28,"button",16),W("click",function(){return S(y),I(p.dismissModal())}),l(29),r(30,"translate"),B()(),H(31,"div",17),T(32,"div",18)(33,"button",19),W("click",function(){return S(y),I(p.saveWallpaper())}),l(34),r(35,"translate"),B()()()()}n&2&&(t(3),u(s(4,11,"settings.display.wallpaper")),t(2),K("disabled",p.clicked),f("aria-label",s(6,13,"form.button_close")),t(7),u(s(13,15,"settings.display.wallpaper_intro")),t(3),u(G(16,17,"settings.display.wallpaper_rule",N(26,yi,p.maxFileSizeText))),t(3),u(s(19,20,"settings.display.wallpaper_rule2")),t(3),_(p.wallpaperUrl?21:22),t(7),K("disabled",p.clicked),t(),g(" ",s(30,22,"form.button_close")," "),t(4),K("disabled",p.wallpaperUrl===p.originalWallpaperUrl||p.clicked),t(),g(" ",s(35,24,"form.button_save")," "))},dependencies:[oe,R],styles:[".anim[_ngcontent-%COMP%]{-webkit-animation:_ngcontent-%COMP%_gradient 20s ease infinite;-moz-animation:gradient 20s ease infinite;-o-animation:gradient 20s ease infinite;animation:_ngcontent-%COMP%_gradient 20s ease infinite}@keyframes _ngcontent-%COMP%_gradient{0%{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}"]})}return i})();var Z=(i,c)=>({"fa-chevron-down":i,"fa-chevron-right":c}),J=i=>({"is-invalid":i}),wi=i=>({link:i}),Bi=(i,c)=>({"badge-danger":i,"badge-info":c});function Ti(i,c){i&1&&d(0,"app-spinner")}function $i(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Fi(i,c){if(i&1){let e=E();a(0,"ul",8)(1,"li",18)(2,"span"),l(3),r(4,"translate"),o(),a(5,"div",19),d(6,"input",20),r(7,"translate"),h(8,$i,1,1,"i",21),o()(),a(9,"li",22)(10,"span",23),l(11),r(12,"translate"),o(),a(13,"button",24),r(14,"translate"),x("click",function(){S(e);let p=b(2);return I(p.openBackupModal())}),d(15,"i",25),o()(),a(16,"li",22)(17,"span",23),l(18),r(19,"translate"),o(),a(20,"button",24),r(21,"translate"),x("click",function(){S(e);let p=b(2);return I(p.openConfigBackup())}),d(22,"i",25),o()(),a(23,"li",22)(24,"span",23),l(25),r(26,"translate"),o(),a(27,"a",26),r(28,"translate"),d(29,"i",25),o()()()}if(i&2){let e=b(2);t(3),u(s(4,11,"settings.name")),t(3),m("formControl",e.hbNameFormControl)("ngClass",N(27,J,e.hbNameIsInvalid)),f("aria-label",s(7,13,"settings.name")),t(2),_(e.hbNameIsSaving?8:-1),t(3),g(" ",s(12,15,"backup.title_backup")," "),t(2),f("aria-label",s(14,17,"backup.title_backup")),t(5),g(" ",s(19,19,"config.restore.title")," "),t(2),f("aria-label",s(21,21,"config.restore.title")),t(5),g(" ",s(26,23,"menu.tooltip_user_accounts")," "),t(2),f("aria-label",s(28,25,"menu.tooltip_user_accounts"))}}function Pi(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Ri(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Ai(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Vi(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Mi(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Di(i,c){if(i&1){let e=E();a(0,"ul",9)(1,"li",18),l(2),r(3,"translate"),a(4,"div",19)(5,"select",27)(6,"option",28),l(7),r(8,"translate"),o(),a(9,"option",29),l(10,"Bulgarian (bg)"),o(),a(11,"option",30),l(12,"Catalan (ca)"),o(),a(13,"option",31),l(14,"Chinese - Simplified (zh-CN)"),o(),a(15,"option",32),l(16,"Chinese - Traditional (zh-TW)"),o(),a(17,"option",33),l(18,"Czech (cs)"),o(),a(19,"option",34),l(20,"Dutch (nl)"),o(),a(21,"option",35),l(22,"English (en)"),o(),a(23,"option",36),l(24,"Finnish (fi)"),o(),a(25,"option",37),l(26,"French (fr)"),o(),a(27,"option",38),l(28,"German (de)"),o(),a(29,"option",39),l(30,"Hebrew (he)"),o(),a(31,"option",40),l(32,"Hungarian (hu)"),o(),a(33,"option",41),l(34,"Indonesian (id)"),o(),a(35,"option",42),l(36,"Italian (it)"),o(),a(37,"option",43),l(38,"Japanese (ja)"),o(),a(39,"option",44),l(40,"Korean (ko)"),o(),a(41,"option",45),l(42,"Macedonian (mk)"),o(),a(43,"option",46),l(44,"Norwegian (no)"),o(),a(45,"option",47),l(46,"Polish (pl)"),o(),a(47,"option",48),l(48,"Portuguese (Brazil)"),o(),a(49,"option",49),l(50,"Portuguese (Portugal)"),o(),a(51,"option",50),l(52,"Russian (ru)"),o(),a(53,"option",51),l(54,"Slovenian (sl)"),o(),a(55,"option",52),l(56,"Spanish (es)"),o(),a(57,"option",53),l(58,"Swedish (sv)"),o(),a(59,"option",54),l(60,"Thai (th)"),o(),a(61,"option",55),l(62,"Turkish (tr)"),o(),a(63,"option",56),l(64,"Ukrainian (uk)"),o()(),h(65,Pi,1,1,"i",21),o()(),a(66,"li",18),l(67),r(68,"translate"),a(69,"div",19)(70,"select",27)(71,"option",57),l(72),r(73,"translate"),o(),a(74,"option",58),l(75),r(76,"translate"),o(),a(77,"option",59),l(78),r(79,"translate"),o(),a(80,"option",60),l(81),r(82,"translate"),o(),a(83,"option",61),l(84),r(85,"translate"),o(),a(86,"option",62),l(87),r(88,"translate"),o(),a(89,"option",63),l(90),r(91,"translate"),o(),a(92,"option",64),l(93),r(94,"translate"),o(),a(95,"option",65),l(96),r(97,"translate"),o(),a(98,"option",66),l(99),r(100,"translate"),o(),a(101,"option",67),l(102),r(103,"translate"),o(),a(104,"option",68),l(105),r(106,"translate"),o(),a(107,"option",69),l(108),r(109,"translate"),o()(),h(110,Ri,1,1,"i",21),o()(),a(111,"li",18),l(112),r(113,"translate"),a(114,"div",19)(115,"select",27)(116,"option",28),l(117),r(118,"translate"),o(),a(119,"option",70),l(120),r(121,"translate"),o(),a(122,"option",71),l(123),r(124,"translate"),o()(),h(125,Ai,1,1,"i",21),o()(),a(126,"li",18),l(127),r(128,"translate"),a(129,"div",19)(130,"select",27)(131,"option",72),l(132),r(133,"translate"),o(),a(134,"option",73),l(135),r(136,"translate"),o()(),h(137,Vi,1,1,"i",21),o()(),a(138,"li",18),l(139),r(140,"translate"),a(141,"div",19)(142,"select",27)(143,"option",74),l(144),r(145,"translate"),o(),a(146,"option",75),l(147),r(148,"translate"),o()(),h(149,Mi,1,1,"i",21),o()(),a(150,"li",22)(151,"span",23),l(152),r(153,"translate"),o(),a(154,"button",24),r(155,"translate"),x("click",function(){S(e);let p=b(2);return I(p.openWallpaperModal())}),d(156,"i",25),o()()()}if(i&2){let e=b(2);t(2),g(" ",s(3,38,"settings.display.lang")," "),t(3),m("formControl",e.uiLangFormControl),t(2),u(s(8,40,"form.select.auto")),t(58),_(e.uiLangIsSaving?65:-1),t(2),g(" ",s(68,42,"settings.display.theme")," "),t(3),m("formControl",e.uiThemeFormControl),t(2),u(s(73,44,"settings.display.orange")),t(3),u(s(76,46,"settings.display.red")),t(3),u(s(79,48,"settings.display.pink")),t(3),u(s(82,50,"settings.display.purple")),t(3),u(s(85,52,"settings.display.deep_purple")),t(3),u(s(88,54,"settings.display.indigo")),t(3),u(s(91,56,"settings.display.blue")),t(3),u(s(94,58,"settings.display.bluegrey")),t(3),u(s(97,60,"settings.display.cyan")),t(3),u(s(100,62,"settings.display.green")),t(3),u(s(103,64,"settings.display.teal")),t(3),u(s(106,66,"settings.display.grey")),t(3),u(s(109,68,"settings.display.brown")),t(2),_(e.uiThemeIsSaving?110:-1),t(2),g(" ",s(113,70,"settings.display.lighting_mode")," "),t(3),m("formControl",e.uiLightFormControl),t(2),u(s(118,72,"form.select.auto")),t(3),u(s(121,74,"settings.display.light")),t(3),u(s(124,76,"settings.display.dark")),t(2),_(e.uiLightIsSaving?125:-1),t(2),g(" ",s(128,78,"settings.display.menu_mode")," "),t(3),m("formControl",e.uiMenuFormControl),t(2),u(s(133,80,"settings.display.menu_default")),t(3),u(s(136,82,"settings.display.menu_freeze")),t(2),_(e.uiMenuIsSaving?137:-1),t(2),g(" ",s(140,84,"settings.display.temp_units")," "),t(3),m("formControl",e.uiTempFormControl),t(2),u(s(145,86,"settings.display.temp_units.c")),t(3),u(s(148,88,"settings.display.temp_units.f")),t(2),_(e.uiTempIsSaving?149:-1),t(3),u(s(153,90,"settings.display.wallpaper")),t(2),f("aria-label",s(155,92,"settings.display.wallpaper"))}}function Ni(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Li(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function zi(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Oi(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Hi(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Ui(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Wi(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Ki(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Gi(i,c){if(i&1&&(a(0,"li",18)(1,"span"),l(2),r(3,"translate"),d(4,"br"),a(5,"small",76),l(6),r(7,"translate"),o()(),a(8,"div",19),d(9,"input",94),r(10,"translate"),h(11,Ki,1,1,"i",21),o()()),i&2){let e=b(4);t(2),g(" ",s(3,5,"settings.linux.temp")),t(4),u(s(7,7,"settings.linux.temp_desc")),t(3),m("formControl",e.uiTempFileFormControl),f("aria-label",s(10,9,"settings.linux.temp")),t(2),_(e.uiTempFileIsSaving?11:-1)}}function ji(i,c){if(i&1&&(a(0,"li",18)(1,"span"),l(2),r(3,"translate"),d(4,"br"),a(5,"small",76),l(6),r(7,"translate"),o()(),a(8,"div",19),d(9,"input",92),r(10,"translate"),h(11,Ui,1,1,"i",21),o()(),a(12,"li",18)(13,"span"),l(14),r(15,"translate"),d(16,"br"),a(17,"small",76),l(18),r(19,"translate"),o()(),a(20,"div",19),d(21,"input",93),r(22,"translate"),h(23,Wi,1,1,"i",21),o()(),h(24,Gi,12,11,"li",18)),i&2){let e=b(3);t(2),g(" ",s(3,11,"settings.linux.shutdown")),t(4),u(s(7,13,"settings.linux.shutdown_desc")),t(3),m("formControl",e.hbLinuxShutdownFormControl),f("aria-label",s(10,15,"settings.linux.shutdown")),t(2),_(e.hbLinuxShutdownIsSaving?11:-1),t(3),g(" ",s(15,17,"settings.linux.restart")),t(4),u(s(19,19,"settings.linux.restart_desc")),t(3),m("formControl",e.hbLinuxRestartFormControl),f("aria-label",s(22,21,"settings.linux.restart")),t(2),_(e.hbLinuxRestartIsSaving?23:-1),t(),_(e.runningOnRaspberryPi?24:-1)}}function qi(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Qi(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Ji(i,c){i&1&&(a(0,"li",22)(1,"span"),l(2),r(3,"translate"),d(4,"br"),a(5,"small",76),l(6),r(7,"translate"),o()(),a(8,"a",95),r(9,"translate"),d(10,"i",25),o()()),i&2&&(t(2),g(" ",s(3,3,"menu.docker.startup_script")),t(4),u(s(7,5,"platform.docker.script_help")),t(2),f("aria-label",s(9,7,"menu.docker.startup_script")))}function Xi(i,c){if(i&1&&(a(0,"ul",10)(1,"li",22)(2,"span"),l(3),r(4,"translate"),a(5,"code"),l(6,"-D"),o(),d(7,"br"),a(8,"small",76),l(9),r(10,"translate"),o()(),a(11,"div",77)(12,"div",78),d(13,"input",79),r(14,"translate"),d(15,"label",80),o(),h(16,Ni,1,1,"i",21),o()(),a(17,"li",22)(18,"span"),l(19),r(20,"translate"),a(21,"code"),l(22,"-I"),o(),d(23,"br"),a(24,"small",76),l(25),r(26,"translate"),o()(),a(27,"div",77)(28,"div",78),d(29,"input",81),r(30,"translate"),d(31,"label",82),o(),h(32,Li,1,1,"i",21),o()(),a(33,"li",22)(34,"span"),l(35),r(36,"translate"),a(37,"code"),l(38,"-K"),o(),d(39,"br"),a(40,"small",76),l(41),r(42,"translate"),o()(),a(43,"div",77)(44,"div",78),d(45,"input",83),r(46,"translate"),d(47,"label",84),o(),h(48,zi,1,1,"i",21),o()(),a(49,"li",22)(50,"span"),l(51),r(52,"translate"),d(53,"br"),a(54,"small",76),l(55),r(56,"translate"),o()(),a(57,"div",77)(58,"div",78),d(59,"input",85),r(60,"translate"),d(61,"label",86),o(),h(62,Oi,1,1,"i",21),o()(),a(63,"li",18)(64,"span"),l(65),r(66,"translate"),d(67,"br"),a(68,"small",76),l(69),r(70,"translate"),o()(),a(71,"div",19),d(72,"input",87),r(73,"translate"),h(74,Hi,1,1,"i",21),o()(),h(75,ji,25,23),a(76,"li",18)(77,"span")(78,"span",88),l(79,"DEBUG"),o(),d(80,"br")(81,"small",89),r(82,"translate"),o(),a(83,"div",19),d(84,"input",90),h(85,qi,1,1,"i",21),o()(),a(86,"li",18)(87,"span")(88,"span",88),l(89,"NODE_OPTIONS"),o(),d(90,"br"),a(91,"small",76),l(92),r(93,"translate"),o()(),a(94,"div",19),d(95,"input",91),h(96,Qi,1,1,"i",21),o()(),h(97,Ji,11,9,"li",22),o()),i&2){let e=b(2);t(3),g(" ",s(4,33,"settings.startup.debug")," "),t(6),g(" ",s(10,35,e.isHbV2?"settings.startup.debug_desc_v2":"settings.startup.debug_desc_v1")," "),t(4),m("formControl",e.hbDebugFormControl),f("aria-label",s(14,37,"settings.startup.debug")),t(3),_(e.hbDebugIsSaving?16:-1),t(3),g(" ",s(20,39,"settings.startup.insecure")," "),t(6),u(s(26,41,"settings.startup.insecure_desc")),t(4),m("formControl",e.hbInsecureFormControl),f("aria-label",s(30,43,"settings.startup.insecure")),t(3),_(e.hbInsecureIsSaving?32:-1),t(3),g(" ",s(36,45,"settings.startup.keep_accessories")," "),t(6),u(s(42,47,"settings.startup.keep_accessories_desc")),t(4),m("formControl",e.hbKeepFormControl),f("aria-label",s(46,49,"settings.startup.keep_accessories")),t(3),_(e.hbKeepIsSaving?48:-1),t(3),g(" ",s(52,51,"settings.startup.metrics")),t(4),u(s(56,53,"settings.startup.metrics_desc")),t(4),m("formControl",e.uiMetricsFormControl),f("aria-label",s(60,55,"settings.startup.metrics")),t(3),_(e.uiMetricsIsSaving?62:-1),t(3),g(" ",s(66,57,"settings.network.hb_package")),t(4),u(s(70,59,"settings.network.hb_package_desc")),t(3),m("formControl",e.hbPackageFormControl),f("aria-label",s(73,61,"settings.network.hb_package")),t(2),_(e.hbPackageIsSaving?74:-1),t(),_(e.platform==="linux"?75:-1),t(6),m("innerHTML",G(82,63,"settings.service.debug_tooltip",N(68,wi,e.linkDebug)),he),t(3),m("formControl",e.hbEnvDebugFormControl),t(),_(e.hbEnvDebugIsSaving?85:-1),t(7),u(s(93,66,"settings.service.node_tooltip")),t(3),m("formControl",e.hbEnvNodeFormControl),t(),_(e.hbEnvNodeIsSaving?96:-1),t(),_(e.runningInDocker?97:-1)}}function Yi(i,c){i&1&&d(0,"i",108)}function Zi(i,c){if(i&1&&(a(0,"span",97),h(1,Yi,1,0,"i",108),l(2),a(3,"span",109),l(4),r(5,"translate"),o()()),i&2){let e=c.$implicit;m("ngClass",F(6,Bi,e.missing,!e.missing)),t(),_(e.missing?1:-1),t(),g(" ",e.iface,": "),t(2),u(e.missing?s(5,4,"settings.mdns_advertiser_not_connected"):e.ip4||e.ip6)}}function en(i,c){i&1&&(a(0,"option",99),l(1),r(2,"translate"),o()),i&2&&(t(),g("Avahi (",s(2,1,"settings.mdns_advertiser_rec"),")"))}function tn(i,c){i&1&&(a(0,"option",102),l(1),r(2,"translate"),o()),i&2&&(t(),g("systemd-resolved (",s(2,1,"settings.mdns_advertiser_exp"),")"))}function nn(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function an(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function on(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function rn(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function sn(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function ln(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function pn(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function dn(i,c){if(i&1){let e=E();a(0,"ul",11)(1,"li",22)(2,"span",23),l(3),r(4,"translate"),d(5,"br"),a(6,"div",96),l(7),r(8,"translate"),o(),z(9,Zi,6,9,"span",97,L),o(),a(11,"button",98),r(12,"translate"),x("click",function(){S(e);let p=b(2);return I(p.selectNetworkInterfaces())}),d(13,"i",25),o()(),a(14,"li",18)(15,"span"),l(16),r(17,"translate"),d(18,"br"),a(19,"small",76),l(20),r(21,"translate"),o()(),a(22,"div",19)(23,"select",27),r(24,"translate"),h(25,en,3,3,"option",99),a(26,"option",100),l(27),r(28,"translate"),o(),a(29,"option",101),l(30,"Bonjour HAP"),o(),h(31,tn,3,3,"option",102),o(),h(32,nn,1,1,"i",21),o()(),a(33,"li",18)(34,"span"),l(35),r(36,"translate"),d(37,"br"),a(38,"small",76),l(39),r(40,"translate"),o()(),a(41,"div",19),d(42,"input",103),r(43,"translate"),h(44,an,1,1,"i",21),o()(),a(45,"li",18)(46,"span"),l(47),r(48,"translate"),d(49,"br"),a(50,"small",76),l(51),r(52,"translate"),o()(),a(53,"div",19),d(54,"input",104),r(55,"translate"),h(56,on,1,1,"i",21),o()(),a(57,"li",18)(58,"span"),l(59),r(60,"translate"),d(61,"br"),a(62,"small",76),l(63),r(64,"translate"),o()(),a(65,"div",19),d(66,"input",103),r(67,"translate"),h(68,rn,1,1,"i",21),o()(),a(69,"li",18)(70,"span"),l(71),r(72,"translate"),d(73,"br"),a(74,"small",76),l(75),r(76,"translate"),o()(),a(77,"div",19),d(78,"input",103),r(79,"translate"),h(80,sn,1,1,"i",21),o()(),a(81,"li",18)(82,"span"),l(83),r(84,"translate"),d(85,"br")(86,"small",105),r(87,"translate"),o(),a(88,"div",19),d(89,"input",106),r(90,"translate"),h(91,ln,1,1,"i",21),o()(),a(92,"li",18)(93,"span"),l(94),r(95,"translate"),d(96,"br"),a(97,"small",76),l(98),r(99,"translate"),o()(),a(100,"div",19),d(101,"input",107),r(102,"translate"),h(103,pn,1,1,"i",21),o()()()}if(i&2){let e=b(2);t(3),g(" ",s(4,46,"settings.network.title_network_interfaces")),t(4),u(s(8,48,"settings.network.message_network_interface")),t(2),O(e.adaptersSelected),t(2),m("disabled",!e.adaptersAvailable.length),f("aria-label",s(12,50,"settings.network.title_network_interfaces")),t(5),g(" ",s(17,52,"settings.mdns_advertiser")),t(4),u(s(21,54,"settings.mdns_advertiser_help")),t(3),m("formControl",e.hbMDnsFormControl),f("aria-label",s(24,56,"settings.mdns_advertiser")),t(2),_(e.showAvahiMdnsOption?25:-1),t(2),g(" Ciao ",e.showAvahiMdnsOption?"":"("+s(28,58,"settings.mdns_advertiser_rec")+")"," "),t(4),_(e.showResolvedMdnsOption?31:-1),t(),_(e.hbMDnsIsSaving?32:-1),t(3),g(" ",s(36,60,"settings.network.port_hb")),t(4),u(s(40,62,"settings.network.port_hb_desc")),t(3),m("formControl",e.hbPortFormControl)("ngClass",N(96,J,e.hbPortIsInvalid)),f("aria-label",s(43,64,"settings.network.port_hb")),t(2),_(e.hbPortIsSaving?44:-1),t(3),g(" ",s(48,66,"settings.network.port_ui")),t(4),u(s(52,68,"settings.network.port_ui_desc")),t(3),m("formControl",e.uiPortFormControl)("ngClass",N(98,J,e.uiPortIsInvalid)),f("aria-label",s(55,70,"settings.network.port_ui")),t(2),_(e.uiPortIsSaving?56:-1),t(3),g(" ",s(60,72,"settings.network.port_start")),t(4),u(s(64,74,"settings.network.port_start_desc")),t(3),m("formControl",e.hbStartPortFormControl)("ngClass",N(100,J,e.hbStartPortIsInvalid)),f("aria-label",s(67,76,"settings.network.port_start")),t(2),_(e.hbStartPortIsSaving?68:-1),t(3),g(" ",s(72,78,"settings.network.port_end")),t(4),u(s(76,80,"settings.network.port_end_desc")),t(3),m("formControl",e.hbEndPortFormControl)("ngClass",N(102,J,e.hbEndPortIsInvalid)),f("aria-label",s(79,82,"settings.network.port_end")),t(2),_(e.hbEndPortIsSaving?80:-1),t(3),g(" ",s(84,84,"settings.network.host")),t(3),m("innerHtml",s(87,86,"settings.network.host_desc"),he),t(3),m("formControl",e.uiHostFormControl),f("aria-label",s(90,88,"settings.network.host")),t(2),_(e.uiHostIsSaving?91:-1),t(3),g(" ",s(95,90,"settings.network.proxy")),t(4),u(s(99,92,"settings.network.proxy_desc")),t(3),m("formControl",e.uiProxyHostFormControl),f("aria-label",s(102,94,"settings.network.proxy")),t(2),_(e.uiProxyHostIsSaving?103:-1)}}function cn(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function mn(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function un(i,c){if(i&1&&(a(0,"li",18)(1,"span"),l(2),r(3,"translate"),d(4,"br"),a(5,"small",76),l(6),r(7,"translate"),o()(),a(8,"div",19),d(9,"input",111),r(10,"translate"),h(11,mn,1,1,"i",21),o()()),i&2){let e=b(3);t(2),g(" ",s(3,6,"settings.terminal.log_truncate")),t(4),u(s(7,8,"settings.terminal.log_truncate_desc")),t(3),m("formControl",e.hbLogTruncateFormControl)("ngClass",N(12,J,e.hbLogTruncateIsInvalid)),f("aria-label",s(10,10,"settings.terminal.log_truncate")),t(2),_(e.hbLogTruncateIsSaving?11:-1)}}function hn(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function _n(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function gn(i,c){if(i&1&&(a(0,"li",22)(1,"span"),l(2),r(3,"translate"),a(4,"span",112),l(5),r(6,"translate"),o(),d(7,"br"),a(8,"small",76),l(9),r(10,"translate"),o()(),a(11,"div",77)(12,"div",78),d(13,"input",115),r(14,"translate"),d(15,"label",116),o(),h(16,_n,1,1,"i",21),o()()),i&2){let e=b(4);t(2),g(" ",s(3,6,"settings.terminal.warning")," "),t(3),u(s(6,8,"common.labels.beta")),t(4),u(s(10,10,"settings.terminal.warning_help")),t(4),m("formControl",e.uiTerminalHideWarningFormControl),f("aria-label",s(14,12,"settings.terminal.warning")),t(3),_(e.uiTerminalHideWarningIsSaving?16:-1)}}function bn(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function fn(i,c){if(i&1&&(a(0,"li",18)(1,"div",117)(2,"span"),l(3),r(4,"translate"),a(5,"span",112),l(6),r(7,"translate"),o()(),a(8,"div",118),l(9),r(10,"translate"),o()(),a(11,"div",19),d(12,"input",119),r(13,"translate"),h(14,bn,1,1,"i",21),o()()),i&2){let e=b(4);t(3),g(" ",s(4,7,"settings.terminal.buffer_size")," "),t(3),u(s(7,9,"common.labels.beta")),t(3),u(s(10,11,"settings.terminal.buffer_size_help")),t(3),m("formControl",e.uiTerminalBufferSizeFormControl)("ngClass",N(15,J,e.uiTerminalBufferSizeIsInvalid)),f("aria-label",s(13,13,"settings.terminal.buffer_size")),t(2),_(e.uiTerminalBufferSizeIsSaving?14:-1)}}function vn(i,c){if(i&1&&(a(0,"li",22)(1,"span"),l(2),r(3,"translate"),a(4,"span",112),l(5),r(6,"translate"),o(),d(7,"br"),a(8,"small",76),l(9),r(10,"translate"),o()(),a(11,"div",77)(12,"div",78),d(13,"input",113),r(14,"translate"),d(15,"label",114),o(),h(16,hn,1,1,"i",21),o()(),h(17,gn,17,14,"li",22),h(18,fn,15,17,"li",18)),i&2){let e=b(3);t(2),g(" ",s(3,8,"settings.terminal.persistence")," "),t(3),u(s(6,10,"common.labels.beta")),t(4),u(s(10,12,"settings.terminal.persistence_help")),t(4),m("formControl",e.uiTerminalPersistenceFormControl),f("aria-label",s(14,14,"settings.terminal.persistence")),t(3),_(e.uiTerminalPersistenceIsSaving?16:-1),t(),_(e.uiTerminalPersistenceFormControl.value?-1:17),t(),_(e.uiTerminalPersistenceFormControl.value?18:-1)}}function Cn(i,c){if(i&1&&(a(0,"ul",12)(1,"li",18)(2,"span"),l(3),r(4,"translate"),d(5,"br"),a(6,"small",76),l(7),r(8,"translate"),o()(),a(9,"div",19),d(10,"input",110),r(11,"translate"),h(12,cn,1,1,"i",21),o()(),h(13,un,12,14,"li",18),h(14,vn,19,16),o()),i&2){let e=b(2);t(3),g(" ",s(4,8,"settings.terminal.log_max")),t(4),u(s(8,10,"settings.terminal.log_max_desc")),t(3),m("formControl",e.hbLogSizeFormControl)("ngClass",N(14,J,e.hbLogSizeIsInvalid)),f("aria-label",s(11,12,"settings.terminal.log_max")),t(2),_(e.hbLogSizeIsSaving?12:-1),t(),_(e.hbLogSizeFormControl.value>0?13:-1),t(),_(e.enableTerminalAccess?14:-1)}}function xn(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Sn(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function In(i,c){if(i&1&&(a(0,"li",18)(1,"span"),l(2),r(3,"translate"),d(4,"br"),a(5,"small",76),l(6),r(7,"translate"),o()(),a(8,"div",19),d(9,"input",125),r(10,"translate"),h(11,Sn,1,1,"i",21),o()()),i&2){let e=b(3);t(2),g(" ",s(3,6,"settings.startup.session")),t(4),u(s(7,8,"settings.startup.session_desc")),t(3),m("formControl",e.uiSessionTimeoutFormControl)("ngClass",N(12,J,e.uiSessionTimeoutIsInvalid)),f("aria-label",s(10,10,"settings.startup.session")),t(2),_(e.uiSessionTimeoutIsSaving?11:-1)}}function yn(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function kn(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function En(i,c){if(i&1&&(a(0,"li",18)(1,"span"),l(2),r(3,"translate"),o(),a(4,"div",19),d(5,"input",126),r(6,"translate"),h(7,yn,1,1,"i",21),o()(),a(8,"li",18)(9,"span"),l(10),r(11,"translate"),o(),a(12,"div",19),d(13,"input",127),r(14,"translate"),h(15,kn,1,1,"i",21),o()()),i&2){let e=b(3);t(2),u(s(3,8,"settings.security.key")),t(3),m("formControl",e.uiSslKeyFormControl),f("aria-label",s(6,10,"settings.security.key")),t(2),_(e.uiSslKeyIsSaving?7:-1),t(3),u(s(11,12,"settings.security.cert")),t(3),m("formControl",e.uiSslCertFormControl),f("aria-label",s(14,14,"settings.security.cert")),t(2),_(e.uiSslCertIsSaving?15:-1)}}function wn(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Bn(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Tn(i,c){if(i&1){let e=E();a(0,"li",18)(1,"span"),l(2),r(3,"translate"),o(),a(4,"div",19),d(5,"input",128),r(6,"translate"),h(7,wn,1,1,"i",21),o()(),a(8,"li",18)(9,"span"),l(10),r(11,"translate"),o(),a(12,"div",19)(13,"input",129),r(14,"translate"),x("focus",function(){S(e);let p=b(3);return I(p.showPfxPassphrase=!0)})("blur",function(){S(e);let p=b(3);return I(p.showPfxPassphrase=!1)}),o(),h(15,Bn,1,1,"i",21),o()()}if(i&2){let e=b(3);t(2),u(s(3,9,"settings.security.pfx")),t(3),m("formControl",e.uiSslPfxFormControl),f("aria-label",s(6,11,"settings.security.pfx")),t(2),_(e.uiSslPfxIsSaving?7:-1),t(3),u(s(11,13,"settings.security.pass")),t(3),m("type",e.showPfxPassphrase?"text":"password")("formControl",e.uiSslPassphraseFormControl),f("aria-label",s(14,15,"settings.security.pass")),t(2),_(e.uiSslPassphraseIsSaving?15:-1)}}function $n(i,c){if(i&1){let e=E();a(0,"ul",13)(1,"li",22)(2,"span"),l(3),r(4,"translate"),d(5,"br"),a(6,"small",76),l(7),r(8,"translate"),o()(),a(9,"div",77)(10,"div",78),d(11,"input",120),r(12,"translate"),d(13,"label",121),o(),h(14,xn,1,1,"i",21),o()(),h(15,In,12,14,"li",18),a(16,"li",18)(17,"span"),l(18),r(19,"translate"),d(20,"br"),a(21,"small",76),l(22),r(23,"translate"),o()(),a(24,"div",19)(25,"select",27),r(26,"translate"),a(27,"option",122),l(28),r(29,"translate"),o(),a(30,"option",123),l(31),r(32,"translate"),o(),a(33,"option",124),l(34),r(35,"translate"),o()()()(),h(36,En,16,16),h(37,Tn,16,17),a(38,"li",22)(39,"span",23),l(40),r(41,"translate"),d(42,"br"),a(43,"small",76),l(44),r(45,"translate"),o()(),a(46,"button",24),r(47,"translate"),x("click",function(){S(e);let p=b(2);return I(p.accessoryUiControl())}),d(48,"i",25),o()()()}if(i&2){let e=b(2);t(3),g(" ",s(4,18,"settings.security.auth")),t(4),g(" ",s(8,20,"settings.security.auth_desc")," "),t(4),m("formControl",e.uiAuthFormControl),f("aria-label",s(12,22,"settings.security.auth")),t(3),_(e.uiAuthIsSaving?14:-1),t(),_(e.uiAuthFormControl.value?15:-1),t(3),g(" ",s(19,24,"settings.security.https")),t(4),u(s(23,26,"settings.security.https_desc")),t(3),m("formControl",e.uiSslTypeFormControl),f("aria-label",s(26,28,"settings.security.https")),t(3),u(s(29,30,"accessories.control.off")),t(3),u(s(32,32,"settings.security.https_keycert")),t(3),u(s(35,34,"settings.security.https_pfx")),t(2),_(e.uiSslTypeFormControl.value==="keycert"?36:-1),t(),_(e.uiSslTypeFormControl.value==="pfx"?37:-1),t(3),g(" ",s(41,36,"settings.security.ui_control")),t(4),u(s(45,38,"settings.security.ui_control_desc")),t(2),f("aria-label",s(47,40,"settings.security.ui_control"))}}function Fn(i,c){i&1&&(a(0,"p",14),l(1),r(2,"translate"),o()),i&2&&(t(),u(s(2,1,"settings.cache.desc")))}function Pn(i,c){i&1&&d(0,"i",21),i&2&&m("@fadeInOut",void 0)}function Rn(i,c){if(i&1){let e=E();a(0,"ul",15)(1,"li",22)(2,"span"),l(3),r(4,"translate"),d(5,"br"),a(6,"small",76),l(7),r(8,"translate"),o()(),a(9,"div",77)(10,"div",78),d(11,"input",130),r(12,"translate"),d(13,"label",131),o(),h(14,Pn,1,1,"i",21),o()(),a(15,"li",22)(16,"span",23),l(17),r(18,"translate"),d(19,"br"),a(20,"small",76),l(21),r(22,"translate"),o()(),a(23,"button",24),r(24,"translate"),x("click",function(){S(e);let p=b(2);return I(p.removeSingleCachedAccessories())}),d(25,"i",25),o()(),a(26,"li",22)(27,"span",23),l(28),r(29,"translate"),d(30,"br"),a(31,"small",76),l(32),r(33,"translate"),o()(),a(34,"button",24),r(35,"translate"),x("click",function(){S(e);let p=b(2);return I(p.removeBridgeAccessories())}),d(36,"i",25),o()(),a(37,"li",22)(38,"span",23),l(39),r(40,"translate"),d(41,"br"),a(42,"small",76),l(43),r(44,"translate"),o()(),a(45,"button",24),r(46,"translate"),x("click",function(){S(e);let p=b(2);return I(p.removeAllCachedAccessories())}),d(47,"i",25),o()()()}if(i&2){let e=b(2);t(3),g(" ",s(4,14,"settings.accessory.debug")),t(4),u(s(8,16,"settings.accessory.debug_desc")),t(4),m("formControl",e.uiAccDebugFormControl),f("aria-label",s(12,18,"settings.accessory.debug")),t(3),_(e.uiAccDebugIsSaving?14:-1),t(3),g(" ",s(18,20,"reset.accessory_ind.title")),t(4),u(s(22,22,"reset.accessory_ind.desc")),t(2),f("aria-label",s(24,24,"reset.accessory_ind.title")),t(5),g(" ",s(29,26,"reset.bridge_accessories.title")),t(4),u(s(33,28,"reset.bridge_accessories.desc")),t(2),f("aria-label",s(35,30,"reset.accessory_all.title")),t(5),g(" ",s(40,32,"reset.accessory_all.title")),t(4),u(s(44,34,"reset.accessory_all.desc")),t(2),f("aria-label",s(46,36,"reset.accessory_all.title"))}}function An(i,c){i&1&&(a(0,"p",14),l(1),r(2,"translate"),o()),i&2&&(t(),u(s(2,1,"reset.bridges.desc")))}function Vn(i,c){if(i&1){let e=E();a(0,"ul",16)(1,"li",22)(2,"span",23),l(3),r(4,"translate"),d(5,"br"),a(6,"small",76),l(7),r(8,"translate"),o()(),a(9,"button",24),r(10,"translate"),x("click",function(){S(e);let p=b(2);return I(p.unpairAccessory())}),d(11,"i",25),o()(),a(12,"li",22)(13,"span",23),l(14),r(15,"translate"),r(16,"titlecase"),d(17,"br"),a(18,"small",76),l(19),r(20,"translate"),o()(),a(21,"button",24),r(22,"translate"),x("click",function(){S(e);let p=b(2);return I(p.resetHomebridgeState())}),d(23,"i",25),o()()()}i&2&&(t(3),g(" ",s(4,6,"reset.bridge_ind.title")),t(4),u(s(8,8,"reset.bridge_ind.desc")),t(2),f("aria-label",s(10,10,"reset.bridge_ind.title")),t(5),g(" ",s(16,14,s(15,12,"reset.bridge_all.title"))),t(5),u(s(20,16,"reset.bridge_all.desc")),t(2),f("aria-label",s(22,18,"reset.bridge_all.title")))}function Mn(i,c){if(i&1){let e=E();a(0,"div",4)(1,"div",5),x("click",function(){S(e);let p=b();return I(p.toggleSection("general"))}),a(2,"h5",6),d(3,"i",7),l(4),r(5,"translate"),o()(),h(6,Fi,30,29,"ul",8),o(),a(7,"div",4)(8,"div",5),x("click",function(){S(e);let p=b();return I(p.toggleSection("display"))}),a(9,"h5",6),d(10,"i",7),l(11),r(12,"translate"),o()(),h(13,Di,157,94,"ul",9),o(),a(14,"div",4)(15,"div",5),x("click",function(){S(e);let p=b();return I(p.toggleSection("startup"))}),a(16,"h5",6),d(17,"i",7),l(18),r(19,"translate"),o()(),h(20,Xi,98,70,"ul",10),o(),a(21,"div",4)(22,"div",5),x("click",function(){S(e);let p=b();return I(p.toggleSection("network"))}),a(23,"h5",6),d(24,"i",7),l(25),r(26,"translate"),o()(),h(27,dn,104,104,"ul",11),o(),a(28,"div",4)(29,"div",5),x("click",function(){S(e);let p=b();return I(p.toggleSection("terminal"))}),a(30,"h5",6),d(31,"i",7),l(32),r(33,"translate"),o()(),h(34,Cn,15,16,"ul",12),o(),a(35,"div",4)(36,"div",5),x("click",function(){S(e);let p=b();return I(p.toggleSection("security"))}),a(37,"h5",6),d(38,"i",7),l(39),r(40,"translate"),o()(),h(41,$n,49,42,"ul",13),o(),a(42,"div",4)(43,"div",5),x("click",function(){S(e);let p=b();return I(p.toggleSection("cache"))}),a(44,"h5",6),d(45,"i",7),l(46),r(47,"translate"),o()(),h(48,Fn,3,3,"p",14),h(49,Rn,48,38,"ul",15),o(),a(50,"div",4)(51,"div",5),x("click",function(){S(e);let p=b();return I(p.toggleSection("reset"))}),a(52,"h5",6),d(53,"i",7),l(54),r(55,"translate"),o()(),h(56,An,3,3,"p",14),h(57,Vn,24,20,"ul",16),o(),d(58,"div",17)}if(i&2){let e=b();t(),f("aria-expanded",e.showFields.general?"true":"false")("aria-controls","fieldsGeneral"),t(2),m("ngClass",F(58,Z,e.showFields.general,!e.showFields.general)),t(),g(" ",s(5,42,"settings.general.title_general")," "),t(2),_(e.showFields.general?6:-1),t(2),f("aria-expanded",e.showFields.display?"true":"false")("aria-controls","fieldsDisplay"),t(2),m("ngClass",F(61,Z,e.showFields.display,!e.showFields.display)),t(),g(" ",s(12,44,"settings.general.title_display")," "),t(2),_(e.showFields.display?13:-1),t(2),f("aria-expanded",e.showFields.startup?"true":"false")("aria-controls","fieldsStartup"),t(2),m("ngClass",F(64,Z,e.showFields.startup,!e.showFields.startup)),t(),g(" ",s(19,46,"settings.title_startup_options")," "),t(2),_(e.showFields.startup?20:-1),t(2),f("aria-expanded",e.showFields.network?"true":"false")("aria-controls","fieldsNetwork"),t(2),m("ngClass",F(67,Z,e.showFields.network,!e.showFields.network)),t(),g(" ",s(26,48,"settings.network.title_network")," "),t(2),_(e.showFields.network?27:-1),t(2),f("aria-expanded",e.showFields.terminal?"true":"false")("aria-controls","fieldsTerminal"),t(2),m("ngClass",F(70,Z,e.showFields.terminal,!e.showFields.terminal)),t(),g(" ",s(33,50,"settings.network.title_terminal")," "),t(2),_(e.showFields.terminal?34:-1),t(2),f("aria-expanded",e.showFields.security?"true":"false")("aria-controls","fieldsSecurity"),t(2),m("ngClass",F(73,Z,e.showFields.security,!e.showFields.security)),t(),g(" ",s(40,52,"settings.network.title_security")," "),t(2),_(e.showFields.security?41:-1),t(2),f("aria-expanded",e.showFields.cache?"true":"false")("aria-controls","fieldsCache"),t(2),m("ngClass",F(76,Z,e.showFields.cache,!e.showFields.cache)),t(),g(" ",s(47,54,"menu.label_accessories")," "),t(2),_(e.showFields.cache?48:-1),t(),_(e.showFields.cache?49:-1),t(2),f("aria-expanded",e.showFields.reset?"true":"false")("aria-controls","fieldsReset"),t(2),m("ngClass",F(79,Z,e.showFields.reset,!e.showFields.reset)),t(),g(" ",s(55,56,"reset.bridges.title")," "),t(2),_(e.showFields.reset?56:-1),t(),_(e.showFields.reset?57:-1)}}var ir=(()=>{class i{$api=C(D);$modal=C(re);$notification=C(Ue);$router=C(U);$settings=C(Y);$terminal=C(Ke);$toastr=C(M);$translate=C(V);restartToastIsShown=!1;showFields={general:!0,display:!0,startup:!0,network:!0,security:!0,terminal:!0,reset:!0,cache:!0};loading=!0;isHbV2=!1;showAvahiMdnsOption=!1;showResolvedMdnsOption=!1;adaptersAvailable=[];adaptersSelected=[];showPfxPassphrase=!1;runningInDocker=this.$settings.env.runningInDocker;runningOnRaspberryPi=this.$settings.env.runningOnRaspberryPi;platform=this.$settings.env.platform;enableTerminalAccess=this.$settings.env.enableTerminalAccess;hbNameIsInvalid=!1;hbNameIsSaving=!1;hbNameFormControl=new w("");uiLangIsSaving=!1;uiLangFormControl=new w("");uiThemeIsSaving=!1;uiThemeFormControl=new w("");uiLightIsSaving=!1;uiLightFormControl=new w("");uiMenuIsSaving=!1;uiMenuFormControl=new w("");uiTempIsSaving=!1;uiTempFormControl=new w("");uiTerminalPersistenceIsSaving=!1;uiTerminalPersistenceFormControl=new w(!1);uiTerminalHideWarningIsSaving=!1;uiTerminalHideWarningFormControl=new w(!1);uiTerminalBufferSizeIsSaving=!1;uiTerminalBufferSizeIsInvalid=!1;uiTerminalBufferSizeFormControl=new w(globalThis.terminal.bufferSize);hbDebugIsSaving=!1;hbDebugFormControl=new w(!1);hbInsecureIsSaving=!1;hbInsecureFormControl=new w(!1);hbKeepIsSaving=!1;hbKeepFormControl=new w(!1);hbEnvDebugIsSaving=!1;hbEnvDebugFormControl=new w("");hbEnvNodeIsSaving=!1;hbEnvNodeFormControl=new w("");hbLogSizeIsInvalid=!1;hbLogSizeIsSaving=!1;hbLogSizeFormControl=new w(-1);hbLogTruncateIsInvalid=!1;hbLogTruncateIsSaving=!1;hbLogTruncateFormControl=new w(0);hbMDnsIsSaving=!1;hbMDnsFormControl=new w("");hbPortIsInvalid=!1;hbPortIsSaving=!1;hbPortFormControl=new w(0);hbStartPortIsInvalid=!1;hbStartPortIsSaving=!1;hbStartPortFormControl=new w(0);hbEndPortIsInvalid=!1;hbEndPortIsSaving=!1;hbEndPortFormControl=new w(0);uiPortIsInvalid=!1;uiPortIsSaving=!1;uiPortFormControl=new w(0);uiAuthIsSaving=!1;uiAuthFormControl=new $e(!0);uiSessionTimeoutIsInvalid=!1;uiSessionTimeoutIsSaving=!1;uiSessionTimeoutFormControl=new w(0);uiSslTypeFormControl=new w("off");uiSslKeyIsSaving=!1;uiSslKeyFormControl=new w("");uiSslCertIsSaving=!1;uiSslCertFormControl=new w("");uiSslPfxIsSaving=!1;uiSslPfxFormControl=new w("");uiSslPassphraseIsSaving=!1;uiSslPassphraseFormControl=new w("");uiHostIsSaving=!1;uiHostFormControl=new w("");uiProxyHostIsSaving=!1;uiProxyHostFormControl=new w("");hbPackageIsSaving=!1;hbPackageFormControl=new w("");uiMetricsIsSaving=!1;uiMetricsFormControl=new w(!0);uiAccDebugIsSaving=!1;uiAccDebugFormControl=new w(!1);uiTempFileIsSaving=!1;uiTempFileFormControl=new w("");hbLinuxShutdownIsSaving=!1;hbLinuxShutdownFormControl=new w("");hbLinuxRestartIsSaving=!1;hbLinuxRestartFormControl=new w("");linkDebug='<a href="https://github.com/homebridge/homebridge-config-ui-x/wiki/Debug-Common-Values" target="_blank" rel="noopener noreferrer"><i class="fa fa-fw fa-external-link-alt primary-text"></i></a>';ngOnInit(){return v(this,null,function*(){this.isHbV2=this.$settings.env.homebridgeVersion.startsWith("2"),yield this.initNetworkingOptions(),yield this.initStartupSettings(),this.hbNameFormControl.patchValue(this.$settings.env.homebridgeInstanceName),this.hbNameFormControl.valueChanges.pipe(k(1500)).subscribe(e=>this.hbNameSave(e)),this.uiLangFormControl.patchValue(this.$settings.env.lang),this.uiLangFormControl.valueChanges.pipe(k(750)).subscribe(e=>this.uiLangSave(e)),this.uiThemeFormControl.patchValue(this.$settings.theme),this.uiThemeFormControl.valueChanges.pipe(k(750)).subscribe(e=>this.uiThemeSave(e)),this.uiLightFormControl.patchValue(this.$settings.lightingMode),this.uiLightFormControl.valueChanges.pipe(k(750)).subscribe(e=>this.uiLightSave(e)),this.uiMenuFormControl.patchValue(this.$settings.menuMode),this.uiMenuFormControl.valueChanges.pipe(k(750)).subscribe(e=>this.uiMenuSave(e)),this.uiTempFormControl.patchValue(this.$settings.env.temperatureUnits),this.uiTempFormControl.valueChanges.pipe(k(750)).subscribe(e=>this.uiTempSave(e)),this.uiTerminalPersistenceFormControl.patchValue(this.$settings.env.terminal?.persistence),this.uiTerminalPersistenceFormControl.valueChanges.pipe(k(750)).subscribe(e=>this.uiTerminalPersistenceSave(e)),this.uiTerminalHideWarningFormControl.patchValue(this.$settings.env.terminal?.hideWarning),this.uiTerminalHideWarningFormControl.valueChanges.pipe(k(750)).subscribe(e=>this.uiTerminalHideWarningSave(e)),this.uiTerminalBufferSizeFormControl.patchValue(this.$settings.env.terminal?.bufferSize),this.uiTerminalBufferSizeFormControl.valueChanges.pipe(k(1500)).subscribe(e=>this.uiTerminalBufferSizeSave(e)),this.hbLogSizeFormControl.patchValue(this.$settings.env.log?.maxSize),this.hbLogSizeFormControl.valueChanges.pipe(k(1500)).subscribe(e=>this.hbLogSizeSave(e)),this.hbLogTruncateFormControl.patchValue(this.$settings.env.log?.truncateSize),this.hbLogTruncateFormControl.valueChanges.pipe(k(1500)).subscribe(e=>this.hbLogTruncateSave(e)),this.uiPortFormControl.patchValue(this.$settings.env.port),this.uiPortFormControl.valueChanges.pipe(k(1500)).subscribe(e=>this.uiPortSave(e)),this.uiAuthFormControl.patchValue(this.$settings.formAuth),this.uiAuthFormControl.valueChanges.pipe(k(750)).subscribe(e=>this.uiAuthSave(e)),this.uiSessionTimeoutFormControl.patchValue(this.$settings.sessionTimeout),this.uiSessionTimeoutFormControl.valueChanges.pipe(k(750)).subscribe(e=>this.uiSessionTimeoutSave(e)),this.uiSslKeyFormControl.patchValue(this.$settings.env.ssl?.key||""),this.uiSslKeyFormControl.valueChanges.pipe(k(1500)).subscribe(e=>this.uiSslKeySave(e)),this.uiSslCertFormControl.patchValue(this.$settings.env.ssl?.cert||""),this.uiSslCertFormControl.valueChanges.pipe(k(1500)).subscribe(e=>this.uiSslCertSave(e)),this.uiSslPfxFormControl.patchValue(this.$settings.env.ssl?.pfx||""),this.uiSslPfxFormControl.valueChanges.pipe(k(1500)).subscribe(e=>this.uiSslPfxSave(e)),this.uiSslPassphraseFormControl.patchValue(this.$settings.env.ssl?.passphrase||""),this.uiSslPassphraseFormControl.valueChanges.pipe(k(1500)).subscribe(e=>this.uiSslPassphraseSave(e)),this.uiSslTypeFormControl.patchValue(this.uiSslKeyFormControl.value||this.uiSslCertFormControl.value?"keycert":this.uiSslPfxFormControl.value||this.uiSslPassphraseFormControl.value?"pfx":"off"),this.uiSslTypeFormControl.valueChanges.pipe(k(750)).subscribe(e=>this.uiSslTypeSave(e)),this.uiHostFormControl.patchValue(this.$settings.env.host||""),this.uiHostFormControl.valueChanges.pipe(k(1500)).subscribe(e=>this.uiHostSave(e)),this.uiProxyHostFormControl.patchValue(this.$settings.env.proxyHost||""),this.uiProxyHostFormControl.valueChanges.pipe(k(1500)).subscribe(e=>this.uiProxyHostSave(e)),this.hbPackageFormControl.patchValue(this.$settings.env.homebridgePackagePath||""),this.hbPackageFormControl.valueChanges.pipe(k(1500)).subscribe(e=>this.hbPackageSave(e)),this.uiMetricsFormControl.patchValue(!this.$settings.env.disableServerMetricsMonitoring),this.uiMetricsFormControl.valueChanges.pipe(k(750)).subscribe(e=>this.uiMetricsSave(e)),this.uiAccDebugFormControl.patchValue(this.$settings.env.accessoryControl?.debug),this.uiAccDebugFormControl.valueChanges.pipe(k(750)).subscribe(e=>this.uiAccDebugSave(e)),this.uiTempFileFormControl.patchValue(this.$settings.env.temp),this.uiTempFileFormControl.valueChanges.pipe(k(1500)).subscribe(e=>this.uiTempFileSave(e)),this.hbLinuxShutdownFormControl.patchValue(this.$settings.env.linux?.shutdown),this.hbLinuxShutdownFormControl.valueChanges.pipe(k(1500)).subscribe(e=>this.hbLinuxShutdownSave(e)),this.hbLinuxRestartFormControl.patchValue(this.$settings.env.linux?.restart),this.hbLinuxRestartFormControl.valueChanges.pipe(k(1500)).subscribe(e=>this.hbLinuxRestartSave(e)),this.loading=!1})}openBackupModal(){this.$modal.open(me,{size:"lg",backdrop:"static"})}openConfigBackup(){this.$router.navigate(["/config"],{queryParams:{action:"restore"}})}openWallpaperModal(){this.$modal.open(lt,{size:"lg",backdrop:"static"})}resetHomebridgeState(){this.$modal.open(at,{size:"lg",backdrop:"static"})}unpairAccessory(){this.$modal.open(rt,{size:"lg",backdrop:"static"})}removeAllCachedAccessories(){this.$modal.open(it,{size:"lg",backdrop:"static"})}accessoryUiControl(){return v(this,null,function*(){try{let e=this.$modal.open(Qe,{size:"lg",backdrop:"static"});e.componentInstance.existingBlacklist=this.$settings.env.accessoryControl?.instanceBlacklist||[],yield e.result,this.showRestartToast()}catch(e){e!=="Dismiss"&&(console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error")))}})}removeSingleCachedAccessories(){this.$modal.open(Ge,{size:"lg",backdrop:"static"})}removeBridgeAccessories(){this.$modal.open(nt,{size:"lg",backdrop:"static"})}selectNetworkInterfaces(){return v(this,null,function*(){let e=this.$modal.open(st,{size:"lg",backdrop:"static"});e.componentInstance.adaptersAvailable=this.adaptersAvailable,e.componentInstance.adaptersSelected=this.adaptersSelected;try{let n=yield e.result;this.buildBridgeNetworkAdapterList(n),yield $(this.$api.put("/server/network-interfaces/bridge",{adapters:n})),this.showRestartToast()}catch(n){n!=="Dismiss"&&(console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")))}})}toggleSection(e){this.showFields[e]=!this.showFields[e]}initStartupSettings(){return v(this,null,function*(){try{let e=yield $(this.$api.get("/platform-tools/hb-service/homebridge-startup-settings"));this.hbDebugFormControl.patchValue(e.HOMEBRIDGE_DEBUG),this.hbDebugFormControl.valueChanges.pipe(k(750)).subscribe(n=>this.hbDebugSave(n)),this.hbInsecureFormControl.patchValue(e.HOMEBRIDGE_INSECURE),this.hbInsecureFormControl.valueChanges.pipe(k(750)).subscribe(n=>this.hbInsecureSave(n)),this.hbKeepFormControl.patchValue(e.HOMEBRIDGE_KEEP_ORPHANS),this.hbKeepFormControl.valueChanges.pipe(k(750)).subscribe(n=>this.hbKeepSave(n)),this.hbEnvDebugFormControl.patchValue(e.ENV_DEBUG),this.hbEnvDebugFormControl.valueChanges.pipe(k(1500)).subscribe(n=>this.hbEnvDebugSave(n)),this.hbEnvNodeFormControl.patchValue(e.ENV_NODE_OPTIONS),this.hbEnvNodeFormControl.valueChanges.pipe(k(1500)).subscribe(n=>this.hbEnvNodeSave(n))}catch(e){console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}initNetworkingOptions(){return v(this,null,function*(){try{yield this.getNetworkSettings(),(this.$settings.env.runningInLinux||this.$settings.env.runningInDocker||this.$settings.env.runningInSynologyPackage||this.$settings.env.runningInPackageMode)&&(this.showAvahiMdnsOption=!0,this.showResolvedMdnsOption=!0)}catch(e){console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}getNetworkSettings(){return v(this,null,function*(){return Promise.all([$(this.$api.get("/server/network-interfaces/system")),$(this.$api.get("/server/network-interfaces/bridge")),$(this.$api.get("/server/mdns-advertiser")),$(this.$api.get("/server/port")),$(this.$api.get("/server/ports"))]).then(([e,n,p,y,X])=>{this.adaptersAvailable=e,this.buildBridgeNetworkAdapterList(n),this.hbMDnsFormControl.patchValue(p.advertiser),this.hbMDnsFormControl.valueChanges.pipe(k(750)).subscribe(q=>this.hbMDnsSave(q)),this.hbPortFormControl.patchValue(y.port),this.hbPortFormControl.valueChanges.pipe(k(1500)).subscribe(q=>this.hbPortSave(q)),this.hbStartPortFormControl.patchValue(X.start),this.hbStartPortFormControl.valueChanges.pipe(k(1500)).subscribe(q=>this.hbStartPortSave(q)),this.hbEndPortFormControl.patchValue(X.end),this.hbEndPortFormControl.valueChanges.pipe(k(1500)).subscribe(q=>this.hbEndPortSave(q))})})}saveUiSettingChange(e,n){return v(this,null,function*(){try{yield $(this.$api.put("/config-editor/ui",{key:e,value:n}))}catch(p){console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}hbNameSave(e){return v(this,null,function*(){if(!e||!/^[\p{L}\p{N}][\p{L}\p{N} ']*[\p{L}\p{N}]$/u.test(e)){this.hbNameIsInvalid=!0;return}try{this.hbNameIsSaving=!0,yield $(this.$api.put("/server/name",{name:e})),this.$settings.setEnvItem("homebridgeInstanceName",e),this.hbNameIsInvalid=!1,setTimeout(()=>{this.hbNameIsSaving=!1},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbNameIsSaving=!1}})}uiLangSave(e){return v(this,null,function*(){try{this.uiLangIsSaving=!0,this.$settings.setLang(e),yield this.saveUiSettingChange("lang",e),setTimeout(()=>{this.uiLangIsSaving=!1},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiLangIsSaving=!1}})}uiThemeSave(e){return v(this,null,function*(){try{this.uiThemeIsSaving=!0,this.$settings.setTheme(e),yield this.saveUiSettingChange("theme",e),setTimeout(()=>{this.uiThemeIsSaving=!1},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiThemeIsSaving=!1}})}uiLightSave(e){return v(this,null,function*(){try{this.uiLightIsSaving=!0,this.$settings.setLightingMode(e,"user"),yield this.saveUiSettingChange("lightingMode",e),setTimeout(()=>{this.uiLightIsSaving=!1},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiLightIsSaving=!1}})}uiMenuSave(e){return v(this,null,function*(){try{this.uiMenuIsSaving=!0,this.$settings.setMenuMode(e),yield this.saveUiSettingChange("menuMode",e),window.location.reload()}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiMenuIsSaving=!1}})}uiTempSave(e){return v(this,null,function*(){try{this.uiTempIsSaving=!0,this.$settings.setEnvItem("temperatureUnits",e),yield this.saveUiSettingChange("tempUnits",e),setTimeout(()=>{this.uiTempIsSaving=!1},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiTempIsSaving=!1}})}uiTerminalPersistenceSave(e){return v(this,null,function*(){if(!e&&this.$terminal.hasActiveSession()){let n=this.$modal.open(He,{size:"lg",backdrop:"static"});n.componentInstance.title=this.$translate.instant("settings.terminal.persistence_confirm_title"),n.componentInstance.message=this.$translate.instant("settings.terminal.persistence_confirm_message"),n.componentInstance.message2=this.$translate.instant("common.phrases.are_you_sure"),n.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_continue"),n.componentInstance.confirmButtonClass="btn-primary",n.componentInstance.faIconClass="fas fa-exclamation-triangle text-warning";try{yield n.result}catch{this.uiTerminalPersistenceFormControl.patchValue(!0,{emitEvent:!1});return}}try{this.uiTerminalPersistenceIsSaving=!0,e||this.$terminal.destroyPersistentSession(),this.$settings.setEnvItem("terminal.persistence",e),yield this.saveUiSettingChange("terminal.persistence",e),setTimeout(()=>{this.uiTerminalPersistenceIsSaving=!1},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiTerminalPersistenceIsSaving=!1}})}uiTerminalHideWarningSave(e){return v(this,null,function*(){try{this.uiTerminalHideWarningIsSaving=!0,this.$settings.setEnvItem("terminal.hideWarning",e),yield this.saveUiSettingChange("terminal.hideWarning",e),setTimeout(()=>{this.uiTerminalHideWarningIsSaving=!1},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiTerminalHideWarningIsSaving=!1}})}uiTerminalBufferSizeSave(e){return v(this,null,function*(){if(e&&(typeof e!="number"||e<0||Number.isInteger(e)===!1)){this.uiTerminalBufferSizeIsInvalid=!0;return}try{this.uiTerminalBufferSizeIsSaving=!0,this.$settings.setEnvItem("terminal.bufferSize",e),yield this.saveUiSettingChange("terminal.bufferSize",e),this.uiTerminalBufferSizeIsInvalid=!1,setTimeout(()=>{this.uiTerminalBufferSizeIsSaving=!1},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiTerminalBufferSizeIsSaving=!1}})}hbDebugSave(e){return v(this,null,function*(){try{this.hbDebugIsSaving=!0,yield $(this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",{HOMEBRIDGE_DEBUG:e,HOMEBRIDGE_KEEP_ORPHANS:this.hbKeepFormControl.value,HOMEBRIDGE_INSECURE:this.hbInsecureFormControl.value,ENV_DEBUG:this.hbEnvDebugFormControl.value,ENV_NODE_OPTIONS:this.hbEnvNodeFormControl.value})),setTimeout(()=>{this.hbDebugIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbDebugIsSaving=!1}})}hbInsecureSave(e){return v(this,null,function*(){try{this.hbInsecureIsSaving=!0,yield $(this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",{HOMEBRIDGE_DEBUG:this.hbDebugFormControl.value,HOMEBRIDGE_KEEP_ORPHANS:this.hbKeepFormControl.value,HOMEBRIDGE_INSECURE:e,ENV_DEBUG:this.hbEnvDebugFormControl.value,ENV_NODE_OPTIONS:this.hbEnvNodeFormControl.value})),setTimeout(()=>{this.hbInsecureIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbInsecureIsSaving=!1}})}hbKeepSave(e){return v(this,null,function*(){try{this.hbKeepIsSaving=!0,yield $(this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",{HOMEBRIDGE_DEBUG:this.hbDebugFormControl.value,HOMEBRIDGE_KEEP_ORPHANS:e,HOMEBRIDGE_INSECURE:this.hbInsecureFormControl.value,ENV_DEBUG:this.hbEnvDebugFormControl.value,ENV_NODE_OPTIONS:this.hbEnvNodeFormControl.value})),this.$settings.setKeepOrphans(e),setTimeout(()=>{this.hbKeepIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbKeepIsSaving=!1}})}hbEnvDebugSave(e){return v(this,null,function*(){try{this.hbEnvDebugIsSaving=!0,yield $(this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",{HOMEBRIDGE_DEBUG:this.hbDebugFormControl.value,HOMEBRIDGE_KEEP_ORPHANS:this.hbKeepFormControl.value,HOMEBRIDGE_INSECURE:this.hbInsecureFormControl.value,ENV_DEBUG:e,ENV_NODE_OPTIONS:this.hbEnvNodeFormControl.value})),setTimeout(()=>{this.hbEnvDebugIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbEnvDebugIsSaving=!1}})}hbEnvNodeSave(e){return v(this,null,function*(){try{this.hbEnvNodeIsSaving=!0,yield $(this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",{HOMEBRIDGE_DEBUG:this.hbDebugFormControl.value,HOMEBRIDGE_KEEP_ORPHANS:this.hbKeepFormControl.value,HOMEBRIDGE_INSECURE:this.hbInsecureFormControl.value,ENV_DEBUG:this.hbEnvDebugFormControl.value,ENV_NODE_OPTIONS:e})),setTimeout(()=>{this.hbEnvNodeIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbEnvNodeIsSaving=!1}})}hbLogSizeSave(e){return v(this,null,function*(){if(e&&(typeof e!="number"||e<-1||Number.isInteger(e)===!1)){this.hbLogSizeIsInvalid=!0;return}try{this.hbLogSizeIsSaving=!0,this.$settings.setEnvItem("log.maxSize",e),(!e||e===-1)&&(yield this.saveUiSettingChange("log.truncateSize",null),this.hbLogTruncateIsInvalid=!1),yield this.saveUiSettingChange("log.maxSize",e),this.hbLogSizeIsInvalid=!1,setTimeout(()=>{this.hbLogSizeIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbLogSizeIsSaving=!1}})}hbLogTruncateSave(e){return v(this,null,function*(){if(e&&(typeof e!="number"||e<0||Number.isInteger(e)===!1)){this.hbLogTruncateIsInvalid=!0;return}try{this.hbLogTruncateIsSaving=!0,this.$settings.setEnvItem("log.truncateSize",e),yield this.saveUiSettingChange("log.truncateSize",e),this.hbLogTruncateIsInvalid=!1,setTimeout(()=>{this.hbLogTruncateIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbLogTruncateIsSaving=!1}})}hbMDnsSave(e){return v(this,null,function*(){try{this.hbMDnsIsSaving=!0,yield $(this.$api.put("/server/mdns-advertiser",{advertiser:e})),setTimeout(()=>{this.hbMDnsIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbMDnsIsSaving=!1}})}hbPortSave(e){return v(this,null,function*(){if(e===this.uiPortFormControl.value){this.hbPortIsInvalid=!0;return}try{this.hbPortIsSaving=!0,yield $(this.$api.put("/server/port",{port:e})),this.hbPortIsInvalid=!1,setTimeout(()=>{this.hbPortIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbPortIsSaving=!1}})}hbStartPortSave(e){return v(this,null,function*(){try{this.hbStartPortIsSaving=!0,yield $(this.$api.put("/server/ports",{start:e,end:this.hbEndPortFormControl.value})),this.hbStartPortIsInvalid=!1,setTimeout(()=>{this.hbStartPortIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbStartPortIsSaving=!1}})}hbEndPortSave(e){return v(this,null,function*(){try{this.hbEndPortIsSaving=!0,yield $(this.$api.put("/server/ports",{start:this.hbStartPortFormControl.value,end:e})),this.hbEndPortIsInvalid=!1,setTimeout(()=>{this.hbEndPortIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbEndPortIsSaving=!1}})}uiPortSave(e){return v(this,null,function*(){if(!e||typeof e!="number"||e<1025||e>65533||Number.isInteger(e)===!1||e===this.hbPortFormControl.value){this.uiPortIsInvalid=!0;return}try{this.uiPortIsSaving=!0,this.$settings.setEnvItem("port",e),yield this.saveUiSettingChange("port",e),this.uiPortIsInvalid=!1,setTimeout(()=>{this.uiPortIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiPortIsSaving=!1}})}uiAuthSave(e){return v(this,null,function*(){try{this.uiAuthIsSaving=!0,this.$settings.setItem("formAuth",e),yield this.saveUiSettingChange("auth",e?"form":"none"),this.$notification.formAuthEnabled.next(e),setTimeout(()=>{this.uiAuthIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiAuthIsSaving=!1}})}uiSessionTimeoutSave(e){return v(this,null,function*(){if(e&&(typeof e!="number"||e<600||e>864e5||Number.isInteger(e)===!1)){this.uiSessionTimeoutIsInvalid=!0;return}try{this.uiSessionTimeoutIsSaving=!0,this.$settings.setItem("sessionTimeout",e),yield this.saveUiSettingChange("sessionTimeout",e),this.uiSessionTimeoutIsInvalid=!1,setTimeout(()=>{this.uiSessionTimeoutIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiSessionTimeoutIsSaving=!1}})}uiSslKeySave(e){return v(this,null,function*(){try{this.uiSslKeyIsSaving=!0,this.$settings.setEnvItem("ssl.key",e),yield this.saveUiSettingChange("ssl.key",e),setTimeout(()=>{this.uiSslKeyIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiSslKeyIsSaving=!1}})}uiSslCertSave(e){return v(this,null,function*(){try{this.uiSslCertIsSaving=!0,this.$settings.setEnvItem("ssl.cert",e),yield this.saveUiSettingChange("ssl.cert",e),setTimeout(()=>{this.uiSslCertIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiSslCertIsSaving=!1}})}uiSslPfxSave(e){return v(this,null,function*(){try{this.uiSslPfxIsSaving=!0,this.$settings.setEnvItem("ssl.pfx",e),yield this.saveUiSettingChange("ssl.pfx",e),setTimeout(()=>{this.uiSslPfxIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiSslPfxIsSaving=!1}})}uiSslPassphraseSave(e){return v(this,null,function*(){try{this.uiSslPassphraseIsSaving=!0,this.$settings.setEnvItem("ssl.passphrase",e),yield this.saveUiSettingChange("ssl.passphrase",e),setTimeout(()=>{this.uiSslPassphraseIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiSslPassphraseIsSaving=!1}})}uiSslTypeSave(e){return v(this,null,function*(){switch(e){case"keycert":this.uiSslPfxFormControl.patchValue("",{emitEvent:!1}),this.uiSslPassphraseFormControl.patchValue("",{emitEvent:!1}),this.$settings.setEnvItem("ssl.pfx",""),this.$settings.setEnvItem("ssl.passphrase","");break;case"pfx":this.uiSslKeyFormControl.patchValue("",{emitEvent:!1}),this.uiSslCertFormControl.patchValue("",{emitEvent:!1}),this.$settings.setEnvItem("ssl.key",""),this.$settings.setEnvItem("ssl.cert","");break;default:this.uiSslKeyFormControl.patchValue("",{emitEvent:!1}),this.uiSslCertFormControl.patchValue("",{emitEvent:!1}),this.uiSslPfxFormControl.patchValue("",{emitEvent:!1}),this.uiSslPassphraseFormControl.patchValue("",{emitEvent:!1}),this.$settings.setEnvItem("ssl.key",""),this.$settings.setEnvItem("ssl.cert",""),this.$settings.setEnvItem("ssl.pfx",""),this.$settings.setEnvItem("ssl.passphrase",""),yield this.saveUiSettingChange("ssl",""),this.showRestartToast()}})}uiHostSave(e){return v(this,null,function*(){try{this.uiHostIsSaving=!0,this.$settings.setEnvItem("host",e),yield this.saveUiSettingChange("host",e),setTimeout(()=>{this.uiHostIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiHostIsSaving=!1}})}uiProxyHostSave(e){return v(this,null,function*(){try{this.uiProxyHostIsSaving=!0,this.$settings.setEnvItem("proxyHost",e),yield this.saveUiSettingChange("proxyHost",e),setTimeout(()=>{this.uiProxyHostIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiProxyHostIsSaving=!1}})}hbPackageSave(e){return v(this,null,function*(){try{this.hbPackageIsSaving=!0,this.$settings.setEnvItem("homebridgePackagePath",e),yield this.saveUiSettingChange("homebridgePackagePath",e),setTimeout(()=>{this.hbPackageIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbPackageIsSaving=!1}})}uiMetricsSave(e){return v(this,null,function*(){try{this.uiMetricsIsSaving=!0,this.$settings.setEnvItem("disableServerMetricsMonitoring",!e),yield this.saveUiSettingChange("disableServerMetricsMonitoring",!e),setTimeout(()=>{this.uiMetricsIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiMetricsIsSaving=!1}})}uiAccDebugSave(e){return v(this,null,function*(){try{this.uiAccDebugIsSaving=!0,this.$settings.setEnvItem("accessoryControl.debug",e),yield this.saveUiSettingChange("accessoryControl.debug",e),setTimeout(()=>{this.uiAccDebugIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiAccDebugIsSaving=!1}})}uiTempFileSave(e){return v(this,null,function*(){try{this.uiTempFileIsSaving=!0,this.$settings.setEnvItem("temp",e),yield this.saveUiSettingChange("temp",e),setTimeout(()=>{this.uiTempFileIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiTempFileIsSaving=!1}})}hbLinuxShutdownSave(e){return v(this,null,function*(){try{this.hbLinuxShutdownIsSaving=!0,this.$settings.setEnvItem("linux.shutdown",e),yield this.saveUiSettingChange("linux.shutdown",e),setTimeout(()=>{this.hbLinuxShutdownIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbLinuxShutdownIsSaving=!1}})}hbLinuxRestartSave(e){return v(this,null,function*(){try{this.hbLinuxRestartIsSaving=!0,this.$settings.setEnvItem("linux.restart",e),yield this.saveUiSettingChange("linux.restart",e),setTimeout(()=>{this.hbLinuxRestartIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbLinuxRestartIsSaving=!1}})}buildBridgeNetworkAdapterList(e){if(!e.length){this.adaptersSelected=[];return}this.adaptersSelected=e.map(n=>{let p=this.adaptersAvailable.find(y=>y.iface===n);return p?{iface:p.iface,selected:!0,missing:!1,ip4:p.ip4,ip6:p.ip6}:{iface:n,selected:!0,missing:!0}})}showRestartToast(){if(!this.restartToastIsShown){this.restartToastIsShown=!0;let e=this.$toastr.info(this.$translate.instant("settings.changes.saved"),this.$translate.instant("menu.hbrestart.title"),{timeOut:0,tapToDismiss:!0,disableTimeOut:!0,positionClass:"toast-bottom-right",enableHtml:!0});e&&e.onTap&&e.onTap.subscribe(()=>{this.$router.navigate(["/restart"])})}}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],decls:8,vars:4,consts:[[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],[1,"my-4"],["role","button","tabindex","0",1,"mt-3","hover-pointer",3,"click"],[1,"primary-text"],[1,"fa","fa-fw",3,"ngClass"],["id","fieldsGeneral",1,"list-group","list-group-box","mt-2","mx-0"],["id","fieldsDisplay",1,"list-group","list-group-box","mt-2","mx-0"],["id","fieldsStartup",1,"list-group","list-group-box","mb-4","mx-0"],["id","fieldsNetwork",1,"list-group","list-group-box","mt-2","mx-0"],["id","fieldsTerminal",1,"list-group","list-group-box","mt-2","mx-0"],["id","fieldsSecurity",1,"list-group","list-group-box","mt-2","mx-0"],[1,"small","grey-text","mb-2","mx-0"],["id","fieldsCache",1,"list-group","list-group-box","mb-4","mx-0"],["id","fieldsReset",1,"list-group","list-group-box","mt-2","mx-0"],[1,"pb-3"],[1,"list-group-item","d-block","d-md-flex","justify-content-between","align-items-center"],[1,"my-3","my-md-0","ps-0","ps-md-5","w-auto","d-flex","align-items-center"],["type","text",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],[1,"fas","fa-fw","fa-floppy-disk","primary-text","fa-xl","me-0","me-md-2","ms-2","ms-md-0","order-2","order-md-1"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"pe-2"],[1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px",3,"click"],[1,"fas","fa-fw","fa-arrow-right"],["routerLink","/users",1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px"],[1,"custom-select","resp-select","order-1","order-md-2",3,"formControl"],["value","auto"],["value","bg"],["value","ca"],["value","zh-CN"],["value","zh-TW"],["value","cs"],["value","nl"],["value","en"],["value","fi"],["value","fr"],["value","de"],["value","he"],["value","hu"],["value","id"],["value","it"],["value","ja"],["value","ko"],["value","mk"],["value","no"],["value","pl"],["value","pt-BR"],["value","pt"],["value","ru"],["value","sl"],["value","es"],["value","sv"],["value","th"],["value","tr"],["value","uk"],["value","orange"],["value","red"],["value","pink"],["value","purple"],["value","deep-purple"],["value","indigo"],["value","blue"],["value","blue-grey"],["value","cyan"],["value","green"],["value","teal"],["value","grey"],["value","brown"],["value","light"],["value","dark"],["value","default"],["value","freeze"],["value","c"],["value","f"],[1,"grey-text","pe-2"],[1,"d-flex","align-items-center"],[1,"order-1","order-md-2"],["type","checkbox","id","homebridgeDebugMode",1,"rendux-input",3,"formControl"],["for","homebridgeDebugMode",1,"rendux-label","ms-3",2,"min-width","50px"],["type","checkbox","id","homebridgeInsecureMode",1,"rendux-input",3,"formControl"],["for","homebridgeInsecureMode",1,"rendux-label","ms-3",2,"min-width","50px"],["type","checkbox","id","homebridgeKeepOrphans",1,"rendux-input",3,"formControl"],["for","homebridgeKeepOrphans",1,"rendux-label","ms-3",2,"min-width","50px"],["type","checkbox","id","homebridgeMetrics",1,"rendux-input",3,"formControl"],["for","homebridgeMetrics",1,"rendux-label","ms-3",2,"min-width","50px"],["type","text","placeholder","/usr/local/lib/node_modules/homebridge",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],[1,"font-monospace"],[1,"grey-text","pe-2",3,"innerHTML"],["type","text","placeholder","HAP-NodeJS:Advertiser,HAP-NodeJS:Service",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","--max-old-space-size=512 --max-http-header-size=8192",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","shutdown",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","reboot",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","/sys/class/thermal/thermal_zone0/temp",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["routerLink","/platform-tools/docker/startup-script",1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px"],[1,"small","grey-text","pe-2"],[1,"badge","badge-primary","me-1",3,"ngClass"],[1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px",3,"click","disabled"],["value","avahi"],["value","ciao"],["value","bonjour-hap"],["value","resolved"],["type","number","min","1025","max","65533",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],["type","number","min","1025","max","65533","placeholder","8581",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],[1,"grey-text","pe-2",3,"innerHtml"],["type","text","pattern","^[^{}/ :\\\\]+(?::\\d+)?$","placeholder","0.0.0.0",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","pattern","^[^{}/ :\\\\]+(?::\\d+)?$","placeholder","example.com:8443",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],[1,"fas","fa-fw","fa-exclamation-triangle"],[1,"fw-normal"],["type","number","min","-1","placeholder","1000000",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],["type","number","min","0","placeholder","200000",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],[1,"badge","badge-primary","ms-1"],["type","checkbox","id","terminalPersistence",1,"rendux-input",3,"formControl"],["for","terminalPersistence",1,"rendux-label","ms-3"],["type","checkbox","id","terminalHideWarning",1,"rendux-input",3,"formControl"],["for","terminalHideWarning",1,"rendux-label","ms-3"],[1,"d-flex","flex-column"],[1,"small","grey-text"],["type","number","min","10000","max","100000","step","10000",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],["type","checkbox","id","uiAuthForm",1,"rendux-input",3,"formControl"],["for","uiAuthForm",1,"rendux-label","ms-3",2,"min-width","50px"],["value","off"],["value","keycert"],["value","pfx"],["type","number","min","600","max","86400000","placeholder","28800",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],["type","text","placeholder","/Users/.../certs/server.key",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","/Users/.../certs/server.crt",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","/Users/.../certs/server.pfx",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["placeholder","mypassphrase",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"focus","blur","type","formControl"],["type","checkbox","id","accessoryDebug",1,"rendux-input",3,"formControl"],["for","accessoryDebug",1,"rendux-label","ms-3",2,"min-width","50px"]],template:function(n,p){n&1&&(a(0,"div",0)(1,"div",1)(2,"h3",2),l(3),r(4,"translate"),o()(),d(5,"div",3),o(),h(6,Ti,1,0,"app-spinner")(7,Mn,59,82)),n&2&&(t(3),u(s(4,2,"menu.settings.title")),t(3),_(p.loading?6:7))},dependencies:[j,Le,ae,Ae,Ve,le,Pe,ie,Re,ne,Ne,De,Me,oe,pe,We,te,R],encapsulation:2,data:{animation:[Te("fadeInOut",[ge(":enter",[se({opacity:0}),_e("750ms",se({opacity:1}))]),ge(":leave",[_e("750ms",se({opacity:0}))])])]}})}return i})();export{ir as SettingsComponent};
@@ -1 +0,0 @@
1
- import{a as D}from"./chunk-OIV4KXSV.js";import"./chunk-5J7OMTCR.js";import{d as E}from"./chunk-5KFQUVTY.js";import{b as R}from"./chunk-2ETJ2W67.js";import{k as O,n as B}from"./chunk-6MRWZBRB.js";import{a as k,b as I}from"./chunk-6FXNHKMA.js";import"./chunk-PP5MH7GY.js";import{$b as $,Ec as b,Fc as g,Jb as f,Kb as _,Kc as o,Lc as l,Pb as x,Qb as r,Rb as n,Sb as v,bb as i,cc as S,ec as d,la as m,ld as T,nb as w,ra as C,rc as a,sa as y,sc as c,tc as h}from"./chunk-XWYKEZQQ.js";var U=(t,p)=>({"fas fa-fw fa-spinner fa-spin":t,"far fa-fw fa-check-circle":p}),F=t=>({"grey-text":t}),P=(t,p)=>({"far fa-fw fa-circle":t,"fas fa-fw fa-spinner fa-spin":p});function j(t,p){if(t&1&&(r(0,"div",7),a(1),n()),t&2){let e=d();i(),c(e.error)}}function M(t,p){if(t&1&&(r(0,"p",9),a(1),o(2,"translate"),n(),r(3,"div",10)(4,"div",11)(5,"span"),v(6,"i",12),a(7),o(8,"translate"),n()(),r(9,"div",11)(10,"span",12),v(11,"i",12),a(12),o(13,"translate"),n()()()),t&2){let e=d();i(),c(l(2,6,"restart.please_wait_while_server_restarts")),i(5),x("ngClass",g(12,U,!e.uiOnline,e.uiOnline)),i(),h(" ",l(8,8,"restart.ui_online")," "),i(3),x("ngClass",b(15,F,!e.uiOnline)),i(),x("ngClass",g(17,P,!e.uiOnline,e.uiOnline)),i(),h(" ",l(13,10,"restart.service_ready")," ")}}function V(t,p){if(t&1){let e=$();r(0,"p",15)(1,"button",16),S("click",function(){C(e);let u=d(2);return y(u.viewLogs())}),a(2),o(3,"translate"),n()()}t&2&&(i(2),c(l(3,1,"menu.tooltip_view_logs")))}function z(t,p){if(t&1&&(r(0,"div",8)(1,"p"),a(2),o(3,"translate"),n(),r(4,"p",13),a(5),o(6,"translate"),r(7,"span",14),a(8),n()(),f(9,V,4,3,"p",15),n()),t&2){let e=d();i(2),c(l(3,4,"restart.server_is_taking_long_time_to_restart")),i(3),h(" ",l(6,6,"restart.label_restart_command_executed"),": "),i(3),c(e.resp.command||"End Process"),i(),_(e.uiOnline?9:-1)}}var X=(()=>{class t{$api=m(B);$router=m(E);$settings=m(R);$toastr=m(O);$translate=m(k);$ws=m(D);checkTimeout;checkDelay;io;uiOnline=!1;error=!1;resp={};timeout=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$router.parseUrl(this.$router.url).queryParams.restarting?(this.uiOnline=!0,this.checkIfServerUp()):this.$api.put("/server/restart",{}).subscribe({next:s=>{this.resp=s,this.checkIfServerUp(),s.restartingUI||(this.uiOnline=!0)},error:s=>{console.error(s),this.error=this.$translate.instant("restart.toast_server_restart_error"),this.$toastr.error(this.$translate.instant("restart.toast_server_restart_error"),this.$translate.instant("toast.title_error"))}})}viewLogs(){this.$router.navigate(["/logs"])}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{this.uiOnline=!0,(e.status==="up"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("restart.toast_server_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},7e3),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("restart.toast_server_restart_timeout"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},4e4)}static \u0275fac=function(s){return new(s||t)};static \u0275cmp=w({type:t,selectors:[["ng-component"]],decls:14,vars:8,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,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"alert","alert-warning","my-4"],[1,"grey-text"],[1,"justify-content-center","my-4"],[1,"restart-progress-box","primary-text"],[3,"ngClass"],[1,"grey-text","mb-0"],[1,"font-monospace"],[1,"mt-2","mb-0"],[1,"btn","btn-primary","mb-0",3,"click"]],template:function(s,u){s&1&&(r(0,"div",0)(1,"h3",1),a(2),o(3,"translate"),n()(),r(4,"div",2)(5,"div",3),v(6,"i",4),n(),r(7,"div",5)(8,"h4",6),a(9),o(10,"translate"),n(),f(11,j,2,1,"div",7)(12,M,14,20),f(13,z,10,8,"div",8),n()()),s&2&&(i(2),c(l(3,4,"menu.restart.title")),i(7),c(l(10,6,"restart.title_restart")),i(2),_(u.error?11:12),i(2),_(u.timeout?13:-1))},dependencies:[T,I],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{X as RestartComponent};
@@ -1 +0,0 @@
1
- import{a as n}from"./chunk-U6ROY5ZN.js";import{g as i}from"./chunk-5KFQUVTY.js";import"./chunk-2ETJ2W67.js";import"./chunk-6MRWZBRB.js";import"./chunk-6FXNHKMA.js";import"./chunk-PP5MH7GY.js";import{ha as o,ob as r}from"./chunk-XWYKEZQQ.js";var a=[{path:"",loadComponent:()=>import("./chunk-QABGEKAZ.js").then(t=>t.SetupWizardComponent)}],u=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=r({type:t});static \u0275inj=o({imports:[i.forChild(a),i]})}return t})();var l=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=r({type:t});static \u0275inj=o({providers:[n],imports:[u]})}return t})();export{l as SetupWizardModule};
@@ -1,4 +0,0 @@
1
- import{a as P}from"./chunk-DD4UIDDU.js";import{a as O}from"./chunk-CQKCDD3I.js";import{B as $,c as y,e as E,l as k}from"./chunk-WMIMAPZH.js";import{b as D}from"./chunk-5KFQUVTY.js";import{b as L}from"./chunk-2ETJ2W67.js";import{k as I,n as H}from"./chunk-6MRWZBRB.js";import{a as T}from"./chunk-6FXNHKMA.js";import"./chunk-PP5MH7GY.js";import{$b as g,Ac as V,Jb as m,Kb as u,Pb as f,Qb as d,Rb as s,Sb as w,bb as p,cc as _,ec as a,h as S,la as r,nb as x,ra as l,rc as v,sa as c,w as C,yc as b,zc as M}from"./chunk-XWYKEZQQ.js";function z(i,h){i&1&&w(0,"i",6)}function A(i,h){i&1&&w(0,"i",7)}function F(i,h){if(i&1){let t=g();d(0,"ngx-monaco-editor",10),_("onInit",function(e){l(t);let o=a();return c(o.onEditorInit(e))})("keydown.control.s",function(e){l(t);let o=a();return e.preventDefault(),c(o.onSave())})("keydown.meta.s",function(e){l(t);let o=a();return e.preventDefault(),c(o.onSave())}),s()}if(i&2){let t=a();f("options",t.editorOptions)("model",t.monacoEditorModel)}}function W(i,h){if(i&1){let t=g();d(0,"textarea",11),V("ngModelChange",function(e){l(t);let o=a();return M(o.startupScript,e)||(o.startupScript=e),c(e)}),v(1," "),s()}if(i&2){let t=a();b("ngModel",t.startupScript)}}var tt=(()=>{class i{$api=r(H);$md=r(O);$route=r(D);$settings=r(L);$toastr=r(I);$translate=r(T);lastHeight;visualViewPortEventCallback;startupScript;saveInProgress;isMobile=!1;options={printMargin:!1};monacoEditor;editorOptions;monacoEditorModel;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
- `)[0].trim())){this.$toastr.error(this.$translate.instant("platform.docker.must_use_hashbang"),this.$translate.instant("toast.title_error")),this.startupScript=`#!/bin/sh
3
-
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}})}ngOnDestroy(){window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove()),this.monacoEditor&&this.monacoEditor.dispose()}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)}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=x({type:i,selectors:[["ng-component"]],decls:11,vars:4,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0","font-monospace"],[1,"col-6","text-end"],[1,"btn","btn-primary","waves-effect","m-0",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],[1,"fas","fa-fw","fa-floppy-disk"],[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&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),v(4,"startup.sh"),s()(),d(5,"div",4)(6,"button",5),_("click",function(){return e.onSave()}),m(7,z,1,0,"i",6)(8,A,1,0,"i",7),s()()(),m(9,F,1,2,"ngx-monaco-editor",8),m(10,W,2,1,"textarea",9),s()),n&2&&(p(6),f("disabled",e.saveInProgress),p(),u(e.saveInProgress?7:8),p(2),u(e.isMobile?-1:9),p(),u(e.isMobile?10:-1))},dependencies:[P,$,y,E,k],encapsulation:2})}return i})();export{tt as StartupScriptComponent};
@@ -1 +0,0 @@
1
- import{a as n}from"./chunk-4ZMTZF3W.js";import"./chunk-5J7OMTCR.js";import{g as r}from"./chunk-5KFQUVTY.js";import"./chunk-2ETJ2W67.js";import"./chunk-6MRWZBRB.js";import"./chunk-6FXNHKMA.js";import"./chunk-PP5MH7GY.js";import{ha as o,ob as e}from"./chunk-XWYKEZQQ.js";var c=[{path:"",loadComponent:()=>import("./chunk-RPTZSO5O.js").then(t=>t.SettingsComponent),canActivate:[n]}],m=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[r.forChild(c),r]})}return t})();var l=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[m]})}return t})();export{l as SettingsModule};