homebridge-config-ui-x 5.0.0-beta.1 → 5.0.0-beta.3

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 (135) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/package.json +3 -3
  3. package/public/3rdpartylicenses.txt +551 -551
  4. package/public/chunk-2OBHR63W.js +1 -0
  5. package/public/chunk-3C6WVST7.js +1 -0
  6. package/public/chunk-3IX3CLER.js +1 -0
  7. package/public/chunk-5ALXJOLQ.js +1 -0
  8. package/public/chunk-5LVGHH2N.js +1 -0
  9. package/public/chunk-6PHMBMFU.js +1 -0
  10. package/public/chunk-6TCHCTXZ.js +1 -0
  11. package/public/chunk-7456RB3C.js +1 -0
  12. package/public/chunk-76S7LYCL.js +1 -0
  13. package/public/chunk-77A3OZ74.js +1 -0
  14. package/public/chunk-7EANS226.js +1 -0
  15. package/public/chunk-7EUQWCP5.js +2 -0
  16. package/public/chunk-7L7RZCFC.js +8 -0
  17. package/public/chunk-ASX35H47.js +1 -0
  18. package/public/chunk-AVJ6EUEE.js +1 -0
  19. package/public/chunk-AX23H5TL.js +1 -0
  20. package/public/chunk-AZXQ73I5.js +1 -0
  21. package/public/chunk-BFDVOBTQ.js +1 -0
  22. package/public/{chunk-THFLPY67.js → chunk-BKUGARB4.js} +1 -1
  23. package/public/chunk-BMXAHMY6.js +1 -0
  24. package/public/chunk-BPMSJ2VF.js +1 -0
  25. package/public/{chunk-GNQUXZMN.js → chunk-CCUID66K.js} +1 -1
  26. package/public/chunk-CW7Q7WEJ.js +1 -0
  27. package/public/chunk-DDXIRKVB.js +1 -0
  28. package/public/chunk-DNOJWLVY.js +1 -0
  29. package/public/chunk-DZY2Q3FG.js +1 -0
  30. package/public/chunk-EA5J2VEJ.js +1 -0
  31. package/public/chunk-FX4GQIE4.js +32 -0
  32. package/public/chunk-GVDR7ZRB.js +1 -0
  33. package/public/chunk-HSJSWZHD.js +1 -0
  34. package/public/chunk-I7ZKPCIW.js +1 -0
  35. package/public/chunk-IPZ4P5DE.js +1 -0
  36. package/public/chunk-IW3EPSTZ.js +23 -0
  37. package/public/chunk-IWYEH4T6.js +1 -0
  38. package/public/chunk-JL6S5IIU.js +1 -0
  39. package/public/chunk-JZZQRLNW.js +1 -0
  40. package/public/chunk-KIJWUGXX.js +1 -0
  41. package/public/chunk-KO3WJGGG.js +1 -0
  42. package/public/chunk-KQJ7ONUG.js +1 -0
  43. package/public/chunk-KTDJZCFW.js +1 -0
  44. package/public/chunk-LDPCT3YF.js +5 -0
  45. package/public/chunk-MHYIZZN4.js +1 -0
  46. package/public/chunk-MOV2HTCQ.js +1 -0
  47. package/public/chunk-NF4NIS42.js +1 -0
  48. package/public/chunk-NW6AFAD7.js +1 -0
  49. package/public/chunk-NZNNTHFQ.js +1 -0
  50. package/public/chunk-O75YP3SB.js +1 -0
  51. package/public/chunk-ODPTCLGS.js +1 -0
  52. package/public/chunk-ORPWYWCL.js +5 -0
  53. package/public/chunk-Q5URFHBE.js +1 -0
  54. package/public/chunk-QE7DO6J3.js +8 -0
  55. package/public/chunk-QHPDGSZ6.js +1 -0
  56. package/public/chunk-QLWY5NWN.js +1 -0
  57. package/public/chunk-QRZNMAFL.js +1 -0
  58. package/public/chunk-RHB2T3FE.js +1 -0
  59. package/public/chunk-RMI35HIS.js +1 -0
  60. package/public/chunk-RO4QXVDE.js +1 -0
  61. package/public/chunk-RWZRB2OY.js +1 -0
  62. package/public/chunk-S62KH3FN.js +6 -0
  63. package/public/chunk-S6EMLS5Q.js +1 -0
  64. package/public/chunk-SVFFEV36.js +1 -0
  65. package/public/chunk-T2YVB4SI.js +1 -0
  66. package/public/chunk-TCSXGQNF.js +1 -0
  67. package/public/chunk-TXOB7R5K.js +7 -0
  68. package/public/chunk-U6ORTLYL.js +1 -0
  69. package/public/chunk-UG5DK2RQ.js +2 -0
  70. package/public/chunk-UJU3NPS7.js +1 -0
  71. package/public/chunk-UYZI56PX.js +1 -0
  72. package/public/chunk-UZU6PLTW.js +1 -0
  73. package/public/chunk-UZW3DWH4.js +1 -0
  74. package/public/chunk-VMXGERJT.js +14 -0
  75. package/public/chunk-VOBHY2IH.js +4 -0
  76. package/public/chunk-WHJOLAED.js +1 -0
  77. package/public/chunk-WHJSVGC7.js +1 -0
  78. package/public/chunk-WMB35VCS.js +1 -0
  79. package/public/{chunk-6QEO3BTW.js → chunk-WNWWUCCZ.js} +14 -14
  80. package/public/chunk-WT2GX4NS.js +1 -0
  81. package/public/chunk-XH6GEPB6.js +1 -0
  82. package/public/chunk-ZLPCX4R4.js +1 -0
  83. package/public/chunk-ZT23DWNL.js +1 -0
  84. package/public/chunk-ZY7HKZ4P.js +20 -0
  85. package/public/index.html +2 -2
  86. package/public/main-ILTX7GFO.js +1 -0
  87. package/public/media/fa-brands-400-6U3GU5Y7.woff2 +0 -0
  88. package/public/media/{fa-brands-400-CNBICIQT.ttf → fa-brands-400-MVB2B5XM.ttf} +0 -0
  89. package/public/media/{fa-regular-400-2FI4ICQD.ttf → fa-regular-400-EGQOOADX.ttf} +0 -0
  90. package/public/media/fa-regular-400-R5EOMW4H.woff2 +0 -0
  91. package/public/media/fa-solid-900-W65KEJAS.woff2 +0 -0
  92. package/public/media/{fa-solid-900-XVWCCN5V.ttf → fa-solid-900-ZUDIWQL5.ttf} +0 -0
  93. package/public/{polyfills-CE2SNIQF.js → polyfills-C6JHVXJJ.js} +2 -2
  94. package/public/prerendered-routes.json +3 -0
  95. package/public/styles-GDLSHXGD.css +1 -0
  96. package/public/chunk-3KSUXL3K.js +0 -20
  97. package/public/chunk-422JXES4.js +0 -23
  98. package/public/chunk-4R6MSI5I.js +0 -14
  99. package/public/chunk-5UYN5OWH.js +0 -1
  100. package/public/chunk-7564WJJL.js +0 -1
  101. package/public/chunk-7R6JSPNH.js +0 -1
  102. package/public/chunk-B6C32ZRK.js +0 -1
  103. package/public/chunk-B6G7GTDI.js +0 -1
  104. package/public/chunk-BQLALGZ5.js +0 -4
  105. package/public/chunk-BROUJ7PT.js +0 -1
  106. package/public/chunk-C4OONTE3.js +0 -1
  107. package/public/chunk-DOLYKWZH.js +0 -1
  108. package/public/chunk-DRWF7R4E.js +0 -1
  109. package/public/chunk-F22FMU37.js +0 -1
  110. package/public/chunk-FBP5C7VG.js +0 -1
  111. package/public/chunk-FPOZAQLC.js +0 -5
  112. package/public/chunk-IGUSDGD6.js +0 -8
  113. package/public/chunk-JM7QCDMZ.js +0 -1
  114. package/public/chunk-K3YXRBTH.js +0 -1
  115. package/public/chunk-K6TZNXIW.js +0 -1
  116. package/public/chunk-LS7T2AVU.js +0 -8
  117. package/public/chunk-NZPTOWFC.js +0 -20
  118. package/public/chunk-RID7V4NP.js +0 -1
  119. package/public/chunk-RIWBPQF3.js +0 -1
  120. package/public/chunk-S4SOWUAW.js +0 -1
  121. package/public/chunk-SJTXTMYT.js +0 -2
  122. package/public/chunk-T5QVI4H2.js +0 -1
  123. package/public/chunk-TBJQ2Y3M.js +0 -1
  124. package/public/chunk-TS27NWVA.js +0 -20
  125. package/public/chunk-VROGSJLF.js +0 -1
  126. package/public/chunk-VVILZWTF.js +0 -1
  127. package/public/chunk-WCDFKYP6.js +0 -5
  128. package/public/chunk-WCQIGCXO.js +0 -1
  129. package/public/chunk-Z47RP4BH.js +0 -1
  130. package/public/chunk-ZEONO5N6.js +0 -1
  131. package/public/main-VTRWQ63R.js +0 -6
  132. package/public/media/fa-brands-400-MDS4TU4L.woff2 +0 -0
  133. package/public/media/fa-regular-400-N56QV3DR.woff2 +0 -0
  134. package/public/media/fa-solid-900-Z3HFQTXF.woff2 +0 -0
  135. package/public/styles-7ETWN6DQ.css +0 -1
