homebridge-config-ui-x 5.0.0-beta.16 → 5.0.0-beta.18

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 (120) hide show
  1. package/CHANGELOG.md +21 -3
  2. package/dist/core/auth/auth.module.js +1 -1
  3. package/dist/core/auth/auth.module.js.map +1 -1
  4. package/dist/modules/plugins/plugins.service.js +4 -1
  5. package/dist/modules/plugins/plugins.service.js.map +1 -1
  6. package/package.json +14 -14
  7. package/public/3rdpartylicenses.txt +26 -0
  8. package/public/{chunk-SYQZ4PD4.js → chunk-27FHAYGA.js} +1 -1
  9. package/public/chunk-2RWIKDMD.js +1 -0
  10. package/public/{chunk-HX4ZYQRQ.js → chunk-2XQTHORM.js} +1 -1
  11. package/public/chunk-4TXJKFSP.js +1 -0
  12. package/public/{chunk-3BJWZ2RN.js → chunk-4WR57N2Z.js} +1 -1
  13. package/public/{chunk-JZZQRLNW.js → chunk-5PPIFCVN.js} +1 -1
  14. package/public/{chunk-UG5DK2RQ.js → chunk-5XVPFQGJ.js} +2 -2
  15. package/public/{chunk-WHJSVGC7.js → chunk-6T627TGJ.js} +1 -1
  16. package/public/chunk-6YZVWQGA.js +1 -0
  17. package/public/chunk-76DNNO4L.js +1 -0
  18. package/public/chunk-7DJCX2WQ.js +1 -0
  19. package/public/{chunk-A5GSY3XX.js → chunk-7JZ4T76U.js} +1 -1
  20. package/public/chunk-7K534OEA.js +1 -0
  21. package/public/{chunk-4GXE2TG4.js → chunk-APX6I7KY.js} +1 -1
  22. package/public/{chunk-DG5IOZTF.js → chunk-BGBEVHH2.js} +1 -1
  23. package/public/{chunk-MI5DOO72.js → chunk-BUH3JOOP.js} +1 -1
  24. package/public/chunk-BYHPFGRQ.js +1 -0
  25. package/public/chunk-CEGU7SYC.js +1 -0
  26. package/public/{chunk-6G4RAFVI.js → chunk-CI6NA7JH.js} +1 -1
  27. package/public/chunk-CUGLF637.js +1 -0
  28. package/public/chunk-CZ6XUBOL.js +1 -0
  29. package/public/{chunk-ZT23DWNL.js → chunk-DCVSB5TS.js} +1 -1
  30. package/public/chunk-DCZ5JR2G.js +1 -0
  31. package/public/{chunk-BTOSHKFS.js → chunk-DRROIYZX.js} +1 -1
  32. package/public/{chunk-2IF5OARU.js → chunk-DTLOR4RL.js} +1 -1
  33. package/public/chunk-EAQZLRF7.js +1 -0
  34. package/public/chunk-EM7UQHZN.js +1 -0
  35. package/public/{chunk-QE7DO6J3.js → chunk-ENEUSDNM.js} +2 -2
  36. package/public/{chunk-EL7BORJ3.js → chunk-EWZ7C2YR.js} +1 -1
  37. package/public/{chunk-JEX77RUF.js → chunk-F57RFVL3.js} +1 -1
  38. package/public/{chunk-CCUID66K.js → chunk-FGUBIKM4.js} +1 -1
  39. package/public/{chunk-QHPDGSZ6.js → chunk-FLUSPBPU.js} +1 -1
  40. package/public/chunk-G4OIQWRY.js +1 -0
  41. package/public/{chunk-WNWWUCCZ.js → chunk-GPSZWI6A.js} +1 -1
  42. package/public/chunk-GR32BS4Z.js +1 -0
  43. package/public/chunk-IEIFZZ7K.js +1 -0
  44. package/public/{chunk-VNWAKNQB.js → chunk-IF22LREG.js} +1 -1
  45. package/public/{chunk-7EUQWCP5.js → chunk-IRGLFC77.js} +1 -1
  46. package/public/{chunk-6ZD3BBNQ.js → chunk-ISB35SV2.js} +1 -1
  47. package/public/{chunk-G2GECCZT.js → chunk-JFTCUHLK.js} +4 -4
  48. package/public/{chunk-VKCF7BAJ.js → chunk-JVRVOS5O.js} +1 -1
  49. package/public/chunk-JZGK7KJI.js +1 -0
  50. package/public/{chunk-M75FNX4G.js → chunk-K5OADLOJ.js} +1 -1
  51. package/public/{chunk-XHKS6AM7.js → chunk-K7XW5CLN.js} +1 -1
  52. package/public/{chunk-3ZMHJQIE.js → chunk-KKLL5O7H.js} +1 -1
  53. package/public/{chunk-3IX3CLER.js → chunk-KTW5C5OW.js} +1 -1
  54. package/public/chunk-LGBZK7HA.js +1 -0
  55. package/public/{chunk-5XXU24EV.js → chunk-MFX5QSR6.js} +1 -1
  56. package/public/{chunk-6TCHCTXZ.js → chunk-MO6NBKKU.js} +1 -1
  57. package/public/{chunk-B6GMK4UO.js → chunk-MROM3VZI.js} +1 -1
  58. package/public/chunk-MVXF4LC7.js +1 -0
  59. package/public/{chunk-XLIFCBEO.js → chunk-MYLTAV2O.js} +1 -1
  60. package/public/{chunk-7UUAVPXG.js → chunk-N2LVTEM7.js} +1 -1
  61. package/public/chunk-N7JBAWYM.js +7 -0
  62. package/public/{chunk-EA5J2VEJ.js → chunk-NGW5QYCP.js} +1 -1
  63. package/public/{chunk-XK24XTED.js → chunk-NP7PF77M.js} +1 -1
  64. package/public/{chunk-KQJ7ONUG.js → chunk-OHVZQ3PT.js} +1 -1
  65. package/public/{chunk-AJAYFTBK.js → chunk-PRGLG2RB.js} +1 -1
  66. package/public/chunk-QH6VVMPF.js +1 -0
  67. package/public/{chunk-3BG7PDOZ.js → chunk-QJRYJII5.js} +1 -1
  68. package/public/{chunk-4SW3QBET.js → chunk-R6S5CRGI.js} +1 -1
  69. package/public/chunk-RAXZ2SF5.js +1 -0
  70. package/public/{chunk-BKUGARB4.js → chunk-RBDXIYQQ.js} +1 -1
  71. package/public/{chunk-BPMSJ2VF.js → chunk-S4MRBFHA.js} +1 -1
  72. package/public/chunk-S6KT6MRH.js +1 -0
  73. package/public/{chunk-NW6AFAD7.js → chunk-SHHUZA33.js} +1 -1
  74. package/public/chunk-SS336JGS.js +1 -0
  75. package/public/chunk-TA73J7HR.js +1 -0
  76. package/public/{chunk-NZNNTHFQ.js → chunk-TKQHVRJM.js} +1 -1
  77. package/public/chunk-TQCNPL7D.js +1 -0
  78. package/public/{chunk-WCRC47TH.js → chunk-UE7MTGGI.js} +1 -1
  79. package/public/chunk-URL2ZYRU.js +1 -0
  80. package/public/{chunk-3N2Q7IWD.js → chunk-UWHIHDJ3.js} +1 -1
  81. package/public/{chunk-BL5MHRAN.js → chunk-VZFSZM4N.js} +1 -1
  82. package/public/{chunk-WHJOLAED.js → chunk-WFMX2K5O.js} +1 -1
  83. package/public/{chunk-ORPWYWCL.js → chunk-X3WXF4QL.js} +3 -3
  84. package/public/{chunk-D7MNIAWD.js → chunk-XUCCN7XM.js} +1 -1
  85. package/public/{chunk-2VYW436W.js → chunk-YBIQ6HL7.js} +1 -1
  86. package/public/{chunk-76TBS5AV.js → chunk-YTYBKUCH.js} +1 -1
  87. package/public/chunk-YX6QLRGC.js +1 -0
  88. package/public/chunk-ZZEMRAIS.js +1 -0
  89. package/public/index.html +1 -1
  90. package/public/main-66HVTIPY.js +1 -0
  91. package/public/chunk-24ULZ3BT.js +0 -1
  92. package/public/chunk-575Y7TVV.js +0 -1
  93. package/public/chunk-75XYWONG.js +0 -1
  94. package/public/chunk-A2N2Q4LU.js +0 -1
  95. package/public/chunk-CIHQVIKG.js +0 -1
  96. package/public/chunk-CN3OMB2Y.js +0 -1
  97. package/public/chunk-ETLJLL32.js +0 -1
  98. package/public/chunk-FHH52I62.js +0 -1
  99. package/public/chunk-FXCBJ67V.js +0 -1
  100. package/public/chunk-HSJSWZHD.js +0 -1
  101. package/public/chunk-LWETKFFL.js +0 -1
  102. package/public/chunk-MM6P6S4W.js +0 -1
  103. package/public/chunk-MPQUGKWM.js +0 -1
  104. package/public/chunk-O6R4MYOK.js +0 -1
  105. package/public/chunk-PJXR7GKO.js +0 -1
  106. package/public/chunk-PU3JBLLD.js +0 -1
  107. package/public/chunk-QKW5HJGC.js +0 -1
  108. package/public/chunk-QTQTMHO2.js +0 -1
  109. package/public/chunk-RHQMX4CH.js +0 -1
  110. package/public/chunk-SHEWI2SS.js +0 -1
  111. package/public/chunk-SVWATWZN.js +0 -1
  112. package/public/chunk-TCSXGQNF.js +0 -1
  113. package/public/chunk-TX6DNJTK.js +0 -1
  114. package/public/chunk-TXOB7R5K.js +0 -7
  115. package/public/chunk-U5R5M7K5.js +0 -1
  116. package/public/chunk-UC3YKZKI.js +0 -1
  117. package/public/chunk-VBT4PKHK.js +0 -1
  118. package/public/chunk-YODW2WL7.js +0 -1
  119. package/public/chunk-ZYDWBTMP.js +0 -1
  120. package/public/main-5X5SCFC2.js +0 -1