@@ -0,0 +1 @@
1
+ import{a as j}from"./chunk-ZY7HKZ4P.js";import"./chunk-EA5J2VEJ.js";import"./chunk-VMXGERJT.js";import{c as y}from"./chunk-7EUQWCP5.js";import"./chunk-JZZQRLNW.js";import{q as h}from"./chunk-ORPWYWCL.js";import{y as M,z as v}from"./chunk-QHPDGSZ6.js";import{d as C,g as a}from"./chunk-NZNNTHFQ.js";import"./chunk-SVFFEV36.js";import{b as l,j as g}from"./chunk-CW7Q7WEJ.js";import"./chunk-UG5DK2RQ.js";import{a as d,c as u}from"./chunk-3IX3CLER.js";import{h as s,ha as c,ia as i,md as p,na as e,sb as n,w as f}from"./chunk-TXOB7R5K.js";var m=(()=>{class o{$api=e(l);$router=e(C);$toastr=e(g);$translate=e(d);resolve(){return s(this,null,function*(){try{let r=yield f(this.$api.get("/config-editor"));return JSON.stringify(r,null,4)}catch(r){console.error(r),this.$toastr.error(r.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(t){return new(t||o)};static \u0275prov=c({token:o,factory:o.\u0275fac})}return o})();var $=[{path:"",loadComponent:()=>import("./chunk-7456RB3C.js").then(o=>o.ConfigEditorComponent),resolve:{config:m}}],R=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=n({type:o});static \u0275inj=i({imports:[a.forChild($),a]})}return o})();var Q=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=n({type:o});static \u0275inj=i({providers:[m],imports:[p,M,v,y,h,u.forChild(),R,j]})}return o})();export{Q as ConfigEditorModule};
@@ -0,0 +1 @@
1
+ import{T as te,c as X,d as Y,e as Z,f as ee}from"./chunk-Q5URFHBE.js";import{a as U}from"./chunk-JZZQRLNW.js";import{m as J,n as K,o as Q}from"./chunk-ORPWYWCL.js";import{c as W,e as R,f as H,i as j,l as G,m as z,y as q}from"./chunk-QHPDGSZ6.js";import{c as F}from"./chunk-BFDVOBTQ.js";import{b as L}from"./chunk-SVFFEV36.js";import{b as T}from"./chunk-3IX3CLER.js";import{$b as A,Bc as s,Cc as l,Kb as y,Lb as x,Mb as c,Wb as r,Xb as a,Yb as _,Zb as E,_b as B,ad as P,bd as V,cc as v,cd as N,dc as p,dd as O,ib as n,na as f,nc as d,oc as u,pc as w,rb as C,sc as M,tc as S,uc as k,wc as $,xa as b,xc as D,ya as h}from"./chunk-TXOB7R5K.js";var re=()=>({standalone:!0}),ne=(()=>{class t{$activeModal=f(J);roomName;static \u0275fac=function(o){return new(o||t)};static \u0275cmp=C({type:t,selectors:[["ng-component"]],inputs:{roomName:"roomName"},decls:30,vars:21,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],["role","alert",1,"alert"],[1,"md-form"],["type","text","id","form-name","autofocus","",1,"form-control","px-0",3,"ngModelChange","keyup.enter","ngModel","ngModelOptions"],["for","form-name"],[1,"fas","fa-fw","fa-home"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-right"],["type","button","data-dismiss","modal",1,"btn","btn-primary",3,"click"]],template:function(o,i){o&1&&(r(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),d(4),s(5,"translate"),a(),r(6,"button",3),s(7,"translate"),v("click",function(){return i.$activeModal.dismiss("Dismiss")}),r(8,"span",4),d(9,"\xD7"),a()()(),r(10,"div",5)(11,"div",6),d(12),s(13,"translate"),a(),r(14,"div",7)(15,"input",8),k("ngModelChange",function(I){return S(i.roomName,I)||(i.roomName=I),I}),v("keyup.enter",function(){return i.$activeModal.close(i.roomName)}),a(),r(16,"label",9),_(17,"i",10),d(18),s(19,"translate"),a()()(),r(20,"div",11)(21,"div",12)(22,"button",13),v("click",function(){return i.$activeModal.dismiss("Dismiss")}),d(23),s(24,"translate"),a()(),_(25,"div",14),r(26,"div",15)(27,"button",16),v("click",function(){return i.$activeModal.close(i.roomName)}),d(28),s(29,"translate"),a()()()()()),o&2&&(n(4),u(l(5,8,"accessories.button_add_room")),n(2),x("aria-label",l(7,10,"form.button_close")),n(6),u(l(13,12,"accessories.rooms_not_appear_in_homekit")),n(3),M("ngModel",i.roomName),c("ngModelOptions",$(20,re)),n(3),w(" ",l(19,14,"accessories.room_name")," "),n(5),w(" ",l(24,16,"form.button_close")," "),n(5),w(" ",l(29,18,"form.button_save")," "))},dependencies:[q,z,W,R,H,G,j,T],encapsulation:2})}return t})();var oe=(()=>{class t{constructor(){}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=C({type:t,selectors:[["app-drag-here-placeholder"]],decls:5,vars:3,consts:[[1,"accessory-box"],[1,"fas","fa-fw","fa-arrow-alt-circle-down","accessory-icon"],[1,"accessory-label"]],template:function(o,i){o&1&&(r(0,"div",0),_(1,"i",1),r(2,"div",2),d(3),s(4,"translate"),a()()),o&2&&(n(3),u(l(4,1,"accessories.control.drag_here")))},dependencies:[T],styles:[".accessory-box[_ngcontent-%COMP%]{opacity:.2}"]})}return t})();var ae=t=>({"cursor-move":t});function se(t,g){if(t&1&&(r(0,"div",19)(1,"div",20)(2,"h5",21),d(3),s(4,"translate"),a()()()),t&2){let e=p().$implicit,o=p(2);n(2),c("ngClass",D(4,ae,!o.isMobile)),n(),w(" ",e.name==="Default Room"?l(4,2,"accessories.control.default_room"):e.name," ")}}function le(t,g){if(t&1&&(E(0),_(1,"app-accessory-tile",26),B()),t&2){let e=p().$implicit;n(),c("service",e)}}function ce(t,g){if(t&1&&(r(0,"div",25),y(1,le,2,1,"ng-container",0),a()),t&2){let e=g.$implicit,o=p(4);c("ngSwitch",e.type),n(),c("ngIf",!o.hideHidden||!e.hidden)}}function de(t,g){if(t&1){let e=A();r(0,"div",22),k("dragulaModelChange",function(i){b(e);let m=p().$implicit;return S(m.services,i)||(m.services=i),h(i)}),y(1,ce,2,2,"div",23),_(2,"div",24)(3,"div",24)(4,"div",24)(5,"div",24)(6,"div",24)(7,"div",24)(8,"div",24)(9,"div",24)(10,"div",24)(11,"div",24)(12,"div",24)(13,"div",24)(14,"div",24)(15,"div",24)(16,"div",24),a()}if(t&2){let e=p().$implicit;c("dragula","services-bag"),M("dragulaModel",e.services),n(),c("ngForOf",e.services)}}function pe(t,g){if(t&1){let e=A();r(0,"div",27),k("dragulaModelChange",function(i){b(e);let m=p().$implicit;return S(m.services,i)||(m.services=i),h(i)}),_(1,"app-drag-here-placeholder",28),a()}if(t&2){let e=p().$implicit;c("dragula","services-bag"),M("dragulaModel",e.services)}}function me(t,g){if(t&1&&(r(0,"div"),y(1,se,5,6,"div",15),r(2,"div",16),y(3,de,17,3,"div",17)(4,pe,2,2,"div",18),a()()),t&2){let e=g.$implicit,o=p(2);n(),c("ngIf",!o.isMobile||e.services.length),n(2),c("ngIf",e.services.length),n(),c("ngIf",!e.services.length&&!o.isMobile)}}function _e(t,g){if(t&1){let e=A();r(0,"div")(1,"div",1)(2,"div",2)(3,"h3",3),d(4),s(5,"translate"),a()(),r(6,"div",4)(7,"div",5)(8,"button",6),s(9,"translate"),s(10,"translate"),v("click",function(){b(e);let i=p();return h(i.addRoom())}),_(11,"i",7),a()(),r(12,"div",5)(13,"button",6),s(14,"translate"),s(15,"translate"),s(16,"translate"),s(17,"translate"),v("click",function(){b(e);let i=p();return h(i.hideHidden=!i.hideHidden)}),_(18,"i",8),a()(),r(19,"div",5)(20,"button",9),s(21,"translate"),s(22,"translate"),v("click",function(){b(e);let i=p();return h(i.toggleLayoutLock())}),_(23,"i",10),a(),r(24,"button",11),s(25,"translate"),s(26,"translate"),v("click",function(){b(e);let i=p();return h(i.toggleLayoutLock())}),_(27,"i",12),a()()()(),r(28,"div",13),k("dragulaModelChange",function(i){b(e);let m=p();return S(m.$accessories.rooms,i)||(m.$accessories.rooms=i),h(i)}),y(29,me,5,3,"div",14),a()()}if(t&2){let e=p();n(4),u(l(5,17,"accessories.title_accessories")),n(4),c("hidden",e.isMobile)("ngbTooltip",l(9,19,"accessories.button_add_room")),x("aria-label",l(10,21,"accessories.button_add_room")),n(5),c("hidden",e.isMobile)("ngbTooltip",e.hideHidden?l(14,23,"accessories.button_hidden_show"):l(15,25,"accessories.button_hidden_hide")),x("aria-label",e.hideHidden?l(16,27,"accessories.button_hidden_show"):l(17,29,"accessories.button_hidden_hide")),n(5),c("ngClass",e.hideHidden?"fa-eye-slash":"fa-eye"),n(2),c("disabled",!e.isMobile)("ngbTooltip",l(21,31,"form.button_unlock")),x("aria-label",l(22,33,"form.button_unlock")),n(4),c("disabled",e.isMobile)("ngbTooltip",l(25,35,"form.button_lock")),x("aria-label",l(26,37,"form.button_lock")),n(4),c("dragula","rooms-bag"),M("dragulaModel",e.$accessories.rooms),n(),c("ngForOf",e.$accessories.rooms)}}function ue(t,g){t&1&&(r(0,"p",37),d(1),s(2,"translate"),a()),t&2&&(n(),u(l(2,1,"accessories.settings_link")))}function ge(t,g){if(t&1&&(r(0,"div")(1,"div",19)(2,"div",29)(3,"h3",30),d(4),s(5,"translate"),a()(),r(6,"div",31)(7,"div",32)(8,"h4",33),d(9),s(10,"translate"),a(),r(11,"div")(12,"p"),d(13),s(14,"translate"),a(),r(15,"p",34)(16,"span"),d(17),s(18,"translate"),a(),r(19,"a",35),d(20," https://github.com/homebridge/homebridge-config-ui-x/wiki/Enabling-Accessory-Control "),a(),r(21,"span"),d(22),s(23,"translate"),a()(),y(24,ue,3,3,"p",36),a()()()()()),t&2){let e=p();n(4),u(l(5,6,"accessories.title_accessories")),n(5),u(l(10,8,"accessories.control_disabled")),n(4),u(l(14,10,"accessories.message_must_use_insecure_mode")),n(4),u(l(18,12,"accessories.message_please_see")),n(5),u(l(23,14,"accessories.message_for_more_information")),n(2),c("ngIf",e.$auth.user.admin)}}var We=(()=>{class t{$auth=f(F);dragulaService=f(Y);$modal=f(K);$settings=f(L);$md=f(U);$accessories=f(X);isMobile=!1;hideHidden=!0;orderSubscription;constructor(){let e=this.dragulaService;this.isMobile=this.$md.detect.mobile(),e.createGroup("rooms-bag",{moves:(o,i,m)=>!this.isMobile&&m.classList.contains("drag-handle")}),e.createGroup("services-bag",{moves:o=>!this.isMobile&&!o.classList.contains("no-drag")}),this.orderSubscription=e.drop().subscribe(()=>{setTimeout(()=>{this.$accessories.saveLayout()})}),window.localStorage.getItem("accessories-layout-locked")&&(this.isMobile=!0)}ngOnInit(){this.$accessories.start()}addRoom(){this.$modal.open(ne,{size:"lg",backdrop:"static"}).result.then(e=>{!e||!e.length||this.$accessories.rooms.find(o=>o.name===e)||(this.$accessories.rooms.push({name:e,services:[]}),this.isMobile&&this.toggleLayoutLock())}).catch(()=>{})}toggleLayoutLock(){this.isMobile=!this.isMobile,this.isMobile?window.localStorage.setItem("accessories-layout-locked","yes"):window.localStorage.removeItem("accessories-layout-locked")}ngOnDestroy(){this.$accessories.stop(),this.orderSubscription.unsubscribe(),this.dragulaService.destroy("rooms-bag"),this.dragulaService.destroy("services-bag")}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=C({type:t,selectors:[["app-accessories"]],decls:2,vars:2,consts:[[4,"ngIf"],[1,"row","mb-3"],[1,"col-sm-6"],[1,"primary-text","m-0"],[1,"col-sm-6","text-right","d-none","d-sm-block"],["role","group",1,"btn-group"],["type","button","container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","status-button","my-0",3,"click","hidden","ngbTooltip"],[1,"fas","fa-fw","fa-folder-plus"],[1,"fas","fa-fw",3,"ngClass"],["type","button","container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","status-button","my-0",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-unlock"],["type","button","container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","status-button","my-0","mr-0",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-lock"],[3,"dragulaModelChange","dragula","dragulaModel"],[4,"ngFor","ngForOf"],["class","row",4,"ngIf"],[1,"row","mb-4"],["class","col-md-12 d-flex flex-wrap justify-content-between noselect services-bag",3,"dragula","dragulaModel","dragulaModelChange",4,"ngIf"],["class","col-md-12 d-flex flex-wrap noselect",3,"dragula","dragulaModel","dragulaModelChange",4,"ngIf"],[1,"row"],[1,"col-md-12"],[1,"primary-text","drag-handle","room-title","m-0",3,"ngClass"],[1,"col-md-12","d-flex","flex-wrap","justify-content-between","noselect","services-bag",3,"dragulaModelChange","dragula","dragulaModel"],["class","accessory-item accessory-tab",3,"ngSwitch",4,"ngFor","ngForOf"],[1,"accessory-box","invisible","py-0","my-0",2,"height","0 !important"],[1,"accessory-item","accessory-tab",3,"ngSwitch"],[3,"service"],[1,"col-md-12","d-flex","flex-wrap","noselect",3,"dragulaModelChange","dragula","dragulaModel"],[1,"no-drag"],[1,"col-12"],[1,"primary-text","m-0","mb-3"],[1,"col-12","text-center"],["role","alert",1,"alert","alert-warning","p-4"],[1,"primary-text","mb-3","mt-0"],[1,"mb-0"],["target","_blank","rel","noopener noreferrer","href","https://github.com/homebridge/homebridge-config-ui-x/wiki/Enabling-Accessory-Control"],["class","mt-3 mb-0",4,"ngIf"],[1,"mt-3","mb-0"]],template:function(o,i){o&1&&y(0,_e,30,39,"div",0)(1,ge,25,16,"div",0),o&2&&(c("ngIf",i.$settings.env.enableAccessories),n(),c("ngIf",!i.$settings.env.enableAccessories))},dependencies:[N,Q,P,ee,Z,V,O,te,oe,T],styles:[".room-title[_ngcontent-%COMP%]{margin-left:10px}@media (max-width: 575px){.room-title[_ngcontent-%COMP%]{margin-left:7px}}.services-bag[_ngcontent-%COMP%]{min-height:170px}@media (max-width: 575px){.services-bag[_ngcontent-%COMP%]{min-height:initial}}.cursor-move[_ngcontent-%COMP%]{cursor:move}.gu-transit[_ngcontent-%COMP%] .manage-accessory-button[_ngcontent-%COMP%]{display:none}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return t})();export{ne as a,We as b};
@@ -0,0 +1 @@
1
+ import{Aa as y,B as V,C as F,D as q,Fa as f,Hc as Z,L as J,O as C,Z as P,a as _,aa as R,ha as h,ia as X,jb as M,ka as v,ma as o,r as L,sb as z,t as c,ub as W,x as I}from"./chunk-TXOB7R5K.js";var d=class{},Q=(()=>{class n extends d{getTranslation(e){return L({})}static \u0275fac=(()=>{let e;return function(s){return(e||(e=y(n)))(s||n)}})();static \u0275prov=h({token:n,factory:n.\u0275fac})}return n})(),m=class{},Y=(()=>{class n{handle(e){return e.key}static \u0275fac=function(t){return new(t||n)};static \u0275prov=h({token:n,factory:n.\u0275fac})}return n})();function E(n,r){if(n===r)return!0;if(n===null||r===null)return!1;if(n!==n&&r!==r)return!0;let e=typeof n,t=typeof r,s,i,a;if(e==t&&e=="object")if(Array.isArray(n)){if(!Array.isArray(r))return!1;if((s=n.length)==r.length){for(i=0;i<s;i++)if(!E(n[i],r[i]))return!1;return!0}}else{if(Array.isArray(r))return!1;a=Object.create(null);for(i in n){if(!E(n[i],r[i]))return!1;a[i]=!0}for(i in r)if(!(i in a)&&typeof r[i]<"u")return!1;return!0}return!1}function u(n){return typeof n<"u"&&n!==null}function D(n){return S(n)&&!H(n)}function S(n){return typeof n=="object"}function H(n){return Array.isArray(n)}function $(n){return typeof n=="string"}function ne(n){return typeof n=="function"}function N(n,r){let e=Object.assign({},n);return S(n)?(S(n)&&S(r)&&Object.keys(r).forEach(t=>{D(r[t])?t in n?e[t]=N(n[t],r[t]):Object.assign(e,{[t]:r[t]}):Object.assign(e,{[t]:r[t]})}),e):N({},r)}function K(n,r){let e=r.split(".");r="";do r+=e.shift(),u(n)&&u(n[r])&&(D(n[r])||H(n[r])||!e.length)?(n=n[r],r=""):e.length?r+=".":n=void 0;while(e.length);return n}function se(n,r,e){let t=r.split("."),s=n;for(let i=0;i<t.length;i++){let a=t[i];i===t.length-1?s[a]=e:((!s[a]||!D(s[a]))&&(s[a]={}),s=s[a])}}var g=class{},k=(()=>{class n extends g{templateMatcher=/{{\s?([^{}\s]*)\s?}}/g;interpolate(e,t){if($(e))return this.interpolateString(e,t);if(ne(e))return this.interpolateFunction(e,t)}interpolateFunction(e,t){return e(t)}interpolateString(e,t){return t?e.replace(this.templateMatcher,(s,i)=>{let a=K(t,i);return u(a)?a:s}):e}static \u0275fac=(()=>{let e;return function(s){return(e||(e=y(n)))(s||n)}})();static \u0275prov=h({token:n,factory:n.\u0275fac})}return n})(),p=class{},ee=(()=>{class n extends p{compile(e,t){return e}compileTranslations(e,t){return e}static \u0275fac=(()=>{let e;return function(s){return(e||(e=y(n)))(s||n)}})();static \u0275prov=h({token:n,factory:n.\u0275fac})}return n})(),j=class{defaultLang;currentLang=this.defaultLang;translations={};langs=[];onTranslationChange=new f;onLangChange=new f;onDefaultLangChange=new f},x=new v("ISOALTE_TRANSLATE_SERVICE"),O=new v("USE_DEFAULT_LANG"),U=new v("DEFAULT_LANGUAGE"),B=new v("USE_EXTEND"),b=n=>c(n)?n:L(n),G=(()=>{class n{store;currentLoader;compiler;parser;missingTranslationHandler;useDefaultLang;isolate;extend;loadingTranslations;pending=!1;_onTranslationChange=new f;_onLangChange=new f;_onDefaultLangChange=new f;_defaultLang;_currentLang;_langs=[];_translations={};_translationRequests={};lastUseLanguage=null;get onTranslationChange(){return this.isolate?this._onTranslationChange:this.store.onTranslationChange}get onLangChange(){return this.isolate?this._onLangChange:this.store.onLangChange}get onDefaultLangChange(){return this.isolate?this._onDefaultLangChange:this.store.onDefaultLangChange}get defaultLang(){return this.isolate?this._defaultLang:this.store.defaultLang}set defaultLang(e){this.isolate?this._defaultLang=e:this.store.defaultLang=e}get currentLang(){return this.isolate?this._currentLang:this.store.currentLang}set currentLang(e){this.isolate?this._currentLang=e:this.store.currentLang=e}get langs(){return this.isolate?this._langs:this.store.langs}set langs(e){this.isolate?this._langs=e:this.store.langs=e}get translations(){return this.isolate?this._translations:this.store.translations}set translations(e){this.isolate?this._translations=e:this.store.translations=e}constructor(e,t,s,i,a,A=!0,l=!1,T=!1,w){this.store=e,this.currentLoader=t,this.compiler=s,this.parser=i,this.missingTranslationHandler=a,this.useDefaultLang=A,this.isolate=l,this.extend=T,w&&this.setDefaultLang(w)}setDefaultLang(e){if(e===this.defaultLang)return;let t=this.retrieveTranslations(e);typeof t<"u"?(this.defaultLang==null&&(this.defaultLang=e),t.pipe(C(1)).subscribe(()=>{this.changeDefaultLang(e)})):this.changeDefaultLang(e)}getDefaultLang(){return this.defaultLang}use(e){if(this.lastUseLanguage=e,e===this.currentLang)return L(this.translations[e]);this.currentLang||(this.currentLang=e);let t=this.retrieveTranslations(e);return c(t)?(t.pipe(C(1)).subscribe(()=>{this.changeLang(e)}),t):(this.changeLang(e),L(this.translations[e]))}changeLang(e){e===this.lastUseLanguage&&(this.currentLang=e,this.onLangChange.emit({lang:e,translations:this.translations[e]}),this.defaultLang==null&&this.changeDefaultLang(e))}retrieveTranslations(e){if(typeof this.translations[e]>"u"||this.extend)return this._translationRequests[e]=this._translationRequests[e]||this.loadAndCompileTranslations(e),this._translationRequests[e]}getTranslation(e){return this.loadAndCompileTranslations(e)}loadAndCompileTranslations(e){this.pending=!0;let t=this.currentLoader.getTranslation(e).pipe(P(1),C(1));return this.loadingTranslations=t.pipe(I(s=>this.compiler.compileTranslations(s,e)),P(1),C(1)),this.loadingTranslations.subscribe({next:s=>{this.translations[e]=this.extend&&this.translations[e]?_(_({},s),this.translations[e]):s,this.updateLangs(),this.pending=!1},error:s=>{this.pending=!1}}),t}setTranslation(e,t,s=!1){let i=this.compiler.compileTranslations(t,e);(s||this.extend)&&this.translations[e]?this.translations[e]=N(this.translations[e],i):this.translations[e]=i,this.updateLangs(),this.onTranslationChange.emit({lang:e,translations:this.translations[e]})}getLangs(){return this.langs}addLangs(e){e.forEach(t=>{this.langs.indexOf(t)===-1&&this.langs.push(t)})}updateLangs(){this.addLangs(Object.keys(this.translations))}getParsedResultForKey(e,t,s){let i;if(e&&(i=this.runInterpolation(K(e,t),s)),i===void 0&&this.defaultLang!=null&&this.defaultLang!==this.currentLang&&this.useDefaultLang&&(i=this.runInterpolation(K(this.translations[this.defaultLang],t),s)),i===void 0){let a={key:t,translateService:this};typeof s<"u"&&(a.interpolateParams=s),i=this.missingTranslationHandler.handle(a)}return i!==void 0?i:t}runInterpolation(e,t){if(H(e))return e.map(s=>this.runInterpolation(s,t));if(D(e)){let s={};for(let i in e)s[i]=this.runInterpolation(e[i],t);return s}else return this.parser.interpolate(e,t)}getParsedResult(e,t,s){if(t instanceof Array){let i={},a=!1;for(let l of t)i[l]=this.getParsedResultForKey(e,l,s),a=a||c(i[l]);if(!a)return i;let A=t.map(l=>b(i[l]));return q(A).pipe(I(l=>{let T={};return l.forEach((w,te)=>{T[t[te]]=w}),T}))}return this.getParsedResultForKey(e,t,s)}get(e,t){if(!u(e)||!e.length)throw new Error('Parameter "key" is required and cannot be empty');return this.pending?this.loadingTranslations.pipe(J(s=>b(this.getParsedResult(s,e,t)))):b(this.getParsedResult(this.translations[this.currentLang],e,t))}getStreamOnTranslationChange(e,t){if(!u(e)||!e.length)throw new Error('Parameter "key" is required and cannot be empty');return V(F(()=>this.get(e,t)),this.onTranslationChange.pipe(R(s=>{let i=this.getParsedResult(s.translations,e,t);return b(i)})))}stream(e,t){if(!u(e)||!e.length)throw new Error('Parameter "key" required');return V(F(()=>this.get(e,t)),this.onLangChange.pipe(R(s=>{let i=this.getParsedResult(s.translations,e,t);return b(i)})))}instant(e,t){if(!u(e)||e.length===0)throw new Error('Parameter "key" is required and cannot be empty');let s=this.getParsedResult(this.translations[this.currentLang],e,t);return c(s)?Array.isArray(e)?e.reduce((i,a)=>(i[a]=a,i),{}):e:s}set(e,t,s=this.currentLang){se(this.translations[s],e,$(t)?this.compiler.compile(t,s):this.compiler.compileTranslations(t,s)),this.updateLangs(),this.onTranslationChange.emit({lang:s,translations:this.translations[s]})}changeDefaultLang(e){this.defaultLang=e,this.onDefaultLangChange.emit({lang:e,translations:this.translations[e]})}reloadLang(e){return this.resetLang(e),this.loadAndCompileTranslations(e)}resetLang(e){delete this._translationRequests[e],delete this.translations[e]}getBrowserLang(){if(typeof window>"u"||!window.navigator)return;let e=this.getBrowserCultureLang();return e?e.split(/[-_]/)[0]:void 0}getBrowserCultureLang(){if(!(typeof window>"u"||typeof window.navigator>"u"))return window.navigator.languages?window.navigator.languages[0]:window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage}static \u0275fac=function(t){return new(t||n)(o(j),o(d),o(p),o(g),o(m),o(O),o(x),o(B),o(U))};static \u0275prov=h({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Ce=(()=>{class n{translate;_ref;value="";lastKey=null;lastParams=[];onTranslationChange;onLangChange;onDefaultLangChange;constructor(e,t){this.translate=e,this._ref=t}updateValue(e,t,s){let i=a=>{this.value=a!==void 0?a:e,this.lastKey=e,this._ref.markForCheck()};if(s){let a=this.translate.getParsedResult(s,e,t);c(a)?a.subscribe(i):i(a)}this.translate.get(e,t).subscribe(i)}transform(e,...t){if(!e||!e.length)return e;if(E(e,this.lastKey)&&E(t,this.lastParams))return this.value;let s;if(u(t[0])&&t.length)if($(t[0])&&t[0].length){let i=t[0].replace(/(')?([a-zA-Z0-9_]+)(')?(\s)?:/g,'"$2":').replace(/:(\s)?(')(.*?)(')/g,':"$3"');try{s=JSON.parse(i)}catch(a){throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${t[0]}`)}}else D(t[0])&&(s=t[0]);return this.lastKey=e,this.lastParams=t,this.updateValue(e,s),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe(i=>{this.lastKey&&i.lang===this.translate.currentLang&&(this.lastKey=null,this.updateValue(e,s,i.translations))})),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe(i=>{this.lastKey&&(this.lastKey=null,this.updateValue(e,s,i.translations))})),this.onDefaultLangChange||(this.onDefaultLangChange=this.translate.onDefaultLangChange.subscribe(()=>{this.lastKey&&(this.lastKey=null,this.updateValue(e,s))})),this.value}_dispose(){typeof this.onTranslationChange<"u"&&(this.onTranslationChange.unsubscribe(),this.onTranslationChange=void 0),typeof this.onLangChange<"u"&&(this.onLangChange.unsubscribe(),this.onLangChange=void 0),typeof this.onDefaultLangChange<"u"&&(this.onDefaultLangChange.unsubscribe(),this.onDefaultLangChange=void 0)}ngOnDestroy(){this._dispose()}static \u0275fac=function(t){return new(t||n)(M(G,16),M(Z,16))};static \u0275pipe=W({name:"translate",type:n,pure:!1});static \u0275prov=h({token:n,factory:n.\u0275fac})}return n})();var ve=(()=>{class n{static forRoot(e={}){return{ngModule:n,providers:[e.loader||{provide:d,useClass:Q},e.compiler||{provide:p,useClass:ee},e.parser||{provide:g,useClass:k},e.missingTranslationHandler||{provide:m,useClass:Y},j,{provide:x,useValue:e.isolate},{provide:O,useValue:e.useDefaultLang},{provide:B,useValue:e.extend},{provide:U,useValue:e.defaultLanguage},G]}}static forChild(e={}){return{ngModule:n,providers:[e.loader||{provide:d,useClass:Q},e.compiler||{provide:p,useClass:ee},e.parser||{provide:g,useClass:k},e.missingTranslationHandler||{provide:m,useClass:Y},{provide:x,useValue:e.isolate},{provide:O,useValue:e.useDefaultLang},{provide:B,useValue:e.extend},{provide:U,useValue:e.defaultLanguage},G]}}static \u0275fac=function(t){return new(t||n)};static \u0275mod=z({type:n});static \u0275inj=X({})}return n})();export{G as a,Ce as b,ve as c};
@@ -0,0 +1 @@
1
+ import{d as s}from"./chunk-NZNNTHFQ.js";import{b as n}from"./chunk-SVFFEV36.js";import{h as r,ha as o,na as e,w as i}from"./chunk-TXOB7R5K.js";var l=(()=>{class t{$router=e(s);$settings=e(n);canActivate(){return r(this,null,function*(){return this.$settings.settingsLoaded||(yield i(this.$settings.onSettingsLoaded)),this.$settings.env.setupWizardComplete===!1||this.$router.navigate(["/"]),!0})}static \u0275fac=function(a){return new(a||t)};static \u0275prov=o({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{l as a};
@@ -0,0 +1 @@
1
+ import{f as a}from"./chunk-S62KH3FN.js";import"./chunk-LDPCT3YF.js";import"./chunk-Q5URFHBE.js";import"./chunk-WHJSVGC7.js";import"./chunk-6TCHCTXZ.js";import"./chunk-FX4GQIE4.js";import"./chunk-VMXGERJT.js";import"./chunk-7EUQWCP5.js";import"./chunk-WNWWUCCZ.js";import"./chunk-7L7RZCFC.js";import"./chunk-CCUID66K.js";import"./chunk-QE7DO6J3.js";import"./chunk-BKUGARB4.js";import"./chunk-BPMSJ2VF.js";import"./chunk-WHJOLAED.js";import"./chunk-JZZQRLNW.js";import"./chunk-KQJ7ONUG.js";import"./chunk-ORPWYWCL.js";import"./chunk-QHPDGSZ6.js";import"./chunk-6PHMBMFU.js";import"./chunk-NZNNTHFQ.js";import"./chunk-BFDVOBTQ.js";import"./chunk-SVFFEV36.js";import"./chunk-CW7Q7WEJ.js";import"./chunk-UG5DK2RQ.js";import"./chunk-3IX3CLER.js";import"./chunk-TXOB7R5K.js";export{a as StatusComponent};
@@ -0,0 +1 @@
1
+ import{c as pe}from"./chunk-BFDVOBTQ.js";import{a as he}from"./chunk-CW7Q7WEJ.js";import{f as We,ha as ue,k as fe,n as X,na as le}from"./chunk-TXOB7R5K.js";var d=Object.create(null);d.open="0";d.close="1";d.ping="2";d.pong="3";d.message="4";d.upgrade="5";d.noop="6";var S=Object.create(null);Object.keys(d).forEach(r=>{S[d[r]]=r});var O={type:"error",data:"parser error"};var ye=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ge=typeof ArrayBuffer=="function",_e=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,B=({type:r,data:e},t,s)=>ye&&e instanceof Blob?t?s(e):de(e,s):ge&&(e instanceof ArrayBuffer||_e(e))?t?s(e):de(new Blob([e]),s):s(d[r]+(e||"")),de=(r,e)=>{let t=new FileReader;return t.onload=function(){let s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(r)};function me(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}var $;function be(r,e){if(ye&&r.data instanceof Blob)return r.data.arrayBuffer().then(me).then(e);if(ge&&(r.data instanceof ArrayBuffer||_e(r.data)))return e(me(r.data));B(r,!1,t=>{$||($=new TextEncoder),e($.encode(t))})}var we="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<we.length;r++)N[we.charCodeAt(r)]=r;var ke=r=>{let e=r.length*.75,t=r.length,s,i=0,n,o,c,a;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);let m=new ArrayBuffer(e),p=new Uint8Array(m);for(s=0;s<t;s+=4)n=N[r.charCodeAt(s)],o=N[r.charCodeAt(s+1)],c=N[r.charCodeAt(s+2)],a=N[r.charCodeAt(s+3)],p[i++]=n<<2|o>>4,p[i++]=(o&15)<<4|c>>2,p[i++]=(c&3)<<6|a&63;return m};var Ke=typeof ArrayBuffer=="function",L=(r,e)=>{if(typeof r!="string")return{type:"message",data:Ee(r,e)};let t=r.charAt(0);return t==="b"?{type:"message",data:Ye(r.substring(1),e)}:S[t]?r.length>1?{type:S[t],data:r.substring(1)}:{type:S[t]}:O},Ye=(r,e)=>{if(Ke){let t=ke(r);return Ee(t,e)}else return{base64:!0,data:r}},Ee=(r,e)=>{switch(e){case"blob":return r instanceof Blob?r:new Blob([r]);case"arraybuffer":default:return r instanceof ArrayBuffer?r:r.buffer}};var ve="",xe=(r,e)=>{let t=r.length,s=new Array(t),i=0;r.forEach((n,o)=>{B(n,!1,c=>{s[o]=c,++i===t&&e(s.join(ve))})})},Te=(r,e)=>{let t=r.split(ve),s=[];for(let i=0;i<t.length;i++){let n=L(t[i],e);if(s.push(n),n.type==="error")break}return s};function Ae(){return new TransformStream({transform(r,e){be(r,t=>{let s=t.length,i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);let n=new DataView(i.buffer);n.setUint8(0,126),n.setUint16(1,s)}else{i=new Uint8Array(9);let n=new DataView(i.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(s))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}var Q;function U(r){return r.reduce((e,t)=>e+t.length,0)}function V(r,e){if(r[0].length===e)return r.shift();let t=new Uint8Array(e),s=0;for(let i=0;i<e;i++)t[i]=r[0][s++],s===r[0].length&&(r.shift(),s=0);return r.length&&s<r[0].length&&(r[0]=r[0].slice(s)),t}function Re(r,e){Q||(Q=new TextDecoder);let t=[],s=0,i=-1,n=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(s===0){if(U(t)<1)break;let a=V(t,1);n=(a[0]&128)===128,i=a[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(U(t)<2)break;let a=V(t,2);i=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),s=3}else if(s===2){if(U(t)<8)break;let a=V(t,8),m=new DataView(a.buffer,a.byteOffset,a.length),p=m.getUint32(0);if(p>Math.pow(2,21)-1){c.enqueue(O);break}i=p*Math.pow(2,32)+m.getUint32(4),s=3}else{if(U(t)<i)break;let a=V(t,i);c.enqueue(L(n?a:Q.decode(a),e)),s=0}if(i===0||i>r){c.enqueue(O);break}}}})}var j=4;function f(r){if(r)return Je(r)}function Je(r){for(var e in f.prototype)r[e]=f.prototype[e];return r}f.prototype.on=f.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};f.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};f.prototype.off=f.prototype.removeListener=f.prototype.removeAllListeners=f.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var s,i=0;i<t.length;i++)if(s=t[i],s===e||s.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};f.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,i=t.length;s<i;++s)t[s].apply(this,e)}return this};f.prototype.emitReserved=f.prototype.emit;f.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};f.prototype.hasListeners=function(r){return!!this.listeners(r).length};var y=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),u=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Ce="arraybuffer";function M(r,...e){return e.reduce((t,s)=>(r.hasOwnProperty(s)&&(t[s]=r[s]),t),{})}var ze=u.setTimeout,Xe=u.clearTimeout;function g(r,e){e.useNativeTimers?(r.setTimeoutFn=ze.bind(u),r.clearTimeoutFn=Xe.bind(u)):(r.setTimeoutFn=u.setTimeout.bind(u),r.clearTimeoutFn=u.clearTimeout.bind(u))}var $e=1.33;function Se(r){return typeof r=="string"?Qe(r):Math.ceil((r.byteLength||r.size)*$e)}function Qe(r){let e=0,t=0;for(let s=0,i=r.length;s<i;s++)e=r.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function H(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Oe(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function Be(r){let e={},t=r.split("&");for(let s=0,i=t.length;s<i;s++){let n=t[s].split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return e}var W=class extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}},_=class extends f{constructor(e){super(),this.writable=!1,g(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new W(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=L(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){let t=Oe(e);return t.length?"?"+t:""}};var P=class extends _{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Te(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,xe(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=H()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}};var Ne=!1;try{Ne=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Le=Ne;function je(){}var G=class extends P{constructor(e){if(super(e),typeof location<"u"){let t=location.protocol==="https:",s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){let s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,n)=>{this.onError("xhr post error",i,n)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}},K=(()=>{class r extends f{constructor(t,s,i){super(),this.createRequest=t,g(this,i),this._opts=i,this._method=i.method||"GET",this._uri=s,this._data=i.data!==void 0?i.data:null,this._create()}_create(){var t;let s=M(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;let i=this._xhr=this.createRequest(s);try{i.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&i.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{i.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(i),"withCredentials"in i&&(i.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(i.timeout=this._opts.requestTimeout),i.onreadystatechange=()=>{var n;i.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(i.getResponseHeader("set-cookie"))),i.readyState===4&&(i.status===200||i.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof i.status=="number"?i.status:0)},0))},i.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=r.requestsCount++,r.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=je,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete r.requests[this._index],this._xhr=null}}_onLoad(){let t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return r.requestsCount=0,r.requests={},r})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Pe);else if(typeof addEventListener=="function"){let r="onpagehide"in u?"pagehide":"unload";addEventListener(r,Pe,!1)}}function Pe(){for(let r in K.requests)K.requests.hasOwnProperty(r)&&K.requests[r].abort()}var Ge=function(){let r=qe({xdomain:!1});return r&&r.responseType!==null}(),w=class extends G{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=Ge&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new K(qe,this.uri(),e)}};function qe(r){let e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Le))return new XMLHttpRequest}catch{}if(!e)try{return new u[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var De=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",ee=class extends _{get name(){return"websocket"}doOpen(){let e=this.uri(),t=this.opts.protocols,s=De?{}:M(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;B(s,this.supportsBinary,n=>{try{this.doWrite(s,n)}catch{}i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=H()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},Z=u.WebSocket||u.MozWebSocket,k=class extends ee{createSocket(e,t,s){return De?new Z(e,t,s):t?new Z(e,t):new Z(e)}doWrite(e,t){this.ws.send(t)}};var v=class extends _{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=Re(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=Ae();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();let n=()=>{s.read().then(({done:c,value:a})=>{c||(this.onPacket(a),n())}).catch(c=>{})};n();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;this._writer.write(s).then(()=>{i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}};var te={websocket:k,webtransport:v,polling:w};var Ze=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,et=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function x(r){if(r.length>8e3)throw"URI too long";let e=r,t=r.indexOf("["),s=r.indexOf("]");t!=-1&&s!=-1&&(r=r.substring(0,t)+r.substring(t,s).replace(/:/g,";")+r.substring(s,r.length));let i=Ze.exec(r||""),n={},o=14;for(;o--;)n[et[o]]=i[o]||"";return t!=-1&&s!=-1&&(n.source=e,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=tt(n,n.path),n.queryKey=st(n,n.query),n}function tt(r,e){let t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function st(r,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,n){i&&(t[i]=n)}),t}var se=typeof addEventListener=="function"&&typeof removeEventListener=="function",Y=[];se&&addEventListener("offline",()=>{Y.forEach(r=>r())},!1);var J=(()=>{class r extends f{constructor(t,s){if(super(),this.binaryType=Ce,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(s=t,t=null),t){let i=x(t);s.hostname=i.host,s.secure=i.protocol==="https"||i.protocol==="wss",s.port=i.port,i.query&&(s.query=i.query)}else s.host&&(s.hostname=x(s.host).host);g(this,s),this.secure=s.secure!=null?s.secure:typeof location<"u"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=s.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(i=>{let n=i.prototype.name;this.transports.push(n),this._transportsByName[n]=i}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Be(this.opts.query)),se&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Y.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){let s=Object.assign({},this.opts.query);s.EIO=j,s.transport=t,this.id&&(s.sid=this.id);let i=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](i)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let t=this.opts.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let s=this.createTransport(t);s.open(),this.setTransport(s)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",s=>this._onClose("transport close",s))}onOpen(){this.readyState="open",r.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let s=new Error("server error");s.code=t.data,this._onError(s);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let i=0;i<this.writeBuffer.length;i++){let n=this.writeBuffer[i].data;if(n&&(s+=Se(n)),i>0&&s>this._maxPayload)return this.writeBuffer.slice(0,i);s+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,y(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,s,i){return this._sendPacket("message",t,s,i),this}send(t,s,i){return this._sendPacket("message",t,s,i),this}_sendPacket(t,s,i,n){if(typeof s=="function"&&(n=s,s=void 0),typeof i=="function"&&(n=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;let o={type:t,data:s,options:i};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let t=()=>{this._onClose("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),t()},i=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():t()}):this.upgrading?i():t()),this}_onError(t){if(r.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),se&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let i=Y.indexOf(this._offlineEventListener);i!==-1&&Y.splice(i,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,s),this.writeBuffer=[],this._prevBufferLen=0}}}return r.protocol=j,r})(),z=class extends J{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;J.priorWebsocketSuccess=!1;let i=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",b=>{if(!s)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;J.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(p(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let C=new Error("probe error");C.transport=t.name,this.emitReserved("upgradeError",C)}}))};function n(){s||(s=!0,p(),t.close(),t=null)}let o=b=>{let C=new Error("probe error: "+b);C.transport=t.name,n(),this.emitReserved("upgradeError",C)};function c(){o("transport closed")}function a(){o("socket closed")}function m(b){t&&b.name!==t.name&&n()}let p=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",c),this.off("close",a),this.off("upgrading",m)};t.once("open",i),t.once("error",o),t.once("close",c),this.once("close",a),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}},T=class extends z{constructor(e,t={}){let s=typeof e=="object"?e:t;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>te[i]).filter(i=>!!i)),super(e,s)}};var ds=T.protocol;function Fe(r,e="",t){let s=r;t=t||typeof location<"u"&&location,r==null&&(r=t.protocol+"//"+t.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=t.protocol+r:r=t.host+r),/^(https?|wss?):\/\//.test(r)||(typeof t<"u"?r=t.protocol+"//"+r:r="https://"+r),s=x(r)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";let n=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+n+":"+s.port+e,s.href=s.protocol+"://"+n+(t&&t.port===s.port?"":":"+s.port),s}var ae={};We(ae,{Decoder:()=>oe,Encoder:()=>ne,PacketType:()=>h,protocol:()=>He});var it=typeof ArrayBuffer=="function",nt=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Ie=Object.prototype.toString,ot=typeof Blob=="function"||typeof Blob<"u"&&Ie.call(Blob)==="[object BlobConstructor]",ct=typeof File=="function"||typeof File<"u"&&Ie.call(File)==="[object FileConstructor]";function D(r){return it&&(r instanceof ArrayBuffer||nt(r))||ot&&r instanceof Blob||ct&&r instanceof File}function q(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,s=r.length;t<s;t++)if(q(r[t]))return!0;return!1}if(D(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return q(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&q(r[t]))return!0;return!1}function Ue(r){let e=[],t=r.data,s=r;return s.data=re(t,e),s.attachments=e.length,{packet:s,buffers:e}}function re(r,e){if(!r)return r;if(D(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let s=0;s<r.length;s++)t[s]=re(r[s],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=re(r[s],e));return t}return r}function Ve(r,e){return r.data=ie(r.data,e),delete r.attachments,r}function ie(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=ie(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=ie(r[t],e));return r}var at=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],He=5,h=function(r){return r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK",r}(h||{}),ne=class{constructor(e){this.replacer=e}encode(e){return(e.type===h.EVENT||e.type===h.ACK)&&q(e)?this.encodeAsBinary({type:e.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===h.BINARY_EVENT||e.type===h.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=Ue(e),s=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(s),i}};function Me(r){return Object.prototype.toString.call(r)==="[object Object]"}var oe=class r extends f{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let s=t.type===h.BINARY_EVENT;s||t.type===h.BINARY_ACK?(t.type=s?h.EVENT:h.ACK,this.reconstructor=new ce(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(D(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,s={type:Number(e.charAt(0))};if(h[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===h.BINARY_EVENT||s.type===h.BINARY_ACK){let n=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(n,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(e.charAt(t+1)==="/"){let n=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(n,t)}else s.nsp="/";let i=e.charAt(t+1);if(i!==""&&Number(i)==i){let n=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}s.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){let n=this.tryParse(e.substr(t));if(r.isPayloadValid(s.type,n))s.data=n;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case h.CONNECT:return Me(t);case h.DISCONNECT:return t===void 0;case h.CONNECT_ERROR:return typeof t=="string"||Me(t);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&at.indexOf(t[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},ce=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=Ve(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function l(r,e,t){return r.on(e,t),function(){r.off(e,t)}}var ht=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),A=class extends f{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[l(e,"open",this.onopen.bind(this)),l(e,"packet",this.onpacket.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,i,n;if(ht.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let o={type:h.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let p=this.ids++,b=t.pop();this._registerAckCallback(p,b),o.id=p}let c=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,a=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!c||(a?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var s;let i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===e&&this.sendBuffer.splice(c,1);t.call(this,new Error("operation has timed out"))},i),o=(...c)=>{this.io.clearTimeoutFn(n),t.apply(this,c)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((s,i)=>{let n=(o,c)=>o?i(o):s(c);n.withError=!0,t.push(n),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());let s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...n)=>s!==this._queue[0]?void 0:(i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...n)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:h.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){let s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case h.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case h.EVENT:case h.BINARY_EVENT:this.onevent(e);break;case h.ACK:case h.BINARY_ACK:this.onack(e);break;case h.DISCONNECT:this.ondisconnect();break;case h.CONNECT_ERROR:this.destroy();let s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,s=!1;return function(...i){s||(s=!0,t.packet({type:h.ACK,id:e,data:i}))}}onack(e){let t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:h.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let s of t)s.apply(this,e.data)}}};function E(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}E.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*r);r=Math.floor(e*10)&1?r+t:r-t}return Math.min(r,this.max)|0};E.prototype.reset=function(){this.attempts=0};E.prototype.setMin=function(r){this.ms=r};E.prototype.setMax=function(r){this.max=r};E.prototype.setJitter=function(r){this.jitter=r};var R=class extends f{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,g(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new E({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let i=t.parser||ae;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new T(this.uri,this.opts);let t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;let i=l(t,"open",function(){s.onopen(),e&&e()}),n=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=l(t,"error",n);if(this._timeout!==!1){let c=this._timeout,a=this.setTimeoutFn(()=>{i(),n(new Error("timeout")),t.close()},c);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(l(e,"ping",this.onping.bind(this)),l(e,"data",this.ondata.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this)),l(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){y(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new A(this,e,t),this.nsps[e]=s),s}_destroy(e){let t=Object.keys(this.nsps);for(let s of t)if(this.nsps[s].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var F={};function I(r,e){typeof r=="object"&&(e=r,r=void 0),e=e||{};let t=Fe(r,e.path||"/socket.io"),s=t.source,i=t.id,n=t.path,o=F[i]&&n in F[i].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o,a;return c?a=new R(s,e):(F[i]||(F[i]=new R(s,e)),a=F[i]),t.query&&!e.query&&(e.query=t.queryKey),a.socket(t.path,e)}Object.assign(I,{Manager:R,Socket:A,io:I,connect:I});var cr=(()=>{class r{$auth=le(pe);namespaceConnectionCache={};connectToNamespace(t){if(this.namespaceConnectionCache[t]){let s=this.namespaceConnectionCache[t];return s.connected=new X,setTimeout(()=>{s.socket.connected&&s.connected.next(void 0)}),s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]}else{let s=this.establishConnectionToNamespace(t);return s.connected=new X,s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]=s,s}}getExistingNamespace(t){return this.namespaceConnectionCache[t]}establishConnectionToNamespace(t){let s=I(`${he.api.socket}/${t}`,{query:{token:this.$auth.token}});return{socket:s,request:(n,o)=>new fe(c=>{s.emit(n,o,a=>{typeof a=="object"&&a.error?c.error(a):c.next(a),c.complete()})})}}static \u0275fac=function(s){return new(s||r)};static \u0275prov=ue({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{cr as a};
@@ -0,0 +1 @@
1
+ import{Wb as t,Xb as r,Yb as i,rb as a,za as o}from"./chunk-TXOB7R5K.js";var m=(()=>{class e{constructor(){}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=a({type:e,selectors:[["app-spinner"]],decls:7,vars:0,consts:[[1,"app-spinner-container"],[1,"animate_loader"],["xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","width","200px","height","200px","viewBox","0 0 100 100","preserveAspectRatio","xMidYMid",2,"margin","auto","display","block"],["cx","50","cy","50","r","32","stroke-width","8","stroke-dasharray","50.26548245743669 50.26548245743669","fill","none","stroke-linecap","round","transform","rotate(327.259 50 50)",1,"spinner_outer"],["attributeName","transform","type","rotate","dur","2s","repeatCount","indefinite","keyTimes","0;1","values","0 50 50;360 50 50"],["cx","50","cy","50","r","23","stroke-width","8","stroke","#f8b26a","stroke-dasharray","36.12831551628262 36.12831551628262","stroke-dashoffset","36.12831551628262","fill","none","stroke-linecap","round","transform","rotate(-327.259 50 50)",1,"spinner_inner"],["attributeName","transform","type","rotate","dur","2s","repeatCount","indefinite","keyTimes","0;1","values","0 50 50;-360 50 50"]],template:function(n,p){n&1&&(t(0,"div",0)(1,"div",1),o(),t(2,"svg",2)(3,"circle",3),i(4,"animateTransform",4),r(),t(5,"circle",5),i(6,"animateTransform",6),r()()()())},styles:[".app-spinner-container[_ngcontent-%COMP%]{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;align-items:center;justify-content:center;z-index:1000}.animate_loader[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;width:200px;overflow:visible}"]})}return e})();export{m as a};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-ZY7HKZ4P.js";import"./chunk-EA5J2VEJ.js";import"./chunk-VMXGERJT.js";import"./chunk-7EUQWCP5.js";import"./chunk-JZZQRLNW.js";import"./chunk-ORPWYWCL.js";import"./chunk-QHPDGSZ6.js";import"./chunk-NZNNTHFQ.js";import"./chunk-SVFFEV36.js";import"./chunk-CW7Q7WEJ.js";import"./chunk-UG5DK2RQ.js";import"./chunk-3IX3CLER.js";import"./chunk-TXOB7R5K.js";export{a as ConfigEditorComponent};
@@ -0,0 +1 @@
1
+ import{a as X}from"./chunk-77A3OZ74.js";import{b as we,w as Be}from"./chunk-FX4GQIE4.js";import{a as ye}from"./chunk-VMXGERJT.js";import{b as De}from"./chunk-7L7RZCFC.js";import{g as U,m as N,n as j,o as ke}from"./chunk-ORPWYWCL.js";import{b as K,c as pe,e as q,f as de,g as Z,j as O,k as ce,l as J,m as me,n as ue,o as ge,p as _e,q as be,r as ve,s as fe,t as he,u as xe,v as Se,y as Q,z as Ce}from"./chunk-QHPDGSZ6.js";import{d as oe,e as se}from"./chunk-NZNNTHFQ.js";import{b as le}from"./chunk-SVFFEV36.js";import{b as T,j as M}from"./chunk-CW7Q7WEJ.js";import{a as A,b as E}from"./chunk-3IX3CLER.js";import{$b as w,Bc as l,Cc as o,Dc as H,Kb as k,Lb as b,M as Y,Mb as u,Rb as h,Tb as F,Ub as V,Vb as D,Wb as i,Xb as n,Yb as d,ad as R,cc as v,db as te,dc as f,g as Ve,h as y,ib as e,id as W,kd as re,na as x,nc as r,oc as c,pc as g,qc as P,rb as B,sc as ie,tc as ne,uc as ae,w as I,xa as S,xc as L,ya as C,yc as $}from"./chunk-TXOB7R5K.js";var ee=Ve(De(),1);var Pe=(a,m)=>({"fa-download":a,"fa-cog fa-spin":m}),Re=a=>({backupTime:a,dayCount:7}),Ue=(a,m)=>({"fa-trash":a,"fa-cog fa-spin":m}),ze=(a,m)=>({backupSize:a,maxBackupSizeText:m});function He(a,m){if(a&1&&(i(0,"li"),r(1),l(2,"date"),l(3,"translate"),n()),a&2){let t=f();e(),g(" ",H(3,4,"backup.scheduled_backup_time",L(7,Re,H(2,1,t.backupTime,"shortTime")))," ")}}function Oe(a,m){if(a&1&&(i(0,"span",24),l(1,"translate"),d(2,"i",28),r(3),n()),a&2){let t=f().$implicit;u("ngbTooltip",H(1,2,"backup.backup_exceeds_max_size",$(5,ze,t.size+"MB",t.maxBackupSizeText))),e(3),g(" ",t.size,"MB ")}}function je(a,m){if(a&1&&(i(0,"span"),r(1),n()),a&2){let t=f().$implicit;e(),g(" ",t.size,"MB ")}}function Ge(a,m){if(a&1){let t=w();i(0,"li",9)(1,"span")(2,"span",23),r(3),l(4,"date"),n(),d(5,"br"),i(6,"small",10),r(7),l(8,"date"),k(9,Oe,4,8,"span",24)(10,je,2,1,"span"),n()(),i(11,"span",11)(12,"button",25),l(13,"translate"),l(14,"translate"),v("click",function(){let s=S(t).$implicit,_=f();return C(_.restore(s))}),d(15,"i",13),n(),i(16,"button",14),l(17,"translate"),l(18,"translate"),v("click",function(){let s=S(t).$implicit,_=f();return C(_.download(s))}),d(19,"i",26),n(),i(20,"button",27),l(21,"translate"),l(22,"translate"),v("click",function(){let s=S(t).$implicit,_=f();return C(_.delete(s))}),d(23,"i",15),n()()()}if(a&2){let t=m.$implicit,p=f();e(2),u("ngbTooltip",t.fileName),e(),g(" ",H(4,15,t.timestamp,"mediumDate")," "),e(4),g(" ",H(8,18,t.timestamp,"shortTime")," \xB7 "),e(2),h(t.size>t.maxBackupSize?9:-1),e(),h(t.size<=t.maxBackupSize?10:-1),e(2),u("disabled",p.clicked||p.deleting||t.size>t.maxBackupSize)("ngbTooltip",o(13,21,"form.button_restore")),b("aria-label",o(14,23,"form.button_restore")),e(4),u("disabled",p.clicked||p.deleting)("ngbTooltip",o(17,25,"form.button_download")),b("aria-label",o(18,27,"form.button_download")),e(4),u("disabled",p.clicked||p.deleting)("ngbTooltip",o(21,29,"form.button_delete")),b("aria-label",o(22,31,"form.button_delete")),e(3),u("ngClass",$(33,Ue,t.id!==p.deleting,t.id===p.deleting))}}function Le(a,m){if(a&1&&(i(0,"div")(1,"div",29)(2,"h4",30),r(3),l(4,"translate"),n(),i(5,"p"),r(6),n()()()),a&2){let t=f();e(3),c(o(4,2,"toast.title_error")),e(3),c(t.errorMessage)}}var Ee=(()=>{class a{$activeModal=x(N);$api=x(T);$modal=x(j);$toastr=x(M);$translate=x(A);clicked=!1;scheduledBackups=[];backupTime;errorMessage="";deleting=null;ngOnInit(){this.getScheduledBackups(),this.getNextBackup()}getScheduledBackups(){this.$api.get("/backup/scheduled-backups").subscribe({next:t=>{this.scheduledBackups=t},error:t=>{this.errorMessage=t.error.message||t.message}})}getNextBackup(){this.$api.get("/backup/scheduled-backups/next").subscribe({next:t=>{this.backupTime=t.next},error:t=>{console.error(t)}})}download(t){this.$api.get(`/backup/scheduled-backups/${t.id}`,{observe:"response",responseType:"blob"}).subscribe({next:p=>{let s=t.fileName||"homebridge-backup.tar.gz",_=p.body.size;if(_>globalThis.backup.maxBackupSize){let z=this.$translate.instant("backup.backup_exceeds_max_size",{maxBackupSizeText:globalThis.backup.maxBackupSizeText,size:`${(_/1048576).toFixed(1)}MB`});this.$toastr.warning(z,this.$translate.instant("toast.title_warning"))}(0,ee.saveAs)(p.body,s)},error:p=>{console.error(p),this.$toastr.error(this.$translate.instant("backup.backup_download_failed"),this.$translate.instant("toast.title_error"))}})}restore(t){this.$activeModal.close();let p=this.$modal.open(X,{size:"lg",backdrop:"static"});p.componentInstance.selectedBackup=t}delete(t){this.deleting=t.id,this.$api.delete(`/backup/scheduled-backups/${t.id}`).subscribe({next:()=>{this.getScheduledBackups(),this.deleting=null},error:p=>{this.deleting=null,console.error(p),this.$toastr.error(this.$translate.instant("backup.backup_delete_failed"),this.$translate.instant("toast.title_error"))}})}onDownloadBackupClick(){return y(this,null,function*(){this.clicked=!0,this.$api.get("/backup/download",{observe:"response",responseType:"blob"}).subscribe({next:t=>{let p=t.headers.get("File-Name")||"homebridge-backup.tar.gz";this.clicked=!1;let s=t.body.size;if(s>globalThis.backup.maxBackupSize){let _=this.$translate.instant("backup.backup_exceeds_max_size",{maxBackupSizeText:globalThis.backup.maxBackupSizeText,size:`${(s/1048576).toFixed(1)}MB`});this.$toastr.warning(_,this.$translate.instant("toast.title_warning"))}(0,ee.saveAs)(t.body,p)},error:t=>{this.clicked=!1,console.error(t),this.$toastr.error(this.$translate.instant("backup.backup_download_failed"),this.$translate.instant("toast.title_error"))}})})}Date=Date;static \u0275fac=function(p){return new(p||a)};static \u0275cmp=B({type:a,selectors:[["ng-component"]],decls:55,vars:50,consts:[[1,"modal-content","hb-backup-modal"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click","disabled"],["aria-hidden","true"],[1,"modal-body"],[1,"text-center","mt-2","mb-3"],[1,"fas","fa-fw","fa-hard-drive","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box","mt-2"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[2,"display","flex","flex-wrap","nowrap"],["disabled","",1,"btn","btn-primary","ml-3"],[1,"fas","fa-fw","fa-history"],["placement","bottom","container","modal","openDelay","150","triggers","hover",1,"btn","btn-primary","ml-1",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw",3,"ngClass"],["disabled","",1,"btn","btn-danger","ml-1"],[1,"fas","fa-fw","fa-trash"],[1,"modal-footer","justify-content-between"],[1,"text-left"],[1,"text-center"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-right"],["container","modal","openDelay","150","triggers","hover",3,"ngbTooltip"],["container","modal","openDelay","150","triggers","hover",1,"red-text",3,"ngbTooltip"],["placement","bottom","container","modal","openDelay","150","triggers","hover",1,"btn","btn-primary","ml-3",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-download"],["placement","bottom","container","modal","openDelay","150","triggers","hover",1,"btn","btn-danger","ml-1",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-exclamation-circle"],["role","alert",1,"alert","alert-error"],[1,"alert-heading"]],template:function(p,s){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),i(7,"span",4),r(8,"\xD7"),n()()(),i(9,"div",5)(10,"div",6),d(11,"i",7),n(),i(12,"ul")(13,"li"),r(14),l(15,"translate"),n(),i(16,"li"),r(17),l(18,"translate"),n(),i(19,"li"),r(20),l(21,"translate"),n(),k(22,He,4,9,"li"),n(),i(23,"ul",8)(24,"li",9)(25,"span")(26,"span"),r(27),l(28,"date"),n(),d(29,"br"),i(30,"small",10),r(31),l(32,"date"),l(33,"translate"),n()(),i(34,"span",11)(35,"button",12),l(36,"translate"),d(37,"i",13),n(),i(38,"button",14),l(39,"translate"),l(40,"translate"),v("click",function(){return s.onDownloadBackupClick()}),d(41,"i",15),n(),i(42,"button",16),l(43,"translate"),d(44,"i",17),n()()(),V(45,Ge,24,36,"li",9,F),n(),k(47,Le,7,4,"div"),n(),i(48,"div",18),d(49,"div",19),i(50,"div",20)(51,"button",21),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),r(52),l(53,"translate"),n()(),d(54,"div",22),n()()),p&2&&(e(3),c(o(4,19,"backup.title_backup")),e(2),u("disabled",s.clicked||s.deleting),b("aria-label",o(6,21,"form.button_close")),e(9),c(o(15,23,"backup.backup_help_one")),e(3),c(o(18,25,"backup.backup_help_two")),e(3),c(o(21,27,"backup.backup_warning")),e(2),h(s.backupTime?22:-1),e(5),g(" ",H(28,29,s.Date.now(),"mediumDate")," "),e(4),P("",H(32,32,s.Date.now(),"shortTime")," \xB7 ",o(33,35,"backup.now"),""),e(4),b("aria-label",o(36,37,"form.button_restore")),e(3),u("disabled",s.clicked)("ngbTooltip",o(39,39,"form.button_download")),b("aria-label",o(40,41,"form.button_download")),e(3),u("ngClass",$(47,Pe,!s.clicked,s.clicked)),e(),b("aria-label",o(43,43,"form.button_delete")),e(3),D(s.scheduledBackups),e(2),h(s.errorMessage?47:-1),e(4),u("disabled",s.clicked||s.deleting),e(),g(" ",o(53,45,"form.button_close")," "))},dependencies:[ke,R,re,E],encapsulation:2})}return a})();function We(a,m){a&1&&(i(0,"div",6),d(1,"i",13),i(2,"p",14),r(3),l(4,"translate"),n()()),a&2&&(e(3),c(o(4,1,"reset.remove_cached_accessories_single_empty")))}function Ke(a,m){a&1&&(i(0,"div")(1,"div",15),d(2,"i",16),n(),i(3,"ngb-alert",17)(4,"p",18),r(5),l(6,"translate"),n(),i(7,"ul",19)(8,"li"),r(9),l(10,"translate"),n(),i(11,"li"),r(12),l(13,"translate"),n(),i(14,"li",14),r(15),l(16,"translate"),n()()()()),a&2&&(e(3),u("dismissible",!1),e(2),c(o(6,5,"reset.action_is_irreversible")),e(4),c(o(10,7,"reset.clear_cache_all.list_1")),e(3),c(o(13,9,"reset.clear_cache_all.list_2")),e(3),c(o(16,11,"reset.clear_cache_all.list_3")))}function qe(a,m){if(a&1){let t=w();i(0,"button",20),l(1,"translate"),v("click",function(){S(t);let s=f();return C(s.$activeModal.dismiss("Dismiss"))}),r(2),l(3,"translate"),n()}if(a&2){let t=f();u("disabled",t.clicked),b("aria-label",o(1,3,"form.button_close")),e(2),g(" ",o(3,5,"form.button_close")," ")}}function Je(a,m){if(a&1){let t=w();i(0,"button",21),l(1,"translate"),v("click",function(){S(t);let s=f();return C(s.$activeModal.dismiss("Dismiss"))}),r(2),l(3,"translate"),n()}a&2&&(b("aria-label",o(1,2,"form.button_close")),e(2),g(" ",o(3,4,"form.button_close")," "))}function Qe(a,m){a&1&&(i(0,"span"),r(1),l(2,"translate"),n()),a&2&&(e(),c(o(2,1,"form.button_remove")))}function Xe(a,m){a&1&&d(0,"i",23)}function Ye(a,m){if(a&1){let t=w();i(0,"button",22),v("click",function(){S(t);let s=f();return C(s.onResetCachedAccessoriesClick())}),k(1,Qe,3,3,"span")(2,Xe,1,0,"i",23),n()}if(a&2){let t=f();u("disabled",t.clicked),e(),h(t.clicked?-1:1),e(),h(t.clicked?2:-1)}}var Ie=(()=>{class a{$activeModal=x(N);$api=x(T);$toastr=x(M);$translate=x(A);clicked;cachedAccessories=[];ngOnInit(){this.loadCachedAccessories()}loadCachedAccessories(){return y(this,null,function*(){try{this.cachedAccessories=yield I(this.$api.get("/server/cached-accessories"))}catch(t){console.error(t),this.$toastr.error(this.$translate.instant("reset.error_message"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}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()},error:t=>{this.clicked=!1,console.error(t),this.$toastr.error(this.$translate.instant("reset.failed_to_reset"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(p){return new(p||a)};static \u0275cmp=B({type:a,selectors:[["ng-component"]],decls:19,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click","disabled"],["aria-hidden","true"],[1,"modal-body"],[1,"text-center"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],["type","button","data-dismiss","modal",1,"btn","btn-elegant"],[1,"text-right"],["type","button","data-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"fas","fa-fw","fa-circle-check","mb-4","primary-text",2,"font-size","75px"],[1,"mb-0"],[1,"text-center","mb-4"],[1,"fas","fa-fw","fa-network-wired","mb-4","primary-text",2,"font-size","75px"],["type","error",2,"margin-bottom","0",3,"dismissible"],[1,"font-weight-bold"],[1,"mb-0","text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(p,s){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),i(7,"span",4),r(8,"\xD7"),n()()(),i(9,"div",5),k(10,We,5,3,"div",6)(11,Ke,17,13,"div"),n(),i(12,"div",7)(13,"div",8),k(14,qe,4,7,"button",9),n(),i(15,"div",6),k(16,Je,4,6,"button",10),n(),i(17,"div",11),k(18,Ye,3,3,"button",12),n()()()),p&2&&(e(3),c(o(4,8,"reset.clear_cache_all.title")),e(2),u("disabled",s.clicked),b("aria-label",o(6,10,"form.button_close")),e(5),h(s.cachedAccessories.length===0?10:-1),e(),h(s.cachedAccessories.length>0?11:-1),e(3),h(s.cachedAccessories.length>0?14:-1),e(2),h(s.cachedAccessories.length===0?16:-1),e(2),h(s.cachedAccessories.length>0?18:-1))},dependencies:[U,E],encapsulation:2})}return a})();var Ze=(a,m)=>({"green-text":a,"red-text":m}),et=(a,m)=>({"fa-trash":a,"fa-cog fa-spin":m});function tt(a,m){a&1&&(i(0,"div",6),d(1,"i",11),i(2,"p",12),r(3),l(4,"translate"),n()()),a&2&&(e(3),c(o(4,1,"reset.clear_cache_bridge.empty")))}function it(a,m){if(a&1){let t=w();i(0,"li",18)(1,"span"),r(2),l(3,"titlecase"),d(4,"br"),i(5,"small",19),d(6,"i",20),r(7),l(8,"translate"),n()(),i(9,"button",21),l(10,"translate"),v("click",function(){let s=S(t).$implicit,_=f(2);return C(_.removeAccessories(s._id))}),d(11,"i",22),n()()}if(a&2){let t=m.$implicit,p=f(2);e(2),P(" ",t.displayName," (",t._main?"Homebridge":o(3,8,t._category),") "),e(4),u("ngClass",$(14,Ze,t._isPaired,!t._isPaired)),e(),P(" ",o(8,10,t._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 ",t._username," "),e(2),u("disabled",p.deleting||p.deleted.includes(t._id)),b("aria-label",o(10,12,"form.button_delete")),e(2),u("ngClass",$(17,et,t._id!==p.deleting,t._id===p.deleting))}}function nt(a,m){if(a&1&&(i(0,"div")(1,"div",13),d(2,"i",14),n(),i(3,"ngb-alert",15)(4,"ul",16)(5,"li"),r(6),l(7,"translate"),n(),i(8,"li"),r(9),l(10,"translate"),n(),i(11,"li"),r(12),l(13,"translate"),n()()(),i(14,"ul",17),V(15,it,12,20,"li",18,F),n()()),a&2){let t=f();e(3),u("dismissible",!1),e(3),c(o(7,4,"reset.clear_cache_bridge.list_1")),e(3),c(o(10,6,"reset.clear_cache_single.list_3")),e(3),c(o(13,8,"reset.clear_cache_bridge.list_2")),e(3),D(t.pairings)}}var $e=(()=>{class a{$activeModal=x(N);$api=x(T);$modal=x(j);$toastr=x(M);$translate=x(A);pairings=[];deleting=null;deleted=[];ngOnInit(){this.loadPairings()}loadPairings(){return y(this,null,function*(){try{this.pairings=(yield I(this.$api.get("/server/pairings"))).filter(t=>t._category==="bridge"&&!t._main).sort((t,p)=>p._main?1:-1)}catch(t){console.error(t),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.load_error"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}removeAccessories(t){this.deleting=t,this.$api.delete(`/server/pairings/${t}/accessories`).subscribe({next:()=>y(this,null,function*(){yield this.loadPairings(),this.deleting=null,this.deleted.push(t),this.$toastr.success("",this.$translate.instant("toast.title_success"))}),error:p=>{this.deleting=null,console.error(p),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.unpair_error"),this.$translate.instant("toast.title_error"))}})}ngOnDestroy(){if(this.deleted.length){let t=this.$modal.open(we,{size:"lg",backdrop:"static"});t.componentInstance.bridges=this.deleted.map(p=>{let{_username:s,displayName:_}=this.pairings.find(z=>z._id===p);return{displayName:_,username:s}})}}static \u0275fac=function(p){return new(p||a)};static \u0275cmp=B({type:a,selectors:[["ng-component"]],decls:19,vars:13,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click","disabled"],["aria-hidden","true"],[1,"modal-body"],[1,"text-center"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-right"],[1,"fas","fa-fw","fa-circle-check","mb-4","primary-text",2,"font-size","75px"],[1,"mb-0"],[1,"text-center","mb-4"],[1,"fas","fa-fw","fa-network-wired","primary-text",2,"font-size","75px"],["type","warning",3,"dismissible"],[1,"mb-0","text-left"],[1,"list-group","list-group-box","mt-2"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"fas","fa-fw","fa-link",3,"ngClass"],[1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw",3,"ngClass"]],template:function(p,s){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),i(7,"span",4),r(8,"\xD7"),n()()(),i(9,"div",5),k(10,tt,5,3,"div",6)(11,nt,17,10,"div"),n(),i(12,"div",7),d(13,"div",8),i(14,"div",6)(15,"button",9),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),r(16),l(17,"translate"),n()(),d(18,"div",10),n()()),p&2&&(e(3),c(o(4,7,"reset.clear_cache_bridge.title")),e(2),u("disabled",s.deleting),b("aria-label",o(6,9,"form.button_close")),e(5),h(s.pairings.length===0?10:-1),e(),h(s.pairings.length>0?11:-1),e(4),u("disabled",s.deleting),e(),g(" ",o(17,11,"form.button_close")," "))},dependencies:[U,R,W,E],encapsulation:2})}return a})();var at=(a,m)=>({"fa-trash":a,"fa-cog fa-spin":m});function rt(a,m){a&1&&(i(0,"div",6),d(1,"i",11),i(2,"p",12),r(3),l(4,"translate"),n()()),a&2&&(e(3),c(o(4,1,"reset.remove_cached_accessories_single_empty")))}function lt(a,m){if(a&1){let t=w();i(0,"li",18)(1,"span"),r(2),d(3,"br"),i(4,"small",19),r(5),n()(),i(6,"button",20),l(7,"translate"),v("click",function(){let s=S(t).$implicit,_=f(2);return C(_.removeAccessory(s))}),d(8,"i",21),n()()}if(a&2){let t=m.$implicit,p=f(2);e(2),P(" ",t.displayName," (",t.plugin,") "),e(3),c(t.UUID),e(),u("disabled",p.deleting),b("aria-label",o(7,6,"form.button_delete")),e(2),u("ngClass",$(8,at,t.UUID!==p.deleting,t.UUID===p.deleting))}}function ot(a,m){if(a&1&&(i(0,"div")(1,"div",13),d(2,"i",14),n(),i(3,"ngb-alert",15)(4,"ul",16)(5,"li"),r(6),l(7,"translate"),n(),i(8,"li"),r(9),l(10,"translate"),n(),i(11,"li"),r(12),l(13,"translate"),n(),i(14,"li",12),r(15),l(16,"translate"),n()()(),i(17,"ul",17),V(18,lt,9,11,"li",18,F),n()()),a&2){let t=f();e(3),u("dismissible",!1),e(3),c(o(7,5,"reset.clear_cache_single.list_1")),e(3),c(o(10,7,"reset.clear_cache_single.list_2")),e(3),c(o(13,9,"reset.clear_cache_single.list_3")),e(3),c(o(16,11,"reset.clear_cache_single.list_4")),e(3),D(t.cachedAccessories)}}var Te=(()=>{class a{$activeModal=x(N);$api=x(T);$toastr=x(M);$translate=x(A);cachedAccessories=[];deleting=null;ngOnInit(){this.loadCachedAccessories()}loadCachedAccessories(){return y(this,null,function*(){try{this.cachedAccessories=yield I(this.$api.get("/server/cached-accessories"))}catch(t){console.error(t),this.$toastr.error(this.$translate.instant("reset.error_message"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}removeAccessory(t){this.deleting=t.UUID,this.$toastr.info(this.$translate.instant("reset.removing_cached_accessory_please_wait")),this.$api.delete(`/server/cached-accessories/${t.UUID}`,{params:{cacheFile:t.$cacheFile}}).subscribe({next:()=>y(this,null,function*(){yield this.loadCachedAccessories(),this.deleting=null,this.cachedAccessories.length||this.$activeModal.close(),this.$toastr.success(this.$translate.instant("reset.cached_accessory_removed"),this.$translate.instant("toast.title_success"))}),error:p=>{this.deleting=null,console.error(p),this.$toastr.error(this.$translate.instant("reset.delete_failed"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(p){return new(p||a)};static \u0275cmp=B({type:a,selectors:[["ng-component"]],decls:19,vars:13,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click","disabled"],["aria-hidden","true"],[1,"modal-body"],[1,"text-center"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-right"],[1,"fas","fa-fw","fa-circle-check","mb-4","primary-text",2,"font-size","75px"],[1,"mb-0"],[1,"text-center","mb-4"],[1,"fas","fa-fw","fa-network-wired","mb-4","primary-text",2,"font-size","75px"],["type","warning",3,"dismissible"],[1,"mb-0","text-left"],[1,"list-group","list-group-box","mt-2"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"btn","btn-danger","ml-3",3,"click","disabled"],[1,"fas","fa-fw",3,"ngClass"]],template:function(p,s){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),i(7,"span",4),r(8,"\xD7"),n()()(),i(9,"div",5),k(10,rt,5,3,"div",6)(11,ot,20,13,"div"),n(),i(12,"div",7),d(13,"div",8),i(14,"div",6)(15,"button",9),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),r(16),l(17,"translate"),n()(),d(18,"div",10),n()()),p&2&&(e(3),c(o(4,7,"reset.clear_cache_single.title")),e(2),u("disabled",s.deleting),b("aria-label",o(6,9,"form.button_close")),e(5),h(s.cachedAccessories.length===0?10:-1),e(),h(s.cachedAccessories.length>0?11:-1),e(4),u("disabled",s.deleting),e(),g(" ",o(17,11,"form.button_close")," "))},dependencies:[U,R,E],encapsulation:2})}return a})();function pt(a,m){if(a&1){let t=w();i(0,"li",11)(1,"span")(2,"label",18)(3,"input",19),ae("ngModelChange",function(s){let _=S(t).$implicit;return ne(_.selected,s)||(_.selected=s),C(s)}),n(),i(4,"span"),r(5),n(),d(6,"span",20),n()(),i(7,"span"),r(8),n()()}if(a&2){let t=m.$implicit;e(2),u("for","adapter"+t.iface),e(),u("id","adapter"+t.iface),ie("ngModel",t.selected),e(2),c(t.iface),e(3),g(" ",t.ip4||t.ip6," ")}}var Ae=(()=>{class a{$activeModal=x(N);availableNetworkAdapters=[];bridgeNetworkAdapters=[];submit(){this.$activeModal.close(this.availableNetworkAdapters.filter(t=>t.selected).map(t=>t.iface))}static \u0275fac=function(p){return new(p||a)};static \u0275cmp=B({type:a,selectors:[["ng-component"]],inputs:{availableNetworkAdapters:"availableNetworkAdapters",bridgeNetworkAdapters:"bridgeNetworkAdapters"},decls:38,vars:24,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"text-center","mb-4"],[1,"fas","fa-fw","fa-ethernet","mb-4","primary-text",2,"font-size","75px"],[1,"alert"],[1,"list-group","list-group-box"],[1,"list-group-item","d-flex","flex-row","justify-content-between"],[1,"list-group-item","d-flex","flex-row","flex-wrap","justify-content-between"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-right"],["type","button","data-dismiss","modal",1,"btn","btn-primary",3,"click"],[1,"hb-uix-switch","d-inline","pr-3",3,"for"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"hb-uix-slider","hb-uix-round"]],template:function(p,s){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),i(7,"span",4),r(8,"\xD7"),n()()(),i(9,"div",5)(10,"div",6),d(11,"i",7),n(),i(12,"div",8),r(13),l(14,"translate"),n(),i(15,"ul",9)(16,"li",10)(17,"span")(18,"strong"),r(19),l(20,"translate"),n()(),i(21,"span")(22,"strong"),r(23),l(24,"translate"),n()()(),V(25,pt,9,5,"li",11,F),n()(),i(27,"div",12)(28,"div",13)(29,"button",14),l(30,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),r(31),l(32,"translate"),n()(),d(33,"div",15),i(34,"div",16)(35,"button",17),v("click",function(){return s.submit()}),r(36),l(37,"translate"),n()()()()),p&2&&(e(3),c(o(4,8,"settings.network.title_network_interfaces")),e(2),b("aria-label",o(6,10,"form.button_close")),e(8),c(o(14,12,"settings.network.message_network_interface")),e(6),c(o(20,14,"settings.network.label_interface_name")),e(4),c(o(24,16,"settings.network.label_ip_address")),e(2),D(s.availableNetworkAdapters),e(4),b("aria-label",o(30,18,"form.button_close")),e(2),g(" ",o(32,20,"form.button_close")," "),e(5),g(" ",o(37,22,"form.button_save")," "))},dependencies:[Q,K,q,J,E],encapsulation:2})}return a})();function dt(a,m){a&1&&(i(0,"span"),r(1),l(2,"translate"),n()),a&2&&(e(),c(o(2,1,"form.button_reset")))}function ct(a,m){a&1&&d(0,"i",18)}var Me=(()=>{class a{$activeModal=x(N);$api=x(T);$route=x(oe);$toastr=x(M);$translate=x(A);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:t=>{console.error(t),this.$toastr.error(this.$translate.instant("reset.failed_to_reset"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(p){return new(p||a)};static \u0275cmp=B({type:a,selectors:[["ng-component"]],decls:40,vars:33,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click","disabled"],["aria-hidden","true"],[1,"modal-body"],[1,"text-center","mb-4"],[1,"fas","fa-fw","fa-bridge","primary-text",2,"font-size","75px"],["type","error",2,"margin-bottom","0",3,"dismissible"],[1,"font-weight-bold"],[1,"mb-0","text-left"],[1,"mb-0"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-right"],["type","button","data-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(p,s){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),i(7,"span",4),r(8,"\xD7"),n()()(),i(9,"div",5)(10,"div",6),d(11,"i",7),n(),i(12,"ngb-alert",8)(13,"p",9),r(14),l(15,"translate"),n(),i(16,"ul",10)(17,"li"),r(18),l(19,"translate"),n(),i(20,"li"),r(21),l(22,"translate"),n(),i(23,"li"),r(24),l(25,"translate"),n(),i(26,"li",11),r(27),l(28,"translate"),n()()()(),i(29,"div",12)(30,"div",13)(31,"button",14),l(32,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),r(33),l(34,"translate"),n()(),d(35,"div",15),i(36,"div",16)(37,"button",17),v("click",function(){return s.onResetHomebridgeAccessoryClick()}),k(38,dt,3,3,"span")(39,ct,1,0,"i",18),n()()()()),p&2&&(e(3),c(o(4,15,"reset.bridges_all.title")),e(2),u("disabled",s.clicked),b("aria-label",o(6,17,"form.button_close")),e(7),u("dismissible",!1),e(2),c(o(15,19,"reset.action_is_irreversible")),e(4),c(o(19,21,"reset.bridges_all.list_1")),e(3),c(o(22,23,"reset.bridges_all.list_2")),e(3),c(o(25,25,"reset.bridges_all.list_3")),e(3),c(o(28,27,"reset.bridges_all.list_4")),e(4),u("disabled",s.clicked),b("aria-label",o(32,29,"form.button_close")),e(2),g(" ",o(34,31,"form.button_close")," "),e(4),u("disabled",s.clicked),e(),h(s.clicked?-1:38),e(),h(s.clicked?39:-1))},dependencies:[U,E],encapsulation:2})}return a})();var mt=(a,m)=>({"green-text":a,"red-text":m}),ut=(a,m)=>({"fa-link-slash":a,"fa-cog fa-spin":m});function gt(a,m){a&1&&(i(0,"div",6),d(1,"i",11),i(2,"p",12),r(3),l(4,"translate"),n()()),a&2&&(e(3),c(o(4,1,"reset.bridges.empty")))}function _t(a,m){if(a&1){let t=w();i(0,"li",18)(1,"span"),r(2),l(3,"titlecase"),d(4,"br"),i(5,"small",19),d(6,"i",20),r(7),l(8,"translate"),n()(),i(9,"button",21),l(10,"translate"),v("click",function(){let s=S(t).$implicit,_=f(2);return C(_.removeAccessory(s._id))}),d(11,"i",22),n()()}if(a&2){let t=m.$implicit,p=f(2);e(2),P(" ",t.displayName," (",t._main?"Homebridge":o(3,8,t._category),") "),e(4),u("ngClass",$(14,mt,t._isPaired,!t._isPaired)),e(),P(" ",o(8,10,t._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 ",t._username," "),e(2),u("disabled",p.deleting),b("aria-label",o(10,12,"form.button_unpair")),e(2),u("ngClass",$(17,ut,t._id!==p.deleting,t._id===p.deleting))}}function bt(a,m){if(a&1&&(i(0,"div")(1,"div",13),d(2,"i",14),n(),i(3,"ngb-alert",15)(4,"ul",16)(5,"li"),r(6),l(7,"translate"),n(),i(8,"li"),r(9),l(10,"translate"),n(),i(11,"li",12),r(12),l(13,"translate"),n()()(),i(14,"ul",17),V(15,_t,12,20,"li",18,F),n()()),a&2){let t=f();e(3),u("dismissible",!1),e(3),c(o(7,4,"reset.bridges_single.list_1")),e(3),c(o(10,6,"reset.bridges_single.list_2")),e(3),c(o(13,8,"reset.bridges_single.list_3")),e(3),D(t.pairings)}}var Ne=(()=>{class a{$activeModal=x(N);$api=x(T);$modal=x(j);$toastr=x(M);$translate=x(A);pairings=[];deleting=null;unpaired=!1;ngOnInit(){this.loadPairings()}loadPairings(){return y(this,null,function*(){try{this.pairings=(yield I(this.$api.get("/server/pairings"))).sort((t,p)=>p._main?1:-1)}catch(t){console.error(t),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.load_error"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}removeAccessory(t){this.deleting=t,this.$api.delete(`/server/pairings/${t}`).subscribe({next:()=>y(this,null,function*(){yield this.loadPairings(),this.pairings.length||this.$activeModal.close(),this.deleting=null,this.unpaired=!0,this.$toastr.success(this.$translate.instant("plugins.settings.restart_required"),this.$translate.instant("toast.title_success"))}),error:p=>{this.deleting=null,console.error(p),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.unpair_error"),this.$translate.instant("toast.title_error"))}})}ngOnDestroy(){this.unpaired&&this.$modal.open(ye,{size:"lg",backdrop:"static"})}static \u0275fac=function(p){return new(p||a)};static \u0275cmp=B({type:a,selectors:[["ng-component"]],decls:19,vars:13,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click","disabled"],["aria-hidden","true"],[1,"modal-body"],[1,"text-center"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-right"],[1,"fas","fa-fw","fa-circle-check","mb-4","primary-text",2,"font-size","75px"],[1,"mb-0"],[1,"text-center","mb-4"],[1,"fas","fa-fw","fa-bridge","primary-text",2,"font-size","75px"],["type","warning",3,"dismissible"],[1,"mb-0","text-left"],[1,"list-group","list-group-box","mt-2"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"fas","fa-fw","fa-link",3,"ngClass"],[1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw",3,"ngClass"]],template:function(p,s){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),i(7,"span",4),r(8,"\xD7"),n()()(),i(9,"div",5),k(10,gt,5,3,"div",6)(11,bt,17,10,"div"),n(),i(12,"div",7),d(13,"div",8),i(14,"div",6)(15,"button",9),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),r(16),l(17,"translate"),n()(),d(18,"div",10),n()()),p&2&&(e(3),c(o(4,7,"reset.bridges_single.title")),e(2),u("disabled",s.deleting),b("aria-label",o(6,9,"form.button_close")),e(5),h(s.pairings.length===0?10:-1),e(),h(s.pairings.length>0?11:-1),e(4),u("disabled",s.deleting),e(),g(" ",o(17,11,"form.button_close")," "))},dependencies:[U,R,W,E],encapsulation:2})}return a})();var vt=a=>({"fa-pulse":a}),Fe=a=>({"is-invalid":a}),ft=(a,m)=>({"badge-danger":a,"badge-info":m});function ht(a,m){if(a&1){let t=w();i(0,"ul",5)(1,"li",12)(2,"span",13),r(3),l(4,"translate"),n(),i(5,"button",14),l(6,"translate"),v("click",function(){S(t);let s=f();return C(s.openBackupModal())}),d(7,"i",15),n()(),i(8,"li",12)(9,"span",13),r(10),l(11,"translate"),n(),i(12,"button",14),l(13,"translate"),v("click",function(){S(t);let s=f();return C(s.openRestoreModal())}),d(14,"i",15),n()(),i(15,"li",12)(16,"span",13),r(17),l(18,"translate"),n(),i(19,"a",16),l(20,"translate"),d(21,"i",15),n()(),i(22,"li",12)(23,"span",13),r(24),l(25,"translate"),n(),i(26,"button",14),l(27,"translate"),v("click",function(){S(t);let s=f();return C(s.openUiSettings())}),d(28,"i",17),n()()()}a&2&&(e(3),g(" ",o(4,8,"backup.title_backup")," "),e(2),b("aria-label",o(6,10,"backup.title_backup")),e(5),g(" ",o(11,12,"form.button_restore")," "),e(2),b("aria-label",o(13,14,"form.button_restore")),e(5),g(" ",o(18,16,"menu.tooltip_user_accounts")," "),e(2),b("aria-label",o(20,18,"menu.tooltip_user_accounts")),e(5),g(" ",o(25,20,"menu.label_settings_advanced")," "),e(2),b("aria-label",o(27,22,"menu.label_settings_advanced")))}function xt(a,m){a&1&&(i(0,"li",69)(1,"small",70),r(2),l(3,"translate"),n(),i(4,"button",71),l(5,"translate"),r(6),l(7,"translate"),n()()),a&2&&(e(2),c(o(3,3,"settings.changes.saved")),e(2),b("aria-label",o(5,5,"menu.tooltip_restart")),e(2),g(" ",o(7,7,"menu.tooltip_restart")," "))}function St(a,m){if(a&1){let t=w();i(0,"ul",6)(1,"li",18)(2,"span"),r(3),l(4,"translate"),n(),i(5,"div",19)(6,"select",20),v("ngModelChange",function(s){S(t);let _=f();return C(_.saveUiSettingChange("lang",s))}),i(7,"option",21),r(8),l(9,"translate"),n(),i(10,"option",22),r(11,"Bulgarian (bg)"),n(),i(12,"option",23),r(13,"Catalan (ca)"),n(),i(14,"option",24),r(15,"Chinese - Simplified (zh-CN)"),n(),i(16,"option",25),r(17,"Chinese - Traditional (zh-TW)"),n(),i(18,"option",26),r(19,"Czech (cs)"),n(),i(20,"option",27),r(21,"Dutch (nl)"),n(),i(22,"option",28),r(23,"English (en)"),n(),i(24,"option",29),r(25,"Finnish (fi)"),n(),i(26,"option",30),r(27,"French (fr)"),n(),i(28,"option",31),r(29,"German (de)"),n(),i(30,"option",32),r(31,"Hebrew (he)"),n(),i(32,"option",33),r(33,"Hungarian (hu)"),n(),i(34,"option",34),r(35,"Indonesian (id)"),n(),i(36,"option",35),r(37,"Italian (it)"),n(),i(38,"option",36),r(39,"Japanese (ja)"),n(),i(40,"option",37),r(41,"Korean (ko)"),n(),i(42,"option",38),r(43,"Macedonian (mk)"),n(),i(44,"option",39),r(45,"Norwegian (no)"),n(),i(46,"option",40),r(47,"Polish (pl)"),n(),i(48,"option",41),r(49,"Portuguese (Brazil)"),n(),i(50,"option",42),r(51,"Portuguese (Portugal)"),n(),i(52,"option",43),r(53,"Russian (ru)"),n(),i(54,"option",44),r(55,"Slovenian (sl)"),n(),i(56,"option",45),r(57,"Spanish (es)"),n(),i(58,"option",46),r(59,"Swedish (sv)"),n(),i(60,"option",47),r(61,"Thai (th)"),n(),i(62,"option",48),r(63,"Turkish (tr)"),n(),i(64,"option",49),r(65,"Ukrainian (uk)"),n()()()(),i(66,"li",18)(67,"span"),r(68),l(69,"translate"),n(),i(70,"div",19)(71,"select",20),v("ngModelChange",function(s){S(t);let _=f();return C(_.saveUiSettingChange("theme",s))}),i(72,"option",50),r(73),l(74,"translate"),n(),i(75,"option",51),r(76),l(77,"translate"),n(),i(78,"option",52),r(79),l(80,"translate"),n(),i(81,"option",53),r(82),l(83,"translate"),n(),i(84,"option",54),r(85),l(86,"translate"),n(),i(87,"option",55),r(88),l(89,"translate"),n(),i(90,"option",56),r(91),l(92,"translate"),n(),i(93,"option",57),r(94),l(95,"translate"),n(),i(96,"option",58),r(97),l(98,"translate"),n(),i(99,"option",59),r(100),l(101,"translate"),n(),i(102,"option",60),r(103),l(104,"translate"),n(),i(105,"option",61),r(106),l(107,"translate"),n(),i(108,"option",62),r(109),l(110,"translate"),n()()()(),i(111,"li",18)(112,"span"),r(113),l(114,"translate"),n(),i(115,"div",19)(116,"select",20),v("ngModelChange",function(s){S(t);let _=f();return C(_.saveUiSettingChange("lightingMode",s))}),i(117,"option",21),r(118),l(119,"translate"),n(),i(120,"option",63),r(121),l(122,"translate"),n(),i(123,"option",64),r(124),l(125,"translate"),n()()()(),i(126,"li",18)(127,"span"),r(128),l(129,"translate"),d(130,"br")(131,"small",65),l(132,"translate"),n(),i(133,"div",19)(134,"input",66),v("ngModelChange",function(s){S(t);let _=f();return C(_.saveUiSettingChange("loginWallpaper",s))}),n()()(),i(135,"li",18)(136,"span"),r(137),l(138,"translate"),n(),i(139,"div",19)(140,"select",20),v("ngModelChange",function(s){S(t);let _=f();return C(_.saveUiSettingChange("tempUnits",s))}),i(141,"option",67),r(142),l(143,"translate"),n(),i(144,"option",68),r(145),l(146,"translate"),n()()()(),k(147,xt,8,9,"li",69),n()}if(a&2){let t=f();e(3),c(o(4,31,"settings.display.lang")),e(3),u("ngModel",t.$settings.env.lang),e(2),c(o(9,33,"form.select.auto")),e(60),c(o(69,35,"settings.display.theme")),e(3),u("ngModel",t.$settings.theme),e(2),c(o(74,37,"settings.display.orange")),e(3),c(o(77,39,"settings.display.red")),e(3),c(o(80,41,"settings.display.pink")),e(3),c(o(83,43,"settings.display.purple")),e(3),c(o(86,45,"settings.display.deep_purple")),e(3),c(o(89,47,"settings.display.indigo")),e(3),c(o(92,49,"settings.display.blue")),e(3),c(o(95,51,"settings.display.bluegrey")),e(3),c(o(98,53,"settings.display.cyan")),e(3),c(o(101,55,"settings.display.green")),e(3),c(o(104,57,"settings.display.teal")),e(3),c(o(107,59,"settings.display.grey")),e(3),c(o(110,61,"settings.display.brown")),e(4),c(o(114,63,"settings.display.lighting_mode")),e(3),u("ngModel",t.$settings.lightingMode),e(2),c(o(119,65,"form.select.auto")),e(3),c(o(122,67,"settings.display.light")),e(3),c(o(125,69,"settings.display.dark")),e(4),g(" ",o(129,71,"settings.display.login_wallpaper"),""),e(3),u("innerHTML",o(132,73,"settings.display.login_wallpaper_desc"),te),e(3),u("ngModel",t.$settings.loginWallpaper),e(3),c(o(138,75,"settings.display.temp_units")),e(3),u("ngModel",t.$settings.env.temperatureUnits),e(2),c(o(143,77,"settings.display.temp_units.c")),e(3),c(o(146,79,"settings.display.temp_units.f")),e(2),h(t.hasChangedLoginWallpaper?147:-1)}}function Ct(a,m){if(a&1&&(i(0,"li",12)(1,"span"),r(2),l(3,"translate"),i(4,"code"),r(5,"-D"),n(),d(6,"br"),i(7,"small",73),r(8),l(9,"translate"),n()(),d(10,"input",74),l(11,"translate"),d(12,"label",75),n()),a&2){let t=f(3);e(2),g(" ",o(3,3,"settings.startup.debug")," "),e(6),g(" ",o(9,5,t.isHbV2?"settings.startup.debug_desc_v2":"settings.startup.debug_desc_v1")," "),e(2),b("aria-label",o(11,7,"settings.startup.debug"))}}function kt(a,m){a&1&&(i(0,"li",12)(1,"span"),r(2),l(3,"translate"),i(4,"code"),r(5,"-I"),n(),d(6,"br"),i(7,"small",73),r(8),l(9,"translate"),n()(),d(10,"input",76),l(11,"translate"),d(12,"label",77),n()),a&2&&(e(2),g(" ",o(3,3,"settings.startup.insecure")," "),e(6),c(o(9,5,"settings.startup.insecure_desc")),e(2),b("aria-label",o(11,7,"settings.startup.insecure")))}function wt(a,m){a&1&&(i(0,"li",12)(1,"span"),r(2),l(3,"translate"),i(4,"code"),r(5,"-K"),n(),d(6,"br"),i(7,"small",73),r(8),l(9,"translate"),n()(),d(10,"input",78),l(11,"translate"),d(12,"label",79),n()),a&2&&(e(2),g(" ",o(3,3,"settings.startup.keep_accessories")," "),e(6),c(o(9,5,"settings.startup.keep_accessories_desc")),e(2),b("aria-label",o(11,7,"settings.startup.keep_accessories")))}function yt(a,m){a&1&&(i(0,"li",18)(1,"span")(2,"span",80),r(3,"DEBUG"),n(),d(4,"br"),i(5,"small",73),r(6),l(7,"translate"),i(8,"a",81),r(9),l(10,"translate"),d(11,"i",82),n()()(),i(12,"div",19),d(13,"input",83),n()()),a&2&&(e(6),g(" ",o(7,2,"settings.service.debug_tooltip")," "),e(3),g(" ",o(10,4,"form.button_more_info")," "))}function Bt(a,m){a&1&&(i(0,"li",18)(1,"span")(2,"span",80),r(3,"NODE_OPTIONS"),n(),d(4,"br"),i(5,"small",73),r(6),l(7,"translate"),n()(),i(8,"div",19),d(9,"input",84),n()()),a&2&&(e(6),c(o(7,1,"settings.service.node_tooltip")))}function Et(a,m){a&1&&(i(0,"li",12)(1,"span"),r(2),l(3,"translate"),d(4,"br"),i(5,"small",73),r(6),l(7,"translate"),n()(),i(8,"a",85),l(9,"translate"),d(10,"i",15),n()()),a&2&&(e(2),g(" ",o(3,3,"menu.docker.startup_script"),""),e(4),c(o(7,5,"platform.docker.script_help")),e(2),b("aria-label",o(9,7,"menu.docker.startup_script")))}function It(a,m){a&1&&(i(0,"li",69)(1,"small",70),r(2),l(3,"translate"),n(),i(4,"button",71),l(5,"translate"),r(6),l(7,"translate"),n()()),a&2&&(e(2),c(o(3,3,"settings.changes.saved")),e(2),b("aria-label",o(5,5,"menu.tooltip_restart")),e(2),g(" ",o(7,7,"menu.tooltip_restart")," "))}function $t(a,m){if(a&1&&(i(0,"ul",72),k(1,Ct,13,9,"li",12)(2,kt,13,9,"li",12)(3,wt,13,9,"li",12)(4,yt,14,6,"li",18)(5,Bt,10,3,"li",18)(6,Et,11,9,"li",12)(7,It,8,9,"li",69),n()),a&2){let t=f(2);e(),h(t.$settings.env.serviceMode?1:-1),e(),h(t.$settings.env.serviceMode?2:-1),e(),h(t.$settings.env.serviceMode?3:-1),e(),h(t.$settings.env.serviceMode?4:-1),e(),h(t.$settings.env.serviceMode?5:-1),e(),h(t.$settings.env.runningInDocker?6:-1),e(),h(t.hasChangedService?7:-1)}}function Tt(a,m){if(a&1){let t=w();i(0,"form",7)(1,"div",2),v("click",function(){S(t);let s=f();return C(s.toggleSection("startup"))}),i(2,"h5",3),d(3,"i",4),r(4),l(5,"translate"),n()(),k(6,$t,8,7,"ul",72),n()}if(a&2){let t=f();u("formGroup",t.serviceForm),e(),b("aria-expanded",t.showFields.startup?"true":"false")("aria-controls","fieldsStartup"),e(2),u("ngClass",t.showFields.startup?"fa-chevron-down":"fa-chevron-right"),e(),g(" ",o(5,6,"settings.title_startup_options")," "),e(2),h(t.showFields.startup?6:-1)}}function At(a,m){a&1&&d(0,"i",96)}function Mt(a,m){if(a&1&&(i(0,"span")(1,"span",95),k(2,At,1,0,"i",96),r(3),i(4,"span",97),r(5),l(6,"translate"),n()()()),a&2){let t=m.$implicit;e(),u("ngClass",$(6,ft,t.missing,!t.missing)),e(),h(t.missing?2:-1),e(),g(" ",t.iface,": "),e(2),c(t.missing?o(6,4,"settings.mdns_advertiser_not_connected"):t.ip4||t.ip6)}}function Nt(a,m){a&1&&(i(0,"option",89),r(1),l(2,"translate"),n()),a&2&&(e(),g("Avahi (",o(2,1,"settings.mdns_advertiser_rec"),")"))}function Ft(a,m){a&1&&(i(0,"option",92),r(1),l(2,"translate"),n()),a&2&&(e(),g("systemd-resolved (",o(2,1,"settings.mdns_advertiser_exp"),")"))}function Vt(a,m){a&1&&(i(0,"li",69)(1,"small",70),r(2),l(3,"translate"),n(),i(4,"button",71),l(5,"translate"),r(6),l(7,"translate"),n()()),a&2&&(e(2),c(o(3,3,"settings.changes.saved")),e(2),b("aria-label",o(5,5,"menu.tooltip_restart")),e(2),g(" ",o(7,7,"menu.tooltip_restart")," "))}function Dt(a,m){if(a&1){let t=w();i(0,"ul",8)(1,"li",12)(2,"span",13)(3,"div"),r(4),l(5,"translate"),d(6,"br"),i(7,"small",73),r(8),l(9,"translate"),n()(),V(10,Mt,7,9,"span",null,F),n(),i(12,"button",86),l(13,"translate"),v("click",function(){S(t);let s=f();return C(s.selectNetworkInterfaces())}),d(14,"i",87),n()(),i(15,"li",18)(16,"span"),r(17),l(18,"translate"),d(19,"br"),i(20,"small",73),r(21),l(22,"translate"),n()(),i(23,"div",19)(24,"select",88),l(25,"translate"),k(26,Nt,3,3,"option",89),i(27,"option",90),r(28),l(29,"translate"),n(),i(30,"option",91),r(31,"Bonjour HAP"),n(),k(32,Ft,3,3,"option",92),n()()(),i(33,"li",18)(34,"span"),r(35),l(36,"translate"),d(37,"br"),i(38,"small",73),r(39),l(40,"translate"),n()(),i(41,"div",19),d(42,"input",93),l(43,"translate"),n()(),i(44,"li",18)(45,"span"),r(46),l(47,"translate"),d(48,"br"),i(49,"small",73),r(50),l(51,"translate"),n()(),i(52,"div",19),d(53,"input",94),l(54,"translate"),n()(),k(55,Vt,8,9,"li",69),n()}if(a&2){let t=f();e(4),g(" ",o(5,22,"settings.network.title_network_interfaces"),""),e(4),c(o(9,24,"settings.network.message_network_interface")),e(2),D(t.bridgeNetworkAdapters),e(2),u("disabled",!t.availableNetworkAdapters.length),b("aria-label",o(13,26,"settings.network.title_network_interfaces")),e(2),u("ngClass",L(48,vt,!t.availableNetworkAdapters.length)),e(3),g(" ",o(18,28,"settings.mdns_advertiser"),""),e(4),c(o(22,30,"settings.mdns_advertiser_help")),e(3),u("formControl",t.legacyMdnsFormControl),b("aria-label",o(25,32,"settings.mdns_advertiser")),e(2),h(t.showAvahiMdnsOption?26:-1),e(2),g(" Ciao ",t.showAvahiMdnsOption?"":"("+o(29,34,"settings.mdns_advertiser_rec")+")"," "),e(4),h(t.showResolvedMdnsOption?32:-1),e(3),g(" ",o(36,36,"settings.network.port_hb"),""),e(4),c(o(40,38,"settings.network.port_hb_desc")),e(3),u("formControl",t.hbPortFormControl)("ngClass",L(50,Fe,t.isInvalidHbPort)),b("aria-label",o(43,40,"settings.network.port_ui")),e(4),g(" ",o(47,42,"settings.network.port_ui"),""),e(4),c(o(51,44,"settings.network.port_ui_desc")),e(3),u("ngClass",L(52,Fe,t.isInvalidHbUiPort)),b("aria-label",o(54,46,"settings.network.port_ui")),e(2),h(t.hasChangedHbPort||t.hasChangedUiSettings||t.hasChangedMdns||t.hasChangedBridgeNetworkAdapters?55:-1)}}function Pt(a,m){a&1&&(i(0,"p",9),r(1),l(2,"translate"),n()),a&2&&(e(),c(o(2,1,"settings.cache.desc")))}function Rt(a,m){if(a&1){let t=w();i(0,"ul",98)(1,"li",12)(2,"span",13),r(3),l(4,"translate"),d(5,"br"),i(6,"small",73),r(7),l(8,"translate"),n()(),i(9,"button",14),l(10,"translate"),v("click",function(){S(t);let s=f(2);return C(s.removeSingleCachedAccessories())}),d(11,"i",15),n()(),i(12,"li",12)(13,"span",13),r(14),l(15,"translate"),d(16,"br"),i(17,"small",73),r(18),l(19,"translate"),n()(),i(20,"button",14),l(21,"translate"),v("click",function(){S(t);let s=f(2);return C(s.removeBridgeAccessories())}),d(22,"i",15),n()(),i(23,"li",12)(24,"span",13),r(25),l(26,"translate"),d(27,"br"),i(28,"small",73),r(29),l(30,"translate"),n()(),i(31,"button",14),l(32,"translate"),v("click",function(){S(t);let s=f(2);return C(s.removeAllCachedAccessories())}),d(33,"i",15),n()()()}a&2&&(e(3),g(" ",o(4,9,"reset.clear_cache_single.title"),""),e(4),c(o(8,11,"reset.clear_cache_single.desc")),e(2),b("aria-label",o(10,13,"reset.clear_cache_single.title")),e(5),g(" ",o(15,15,"reset.clear_cache_bridge.title"),""),e(4),c(o(19,17,"reset.clear_cache_bridge.desc")),e(2),b("aria-label",o(21,19,"reset.clear_cache_all.title")),e(5),g(" ",o(26,21,"reset.clear_cache_all.title"),""),e(4),c(o(30,23,"reset.clear_cache_all.desc")),e(2),b("aria-label",o(32,25,"reset.clear_cache_all.title")))}function Ut(a,m){if(a&1){let t=w();i(0,"div",1)(1,"div",2),v("click",function(){S(t);let s=f();return C(s.toggleSection("cache"))}),i(2,"h5",3),d(3,"i",4),r(4),l(5,"translate"),n()(),k(6,Pt,3,3,"p",9)(7,Rt,34,27,"ul",98),n()}if(a&2){let t=f();e(),b("aria-expanded",t.showFields.cache?"true":"false")("aria-controls","fieldsCache"),e(2),u("ngClass",t.showFields.cache?"fa-chevron-down":"fa-chevron-right"),e(),g(" ",o(5,6,"settings.cache.title")," "),e(2),h(t.showFields.cache?6:-1),e(),h(t.showFields.cache?7:-1)}}function zt(a,m){a&1&&(i(0,"p",9),r(1),l(2,"translate"),n()),a&2&&(e(),c(o(2,1,"reset.bridges.desc")))}function Ht(a,m){if(a&1){let t=w();i(0,"ul",10)(1,"li",12)(2,"span",13),r(3),l(4,"translate"),d(5,"br"),i(6,"small",73),r(7),l(8,"translate"),n()(),i(9,"button",14),l(10,"translate"),v("click",function(){S(t);let s=f();return C(s.unpairAccessory())}),d(11,"i",15),n()(),i(12,"li",12)(13,"span",13),r(14),l(15,"translate"),l(16,"titlecase"),d(17,"br"),i(18,"small",73),r(19),l(20,"translate"),n()(),i(21,"button",14),l(22,"translate"),v("click",function(){S(t);let s=f();return C(s.resetHomebridgeState())}),d(23,"i",15),n()()()}a&2&&(e(3),g(" ",o(4,6,"reset.bridges_single.title"),""),e(4),c(o(8,8,"reset.bridges_single.desc")),e(2),b("aria-label",o(10,10,"reset.bridges_single.title")),e(5),g(" ",o(16,14,o(15,12,"reset.bridges_all.title")),""),e(5),c(o(20,16,"reset.bridges_all.desc")),e(2),b("aria-label",o(22,18,"reset.bridges_all.title")))}var Cn=(()=>{class a{$api=x(T);$modal=x(j);$plugin=x(Be);$settings=x(le);$toastr=x(M);$translate=x(A);originalServiceForm={HOMEBRIDGE_DEBUG:!1,HOMEBRIDGE_KEEP_ORPHANS:!1,HOMEBRIDGE_INSECURE:!0,ENV_DEBUG:"",ENV_NODE_OPTIONS:""};originalUiSettingsForm={port:0};originalLoginWallpaper="";originalMdnsSetting="";originalBridgeNetworkAdapters=[];originalHbPort=0;hasChangedService=!1;hasChangedUiSettings=!1;hasChangedMdns=!1;hasChangedBridgeNetworkAdapters=!1;hasChangedHbPort=!1;hasChangedLoginWallpaper=!1;isInvalidHbPort=!1;isInvalidHbUiPort=!1;serviceForm=new Z({HOMEBRIDGE_DEBUG:new O(!1),HOMEBRIDGE_KEEP_ORPHANS:new O(!1),HOMEBRIDGE_INSECURE:new O(!0),ENV_DEBUG:new O(""),ENV_NODE_OPTIONS:new O("")});uiSettingsForm=new Z({port:new O(0)});loginWallpaper="";legacyMdnsFormControl=new ce(!1);showAvahiMdnsOption=!1;showResolvedMdnsOption=!1;availableNetworkAdapters=[];bridgeNetworkAdapters=[];hbPortFormControl=new O(0);isHbV2=!1;showFields={general:!0,display:!0,startup:!0,network:!0,reset:!0,cache:!0};ngOnInit(){this.isHbV2=this.$settings.env.homebridgeVersion.startsWith("2"),this.initUiSettingsForm(),this.initDisplaySettingsForm(),this.initNetworkingOptions(),this.$settings.env.serviceMode&&this.initServiceModeForm()}initUiSettingsForm(){this.originalUiSettingsForm={port:this.$settings.env.port},this.uiSettingsForm.patchValue({port:this.$settings.env.port}),this.uiSettingsForm.valueChanges.pipe(Y(500)).subscribe(t=>{let p=!1;Object.keys(t).forEach(s=>{this.originalUiSettingsForm[s]!==t[s]&&(this.saveUiSettingChange(s,t[s]),p=!0)}),this.hasChangedUiSettings=p})}initServiceModeForm(){this.$api.get("/platform-tools/hb-service/homebridge-startup-settings").subscribe({next:t=>{Object.keys(t).forEach(p=>{this.originalServiceForm[p]=t[p]}),this.serviceForm.patchValue(t),this.serviceForm.valueChanges.pipe(Y(500)).subscribe(this.saveServiceModeSettings.bind(this))},error:t=>{console.error(t),this.$toastr.error(t.message,this.$translate.instant("toast.title_error"))}})}initDisplaySettingsForm(){this.originalLoginWallpaper=this.$settings.loginWallpaper,this.loginWallpaper=this.$settings.loginWallpaper}saveUiSettingChange(t,p){switch(t){case"lang":this.$settings.setLang(p);break;case"lightingMode":this.$settings.setLightingMode(p,"user");break;case"theme":this.$settings.setTheme(p);break;case"tempUnits":this.$settings.setEnvItem("temperatureUnits",p);break;case"loginWallpaper":this.$settings.setEnvItem("loginWallpaper",p),this.hasChangedLoginWallpaper=p!==this.originalLoginWallpaper;break;case"port":if(!p||typeof p!="number"||p<1025||p>65533||Number.isInteger(p)===!1||p===this.hbPortFormControl.value){this.isInvalidHbUiPort=!0;return}this.$settings.setEnvItem("port",p),this.isInvalidHbUiPort=!1;break}I(this.$api.put("/config-editor/ui",{key:t,value:p})).catch(s=>{console.error(s),this.$toastr.error(s.message,this.$translate.instant("toast.title_error"))})}openUiSettings(){this.$plugin.settings({name:"homebridge-config-ui-x",displayName:"Homebridge UI",settingsSchema:!0,links:{}})}openRestoreModal(){this.$modal.open(X,{size:"lg",backdrop:"static"})}openBackupModal(){this.$modal.open(Ee,{size:"lg",backdrop:"static"})}saveServiceModeSettings(t=this.serviceForm.value){this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",t).subscribe({next:()=>{this.hasChangedService=JSON.stringify(t)!==JSON.stringify(this.originalServiceForm)},error:p=>{console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}resetHomebridgeState(){this.$modal.open(Me,{size:"lg",backdrop:"static"})}unpairAccessory(){this.$modal.open(Ne,{size:"lg",backdrop:"static"})}removeAllCachedAccessories(){this.$modal.open(Ie,{size:"lg",backdrop:"static"})}removeSingleCachedAccessories(){this.$modal.open(Te,{size:"lg",backdrop:"static"})}removeBridgeAccessories(){this.$modal.open($e,{size:"lg",backdrop:"static"})}initNetworkingOptions(){return y(this,null,function*(){try{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{}})}getNetworkSettings(){return y(this,null,function*(){return Promise.all([I(this.$api.get("/server/network-interfaces/system")),I(this.$api.get("/server/network-interfaces/bridge")),I(this.$api.get("/server/mdns-advertiser")),I(this.$api.get("/server/port"))]).then(([t,p,s,_])=>{this.availableNetworkAdapters=t,this.buildBridgeNetworkAdapterList(p),this.legacyMdnsFormControl.patchValue(s.advertiser),this.originalMdnsSetting=s.advertiser,this.originalBridgeNetworkAdapters=this.bridgeNetworkAdapters.map(z=>z.iface),this.legacyMdnsFormControl.valueChanges.subscribe(z=>{this.setHomebridgeMdnsSetting(z)}),this.hbPortFormControl.patchValue(_.port),this.hbPortFormControl.valueChanges.subscribe(z=>this.setHomebridgePort(z)),this.originalHbPort=_.port})})}setHomebridgeMdnsSetting(t){return y(this,null,function*(){this.$api.put("/server/mdns-advertiser",{advertiser:t}).subscribe({next:()=>{this.hasChangedMdns=t!==this.originalMdnsSetting},error:p=>{console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})})}setNetworkInterfaces(t){return y(this,null,function*(){this.$api.put("/server/network-interfaces/bridge",{adapters:t}).subscribe({next:()=>{this.hasChangedBridgeNetworkAdapters=this.originalBridgeNetworkAdapters.join(",")!==t.join(",")},error:p=>{console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})})}setHomebridgePort(t){return y(this,null,function*(){if(t===this.uiSettingsForm.get("port").value){this.isInvalidHbPort=!0;return}this.$api.put("/server/port",{port:t}).subscribe({next:()=>{this.hasChangedHbPort=this.originalHbPort!==t,this.isInvalidHbPort=!1},error:()=>{this.isInvalidHbPort=!0}})})}buildBridgeNetworkAdapterList(t){if(!t.length){this.bridgeNetworkAdapters=[];return}this.bridgeNetworkAdapters=t.map(p=>{let s=this.availableNetworkAdapters.find(_=>_.iface===p);return s?(s.selected=!0,s.missing=!1,s):{iface:p,missing:!0}})}selectNetworkInterfaces(){let t=this.$modal.open(Ae,{size:"lg",backdrop:"static"});t.componentInstance.availableNetworkAdapters=this.availableNetworkAdapters,t.componentInstance.bridgeNetworkAdapters=this.bridgeNetworkAdapters,t.result.then(p=>{this.buildBridgeNetworkAdapterList(p),this.setNetworkInterfaces(p)}).catch(()=>{})}toggleSection(t){this.showFields[t]=!this.showFields[t]}static \u0275fac=function(p){return new(p||a)};static \u0275cmp=B({type:a,selectors:[["ng-component"]],decls:35,vars:35,consts:[[1,"primary-text","m-0"],[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"],["novalidate","",1,"my-4",3,"formGroup"],["id","fieldsNetwork",1,"list-group","list-group-box","mt-2","mx-0"],[1,"small","grey-text","mb-2","mx-0"],["id","fieldsReset",1,"list-group","list-group-box","mt-2","mx-0"],[1,"pb-3"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"pr-2"],[1,"btn","btn-primary","waves-effect","m-0","ml-3",2,"min-width","50px",3,"click"],[1,"fas","fa-fw","fa-chevron-right"],["routerLink","/users",1,"btn","btn-primary","waves-effect","m-0","ml-3",2,"min-width","50px"],[1,"fas","fa-fw","fa-sliders"],[1,"list-group-item","d-block","d-md-flex","justify-content-between","align-items-center"],[1,"my-3","my-md-0","pl-0","pl-md-5","w-auto"],[1,"custom-select","resp-select",3,"ngModelChange","ngModel"],["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"],[1,"grey-text","pr-2",3,"innerHTML"],["name","search_wallpaper","autocomplete","off","type","text","placeholder","/path-to/image.png",1,"form-control","custom-input","form-control-sm","resp-input",3,"ngModelChange","ngModel"],["value","c"],["value","f"],[1,"list-group-item","d-flex","flex-column","align-items-center"],[1,"grey-text","my-2"],["routerLink","/restart",1,"btn","btn-primary","waves-effect","my-2"],["id","fieldsStartup",1,"list-group","list-group-box","mb-4","mx-0"],[1,"grey-text","pr-2"],["type","checkbox","id","homebridgeDebugMode","formControlName","HOMEBRIDGE_DEBUG",1,"rendux-input"],["for","homebridgeDebugMode",1,"rendux-label","ml-3",2,"min-width","50px"],["type","checkbox","id","homebridgeInsecureMode","formControlName","HOMEBRIDGE_INSECURE",1,"rendux-input"],["for","homebridgeInsecureMode",1,"rendux-label","ml-3",2,"min-width","50px"],["type","checkbox","id","homebridgeKeepOrphans","formControlName","HOMEBRIDGE_KEEP_ORPHANS",1,"rendux-input"],["for","homebridgeKeepOrphans",1,"rendux-label","ml-3",2,"min-width","50px"],[1,"text-monospace"],["href","https://github.com/homebridge/homebridge-config-ui-x/wiki/Debug-Common-Values","target","_blank"],[1,"fa","fa/fw","fas","fa-fw","fa-external-link-alt"],["formControlName","ENV_DEBUG","type","text","placeholder","HAP-NodeJS:Advertiser,HAP-NodeJS:Service",1,"form-control","custom-input","form-control-sm","resp-input"],["formControlName","ENV_NODE_OPTIONS","type","text","placeholder","--max-old-space-size=512 --max-http-header-size=8192",1,"form-control","custom-input","form-control-sm","resp-input"],["routerLink","/platform-tools/docker/startup-script",1,"btn","btn-primary","waves-effect","m-0","ml-3",2,"min-width","50px"],[1,"btn","btn-primary","waves-effect","m-0","ml-3",2,"min-width","50px",3,"click","disabled"],[1,"fas","fa-fw","fa-chevron-right",3,"ngClass"],[1,"custom-select","resp-select",3,"formControl"],["value","avahi"],["value","ciao"],["value","bonjour-hap"],["value","resolved"],["type","number","min","1025","max","65533",1,"form-control","custom-input","form-control-sm","resp-input",3,"formControl","ngClass"],["type","number","min","1025","max","65533","placeholder","8581","formControlName","port",1,"form-control","custom-input","form-control-sm","resp-input",3,"ngClass"],[1,"badge","badge-pill","mr-1",3,"ngClass"],[1,"fas","fa-fw","fa-exclamation-triangle"],[1,"font-weight-normal"],["id","fieldsCache",1,"list-group","list-group-box","mb-4","mx-0"]],template:function(p,s){p&1&&(i(0,"h3",0),r(1),l(2,"translate"),n(),i(3,"div",1)(4,"div",2),v("click",function(){return s.toggleSection("general")}),i(5,"h5",3),d(6,"i",4),r(7),l(8,"translate"),n()(),k(9,ht,29,24,"ul",5),n(),i(10,"div",1)(11,"div",2),v("click",function(){return s.toggleSection("display")}),i(12,"h5",3),d(13,"i",4),r(14),l(15,"translate"),n()(),k(16,St,148,81,"ul",6),n(),k(17,Tt,7,8,"form",7),i(18,"form",7)(19,"div",2),v("click",function(){return s.toggleSection("network")}),i(20,"h5",3),d(21,"i",4),r(22),l(23,"translate"),n()(),k(24,Dt,56,54,"ul",8),n(),k(25,Ut,8,8,"div",1),i(26,"div",1)(27,"div",2),v("click",function(){return s.toggleSection("reset")}),i(28,"h5",3),d(29,"i",4),r(30),l(31,"translate"),n()(),k(32,zt,3,3,"p",9)(33,Ht,24,20,"ul",10),n(),d(34,"div",11)),p&2&&(e(),c(o(2,25,"menu.settings.title")),e(3),b("aria-expanded",s.showFields.general?"true":"false")("aria-controls","fieldsGeneral"),e(2),u("ngClass",s.showFields.general?"fa-chevron-down":"fa-chevron-right"),e(),g(" ",o(8,27,"settings.general.title_general")," "),e(2),h(s.showFields.general?9:-1),e(2),b("aria-expanded",s.showFields.display?"true":"false")("aria-controls","fieldsDisplay"),e(2),u("ngClass",s.showFields.display?"fa-chevron-down":"fa-chevron-right"),e(),g(" ",o(15,29,"settings.general.title_display")," "),e(2),h(s.showFields.display?16:-1),e(),h(s.$settings.env.serviceMode||s.$settings.env.runningInDocker?17:-1),e(),u("formGroup",s.uiSettingsForm),e(),b("aria-expanded",s.showFields.network?"true":"false")("aria-controls","fieldsNetwork"),e(2),u("ngClass",s.showFields.network?"fa-chevron-down":"fa-chevron-right"),e(),g(" ",o(23,31,"settings.network.title_network")," "),e(2),h(s.showFields.network?24:-1),e(),h(s.$settings.env.serviceMode?25:-1),e(2),b("aria-expanded",s.showFields.reset?"true":"false")("aria-controls","fieldsReset"),e(2),u("ngClass",s.showFields.reset?"fa-chevron-down":"fa-chevron-right"),e(),g(" ",o(31,33,"reset.bridges.title")," "),e(2),h(s.showFields.reset?32:-1),e(),h(s.showFields.reset?33:-1))},dependencies:[R,se,Q,me,fe,he,pe,ue,K,ve,q,de,Se,xe,J,Ce,ge,_e,be,W,E],encapsulation:2})}return a})();export{Ie as a,$e as b,Te as c,Ae as d,Me as e,Ne as f,Cn as g};
@@ -0,0 +1 @@
1
+ import{a as N,b as U}from"./chunk-BKUGARB4.js";import{m as H}from"./chunk-ORPWYWCL.js";import{a as D}from"./chunk-6PHMBMFU.js";import{d as V}from"./chunk-NZNNTHFQ.js";import{b as E,j as z}from"./chunk-CW7Q7WEJ.js";import{c as I,d as w}from"./chunk-UG5DK2RQ.js";import{a as P,b as A}from"./chunk-3IX3CLER.js";import{$b as R,Bc as l,Cc as d,Dc as F,Kb as f,Lb as S,Mb as b,Rb as c,Wb as a,Xb as o,Yb as u,cc as x,dc as p,g as $,h as k,ib as i,na as _,nc as s,oc as h,pc as v,rb as y,xa as C,xc as B,ya as g}from"./chunk-TXOB7R5K.js";var M=$(N(),1),W=$(U(),1);var j=t=>({maxBackupSizeText:t});function q(t,m){if(t&1&&(a(0,"div"),u(1,"input",11),o()),t&2){let e=p(2);i(),b("value",e.selectedBackup.fileName)}}function O(t,m){if(t&1){let e=R();a(0,"div",10)(1,"input",12),x("change",function(n){C(e);let T=p(2);return g(T.handleRestoreFileInput(n.target.files))}),o(),a(2,"label",13),s(3),l(4,"translate"),o()()}if(t&2){let e=p(2);i(3),v(" ",d(4,1,(e.selectedFile==null?null:e.selectedFile.name)||"backup.label_choose_backup_file_to_restore")," ")}}function G(t,m){if(t&1&&(a(0,"div",5)(1,"div",8),u(2,"i",9),o(),a(3,"p"),s(4),l(5,"translate"),o(),a(6,"ul")(7,"li"),s(8),l(9,"translate"),o(),a(10,"li"),s(11),l(12,"translate"),o(),a(13,"li"),s(14),l(15,"translate"),o()(),f(16,q,2,1,"div")(17,O,5,3,"div",10),o()),t&2){let e=p();i(4),h(d(5,6,"backup.restore_help_one")),i(4),h(d(9,8,"backup.restore_help_two")),i(3),h(F(12,10,"backup.restore_max_size",B(15,j,e.maxFileSizeText))),i(3),h(d(15,13,"backup.restore_warning")),i(2),c(e.selectedBackup?16:-1),i(),c(e.selectedBackup?-1:17)}}function J(t,m){t&1&&u(0,"i",19)}function K(t,m){if(t&1&&(a(0,"span"),s(1),o()),t&2){let e=p(3);i(),v("",e.uploadPercent,"% - ")}}function L(t,m){t&1&&(a(0,"span"),s(1," Extracting Archive"),o())}function Q(t,m){t&1&&(a(0,"span"),s(1),l(2,"translate"),o()),t&2&&(i(),v(" ",d(2,1,"backup.label_uploading"),""))}function X(t,m){if(t&1&&(a(0,"span"),f(1,J,1,0,"i",19)(2,K,2,1,"span")(3,L,2,0,"span")(4,Q,3,3,"span"),o()),t&2){let e=p(2);i(),c(!e.uploadPercent||e.uploadPercent===100?1:-1),i(),c(e.uploadPercent&&e.uploadPercent!==100?2:-1),i(),c(e.uploadPercent===100?3:-1),i(),c(e.uploadPercent!==100?4:-1)}}function Y(t,m){t&1&&(a(0,"span"),s(1),l(2,"translate"),o()),t&2&&(i(),h(d(2,1,"form.button_restore")))}function Z(t,m){if(t&1){let e=R();a(0,"div",7)(1,"div",14)(2,"button",15),l(3,"translate"),x("click",function(){C(e);let n=p();return g(n.$activeModal.dismiss("Dismiss"))}),s(4),l(5,"translate"),o()(),u(6,"div",16),a(7,"div",17)(8,"button",18),x("click",function(){C(e);let n=p();return g(n.onRestoreBackupClick())}),f(9,X,5,4,"span")(10,Y,3,3,"span"),o()()()}if(t&2){let e=p();i(2),b("disabled",e.clicked),S("aria-label",d(3,6,"form.button_close")),i(2),v(" ",d(5,8,"form.button_close")," "),i(4),b("disabled",!e.selectedBackup&&!e.selectedFile||e.clicked),i(),c(e.clicked?9:-1),i(),c(e.clicked?-1:10)}}function ee(t,m){if(t&1){let e=R();a(0,"div",7),u(1,"div",14),a(2,"div",16)(3,"button",20),x("click",function(){C(e);let n=p();return g(n.postBackupRestart())}),s(4),l(5,"translate"),o()(),u(6,"div",17),o()}t&2&&(i(4),v(" ",d(5,1,"menu.hbrestart.title")," "))}var me=(()=>{class t{$activeModal=_(H);$api=_(E);$route=_(V);$toastr=_(z);$translate=_(P);$ws=_(D);setupWizardRestore=!1;selectedBackup=null;clicked=!1;maxFileSizeText=globalThis.backup.maxBackupSizeText;selectedFile;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;restoreArchiveType="homebridge";uploadPercent=0;term=new M.Terminal;termTarget;fitAddon=new W.FitAddon;io;ngOnInit(){return k(this,null,function*(){this.io=this.$ws.connectToNamespace("backup"),this.termTarget=document.getElementById("plugin-log-output"),this.term.open(this.termTarget),this.fitAddon.fit(),this.io.socket.on("stdout",e=>{this.term.write(e)}),this.setupWizardRestore&&(this.restoreStarted=!0,this.restoreInProgress=!0,this.startRestore())})}onRestoreBackupClick(){this.selectedBackup?this.restoreScheduledBackup():this.restoreArchiveType==="homebridge"?this.uploadHomebridgeArchive():this.restoreArchiveType==="hbfx"&&this.uploadHbfxArchive()}uploadHomebridgeArchive(){this.term.reset(),this.clicked=!0;let e=new FormData;e.append("restoreArchive",this.selectedFile,this.selectedFile.name),this.$api.post("/backup/restore",e).subscribe({next:()=>{this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startRestore()},500),this.clicked=!1},error:r=>{var n;console.error(r),this.$toastr.error(((n=r.error)==null?void 0:n.message)||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error")),this.clicked=!1}})}restoreScheduledBackup(){return k(this,null,function*(){this.term.reset(),this.clicked=!0,this.$api.post(`/backup/scheduled-backups/${this.selectedBackup.id}/restore`,{}).subscribe({next:()=>{this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startRestore()},500),this.clicked=!1},error:e=>{var r;console.error(e),this.$toastr.error(((r=e.error)==null?void 0:r.message)||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error")),this.clicked=!1}})})}startRestore(){return k(this,null,function*(){this.io.request("do-restore").subscribe({next:()=>{this.restoreInProgress=!1,this.$toastr.success(this.$translate.instant("backup.backup_restored"),this.$translate.instant("toast.title_success")),this.setupWizardRestore&&this.postBackupRestart()},error:e=>{this.restoreFailed=!0,console.error(e),this.$toastr.error(this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})})}uploadHbfxArchive(){this.term.reset(),this.clicked=!0;let e=new FormData;e.append("restoreArchive",this.selectedFile,this.selectedFile.name),this.$api.post("/backup/restore/hbfx",e,{reportProgress:!0,observe:"events"}).subscribe({next:r=>{r.type===I.UploadProgress?this.uploadPercent=Math.round(100*r.loaded/r.total):r instanceof w&&(this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startHbfxRestore()},500),this.clicked=!1)},error:r=>{var n;this.clicked=!1,console.error(r),this.$toastr.error(((n=r.error)==null?void 0:n.message)||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})}startHbfxRestore(){return k(this,null,function*(){this.io.request("do-restore-hbfx").subscribe({next:()=>{this.restoreInProgress=!1,this.$toastr.success(this.$translate.instant("backup.backup_restored"),this.$translate.instant("toast.title_success"))},error:e=>{this.restoreFailed=!0,console.error(e),this.$toastr.error(this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})})}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.selectedFile.name.endsWith(".hbfx")?this.restoreArchiveType="hbfx":this.restoreArchiveType="homebridge"):delete this.selectedFile}postBackupRestart(){this.$api.put("/backup/restart",{}).subscribe({next:()=>{this.$activeModal.close(!0),this.$route.navigate(["/"])},error:()=>{}})}ngOnDestroy(){this.io.end()}static \u0275fac=function(r){return new(r||t)};static \u0275cmp=y({type:t,selectors:[["ng-component"]],inputs:{setupWizardRestore:"setupWizardRestore",selectedBackup:"selectedBackup"},decls:13,vars:11,consts:[[1,"modal-content","hb-backup-modal"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click","disabled"],["aria-hidden","true"],[1,"modal-body"],["id","plugin-log-output",1,"modal-body",3,"hidden"],[1,"modal-footer","justify-content-between"],[1,"text-center","mt-2","mb-3"],[1,"fas","fa-fw","fa-hard-drive","primary-text",2,"font-size","75px"],[1,"custom-file"],["type","text","disabled","",1,"form-control","custom-input",3,"value"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz, .hbfx",1,"custom-file-input",3,"change"],["for","restoreFileUpload",1,"custom-file-label"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-right"],["type","button","data-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"],[1,"fa","fa-fw","fa-circle-notch","fa-spin"],["type","button","data-dismiss","modal",1,"btn","btn-primary",3,"click"]],template:function(r,n){r&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),s(3),l(4,"translate"),o(),a(5,"button",3),l(6,"translate"),x("click",function(){return n.$activeModal.dismiss("Dismiss")}),a(7,"span",4),s(8,"\xD7"),o()()(),f(9,G,18,17,"div",5),u(10,"div",6),f(11,Z,11,10,"div",7)(12,ee,7,3,"div",7),o()),r&2&&(i(3),h(d(4,7,"form.button_restore")),i(2),b("disabled",n.restoreInProgress),S("aria-label",d(6,9,"form.button_close")),i(4),c(!n.restoreStarted&&!n.setupWizardRestore?9:-1),i(),b("hidden",!n.restoreStarted),i(),c(!n.restoreStarted||n.restoreFailed===!0?11:-1),i(),c(!n.restoreInProgress&&n.restoreStarted?12:-1))},dependencies:[A],encapsulation:2})}return t})();export{me as a};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-DNOJWLVY.js";import"./chunk-6PHMBMFU.js";import"./chunk-NZNNTHFQ.js";import"./chunk-BFDVOBTQ.js";import"./chunk-SVFFEV36.js";import"./chunk-CW7Q7WEJ.js";import"./chunk-UG5DK2RQ.js";import"./chunk-3IX3CLER.js";import"./chunk-TXOB7R5K.js";export{a as RestartComponent};
@@ -0,0 +1,2 @@
1
+ import{a as D}from"./chunk-QHPDGSZ6.js";import{Aa as l,E as h,Fa as w,Ga as u,Hb as f,Yb as g,ga as _,hc as y,ia as M,ic as b,jc as E,ka as v,md as O,na as a,rb as c,sb as C,vc as N}from"./chunk-TXOB7R5K.js";var z=["editorContainer"],T="[_nghost-%COMP%]{display:block;height:200px}.editor-container[_ngcontent-%COMP%]{width:100%;height:98%}",I=new v("NGX_MONACO_EDITOR_CONFIG"),R=!1,q,x=(()=>{let i=class i{constructor(){this.config=a(I),this.onInit=new w,this._insideNg=!1}set insideNg(e){this._insideNg=e,this._editor&&(this._editor.dispose(),this.initMonaco(this._options,this.insideNg))}get insideNg(){return this._insideNg}ngAfterViewInit(){R?q.then(()=>{this.initMonaco(this._options,this.insideNg)}):(R=!0,q=new Promise(e=>{let t=this.config.baseUrl;if((t==="assets"||!t)&&(t="./assets/monaco/min/vs"),typeof window.monaco=="object"){this.initMonaco(this._options,this.insideNg),e();return}let o=r=>{let m=r||window.require,p={paths:{vs:`${t}`}};Object.assign(p,this.config.requireConfig||{}),m.config(p),m(["vs/editor/editor.main"],()=>{typeof this.config.onMonacoLoad=="function"&&this.config.onMonacoLoad(),this.initMonaco(this._options,this.insideNg),e()})};if(this.config.monacoRequire)o(this.config.monacoRequire);else if(window.require)if(window.require.config)o();else{var s=`${t}/loader.js`,d=new XMLHttpRequest;d.addEventListener("load",()=>{let r=document.createElement("script");r.type="text/javascript",r.text=["var nodeRequire = require;",d.responseText.replace('"use strict";',""),"var monacoAmdRequire = require;","require = nodeRequire;","require.nodeRequire = require;"].join(`
2
+ `),document.body.appendChild(r),o(window.monacoAmdRequire)}),d.open("GET",s),d.send()}else{let r=document.createElement("script");r.type="text/javascript",r.src=`${t}/loader.js`,r.addEventListener("load",()=>{o()}),document.body.appendChild(r)}}))}ngOnDestroy(){this._windowResizeSubscription&&this._windowResizeSubscription.unsubscribe(),this._editor&&(this._editor.dispose(),this._editor=void 0)}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=c({type:i,selectors:[["ng-component"]],viewQuery:function(t,o){if(t&1&&y(z,7),t&2){let s;b(s=E())&&(o._editorContainer=s.first)}},inputs:{insideNg:"insideNg"},outputs:{onInit:"onInit"},standalone:!1,decls:0,vars:0,template:function(t,o){},encapsulation:2});let n=i;return n})(),X=(()=>{let i=class i extends x{constructor(){super(...arguments),this.zone=a(u),this._value="",this.propagateChange=e=>{},this.onTouched=()=>{}}set options(e){this._options=Object.assign({},this.config.defaultOptions,e),this._editor&&(this._editor.dispose(),this.initMonaco(e,this.insideNg))}get options(){return this._options}set model(e){this.options.model=e,this._editor&&(this._editor.dispose(),this.initMonaco(this.options,this.insideNg))}writeValue(e){this._value=e||"",setTimeout(()=>{this._editor&&!this.options.model&&this._editor.setValue(this._value)})}registerOnChange(e){this.propagateChange=e}registerOnTouched(e){this.onTouched=e}initMonaco(e,t){let o=!!e.model;if(o){let s=monaco.editor.getModel(e.model.uri||"");s?(e.model=s,e.model.setValue(this._value)):e.model=monaco.editor.createModel(e.model.value,e.model.language,e.model.uri)}t?this._editor=monaco.editor.create(this._editorContainer.nativeElement,e):this.zone.runOutsideAngular(()=>{this._editor=monaco.editor.create(this._editorContainer.nativeElement,e)}),o||this._editor.setValue(this._value),this._editor.onDidChangeModelContent(s=>{let d=this._editor.getValue();this.zone.run(()=>{this.propagateChange(d),this._value=d})}),this._editor.onDidBlurEditorWidget(()=>{this.onTouched()}),this._windowResizeSubscription&&this._windowResizeSubscription.unsubscribe(),this._windowResizeSubscription=h(window,"resize").subscribe(()=>this._editor.layout()),this.onInit.emit(this._editor)}};i.\u0275fac=(()=>{let e;return function(o){return(e||(e=l(i)))(o||i)}})(),i.\u0275cmp=c({type:i,selectors:[["ngx-monaco-editor"]],inputs:{options:"options",model:"model"},features:[N([{provide:D,useExisting:_(()=>i),multi:!0}]),f],decls:2,vars:0,consts:[["editorContainer",""],[1,"editor-container"]],template:function(t,o){t&1&&g(0,"div",1,0)},styles:["[_nghost-%COMP%]{display:block;height:200px}.editor-container[_ngcontent-%COMP%]{width:100%;height:98%}"],changeDetection:0});let n=i;return n})(),$=(()=>{let i=class i extends x{constructor(){super(...arguments),this.zone=a(u)}set options(e){this._options=Object.assign({},this.config.defaultOptions,e),this._editor&&(this._editor.dispose(),this.initMonaco(e,this.insideNg))}get options(){return this._options}set originalModel(e){this._originalModel=e,this._editor&&(this._editor.dispose(),this.initMonaco(this.options,this.insideNg))}set modifiedModel(e){this._modifiedModel=e,this._editor&&(this._editor.dispose(),this.initMonaco(this.options,this.insideNg))}initMonaco(e,t){if(!this._originalModel||!this._modifiedModel)throw new Error("originalModel or modifiedModel not found for ngx-monaco-diff-editor");this._originalModel.language=this._originalModel.language||e.language,this._modifiedModel.language=this._modifiedModel.language||e.language;let o=monaco.editor.createModel(this._originalModel.code,this._originalModel.language),s=monaco.editor.createModel(this._modifiedModel.code,this._modifiedModel.language);this._editorContainer.nativeElement.innerHTML="";let d=e.theme;t?this._editor=monaco.editor.createDiffEditor(this._editorContainer.nativeElement,e):this.zone.runOutsideAngular(()=>{this._editor=monaco.editor.createDiffEditor(this._editorContainer.nativeElement,e)}),e.theme=d,this._editor.setModel({original:o,modified:s}),this._windowResizeSubscription&&this._windowResizeSubscription.unsubscribe(),this._windowResizeSubscription=h(window,"resize").subscribe(()=>this._editor.layout()),this.onInit.emit(this._editor)}};i.\u0275fac=(()=>{let e;return function(o){return(e||(e=l(i)))(o||i)}})(),i.\u0275cmp=c({type:i,selectors:[["ngx-monaco-diff-editor"]],inputs:{options:"options",originalModel:"originalModel",modifiedModel:"modifiedModel"},features:[f],decls:2,vars:0,consts:[["editorContainer",""],[1,"editor-container"]],template:function(t,o){t&1&&g(0,"div",1,0)},styles:[T],changeDetection:0});let n=i;return n})(),H=(()=>{let i=class i{static forRoot(e={}){return{ngModule:i,providers:[{provide:I,useValue:e}]}}};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=C({type:i}),i.\u0275inj=M({imports:[O]});let n=i;return n})();export{X as a,$ as b,H as c};
@@ -0,0 +1,8 @@
1
+ import{a as U}from"./chunk-CCUID66K.js";import{a as S,b as O}from"./chunk-BKUGARB4.js";import{a as g}from"./chunk-6PHMBMFU.js";import{M as w,e as x,g as h,ha as E,n as R,na as L}from"./chunk-TXOB7R5K.js";var F=x((v,b)=>{(function(a,l){typeof define=="function"&&define.amd?define([],l):typeof v<"u"?l():(l(),a.FileSaver={})})(v,function(){"use strict";function a(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function l(e,t,n){var i=new XMLHttpRequest;i.open("GET",e),i.responseType="blob",i.onload=function(){r(i.response,t,n)},i.onerror=function(){console.error("could not download file")},i.send()}function d(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function c(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,m=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),r=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!m?function(e,t,n){var i=s.URL||s.webkitURL,o=document.createElement("a");t=t||e.name||"download",o.download=t,o.rel="noopener",typeof e=="string"?(o.href=e,o.origin===location.origin?c(o):d(o.href)?l(e,t,n):c(o,o.target="_blank")):(o.href=i.createObjectURL(e),setTimeout(function(){i.revokeObjectURL(o.href)},4e4),setTimeout(function(){c(o)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(a(e,n),t);else if(d(e))l(e,t,n);else{var i=document.createElement("a");i.href=e,i.target="_blank",setTimeout(function(){c(i)})}}:function(e,t,n,i){if(i=i||open("","_blank"),i&&(i.document.title=i.document.body.innerText="downloading..."),typeof e=="string")return l(e,t,n);var o=e.type==="application/octet-stream",z=/constructor/i.test(s.HTMLElement)||s.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||o&&z||m)&&typeof FileReader<"u"){var u=new FileReader;u.onloadend=function(){var f=u.result;f=y?f:f.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=f:location=f,i=null},u.readAsDataURL(e)}else{var A=s.URL||s.webkitURL,p=A.createObjectURL(e);i?i.location=p:location.href=p,i=null,setTimeout(function(){A.revokeObjectURL(p)},4e4)}});s.saveAs=r.saveAs=r,typeof b<"u"&&(b.exports=r)})});var k=h(S(),1),j=h(O(),1),T=h(U(),1);var W=(()=>{class a{$ws=L(g);term;io;fitAddon;webLinksAddon;resize;elementResize;pluginName;startTerminal(d,c={},s,m){this.pluginName=m,this.elementResize=s,this.io=this.$ws.connectToNamespace("log"),this.term=new k.Terminal(c),setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.fitAddon=new j.FitAddon,this.webLinksAddon=new T.WebLinksAddon,this.resize=new R,this.term.open(d.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.connected.subscribe(()=>{this.term.reset(),this.io.socket.emit("tail-log",{cols:this.term.cols,rows:this.term.rows})}),this.io.socket.on("disconnect",()=>{this.term.write(`
2
+ \r
3
+ \rWebsocket failed to connect. Is the server running?
4
+ \r
5
+ \r`)}),this.resize.pipe(w(500)).subscribe(r=>{this.io.socket.emit("resize",r)}),this.io.socket.on("stdout",r=>{if(this.pluginName){let e=r.split(`
6
+ \r`),t=!1;e.forEach(n=>{if(n){if(t)if(n.match(/36m\[.*?\]/))t=!1;else{this.term.write(`${n}
7
+ \r`);return}n.includes(`36m[${this.pluginName}]`)&&(this.term.write(`${n}
8
+ \r`),t=!0)}})}else this.term.write(r)}),this.term.onResize(r=>{this.resize.next(r)}),this.elementResize&&this.elementResize.pipe(w(100)).subscribe({next:()=>{this.fitAddon.fit()}})}destroyTerminal(){this.io.end(),this.term.dispose(),this.resize.complete(),this.elementResize&&this.elementResize.complete()}static \u0275fac=function(c){return new(c||a)};static \u0275prov=E({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();export{W as a,F as b};
@@ -0,0 +1 @@
1
+ import{g as i}from"./chunk-NZNNTHFQ.js";import"./chunk-UG5DK2RQ.js";import{ia as t,md as l,sb as e}from"./chunk-TXOB7R5K.js";var d=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"docker",loadChildren:()=>import("./chunk-RHB2T3FE.js").then(o=>o.DockerModule)},{path:"linux",loadChildren:()=>import("./chunk-UYZI56PX.js").then(o=>o.LinuxModule)},{path:"terminal",loadChildren:()=>import("./chunk-AZXQ73I5.js").then(o=>o.TerminalModule)}],n=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[i.forChild(d),i]})}return o})();var s=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[l,n]})}return o})();export{s as PlatformToolsModule};
@@ -0,0 +1 @@
1
+ import{a as p}from"./chunk-5ALXJOLQ.js";import{a as f}from"./chunk-WMB35VCS.js";import"./chunk-77A3OZ74.js";import"./chunk-BKUGARB4.js";import{q as a}from"./chunk-ORPWYWCL.js";import{y as u,z as d}from"./chunk-QHPDGSZ6.js";import"./chunk-6PHMBMFU.js";import{g as i}from"./chunk-NZNNTHFQ.js";import"./chunk-BFDVOBTQ.js";import"./chunk-SVFFEV36.js";import"./chunk-CW7Q7WEJ.js";import"./chunk-UG5DK2RQ.js";import{c as n}from"./chunk-3IX3CLER.js";import{ia as t,md as m,sb as r}from"./chunk-TXOB7R5K.js";var M=[{path:"",loadComponent:()=>import("./chunk-GVDR7ZRB.js").then(o=>o.SetupWizardComponent)}],l=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[i.forChild(M),i]})}return o})();var R=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({providers:[p],imports:[m,u,d,n,a,l,f]})}return o})();export{R as SetupWizardModule};
@@ -0,0 +1 @@
1
+ import{a as C,b as y,c as $,d as j}from"./chunk-T2YVB4SI.js";import"./chunk-QE7DO6J3.js";import{q as h}from"./chunk-ORPWYWCL.js";import{y as g,z as v}from"./chunk-QHPDGSZ6.js";import{d as U,g as n}from"./chunk-NZNNTHFQ.js";import"./chunk-BFDVOBTQ.js";import"./chunk-SVFFEV36.js";import{b as c,j as M}from"./chunk-CW7Q7WEJ.js";import"./chunk-UG5DK2RQ.js";import{a as u,c as d}from"./chunk-3IX3CLER.js";import{h as a,ha as f,ia as i,md as l,na as e,sb as s,w as p}from"./chunk-TXOB7R5K.js";var m=(()=>{class r{$api=e(c);$router=e(U);$toastr=e(M);$translate=e(u);resolve(){return a(this,null,function*(){try{return yield p(this.$api.get("/users"))}catch(o){console.error(o),this.$toastr.error(o.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(t){return new(t||r)};static \u0275prov=f({token:r,factory:r.\u0275fac})}return r})();var F=[{path:"",loadComponent:()=>import("./chunk-WT2GX4NS.js").then(r=>r.UsersComponent),resolve:{homebridgeUsers:m}}],b=(()=>{class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=s({type:r});static \u0275inj=i({imports:[n.forChild(F),n]})}return r})();var Y=(()=>{class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=s({type:r});static \u0275inj=i({providers:[m],imports:[l,g,v,d.forChild(),h,b,$,j,y,C]})}return r})();export{Y as UsersModule};
@@ -0,0 +1 @@
1
+ import"./chunk-S6EMLS5Q.js";import"./chunk-LDPCT3YF.js";import"./chunk-CCUID66K.js";import"./chunk-BKUGARB4.js";import"./chunk-6PHMBMFU.js";import{g as i}from"./chunk-NZNNTHFQ.js";import"./chunk-BFDVOBTQ.js";import"./chunk-SVFFEV36.js";import"./chunk-CW7Q7WEJ.js";import"./chunk-UG5DK2RQ.js";import{c as m}from"./chunk-3IX3CLER.js";import{ia as t,md as n,sb as r}from"./chunk-TXOB7R5K.js";var u=[{path:"",loadComponent:()=>import("./chunk-UJU3NPS7.js").then(o=>o.TerminalComponent)}],a=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[i.forChild(u),i]})}return o})();var T=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[n,a,m.forChild()]})}return o})();export{T as TerminalModule};
@@ -0,0 +1 @@
1
+ import{a as _,b as D}from"./chunk-SVFFEV36.js";import{a as l,b as S}from"./chunk-CW7Q7WEJ.js";import{f as x}from"./chunk-UG5DK2RQ.js";import{C as v,Sc as I,g as O,h as a,ha as h,ia as E,ka as y,ma as c,na as f,r as p,sb as j,w as d,x as T,z as w}from"./chunk-TXOB7R5K.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&6)):0)n=t.indexOf(n);return o}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return r.\u0275fac=function(e){return new(e||r)(c(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{constructor(e,t,o){this.jwtHelper=t,this.document=o,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===o:i instanceof RegExp?i.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(c(g),c(m),c(I))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(c(r,12))},r.\u0275mod=j({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(l.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(l.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(l.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(l.jwt.tokenKey);e&&this.validateToken(e)})}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(l.jwt.tokenKey),this.token=null,!1}}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{m as a,F as b,q as c};