@@ -1 +1 @@
1
- import{T as te,c as X,d as Y,e as Z,f as ee}from"./chunk-6G4RAFVI.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-4SW3QBET.js";import{b as L}from"./chunk-WCRC47TH.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};
1
+ import{T as te,c as X,d as Y,e as Z,f as ee}from"./chunk-CI6NA7JH.js";import{a as U}from"./chunk-5PPIFCVN.js";import{m as J,n as K,o as Q}from"./chunk-X3WXF4QL.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-FLUSPBPU.js";import{c as F}from"./chunk-R6S5CRGI.js";import{b as L}from"./chunk-UE7MTGGI.js";import{b as T}from"./chunk-KTW5C5OW.js";import{$b as A,Bb as y,Bc as s,Cc as l,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,sc as M,tc as S,ub as C,uc as k,wc as $,xa as b,xc as D,ya as h}from"./chunk-N7JBAWYM.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};
@@ -1 +1 @@
1
- import{m as k}from"./chunk-ORPWYWCL.js";import{b as g}from"./chunk-3IX3CLER.js";import{Bc as m,Cc as r,Kb as x,Lb as d,Qb as p,Rb as I,Wb as i,Xb as a,Yb as f,cc as s,dc as B,ib as t,na as v,nc as o,oc as u,pc as b,rb as _}from"./chunk-TXOB7R5K.js";function y(n,M){if(n&1&&f(0,"i",14),n&2){let c=B();p("fas fa-fw ",c.faIconClass," mb-4")}}var L=(()=>{class n{$activeModal=v(k);title;message;confirmButtonLabel;confirmButtonClass;faIconClass;static \u0275fac=function(l){return new(l||n)};static \u0275cmp=_({type:n,selectors:[["ng-component"]],inputs:{title:"title",message:"message",confirmButtonLabel:"confirmButtonLabel",confirmButtonClass:"confirmButtonClass",faIconClass:"faIconClass"},decls:22,vars:16,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","w-100","text-center"],[2,"font-size","75px",3,"class"],[1,"w-100","text-center"],[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",3,"click"],[2,"font-size","75px"]],template:function(l,e){l&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),o(3),a(),i(4,"button",3),m(5,"translate"),s("click",function(){return e.$activeModal.dismiss("Dismiss")}),i(6,"span",4),o(7,"\xD7"),a()()(),i(8,"div",5),x(9,y,1,3,"i",6),i(10,"p",7),o(11),a()(),i(12,"div",8)(13,"div",9)(14,"button",10),m(15,"translate"),s("click",function(){return e.$activeModal.dismiss("Dismiss")}),o(16),m(17,"translate"),a()(),f(18,"div",11),i(19,"div",12)(20,"button",13),s("click",function(){return e.$activeModal.close()}),o(21),a()()()()),l&2&&(t(3),u(e.title),t(),d("aria-label",r(5,10,"form.button_close")),t(5),I(e.faIconClass?9:-1),t(2),u(e.message),t(3),d("aria-label",r(15,12,"form.button_close")),t(2),b(" ",r(17,14,"form.button_close")," "),t(4),p("btn ",e.confirmButtonClass||"btn-primary",""),t(),b(" ",e.confirmButtonLabel," "))},dependencies:[g],encapsulation:2})}return n})();export{L as a};
1
+ import{m as k}from"./chunk-X3WXF4QL.js";import{b as g}from"./chunk-KTW5C5OW.js";import{Bb as x,Bc as m,Cc as r,Lb as d,Qb as p,Rb as I,Wb as i,Xb as a,Yb as f,cc as s,dc as B,ib as t,na as v,nc as o,oc as u,pc as b,ub as _}from"./chunk-N7JBAWYM.js";function y(n,M){if(n&1&&f(0,"i",14),n&2){let c=B();p("fas fa-fw ",c.faIconClass," mb-4")}}var L=(()=>{class n{$activeModal=v(k);title;message;confirmButtonLabel;confirmButtonClass;faIconClass;static \u0275fac=function(l){return new(l||n)};static \u0275cmp=_({type:n,selectors:[["ng-component"]],inputs:{title:"title",message:"message",confirmButtonLabel:"confirmButtonLabel",confirmButtonClass:"confirmButtonClass",faIconClass:"faIconClass"},decls:22,vars:16,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","w-100","text-center"],[2,"font-size","75px",3,"class"],[1,"w-100","text-center"],[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",3,"click"],[2,"font-size","75px"]],template:function(l,e){l&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),o(3),a(),i(4,"button",3),m(5,"translate"),s("click",function(){return e.$activeModal.dismiss("Dismiss")}),i(6,"span",4),o(7,"\xD7"),a()()(),i(8,"div",5),x(9,y,1,3,"i",6),i(10,"p",7),o(11),a()(),i(12,"div",8)(13,"div",9)(14,"button",10),m(15,"translate"),s("click",function(){return e.$activeModal.dismiss("Dismiss")}),o(16),m(17,"translate"),a()(),f(18,"div",11),i(19,"div",12)(20,"button",13),s("click",function(){return e.$activeModal.close()}),o(21),a()()()()),l&2&&(t(3),u(e.title),t(),d("aria-label",r(5,10,"form.button_close")),t(5),I(e.faIconClass?9:-1),t(2),u(e.message),t(3),d("aria-label",r(15,12,"form.button_close")),t(2),b(" ",r(17,14,"form.button_close")," "),t(4),p("btn ",e.confirmButtonClass||"btn-primary",""),t(),b(" ",e.confirmButtonLabel," "))},dependencies:[g],encapsulation:2})}return n})();export{L as a};
@@ -1 +1 @@
1
- import{o as V}from"./chunk-ORPWYWCL.js";import{d as O}from"./chunk-NZNNTHFQ.js";import{b as P}from"./chunk-WCRC47TH.js";import{b as k,j as T}from"./chunk-TX6DNJTK.js";import{a as y,b as $}from"./chunk-3IX3CLER.js";import{$b as v,Bc as a,Cc as s,Kb as g,Mb as C,Rb as f,Wb as o,Xb as r,Yb as h,cc as m,dc as b,ib as i,na as c,nc as l,oc as S,pc as d,rb as w,xa as u,ya as _}from"./chunk-TXOB7R5K.js";function B(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.restartServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_restart_server")," "))}function I(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.shutdownServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_shutdown_server")," "))}function H(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.dockerRestartContainer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.docker.restart_container")," "))}var G=(()=>{class t{$api=c(k);$router=c(O);$settings=c(P);$toastr=c(T);$translate=c(y);restartHomebridge(){this.$router.navigate(["/restart"])}restartHomebridgeService(){this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>{this.$router.navigate(["/restart"])},error:n=>{console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error"))}})}restartServer(){this.$router.navigate(["/platform-tools/linux/restart-server"])}shutdownServer(){this.$router.navigate(["/platform-tools/linux/shutdown-server"])}dockerRestartContainer(){this.$router.navigate(["/platform-tools/docker/restart-container"])}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=w({type:t,selectors:[["ng-component"]],decls:19,vars:15,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"w-100","text-center","my-5"],["type","button",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click"],["type","button","container","body","openDelay","150","triggers","hover",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click","ngbTooltip"]],template:function(p,e){p&1&&(o(0,"div",0)(1,"h3",1),l(2),a(3,"translate"),r()(),o(4,"div",2)(5,"div",3),h(6,"i",4),r(),o(7,"p",5)(8,"button",6),m("click",function(){return e.restartHomebridge()}),l(9),a(10,"translate"),r()(),o(11,"p",5)(12,"button",7),a(13,"translate"),m("click",function(){return e.restartHomebridgeService()}),l(14),a(15,"translate"),r()(),g(16,B,4,3,"p",5)(17,I,4,3,"p",5)(18,H,4,3,"p",5),r()),p&2&&(i(2),S(s(3,7,"menu.restart.title")),i(7),d(" ",s(10,9,"menu.hbrestart.confirm_hb")," "),i(3),C("ngbTooltip",s(13,11,"reset.force_restart_hb_help_text")),i(2),d(" ",s(15,13,"menu.hbrestart.confirm_ui")," "),i(2),f(e.$settings.env.canShutdownRestartHost?16:-1),i(),f(e.$settings.env.canShutdownRestartHost?17:-1),i(),f(e.$settings.env.runningInDocker?18:-1))},dependencies:[V,$],encapsulation:2})}return t})();export{G as a};
1
+ import{o as V}from"./chunk-X3WXF4QL.js";import{d as O}from"./chunk-TKQHVRJM.js";import{b as P}from"./chunk-UE7MTGGI.js";import{b as k,j as T}from"./chunk-IEIFZZ7K.js";import{a as y,b as $}from"./chunk-KTW5C5OW.js";import{$b as v,Bb as g,Bc as a,Cc as s,Mb as C,Rb as f,Wb as o,Xb as r,Yb as h,cc as m,dc as b,ib as i,na as c,nc as l,oc as S,pc as d,ub as w,xa as u,ya as _}from"./chunk-N7JBAWYM.js";function B(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.restartServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_restart_server")," "))}function I(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.shutdownServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_shutdown_server")," "))}function H(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.dockerRestartContainer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.docker.restart_container")," "))}var G=(()=>{class t{$api=c(k);$router=c(O);$settings=c(P);$toastr=c(T);$translate=c(y);restartHomebridge(){this.$router.navigate(["/restart"])}restartHomebridgeService(){this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>{this.$router.navigate(["/restart"])},error:n=>{console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error"))}})}restartServer(){this.$router.navigate(["/platform-tools/linux/restart-server"])}shutdownServer(){this.$router.navigate(["/platform-tools/linux/shutdown-server"])}dockerRestartContainer(){this.$router.navigate(["/platform-tools/docker/restart-container"])}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=w({type:t,selectors:[["ng-component"]],decls:19,vars:15,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"w-100","text-center","my-5"],["type","button",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click"],["type","button","container","body","openDelay","150","triggers","hover",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click","ngbTooltip"]],template:function(p,e){p&1&&(o(0,"div",0)(1,"h3",1),l(2),a(3,"translate"),r()(),o(4,"div",2)(5,"div",3),h(6,"i",4),r(),o(7,"p",5)(8,"button",6),m("click",function(){return e.restartHomebridge()}),l(9),a(10,"translate"),r()(),o(11,"p",5)(12,"button",7),a(13,"translate"),m("click",function(){return e.restartHomebridgeService()}),l(14),a(15,"translate"),r()(),g(16,B,4,3,"p",5)(17,I,4,3,"p",5)(18,H,4,3,"p",5),r()),p&2&&(i(2),S(s(3,7,"menu.restart.title")),i(7),d(" ",s(10,9,"menu.hbrestart.confirm_hb")," "),i(3),C("ngbTooltip",s(13,11,"reset.force_restart_hb_help_text")),i(2),d(" ",s(15,13,"menu.hbrestart.confirm_ui")," "),i(2),f(e.$settings.env.canShutdownRestartHost?16:-1),i(),f(e.$settings.env.canShutdownRestartHost?17:-1),i(),f(e.$settings.env.runningInDocker?18:-1))},dependencies:[V,$],encapsulation:2})}return t})();export{G as a};
@@ -0,0 +1 @@
1
+ import{a as p}from"./chunk-K5OADLOJ.js";import{a as f}from"./chunk-MROM3VZI.js";import"./chunk-UWHIHDJ3.js";import"./chunk-RBDXIYQQ.js";import{q as a}from"./chunk-X3WXF4QL.js";import{y as u,z as d}from"./chunk-FLUSPBPU.js";import"./chunk-2XQTHORM.js";import{g as i}from"./chunk-TKQHVRJM.js";import"./chunk-R6S5CRGI.js";import"./chunk-UE7MTGGI.js";import"./chunk-IEIFZZ7K.js";import"./chunk-5XVPFQGJ.js";import{c as n}from"./chunk-KTW5C5OW.js";import{ia as t,md as m,vb as r}from"./chunk-N7JBAWYM.js";var M=[{path:"",loadComponent:()=>import("./chunk-2RWIKDMD.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};
@@ -1 +1 @@
1
- import{a as j}from"./chunk-BL5MHRAN.js";import"./chunk-EA5J2VEJ.js";import"./chunk-6ZD3BBNQ.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-WCRC47TH.js";import{b as l,j as g}from"./chunk-TX6DNJTK.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-QKW5HJGC.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};
1
+ import{a as j}from"./chunk-VZFSZM4N.js";import"./chunk-NGW5QYCP.js";import"./chunk-ISB35SV2.js";import{c as y}from"./chunk-IRGLFC77.js";import"./chunk-5PPIFCVN.js";import{q as h}from"./chunk-X3WXF4QL.js";import{y as M,z as v}from"./chunk-FLUSPBPU.js";import{d as C,g as a}from"./chunk-TKQHVRJM.js";import"./chunk-UE7MTGGI.js";import{b as l,j as g}from"./chunk-IEIFZZ7K.js";import"./chunk-5XVPFQGJ.js";import{a as d,c as u}from"./chunk-KTW5C5OW.js";import{h as s,ha as c,ia as i,md as p,na as e,vb as n,w as f}from"./chunk-N7JBAWYM.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-S6KT6MRH.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};
@@ -1 +1 @@
1
- import{a as _,b as D}from"./chunk-WCRC47TH.js";import{a as l,b as S}from"./chunk-TX6DNJTK.js";import{f as x}from"./chunk-UG5DK2RQ.js";import{C as v,Sc as I,g as O,h as a,ha as h,ia as E,ka as y,ma as c,na as f,r as p,sb as j,w as d,x as T,z as w}from"./chunk-TXOB7R5K.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&6)):0)n=t.indexOf(n);return o}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return r.\u0275fac=function(e){return new(e||r)(c(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{constructor(e,t,o){this.jwtHelper=t,this.document=o,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===o:i instanceof RegExp?i.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(c(g),c(m),c(I))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(c(r,12))},r.\u0275mod=j({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(l.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(l.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(l.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(l.jwt.tokenKey);e&&this.validateToken(e)})}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(l.jwt.tokenKey),this.token=null,!1}}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{m as a,F as b,q as c};
1
+ import{a as _,b as D}from"./chunk-UE7MTGGI.js";import{a as l,b as S}from"./chunk-IEIFZZ7K.js";import{f as x}from"./chunk-5XVPFQGJ.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,vb as j,w as d,x as T,z as w}from"./chunk-N7JBAWYM.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};
@@ -0,0 +1 @@
1
+ import"./chunk-SHHUZA33.js";import{q as u}from"./chunk-X3WXF4QL.js";import{z as n}from"./chunk-FLUSPBPU.js";import{g as i}from"./chunk-TKQHVRJM.js";import"./chunk-5XVPFQGJ.js";import{c as p}from"./chunk-KTW5C5OW.js";import{ia as t,md as m,vb as r}from"./chunk-N7JBAWYM.js";var l=[{path:"",loadComponent:()=>import("./chunk-DCZ5JR2G.js").then(o=>o.SupportComponent)}],d=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[i.forChild(l),i]})}return o})();var R=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[m,d,u,n,p]})}return o})();export{R as SupportModule};