homebridge-config-ui-x 5.0.1-beta.0 → 5.0.1-beta.1

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 (58) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +1 -1
  3. package/public/{chunk-REKXMGJU.js → chunk-2E7ZORGV.js} +1 -1
  4. package/public/{chunk-2CKLKY5R.js → chunk-3K4AKQIG.js} +1 -1
  5. package/public/{chunk-77L2MCKQ.js → chunk-3WACEBJM.js} +1 -1
  6. package/public/{chunk-B3ZMTQUC.js → chunk-4G62IPBL.js} +1 -1
  7. package/public/chunk-4NAUGWMH.js +1 -0
  8. package/public/{chunk-YUBK6BVK.js → chunk-52ICMLXG.js} +1 -1
  9. package/public/{chunk-6ZV74JJX.js → chunk-5ELTAW44.js} +1 -1
  10. package/public/{chunk-7NKVE7MW.js → chunk-5QJD4F5J.js} +1 -1
  11. package/public/chunk-5VP77P7I.js +1 -0
  12. package/public/{chunk-7HL2NUIE.js → chunk-6FHUI6EC.js} +1 -1
  13. package/public/{chunk-HVI3LFAL.js → chunk-6HNZZKA3.js} +1 -1
  14. package/public/{chunk-XYW3RCJ2.js → chunk-6HXGDQKN.js} +1 -1
  15. package/public/{chunk-YZBWQAXL.js → chunk-736V2KJB.js} +2 -2
  16. package/public/{chunk-2ZIMN6HQ.js → chunk-7BGQ3WIH.js} +1 -1
  17. package/public/{chunk-HOWJDZVR.js → chunk-A3GG65TX.js} +1 -1
  18. package/public/{chunk-EKGJ3N4Y.js → chunk-B55QOQVD.js} +1 -1
  19. package/public/{chunk-BWV3SD3Z.js → chunk-CNNTXFBF.js} +1 -1
  20. package/public/{chunk-DCXDGRPU.js → chunk-CSB4ROBA.js} +1 -1
  21. package/public/{chunk-XIPV6S2E.js → chunk-ETFLC24E.js} +1 -1
  22. package/public/{chunk-IJVDEEEM.js → chunk-FPLWS5WP.js} +1 -1
  23. package/public/{chunk-VAZOOXJZ.js → chunk-FZM6AHK2.js} +1 -1
  24. package/public/chunk-HBOWJDR5.js +2 -0
  25. package/public/{chunk-WK5S4AAU.js → chunk-HIAE32S7.js} +1 -1
  26. package/public/{chunk-XSYDRPRP.js → chunk-IHSOZF6N.js} +1 -1
  27. package/public/{chunk-TANPXHFU.js → chunk-IV4ZCEWF.js} +1 -1
  28. package/public/{chunk-WDFAWIMZ.js → chunk-JHPEPG44.js} +1 -1
  29. package/public/{chunk-YKDYWWHU.js → chunk-JN7YT2VS.js} +1 -1
  30. package/public/{chunk-3ZPN5PPV.js → chunk-KM7BRFHX.js} +1 -1
  31. package/public/{chunk-ME25VZ4V.js → chunk-LWKJJ5PU.js} +1 -1
  32. package/public/{chunk-LM66QCFN.js → chunk-NCZ7M3AB.js} +1 -1
  33. package/public/{chunk-23Y7BPAN.js → chunk-PQR6HK2C.js} +1 -1
  34. package/public/{chunk-MHB4GJLL.js → chunk-PRMVT3SQ.js} +1 -1
  35. package/public/{chunk-PXYSYTXG.js → chunk-PT72GTGE.js} +1 -1
  36. package/public/{chunk-F754W3WB.js → chunk-RFGGDHFG.js} +1 -1
  37. package/public/{chunk-D5MSFLIQ.js → chunk-RRA3IHCM.js} +1 -1
  38. package/public/{chunk-JO7II7GX.js → chunk-S2ZVRZCY.js} +1 -1
  39. package/public/{chunk-RZBLN3JA.js → chunk-SR7XEHET.js} +1 -1
  40. package/public/{chunk-2LZEASRE.js → chunk-TOLEK5UA.js} +1 -1
  41. package/public/{chunk-4M5IBLFU.js → chunk-TZFHB7AU.js} +1 -1
  42. package/public/{chunk-RSFLPDGU.js → chunk-UD6SW2QN.js} +1 -1
  43. package/public/{chunk-TGV7QZLC.js → chunk-UJNY5BYT.js} +1 -1
  44. package/public/{chunk-LYUKIQWV.js → chunk-UVNR77PB.js} +1 -1
  45. package/public/{chunk-QTTC6A7P.js → chunk-UXUU25EW.js} +1 -1
  46. package/public/{chunk-TXNH42IW.js → chunk-VLNYF5AS.js} +1 -1
  47. package/public/{chunk-4QBSVR54.js → chunk-WNQA5E2O.js} +1 -1
  48. package/public/{chunk-ACNBCUWA.js → chunk-XJ2MUFCV.js} +1 -1
  49. package/public/{chunk-J2WQQ5XA.js → chunk-YHQ4H2LV.js} +1 -1
  50. package/public/{chunk-J7Q5BUJW.js → chunk-YJWU65EW.js} +1 -1
  51. package/public/{chunk-4AJSXM5Z.js → chunk-ZCSPADUX.js} +1 -1
  52. package/public/{chunk-GEIS2BWE.js → chunk-ZJ3JJYIN.js} +1 -1
  53. package/public/index.html +1 -1
  54. package/public/main-7VIDFQBH.js +1 -0
  55. package/public/chunk-22J4EY4Y.js +0 -1
  56. package/public/chunk-PQPAXVOA.js +0 -1
  57. package/public/chunk-Q4CZ7LVK.js +0 -2
  58. package/public/main-HHD5K3CT.js +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to `homebridge-config-ui-x` will be documented in this file. This project tries to adhere to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## v5.0.1 (Unreleased)
6
+
7
+ ### UI Changes
8
+
9
+ - only show hbv2 readiness icon when ready to show
10
+ - migrate to use `fetch()` for http requests
11
+
5
12
  ## v5.0.0 (2025-07-13)
6
13
 
7
14
  ### ⚠️ Breaking Changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-config-ui-x",
3
3
  "displayName": "Homebridge UI",
4
- "version": "5.0.1-beta.0",
4
+ "version": "5.0.1-beta.1",
5
5
  "description": "A web based management, configuration and control platform for Homebridge.",
6
6
  "author": "oznu <dev@oz.nu>",
7
7
  "license": "MIT",
@@ -1,4 +1,4 @@
1
- import{a as p,b as w,c as b}from"./chunk-BG5MCCBU.js";import{a as d}from"./chunk-TXNH42IW.js";import{M as i,g as o,ga as m,la as h,n}from"./chunk-ULJPS3WS.js";var c=o(p(),1),a=o(w(),1),l=o(b(),1);var v=(()=>{class t{$ws=h(d);io;fitAddon;webLinksAddon;resize;elementResize;term;destroyTerminal(){this.io.end(),this.term.dispose(),this.resize.complete(),this.elementResize&&this.elementResize.complete()}startTerminal(r,s={},f){this.elementResize=f,this.io=this.$ws.connectToNamespace("platform-tools/terminal"),this.term=new c.Terminal(s),setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.fitAddon=new a.FitAddon,this.webLinksAddon=new l.WebLinksAddon,this.resize=new n,this.term.open(r.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.connected.pipe(i(200)).subscribe(()=>{this.startSession()}),this.io.socket.on("disconnect",()=>{this.term.write(`
1
+ import{a as p,b as w,c as b}from"./chunk-BG5MCCBU.js";import{a as d}from"./chunk-VLNYF5AS.js";import{M as i,g as o,ga as m,la as h,n}from"./chunk-ULJPS3WS.js";var c=o(p(),1),a=o(w(),1),l=o(b(),1);var v=(()=>{class t{$ws=h(d);io;fitAddon;webLinksAddon;resize;elementResize;term;destroyTerminal(){this.io.end(),this.term.dispose(),this.resize.complete(),this.elementResize&&this.elementResize.complete()}startTerminal(r,s={},f){this.elementResize=f,this.io=this.$ws.connectToNamespace("platform-tools/terminal"),this.term=new c.Terminal(s),setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.fitAddon=new a.FitAddon,this.webLinksAddon=new l.WebLinksAddon,this.resize=new n,this.term.open(r.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.connected.pipe(i(200)).subscribe(()=>{this.startSession()}),this.io.socket.on("disconnect",()=>{this.term.write(`
2
2
  \r
3
3
  \rTerminal disconnected. Is the server running?
4
4
  \r
@@ -1 +1 @@
1
- import{a as _,b as D}from"./chunk-4AJSXM5Z.js";import{m as c,n as S}from"./chunk-IJVDEEEM.js";import{f as x}from"./chunk-Q4CZ7LVK.js";import{C as v,g as O,ga as h,h as a,ha as E,ja as y,ka as l,la as f,nb as I,r as p,va as j,w as d,x as T,z as w}from"./chunk-ULJPS3WS.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&6)):0)n=t.indexOf(n);return o}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return r.\u0275fac=function(e){return new(e||r)(l(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{constructor(e,t,o){this.jwtHelper=t,this.document=o,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===o:i instanceof RegExp?i.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(l(g),l(m),l(j))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(l(r,12))},r.\u0275mod=I({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(c.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(c.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(c.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(c.jwt.tokenKey);e&&this.validateToken(e)})}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(c.jwt.tokenKey),this.token=null,!1}}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{F as a,q as b};
1
+ import{a as _,b as D}from"./chunk-ZCSPADUX.js";import{m as c,n as S}from"./chunk-FPLWS5WP.js";import{f as x}from"./chunk-HBOWJDR5.js";import{C as v,g as O,ga as h,h as a,ha as E,ja as y,ka as l,la as f,nb as I,r as p,va as j,w as d,x as T,z as w}from"./chunk-ULJPS3WS.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&6)):0)n=t.indexOf(n);return o}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return r.\u0275fac=function(e){return new(e||r)(l(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{constructor(e,t,o){this.jwtHelper=t,this.document=o,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===o:i instanceof RegExp?i.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(l(g),l(m),l(j))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(l(r,12))},r.\u0275mod=I({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(c.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(c.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(c.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(c.jwt.tokenKey);e&&this.validateToken(e)})}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(c.jwt.tokenKey),this.token=null,!1}}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{F as a,q as b};
@@ -1,4 +1,4 @@
1
- import{a as S,b as O,c as U}from"./chunk-BG5MCCBU.js";import{a as g}from"./chunk-TXNH42IW.js";import{M as w,e as x,g as h,ga as E,la as L,n as R}from"./chunk-ULJPS3WS.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);io;fitAddon;webLinksAddon;resize;elementResize;pluginName;term;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(`
1
+ import{a as S,b as O,c as U}from"./chunk-BG5MCCBU.js";import{a as g}from"./chunk-VLNYF5AS.js";import{M as w,e as x,g as h,ga as E,la as L,n as R}from"./chunk-ULJPS3WS.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);io;fitAddon;webLinksAddon;resize;elementResize;pluginName;term;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
2
  \r
3
3
  \rWebsocket failed to connect. Is the server running?
4
4
  \r
@@ -1,4 +1,4 @@
1
- import{a as _i,b as r2}from"./chunk-WDFAWIMZ.js";import{a as qf}from"./chunk-HUAADM2I.js";import{a as Bf}from"./chunk-THGDS273.js";import{a as zf,b as lo}from"./chunk-77L2MCKQ.js";import{a as Lf,b as Uf}from"./chunk-BG5MCCBU.js";import{a as Rf}from"./chunk-QIOCGI3G.js";import{a as Qa,b as is}from"./chunk-EI76KND2.js";import{a as es,b as ts}from"./chunk-J7Q5BUJW.js";import{a as Vf}from"./chunk-CHYWVK3W.js";import{a as Ka,b as Ga,c as Ja,d as Xa,e as Ya,f as Za,g as rr,m as Oe,n as ot,o as Df,p as Af,q as Nf,r as jf,s as Ff,t as or}from"./chunk-C3HWKB2Q.js";import{A as so,a as Sf,b as Yi,c as ir,e as $t,f as $f,h as Ef,i as Tf,j as Pf,k as Of,l as Zi,m as Mf,o as Qi,r as nr,s as On,t as Mn,y as kf,z as oi}from"./chunk-WFYBML4S.js";import{a as tn}from"./chunk-TXNH42IW.js";import{d as yi}from"./chunk-GEIS2BWE.js";import{b as Re}from"./chunk-4AJSXM5Z.js";import{k as Ce,m as en,n as ve}from"./chunk-IJVDEEEM.js";import{a as xe,b as Me}from"./chunk-R3563DDE.js";import{e as If}from"./chunk-Q4CZ7LVK.js";import{$a as mf,Ac as vf,Bc as xf,Ca as Wi,Cc as Pe,D as uf,Da as ff,Dc as ri,Ec as Tn,Fa as Qn,Fc as Wt,Gc as tr,Hb as G,Hc as w,Ib as E,Ic as S,Jb as T,Jc as He,Lb as at,M as Yn,Mb as st,Nb as lt,Ob as b,Pb as f,Qb as m,Qc as xt,Rb as $,Rc as z,Sb as Qe,Sc as Xi,Tb as rt,Ub as gi,Uc as Cf,Vb as yf,Wb as _f,Xa as he,Z as lu,_b as H,a as X,aa as ao,ab as d,b as $e,bc as q,cc as Ht,dc as y,e as g,fa as cf,fb as Ua,g as ze,ga as Ft,gb as Ti,h as K,ha as Zn,hc as uu,ib as Sn,ic as cu,id as Kt,ja as df,jc as du,jd as Pn,k as of,ka as pf,kc as Ki,kd as Ct,la as P,lc as Gi,mb as Y,mc as bf,n as jt,nb as er,nc as ni,o as su,ob as $n,oc as Ji,pb as hf,pc as Z,q as af,qc as x,ra as j,rc as R,rd as Wa,sa as F,sb as ue,sc as V,tc as En,ub as gf,uc as Ha,v as sf,vb as za,w as le,x as lf,xc as Ae,yc as Ne,za as La,zc as je,zd as wf}from"./chunk-ULJPS3WS.js";var po=g(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.regexpCode=be.getEsmExportName=be.getProperty=be.safeStringify=be.stringify=be.strConcat=be.addCodeArg=be.str=be._=be.nil=be._Code=be.Name=be.IDENTIFIER=be._CodeOrName=void 0;var uo=class{};be._CodeOrName=uo;be.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var kn=class extends uo{constructor(t){if(super(),!be.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};be.Name=kn;var Gt=class extends uo{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((i,n)=>`${i}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((i,n)=>(n instanceof kn&&(i[n.str]=(i[n.str]||0)+1),i),{})}};be._Code=Gt;be.nil=new Gt("");function Hf(e,...t){let i=[e[0]],n=0;for(;n<t.length;)fu(i,t[n]),i.push(e[++n]);return new Gt(i)}be._=Hf;var pu=new Gt("+");function Wf(e,...t){let i=[co(e[0])],n=0;for(;n<t.length;)i.push(pu),fu(i,t[n]),i.push(pu,co(e[++n]));return a2(i),new Gt(i)}be.str=Wf;function fu(e,t){t instanceof Gt?e.push(...t._items):t instanceof kn?e.push(t):e.push(u2(t))}be.addCodeArg=fu;function a2(e){let t=1;for(;t<e.length-1;){if(e[t]===pu){let i=s2(e[t-1],e[t+1]);if(i!==void 0){e.splice(t-1,3,i);continue}e[t++]="+"}t++}}function s2(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof kn||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof kn))return`"${e}${t.slice(1)}`}function l2(e,t){return t.emptyStr()?e:e.emptyStr()?t:Wf`${e}${t}`}be.strConcat=l2;function u2(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:co(Array.isArray(e)?e.join(","):e)}function c2(e){return new Gt(co(e))}be.stringify=c2;function co(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}be.safeStringify=co;function d2(e){return typeof e=="string"&&be.IDENTIFIER.test(e)?new Gt(`.${e}`):Hf`[${e}]`}be.getProperty=d2;function p2(e){if(typeof e=="string"&&be.IDENTIFIER.test(e))return new Gt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}be.getEsmExportName=p2;function f2(e){return new Gt(e.toString())}be.regexpCode=f2});var gu=g(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.ValueScope=Tt.ValueScopeName=Tt.Scope=Tt.varKinds=Tt.UsedValueState=void 0;var Et=po(),mu=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},ns=function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e}(ns||(Tt.UsedValueState=ns={}));Tt.varKinds={const:new Et.Name("const"),let:new Et.Name("let"),var:new Et.Name("var")};var rs=class{constructor({prefixes:t,parent:i}={}){this._names={},this._prefixes=t,this._parent=i}toName(t){return t instanceof Et.Name?t:this.name(t)}name(t){return new Et.Name(this._newName(t))}_newName(t){let i=this._names[t]||this._nameGroup(t);return`${t}${i.index++}`}_nameGroup(t){var i,n;if(!((n=(i=this._parent)===null||i===void 0?void 0:i._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};Tt.Scope=rs;var os=class extends Et.Name{constructor(t,i){super(i),this.prefix=t}setValue(t,{property:i,itemIndex:n}){this.value=t,this.scopePath=(0,Et._)`.${new Et.Name(i)}[${n}]`}};Tt.ValueScopeName=os;var m2=(0,Et._)`\n`,hu=class extends rs{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts=$e(X({},t),{_n:t.lines?m2:Et.nil})}get(){return this._scope}name(t){return new os(t,this._newName(t))}value(t,i){var n;if(i.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let r=this.toName(t),{prefix:o}=r,a=(n=i.key)!==null&&n!==void 0?n:i.ref,s=this._values[o];if(s){let c=s.get(a);if(c)return c}else s=this._values[o]=new Map;s.set(a,r);let l=this._scope[o]||(this._scope[o]=[]),u=l.length;return l[u]=i.ref,r.setValue(i,{property:o,itemIndex:u}),r}getValue(t,i){let n=this._values[t];if(n)return n.get(i)}scopeRefs(t,i=this._values){return this._reduceValues(i,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Et._)`${t}${n.scopePath}`})}scopeCode(t=this._values,i,n){return this._reduceValues(t,r=>{if(r.value===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return r.value.code},i,n)}_reduceValues(t,i,n={},r){let o=Et.nil;for(let a in t){let s=t[a];if(!s)continue;let l=n[a]=n[a]||new Map;s.forEach(u=>{if(l.has(u))return;l.set(u,ns.Started);let c=i(u);if(c){let p=this.opts.es5?Tt.varKinds.var:Tt.varKinds.const;o=(0,Et._)`${o}${p} ${u} = ${c};${this.opts._n}`}else if(c=r?.(u))o=(0,Et._)`${o}${c}${this.opts._n}`;else throw new mu(u);l.set(u,ns.Completed)})}return o}};Tt.ValueScope=hu});var ee=g(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.or=ce.and=ce.not=ce.CodeGen=ce.operators=ce.varKinds=ce.ValueScopeName=ce.ValueScope=ce.Scope=ce.Name=ce.regexpCode=ce.stringify=ce.getProperty=ce.nil=ce.strConcat=ce.str=ce._=void 0;var ge=po(),ai=gu(),nn=po();Object.defineProperty(ce,"_",{enumerable:!0,get:function(){return nn._}});Object.defineProperty(ce,"str",{enumerable:!0,get:function(){return nn.str}});Object.defineProperty(ce,"strConcat",{enumerable:!0,get:function(){return nn.strConcat}});Object.defineProperty(ce,"nil",{enumerable:!0,get:function(){return nn.nil}});Object.defineProperty(ce,"getProperty",{enumerable:!0,get:function(){return nn.getProperty}});Object.defineProperty(ce,"stringify",{enumerable:!0,get:function(){return nn.stringify}});Object.defineProperty(ce,"regexpCode",{enumerable:!0,get:function(){return nn.regexpCode}});Object.defineProperty(ce,"Name",{enumerable:!0,get:function(){return nn.Name}});var cs=gu();Object.defineProperty(ce,"Scope",{enumerable:!0,get:function(){return cs.Scope}});Object.defineProperty(ce,"ValueScope",{enumerable:!0,get:function(){return cs.ValueScope}});Object.defineProperty(ce,"ValueScopeName",{enumerable:!0,get:function(){return cs.ValueScopeName}});Object.defineProperty(ce,"varKinds",{enumerable:!0,get:function(){return cs.varKinds}});ce.operators={GT:new ge._Code(">"),GTE:new ge._Code(">="),LT:new ge._Code("<"),LTE:new ge._Code("<="),EQ:new ge._Code("==="),NEQ:new ge._Code("!=="),NOT:new ge._Code("!"),OR:new ge._Code("||"),AND:new ge._Code("&&"),ADD:new ge._Code("+")};var Pi=class{optimizeNodes(){return this}optimizeNames(t,i){return this}},yu=class extends Pi{constructor(t,i,n){super(),this.varKind=t,this.name=i,this.rhs=n}render({es5:t,_n:i}){let n=t?ai.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+i}optimizeNames(t,i){if(t[this.name.str])return this.rhs&&(this.rhs=sr(this.rhs,t,i)),this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}},ss=class extends Pi{constructor(t,i,n){super(),this.lhs=t,this.rhs=i,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,i){if(!(this.lhs instanceof ge.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=sr(this.rhs,t,i),this}get names(){let t=this.lhs instanceof ge.Name?{}:X({},this.lhs.names);return us(t,this.rhs)}},_u=class extends ss{constructor(t,i,n,r){super(t,n,r),this.op=i}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},bu=class extends Pi{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},vu=class extends Pi{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},xu=class extends Pi{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Cu=class extends Pi{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,i){return this.code=sr(this.code,t,i),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}},fo=class extends Pi{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((i,n)=>i+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,i=t.length;for(;i--;){let n=t[i].optimizeNodes();Array.isArray(n)?t.splice(i,1,...n):n?t[i]=n:t.splice(i,1)}return t.length>0?this:void 0}optimizeNames(t,i){let{nodes:n}=this,r=n.length;for(;r--;){let o=n[r];o.optimizeNames(t,i)||(h2(t,o.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,i)=>Dn(t,i.names),{})}},Oi=class extends fo{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},wu=class extends fo{},Iu=(()=>{class e extends Oi{}return e.kind="else",e})(),as=(()=>{class e extends Oi{constructor(i,n){super(n),this.condition=i}render(i){let n=`if(${this.condition})`+super.render(i);return this.else&&(n+="else "+this.else.render(i)),n}optimizeNodes(){super.optimizeNodes();let i=this.condition;if(i===!0)return this.nodes;let n=this.else;if(n){let r=n.optimizeNodes();n=this.else=Array.isArray(r)?new Iu(r):r}if(n)return i===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(Yf(i),n instanceof e?[n]:n.nodes);if(!(i===!1||!this.nodes.length))return this}optimizeNames(i,n){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(i,n),!!(super.optimizeNames(i,n)||this.else))return this.condition=sr(this.condition,i,n),this}get names(){let i=super.names;return us(i,this.condition),this.else&&Dn(i,this.else.names),i}}return e.kind="if",e})(),ds=(()=>{class e extends Oi{}return e.kind="for",e})(),Su=class extends ds{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,i){if(super.optimizeNames(t,i))return this.iteration=sr(this.iteration,t,i),this}get names(){return Dn(super.names,this.iteration.names)}},$u=class extends ds{constructor(t,i,n,r){super(),this.varKind=t,this.name=i,this.from=n,this.to=r}render(t){let i=t.es5?ai.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${i} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(t)}get names(){let t=us(super.names,this.from);return us(t,this.to)}},ls=class extends ds{constructor(t,i,n,r){super(),this.loop=t,this.varKind=i,this.name=n,this.iterable=r}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,i){if(super.optimizeNames(t,i))return this.iterable=sr(this.iterable,t,i),this}get names(){return Dn(super.names,this.iterable.names)}},Kf=(()=>{class e extends Oi{constructor(i,n,r){super(),this.name=i,this.args=n,this.async=r}render(i){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(i)}}return e.kind="func",e})(),Gf=(()=>{class e extends fo{render(i){return"return "+super.render(i)}}return e.kind="return",e})(),Eu=class extends Oi{render(t){let i="try"+super.render(t);return this.catch&&(i+=this.catch.render(t)),this.finally&&(i+=this.finally.render(t)),i}optimizeNodes(){var t,i;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(i=this.finally)===null||i===void 0||i.optimizeNodes(),this}optimizeNames(t,i){var n,r;return super.optimizeNames(t,i),(n=this.catch)===null||n===void 0||n.optimizeNames(t,i),(r=this.finally)===null||r===void 0||r.optimizeNames(t,i),this}get names(){let t=super.names;return this.catch&&Dn(t,this.catch.names),this.finally&&Dn(t,this.finally.names),t}},Jf=(()=>{class e extends Oi{constructor(i){super(),this.error=i}render(i){return`catch(${this.error})`+super.render(i)}}return e.kind="catch",e})(),Xf=(()=>{class e extends Oi{render(i){return"finally"+super.render(i)}}return e.kind="finally",e})(),Tu=class{constructor(t,i={}){this._values={},this._blockStarts=[],this._constants={},this.opts=$e(X({},i),{_n:i.lines?`
1
+ import{a as _i,b as r2}from"./chunk-JHPEPG44.js";import{a as qf}from"./chunk-HUAADM2I.js";import{a as Bf}from"./chunk-THGDS273.js";import{a as zf,b as lo}from"./chunk-3WACEBJM.js";import{a as Lf,b as Uf}from"./chunk-BG5MCCBU.js";import{a as Rf}from"./chunk-QIOCGI3G.js";import{a as Qa,b as is}from"./chunk-EI76KND2.js";import{a as es,b as ts}from"./chunk-YJWU65EW.js";import{a as Vf}from"./chunk-CHYWVK3W.js";import{a as Ka,b as Ga,c as Ja,d as Xa,e as Ya,f as Za,g as rr,m as Oe,n as ot,o as Df,p as Af,q as Nf,r as jf,s as Ff,t as or}from"./chunk-C3HWKB2Q.js";import{A as so,a as Sf,b as Yi,c as ir,e as $t,f as $f,h as Ef,i as Tf,j as Pf,k as Of,l as Zi,m as Mf,o as Qi,r as nr,s as On,t as Mn,y as kf,z as oi}from"./chunk-WFYBML4S.js";import{a as tn}from"./chunk-VLNYF5AS.js";import{d as yi}from"./chunk-ZJ3JJYIN.js";import{b as Re}from"./chunk-ZCSPADUX.js";import{k as Ce,m as en,n as ve}from"./chunk-FPLWS5WP.js";import{a as xe,b as Me}from"./chunk-R3563DDE.js";import{e as If}from"./chunk-HBOWJDR5.js";import{$a as mf,Ac as vf,Bc as xf,Ca as Wi,Cc as Pe,D as uf,Da as ff,Dc as ri,Ec as Tn,Fa as Qn,Fc as Wt,Gc as tr,Hb as G,Hc as w,Ib as E,Ic as S,Jb as T,Jc as He,Lb as at,M as Yn,Mb as st,Nb as lt,Ob as b,Pb as f,Qb as m,Qc as xt,Rb as $,Rc as z,Sb as Qe,Sc as Xi,Tb as rt,Ub as gi,Uc as Cf,Vb as yf,Wb as _f,Xa as he,Z as lu,_b as H,a as X,aa as ao,ab as d,b as $e,bc as q,cc as Ht,dc as y,e as g,fa as cf,fb as Ua,g as ze,ga as Ft,gb as Ti,h as K,ha as Zn,hc as uu,ib as Sn,ic as cu,id as Kt,ja as df,jc as du,jd as Pn,k as of,ka as pf,kc as Ki,kd as Ct,la as P,lc as Gi,mb as Y,mc as bf,n as jt,nb as er,nc as ni,o as su,ob as $n,oc as Ji,pb as hf,pc as Z,q as af,qc as x,ra as j,rc as R,rd as Wa,sa as F,sb as ue,sc as V,tc as En,ub as gf,uc as Ha,v as sf,vb as za,w as le,x as lf,xc as Ae,yc as Ne,za as La,zc as je,zd as wf}from"./chunk-ULJPS3WS.js";var po=g(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.regexpCode=be.getEsmExportName=be.getProperty=be.safeStringify=be.stringify=be.strConcat=be.addCodeArg=be.str=be._=be.nil=be._Code=be.Name=be.IDENTIFIER=be._CodeOrName=void 0;var uo=class{};be._CodeOrName=uo;be.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var kn=class extends uo{constructor(t){if(super(),!be.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};be.Name=kn;var Gt=class extends uo{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((i,n)=>`${i}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((i,n)=>(n instanceof kn&&(i[n.str]=(i[n.str]||0)+1),i),{})}};be._Code=Gt;be.nil=new Gt("");function Hf(e,...t){let i=[e[0]],n=0;for(;n<t.length;)fu(i,t[n]),i.push(e[++n]);return new Gt(i)}be._=Hf;var pu=new Gt("+");function Wf(e,...t){let i=[co(e[0])],n=0;for(;n<t.length;)i.push(pu),fu(i,t[n]),i.push(pu,co(e[++n]));return a2(i),new Gt(i)}be.str=Wf;function fu(e,t){t instanceof Gt?e.push(...t._items):t instanceof kn?e.push(t):e.push(u2(t))}be.addCodeArg=fu;function a2(e){let t=1;for(;t<e.length-1;){if(e[t]===pu){let i=s2(e[t-1],e[t+1]);if(i!==void 0){e.splice(t-1,3,i);continue}e[t++]="+"}t++}}function s2(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof kn||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof kn))return`"${e}${t.slice(1)}`}function l2(e,t){return t.emptyStr()?e:e.emptyStr()?t:Wf`${e}${t}`}be.strConcat=l2;function u2(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:co(Array.isArray(e)?e.join(","):e)}function c2(e){return new Gt(co(e))}be.stringify=c2;function co(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}be.safeStringify=co;function d2(e){return typeof e=="string"&&be.IDENTIFIER.test(e)?new Gt(`.${e}`):Hf`[${e}]`}be.getProperty=d2;function p2(e){if(typeof e=="string"&&be.IDENTIFIER.test(e))return new Gt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}be.getEsmExportName=p2;function f2(e){return new Gt(e.toString())}be.regexpCode=f2});var gu=g(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.ValueScope=Tt.ValueScopeName=Tt.Scope=Tt.varKinds=Tt.UsedValueState=void 0;var Et=po(),mu=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},ns=function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e}(ns||(Tt.UsedValueState=ns={}));Tt.varKinds={const:new Et.Name("const"),let:new Et.Name("let"),var:new Et.Name("var")};var rs=class{constructor({prefixes:t,parent:i}={}){this._names={},this._prefixes=t,this._parent=i}toName(t){return t instanceof Et.Name?t:this.name(t)}name(t){return new Et.Name(this._newName(t))}_newName(t){let i=this._names[t]||this._nameGroup(t);return`${t}${i.index++}`}_nameGroup(t){var i,n;if(!((n=(i=this._parent)===null||i===void 0?void 0:i._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};Tt.Scope=rs;var os=class extends Et.Name{constructor(t,i){super(i),this.prefix=t}setValue(t,{property:i,itemIndex:n}){this.value=t,this.scopePath=(0,Et._)`.${new Et.Name(i)}[${n}]`}};Tt.ValueScopeName=os;var m2=(0,Et._)`\n`,hu=class extends rs{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts=$e(X({},t),{_n:t.lines?m2:Et.nil})}get(){return this._scope}name(t){return new os(t,this._newName(t))}value(t,i){var n;if(i.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let r=this.toName(t),{prefix:o}=r,a=(n=i.key)!==null&&n!==void 0?n:i.ref,s=this._values[o];if(s){let c=s.get(a);if(c)return c}else s=this._values[o]=new Map;s.set(a,r);let l=this._scope[o]||(this._scope[o]=[]),u=l.length;return l[u]=i.ref,r.setValue(i,{property:o,itemIndex:u}),r}getValue(t,i){let n=this._values[t];if(n)return n.get(i)}scopeRefs(t,i=this._values){return this._reduceValues(i,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Et._)`${t}${n.scopePath}`})}scopeCode(t=this._values,i,n){return this._reduceValues(t,r=>{if(r.value===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return r.value.code},i,n)}_reduceValues(t,i,n={},r){let o=Et.nil;for(let a in t){let s=t[a];if(!s)continue;let l=n[a]=n[a]||new Map;s.forEach(u=>{if(l.has(u))return;l.set(u,ns.Started);let c=i(u);if(c){let p=this.opts.es5?Tt.varKinds.var:Tt.varKinds.const;o=(0,Et._)`${o}${p} ${u} = ${c};${this.opts._n}`}else if(c=r?.(u))o=(0,Et._)`${o}${c}${this.opts._n}`;else throw new mu(u);l.set(u,ns.Completed)})}return o}};Tt.ValueScope=hu});var ee=g(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.or=ce.and=ce.not=ce.CodeGen=ce.operators=ce.varKinds=ce.ValueScopeName=ce.ValueScope=ce.Scope=ce.Name=ce.regexpCode=ce.stringify=ce.getProperty=ce.nil=ce.strConcat=ce.str=ce._=void 0;var ge=po(),ai=gu(),nn=po();Object.defineProperty(ce,"_",{enumerable:!0,get:function(){return nn._}});Object.defineProperty(ce,"str",{enumerable:!0,get:function(){return nn.str}});Object.defineProperty(ce,"strConcat",{enumerable:!0,get:function(){return nn.strConcat}});Object.defineProperty(ce,"nil",{enumerable:!0,get:function(){return nn.nil}});Object.defineProperty(ce,"getProperty",{enumerable:!0,get:function(){return nn.getProperty}});Object.defineProperty(ce,"stringify",{enumerable:!0,get:function(){return nn.stringify}});Object.defineProperty(ce,"regexpCode",{enumerable:!0,get:function(){return nn.regexpCode}});Object.defineProperty(ce,"Name",{enumerable:!0,get:function(){return nn.Name}});var cs=gu();Object.defineProperty(ce,"Scope",{enumerable:!0,get:function(){return cs.Scope}});Object.defineProperty(ce,"ValueScope",{enumerable:!0,get:function(){return cs.ValueScope}});Object.defineProperty(ce,"ValueScopeName",{enumerable:!0,get:function(){return cs.ValueScopeName}});Object.defineProperty(ce,"varKinds",{enumerable:!0,get:function(){return cs.varKinds}});ce.operators={GT:new ge._Code(">"),GTE:new ge._Code(">="),LT:new ge._Code("<"),LTE:new ge._Code("<="),EQ:new ge._Code("==="),NEQ:new ge._Code("!=="),NOT:new ge._Code("!"),OR:new ge._Code("||"),AND:new ge._Code("&&"),ADD:new ge._Code("+")};var Pi=class{optimizeNodes(){return this}optimizeNames(t,i){return this}},yu=class extends Pi{constructor(t,i,n){super(),this.varKind=t,this.name=i,this.rhs=n}render({es5:t,_n:i}){let n=t?ai.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+i}optimizeNames(t,i){if(t[this.name.str])return this.rhs&&(this.rhs=sr(this.rhs,t,i)),this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}},ss=class extends Pi{constructor(t,i,n){super(),this.lhs=t,this.rhs=i,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,i){if(!(this.lhs instanceof ge.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=sr(this.rhs,t,i),this}get names(){let t=this.lhs instanceof ge.Name?{}:X({},this.lhs.names);return us(t,this.rhs)}},_u=class extends ss{constructor(t,i,n,r){super(t,n,r),this.op=i}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},bu=class extends Pi{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},vu=class extends Pi{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},xu=class extends Pi{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Cu=class extends Pi{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,i){return this.code=sr(this.code,t,i),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}},fo=class extends Pi{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((i,n)=>i+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,i=t.length;for(;i--;){let n=t[i].optimizeNodes();Array.isArray(n)?t.splice(i,1,...n):n?t[i]=n:t.splice(i,1)}return t.length>0?this:void 0}optimizeNames(t,i){let{nodes:n}=this,r=n.length;for(;r--;){let o=n[r];o.optimizeNames(t,i)||(h2(t,o.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,i)=>Dn(t,i.names),{})}},Oi=class extends fo{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},wu=class extends fo{},Iu=(()=>{class e extends Oi{}return e.kind="else",e})(),as=(()=>{class e extends Oi{constructor(i,n){super(n),this.condition=i}render(i){let n=`if(${this.condition})`+super.render(i);return this.else&&(n+="else "+this.else.render(i)),n}optimizeNodes(){super.optimizeNodes();let i=this.condition;if(i===!0)return this.nodes;let n=this.else;if(n){let r=n.optimizeNodes();n=this.else=Array.isArray(r)?new Iu(r):r}if(n)return i===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(Yf(i),n instanceof e?[n]:n.nodes);if(!(i===!1||!this.nodes.length))return this}optimizeNames(i,n){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(i,n),!!(super.optimizeNames(i,n)||this.else))return this.condition=sr(this.condition,i,n),this}get names(){let i=super.names;return us(i,this.condition),this.else&&Dn(i,this.else.names),i}}return e.kind="if",e})(),ds=(()=>{class e extends Oi{}return e.kind="for",e})(),Su=class extends ds{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,i){if(super.optimizeNames(t,i))return this.iteration=sr(this.iteration,t,i),this}get names(){return Dn(super.names,this.iteration.names)}},$u=class extends ds{constructor(t,i,n,r){super(),this.varKind=t,this.name=i,this.from=n,this.to=r}render(t){let i=t.es5?ai.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${i} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(t)}get names(){let t=us(super.names,this.from);return us(t,this.to)}},ls=class extends ds{constructor(t,i,n,r){super(),this.loop=t,this.varKind=i,this.name=n,this.iterable=r}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,i){if(super.optimizeNames(t,i))return this.iterable=sr(this.iterable,t,i),this}get names(){return Dn(super.names,this.iterable.names)}},Kf=(()=>{class e extends Oi{constructor(i,n,r){super(),this.name=i,this.args=n,this.async=r}render(i){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(i)}}return e.kind="func",e})(),Gf=(()=>{class e extends fo{render(i){return"return "+super.render(i)}}return e.kind="return",e})(),Eu=class extends Oi{render(t){let i="try"+super.render(t);return this.catch&&(i+=this.catch.render(t)),this.finally&&(i+=this.finally.render(t)),i}optimizeNodes(){var t,i;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(i=this.finally)===null||i===void 0||i.optimizeNodes(),this}optimizeNames(t,i){var n,r;return super.optimizeNames(t,i),(n=this.catch)===null||n===void 0||n.optimizeNames(t,i),(r=this.finally)===null||r===void 0||r.optimizeNames(t,i),this}get names(){let t=super.names;return this.catch&&Dn(t,this.catch.names),this.finally&&Dn(t,this.finally.names),t}},Jf=(()=>{class e extends Oi{constructor(i){super(),this.error=i}render(i){return`catch(${this.error})`+super.render(i)}}return e.kind="catch",e})(),Xf=(()=>{class e extends Oi{render(i){return"finally"+super.render(i)}}return e.kind="finally",e})(),Tu=class{constructor(t,i={}){this._values={},this._blockStarts=[],this._constants={},this.opts=$e(X({},i),{_n:i.lines?`
2
2
  `:""}),this._extScope=t,this._scope=new ai.Scope({parent:t}),this._nodes=[new wu]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,i){let n=this._extScope.value(t,i);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,i){return this._extScope.getValue(t,i)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,i,n,r){let o=this._scope.toName(i);return n!==void 0&&r&&(this._constants[o.str]=n),this._leafNode(new yu(t,o,n)),o}const(t,i,n){return this._def(ai.varKinds.const,t,i,n)}let(t,i,n){return this._def(ai.varKinds.let,t,i,n)}var(t,i,n){return this._def(ai.varKinds.var,t,i,n)}assign(t,i,n){return this._leafNode(new ss(t,i,n))}add(t,i){return this._leafNode(new _u(t,ce.operators.ADD,i))}code(t){return typeof t=="function"?t():t!==ge.nil&&this._leafNode(new Cu(t)),this}object(...t){let i=["{"];for(let[n,r]of t)i.length>1&&i.push(","),i.push(n),(n!==r||this.opts.es5)&&(i.push(":"),(0,ge.addCodeArg)(i,r));return i.push("}"),new ge._Code(i)}if(t,i,n){if(this._blockNode(new as(t)),i&&n)this.code(i).else().code(n).endIf();else if(i)this.code(i).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new as(t))}else(){return this._elseNode(new Iu)}endIf(){return this._endBlockNode(as,Iu)}_for(t,i){return this._blockNode(t),i&&this.code(i).endFor(),this}for(t,i){return this._for(new Su(t),i)}forRange(t,i,n,r,o=this.opts.es5?ai.varKinds.var:ai.varKinds.let){let a=this._scope.toName(t);return this._for(new $u(o,a,i,n),()=>r(a))}forOf(t,i,n,r=ai.varKinds.const){let o=this._scope.toName(t);if(this.opts.es5){let a=i instanceof ge.Name?i:this.var("_arr",i);return this.forRange("_i",0,(0,ge._)`${a}.length`,s=>{this.var(o,(0,ge._)`${a}[${s}]`),n(o)})}return this._for(new ls("of",r,o,i),()=>n(o))}forIn(t,i,n,r=this.opts.es5?ai.varKinds.var:ai.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ge._)`Object.keys(${i})`,n);let o=this._scope.toName(t);return this._for(new ls("in",r,o,i),()=>n(o))}endFor(){return this._endBlockNode(ds)}label(t){return this._leafNode(new bu(t))}break(t){return this._leafNode(new vu(t))}return(t){let i=new Gf;if(this._blockNode(i),this.code(t),i.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Gf)}try(t,i,n){if(!i&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let r=new Eu;if(this._blockNode(r),this.code(t),i){let o=this.name("e");this._currNode=r.catch=new Jf(o),i(o)}return n&&(this._currNode=r.finally=new Xf,this.code(n)),this._endBlockNode(Jf,Xf)}throw(t){return this._leafNode(new xu(t))}block(t,i){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(i),this}endBlock(t){let i=this._blockStarts.pop();if(i===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-i;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=i,this}func(t,i=ge.nil,n,r){return this._blockNode(new Kf(t,i,n)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(Kf)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,i){let n=this._currNode;if(n instanceof t||i&&n instanceof i)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${i?`${t.kind}/${i.kind}`:t.kind}"`)}_elseNode(t){let i=this._currNode;if(!(i instanceof as))throw new Error('CodeGen: "else" without "if"');return this._currNode=i.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let i=this._nodes;i[i.length-1]=t}};ce.CodeGen=Tu;function Dn(e,t){for(let i in t)e[i]=(e[i]||0)+(t[i]||0);return e}function us(e,t){return t instanceof ge._CodeOrName?Dn(e,t.names):e}function sr(e,t,i){if(e instanceof ge.Name)return n(e);if(!r(e))return e;return new ge._Code(e._items.reduce((o,a)=>(a instanceof ge.Name&&(a=n(a)),a instanceof ge._Code?o.push(...a._items):o.push(a),o),[]));function n(o){let a=i[o.str];return a===void 0||t[o.str]!==1?o:(delete t[o.str],a)}function r(o){return o instanceof ge._Code&&o._items.some(a=>a instanceof ge.Name&&t[a.str]===1&&i[a.str]!==void 0)}}function h2(e,t){for(let i in t)e[i]=(e[i]||0)-(t[i]||0)}function Yf(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ge._)`!${Pu(e)}`}ce.not=Yf;var g2=Zf(ce.operators.AND);function y2(...e){return e.reduce(g2)}ce.and=y2;var _2=Zf(ce.operators.OR);function b2(...e){return e.reduce(_2)}ce.or=b2;function Zf(e){return(t,i)=>t===ge.nil?i:i===ge.nil?t:(0,ge._)`${Pu(t)} ${e} ${Pu(i)}`}function Pu(e){return e instanceof ge.Name?e:(0,ge._)`(${e})`}});var pe=g(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.checkStrictMode=de.getErrorPath=de.Type=de.useFunc=de.setEvaluated=de.evaluatedPropsToName=de.mergeEvaluated=de.eachItem=de.unescapeJsonPointer=de.escapeJsonPointer=de.escapeFragment=de.unescapeFragment=de.schemaRefOrVal=de.schemaHasRulesButRef=de.schemaHasRules=de.checkUnknownRules=de.alwaysValidSchema=de.toHash=void 0;var Ee=ee(),v2=po();function x2(e){let t={};for(let i of e)t[i]=!0;return t}de.toHash=x2;function C2(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(tm(e,t),!im(t,e.self.RULES.all))}de.alwaysValidSchema=C2;function tm(e,t=e.schema){let{opts:i,self:n}=e;if(!i.strictSchema||typeof t=="boolean")return;let r=n.RULES.keywords;for(let o in t)r[o]||om(e,`unknown keyword: "${o}"`)}de.checkUnknownRules=tm;function im(e,t){if(typeof e=="boolean")return!e;for(let i in e)if(t[i])return!0;return!1}de.schemaHasRules=im;function w2(e,t){if(typeof e=="boolean")return!e;for(let i in e)if(i!=="$ref"&&t.all[i])return!0;return!1}de.schemaHasRulesButRef=w2;function I2({topSchemaRef:e,schemaPath:t},i,n,r){if(!r){if(typeof i=="number"||typeof i=="boolean")return i;if(typeof i=="string")return(0,Ee._)`${i}`}return(0,Ee._)`${e}${t}${(0,Ee.getProperty)(n)}`}de.schemaRefOrVal=I2;function S2(e){return nm(decodeURIComponent(e))}de.unescapeFragment=S2;function $2(e){return encodeURIComponent(Mu(e))}de.escapeFragment=$2;function Mu(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}de.escapeJsonPointer=Mu;function nm(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}de.unescapeJsonPointer=nm;function E2(e,t){if(Array.isArray(e))for(let i of e)t(i);else t(e)}de.eachItem=E2;function Qf({mergeNames:e,mergeToName:t,mergeValues:i,resultToName:n}){return(r,o,a,s)=>{let l=a===void 0?o:a instanceof Ee.Name?(o instanceof Ee.Name?e(r,o,a):t(r,o,a),a):o instanceof Ee.Name?(t(r,a,o),o):i(o,a);return s===Ee.Name&&!(l instanceof Ee.Name)?n(r,l):l}}de.mergeEvaluated={props:Qf({mergeNames:(e,t,i)=>e.if((0,Ee._)`${i} !== true && ${t} !== undefined`,()=>{e.if((0,Ee._)`${t} === true`,()=>e.assign(i,!0),()=>e.assign(i,(0,Ee._)`${i} || {}`).code((0,Ee._)`Object.assign(${i}, ${t})`))}),mergeToName:(e,t,i)=>e.if((0,Ee._)`${i} !== true`,()=>{t===!0?e.assign(i,!0):(e.assign(i,(0,Ee._)`${i} || {}`),ku(e,i,t))}),mergeValues:(e,t)=>e===!0?!0:X(X({},e),t),resultToName:rm}),items:Qf({mergeNames:(e,t,i)=>e.if((0,Ee._)`${i} !== true && ${t} !== undefined`,()=>e.assign(i,(0,Ee._)`${t} === true ? true : ${i} > ${t} ? ${i} : ${t}`)),mergeToName:(e,t,i)=>e.if((0,Ee._)`${i} !== true`,()=>e.assign(i,t===!0?!0:(0,Ee._)`${i} > ${t} ? ${i} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function rm(e,t){if(t===!0)return e.var("props",!0);let i=e.var("props",(0,Ee._)`{}`);return t!==void 0&&ku(e,i,t),i}de.evaluatedPropsToName=rm;function ku(e,t,i){Object.keys(i).forEach(n=>e.assign((0,Ee._)`${t}${(0,Ee.getProperty)(n)}`,!0))}de.setEvaluated=ku;var em={};function T2(e,t){return e.scopeValue("func",{ref:t,code:em[t.code]||(em[t.code]=new v2._Code(t.code))})}de.useFunc=T2;var Ou=function(e){return e[e.Num=0]="Num",e[e.Str=1]="Str",e}(Ou||(de.Type=Ou={}));function P2(e,t,i){if(e instanceof Ee.Name){let n=t===Ou.Num;return i?n?(0,Ee._)`"[" + ${e} + "]"`:(0,Ee._)`"['" + ${e} + "']"`:n?(0,Ee._)`"/" + ${e}`:(0,Ee._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return i?(0,Ee.getProperty)(e).toString():"/"+Mu(e)}de.getErrorPath=P2;function om(e,t,i=e.opts.strictSchema){if(i){if(t=`strict mode: ${t}`,i===!0)throw new Error(t);e.self.logger.warn(t)}}de.checkStrictMode=om});var Jt=g(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});var ft=ee(),O2={data:new ft.Name("data"),valCxt:new ft.Name("valCxt"),instancePath:new ft.Name("instancePath"),parentData:new ft.Name("parentData"),parentDataProperty:new ft.Name("parentDataProperty"),rootData:new ft.Name("rootData"),dynamicAnchors:new ft.Name("dynamicAnchors"),vErrors:new ft.Name("vErrors"),errors:new ft.Name("errors"),this:new ft.Name("this"),self:new ft.Name("self"),scope:new ft.Name("scope"),json:new ft.Name("json"),jsonPos:new ft.Name("jsonPos"),jsonLen:new ft.Name("jsonLen"),jsonPart:new ft.Name("jsonPart")};Du.default=O2});var mo=g(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.extendErrors=mt.resetErrorsCount=mt.reportExtraError=mt.reportError=mt.keyword$DataError=mt.keywordError=void 0;var _e=ee(),ps=pe(),wt=Jt();mt.keywordError={message:({keyword:e})=>(0,_e.str)`must pass "${e}" keyword validation`};mt.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,_e.str)`"${e}" keyword must be ${t} ($data)`:(0,_e.str)`"${e}" keyword is invalid ($data)`};function M2(e,t=mt.keywordError,i,n){let{it:r}=e,{gen:o,compositeRule:a,allErrors:s}=r,l=lm(e,t,i);n??(a||s)?am(o,l):sm(r,(0,_e._)`[${l}]`)}mt.reportError=M2;function k2(e,t=mt.keywordError,i){let{it:n}=e,{gen:r,compositeRule:o,allErrors:a}=n,s=lm(e,t,i);am(r,s),o||a||sm(n,wt.default.vErrors)}mt.reportExtraError=k2;function D2(e,t){e.assign(wt.default.errors,t),e.if((0,_e._)`${wt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,_e._)`${wt.default.vErrors}.length`,t),()=>e.assign(wt.default.vErrors,null)))}mt.resetErrorsCount=D2;function A2({gen:e,keyword:t,schemaValue:i,data:n,errsCount:r,it:o}){if(r===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",r,wt.default.errors,s=>{e.const(a,(0,_e._)`${wt.default.vErrors}[${s}]`),e.if((0,_e._)`${a}.instancePath === undefined`,()=>e.assign((0,_e._)`${a}.instancePath`,(0,_e.strConcat)(wt.default.instancePath,o.errorPath))),e.assign((0,_e._)`${a}.schemaPath`,(0,_e.str)`${o.errSchemaPath}/${t}`),o.opts.verbose&&(e.assign((0,_e._)`${a}.schema`,i),e.assign((0,_e._)`${a}.data`,n))})}mt.extendErrors=A2;function am(e,t){let i=e.const("err",t);e.if((0,_e._)`${wt.default.vErrors} === null`,()=>e.assign(wt.default.vErrors,(0,_e._)`[${i}]`),(0,_e._)`${wt.default.vErrors}.push(${i})`),e.code((0,_e._)`${wt.default.errors}++`)}function sm(e,t){let{gen:i,validateName:n,schemaEnv:r}=e;r.$async?i.throw((0,_e._)`new ${e.ValidationError}(${t})`):(i.assign((0,_e._)`${n}.errors`,t),i.return(!1))}var An={keyword:new _e.Name("keyword"),schemaPath:new _e.Name("schemaPath"),params:new _e.Name("params"),propertyName:new _e.Name("propertyName"),message:new _e.Name("message"),schema:new _e.Name("schema"),parentSchema:new _e.Name("parentSchema")};function lm(e,t,i){let{createErrors:n}=e.it;return n===!1?(0,_e._)`{}`:N2(e,t,i)}function N2(e,t,i={}){let{gen:n,it:r}=e,o=[j2(r,i),F2(e,i)];return q2(e,t,o),n.object(...o)}function j2({errorPath:e},{instancePath:t}){let i=t?(0,_e.str)`${e}${(0,ps.getErrorPath)(t,ps.Type.Str)}`:e;return[wt.default.instancePath,(0,_e.strConcat)(wt.default.instancePath,i)]}function F2({keyword:e,it:{errSchemaPath:t}},{schemaPath:i,parentSchema:n}){let r=n?t:(0,_e.str)`${t}/${e}`;return i&&(r=(0,_e.str)`${r}${(0,ps.getErrorPath)(i,ps.Type.Str)}`),[An.schemaPath,r]}function q2(e,{params:t,message:i},n){let{keyword:r,data:o,schemaValue:a,it:s}=e,{opts:l,propertyName:u,topSchemaRef:c,schemaPath:p}=s;n.push([An.keyword,r],[An.params,typeof t=="function"?t(e):t||(0,_e._)`{}`]),l.messages&&n.push([An.message,typeof i=="function"?i(e):i]),l.verbose&&n.push([An.schema,a],[An.parentSchema,(0,_e._)`${c}${p}`],[wt.default.data,o]),u&&n.push([An.propertyName,u])}});var cm=g(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.boolOrEmptySchema=lr.topBoolOrEmptySchema=void 0;var V2=mo(),B2=ee(),R2=Jt(),L2={message:"boolean schema is false"};function U2(e){let{gen:t,schema:i,validateName:n}=e;i===!1?um(e,!1):typeof i=="object"&&i.$async===!0?t.return(R2.default.data):(t.assign((0,B2._)`${n}.errors`,null),t.return(!0))}lr.topBoolOrEmptySchema=U2;function z2(e,t){let{gen:i,schema:n}=e;n===!1?(i.var(t,!1),um(e)):i.var(t,!0)}lr.boolOrEmptySchema=z2;function um(e,t){let{gen:i,data:n}=e,r={gen:i,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,V2.reportError)(r,L2,void 0,t)}});var Au=g(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.getRules=ur.isJSONType=void 0;var H2=["string","number","integer","boolean","null","object","array"],W2=new Set(H2);function K2(e){return typeof e=="string"&&W2.has(e)}ur.isJSONType=K2;function G2(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:$e(X({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}ur.getRules=G2});var Nu=g(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.shouldUseRule=rn.shouldUseGroup=rn.schemaHasRulesForType=void 0;function J2({schema:e,self:t},i){let n=t.RULES.types[i];return n&&n!==!0&&dm(e,n)}rn.schemaHasRulesForType=J2;function dm(e,t){return t.rules.some(i=>pm(e,i))}rn.shouldUseGroup=dm;function pm(e,t){var i;return e[t.keyword]!==void 0||((i=t.definition.implements)===null||i===void 0?void 0:i.some(n=>e[n]!==void 0))}rn.shouldUseRule=pm});var ho=g(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.reportTypeError=ht.checkDataTypes=ht.checkDataType=ht.coerceAndCheckDataType=ht.getJSONTypes=ht.getSchemaTypes=ht.DataType=void 0;var X2=Au(),Y2=Nu(),Z2=mo(),ae=ee(),fm=pe(),cr=function(e){return e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong",e}(cr||(ht.DataType=cr={}));function Q2(e){let t=mm(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}ht.getSchemaTypes=Q2;function mm(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(X2.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}ht.getJSONTypes=mm;function e$(e,t){let{gen:i,data:n,opts:r}=e,o=t$(t,r.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&(0,Y2.schemaHasRulesForType)(e,t[0]));if(a){let s=Fu(t,n,r.strictNumbers,cr.Wrong);i.if(s,()=>{o.length?i$(e,t,o):qu(e)})}return a}ht.coerceAndCheckDataType=e$;var hm=new Set(["string","number","integer","boolean","null"]);function t$(e,t){return t?e.filter(i=>hm.has(i)||t==="array"&&i==="array"):[]}function i$(e,t,i){let{gen:n,data:r,opts:o}=e,a=n.let("dataType",(0,ae._)`typeof ${r}`),s=n.let("coerced",(0,ae._)`undefined`);o.coerceTypes==="array"&&n.if((0,ae._)`${a} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,()=>n.assign(r,(0,ae._)`${r}[0]`).assign(a,(0,ae._)`typeof ${r}`).if(Fu(t,r,o.strictNumbers),()=>n.assign(s,r))),n.if((0,ae._)`${s} !== undefined`);for(let u of i)(hm.has(u)||u==="array"&&o.coerceTypes==="array")&&l(u);n.else(),qu(e),n.endIf(),n.if((0,ae._)`${s} !== undefined`,()=>{n.assign(r,s),n$(e,s)});function l(u){switch(u){case"string":n.elseIf((0,ae._)`${a} == "number" || ${a} == "boolean"`).assign(s,(0,ae._)`"" + ${r}`).elseIf((0,ae._)`${r} === null`).assign(s,(0,ae._)`""`);return;case"number":n.elseIf((0,ae._)`${a} == "boolean" || ${r} === null
3
3
  || (${a} == "string" && ${r} && ${r} == +${r})`).assign(s,(0,ae._)`+${r}`);return;case"integer":n.elseIf((0,ae._)`${a} === "boolean" || ${r} === null
4
4
  || (${a} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(s,(0,ae._)`+${r}`);return;case"boolean":n.elseIf((0,ae._)`${r} === "false" || ${r} === 0 || ${r} === null`).assign(s,!1).elseIf((0,ae._)`${r} === "true" || ${r} === 1`).assign(s,!0);return;case"null":n.elseIf((0,ae._)`${r} === "" || ${r} === 0 || ${r} === false`),n.assign(s,null);return;case"array":n.elseIf((0,ae._)`${a} === "string" || ${a} === "number"
@@ -0,0 +1 @@
1
+ import{a as n}from"./chunk-6HXGDQKN.js";import"./chunk-3K4AKQIG.js";import{g as r}from"./chunk-ZJ3JJYIN.js";import"./chunk-ZCSPADUX.js";import"./chunk-FPLWS5WP.js";import"./chunk-R3563DDE.js";import"./chunk-HBOWJDR5.js";import{ha as o,nb as e}from"./chunk-ULJPS3WS.js";var c=[{path:"",loadComponent:()=>import("./chunk-UJNY5BYT.js").then(t=>t.SettingsComponent),canActivate:[n]}],m=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[r.forChild(c),r]})}return t})();var l=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[m]})}return t})();export{l as SettingsModule};
@@ -1 +1 @@
1
- import{d as f,g as s}from"./chunk-GEIS2BWE.js";import{k as u,n as d}from"./chunk-IJVDEEEM.js";import{a as l}from"./chunk-R3563DDE.js";import"./chunk-Q4CZ7LVK.js";import{ga as m,h as p,ha as i,la as e,nb as a,w as c}from"./chunk-ULJPS3WS.js";var n=(()=>{class t{$api=e(d);$router=e(f);$toastr=e(u);$translate=e(l);resolve(){return p(this,null,function*(){try{return yield c(this.$api.get("/platform-tools/docker/startup-script"))}catch(r){console.error(r),this.$toastr.error(r.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(o){return new(o||t)};static \u0275prov=m({token:t,factory:t.\u0275fac})}return t})();var S=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"startup-script",loadComponent:()=>import("./chunk-J2WQQ5XA.js").then(t=>t.StartupScriptComponent),resolve:{startupScript:n}},{path:"restart-container",loadComponent:()=>import("./chunk-MHB4GJLL.js").then(t=>t.ContainerRestartComponent)}],v=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({imports:[s.forChild(S),s]})}return t})();var T=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({providers:[n],imports:[v]})}return t})();export{T as DockerModule};
1
+ import{d as f,g as s}from"./chunk-ZJ3JJYIN.js";import{k as u,n as d}from"./chunk-FPLWS5WP.js";import{a as l}from"./chunk-R3563DDE.js";import"./chunk-HBOWJDR5.js";import{ga as m,h as p,ha as i,la as e,nb as a,w as c}from"./chunk-ULJPS3WS.js";var n=(()=>{class t{$api=e(d);$router=e(f);$toastr=e(u);$translate=e(l);resolve(){return p(this,null,function*(){try{return yield c(this.$api.get("/platform-tools/docker/startup-script"))}catch(r){console.error(r),this.$toastr.error(r.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(o){return new(o||t)};static \u0275prov=m({token:t,factory:t.\u0275fac})}return t})();var S=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"startup-script",loadComponent:()=>import("./chunk-YHQ4H2LV.js").then(t=>t.StartupScriptComponent),resolve:{startupScript:n}},{path:"restart-container",loadComponent:()=>import("./chunk-PRMVT3SQ.js").then(t=>t.ContainerRestartComponent)}],v=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({imports:[s.forChild(S),s]})}return t})();var T=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({providers:[n],imports:[v]})}return t})();export{T as DockerModule};
@@ -1 +1 @@
1
- import{a as se}from"./chunk-YKDYWWHU.js";import{a as te,b as ie,c as ne}from"./chunk-YJ2Q2RAD.js";import{c as re}from"./chunk-BWV3SD3Z.js";import"./chunk-7HL2NUIE.js";import{a as le}from"./chunk-THGDS273.js";import{m as V,n as Z,t as ee}from"./chunk-C3HWKB2Q.js";import{c as G,e as J,f as K,i as Q,l as U,m as X,z as Y}from"./chunk-WFYBML4S.js";import"./chunk-TXNH42IW.js";import{b as ae}from"./chunk-2CKLKY5R.js";import"./chunk-GEIS2BWE.js";import{b as oe}from"./chunk-4AJSXM5Z.js";import"./chunk-IJVDEEEM.js";import{b as E}from"./chunk-R3563DDE.js";import"./chunk-Q4CZ7LVK.js";import{Cc as R,Dc as $,Ec as j,Hb as C,Hc as a,Ib as w,Ic as r,Jb as S,Jc as z,Lb as P,Mb as L,Nb as N,Ob as _,Pb as s,Qb as l,Rb as f,Sb as u,Tb as b,Ub as A,Xa as W,_b as D,ab as o,bc as v,cc as H,dc as m,id as q,la as x,mb as M,qc as c,ra as y,rc as p,sa as h,sc as k,xc as T,yc as B,zc as I}from"./chunk-ULJPS3WS.js";var ce=(()=>{class t{$activeModal=x(V);dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=M({type:t,selectors:[["ng-component"]],decls:41,vars:30,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fa","fa-fw","fa-question-circle-o","primary-text",2,"font-size","75px"],[1,"ms-2"],[1,"mb-0"],[1,"ms-2","mt-2"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-end"]],template:function(i,n){i&1&&(u(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),a(5,"translate"),b(),u(6,"button",3),a(7,"translate"),H("click",function(){return n.dismissModal()}),b()(),u(8,"div",4)(9,"div",5),A(10,"i",6),b(),u(11,"h5",7),c(12),a(13,"translate"),b(),u(14,"ul",8)(15,"li"),c(16),a(17,"translate"),b(),u(18,"li"),c(19),a(20,"translate"),b()(),u(21,"h5",9),c(22),a(23,"translate"),b(),u(24,"ul",8)(25,"li"),c(26),a(27,"translate"),b(),u(28,"li"),c(29),a(30,"translate"),b(),u(31,"li"),c(32),a(33,"translate"),b()()(),u(34,"div",10),A(35,"div",11),u(36,"div",12)(37,"button",13),H("click",function(){return n.dismissModal()}),c(38),a(39,"translate"),b()(),A(40,"div",14),b()()()),i&2&&(o(4),p(r(5,10,"support.title")),o(2),C("aria-label",r(7,12,"form.button_close")),o(6),p(r(13,14,"accessories.title_accessories")),o(4),p(r(17,16,"accessories.support.acc_1")),o(3),p(r(20,18,"accessories.support.acc_2")),o(3),p(r(23,20,"accessories.title_rooms")),o(4),p(r(27,22,"accessories.support.rooms_1")),o(3),p(r(30,24,"accessories.support.rooms_2")),o(3),p(r(33,26,"accessories.support.rooms_3")),o(6),k(" ",r(39,28,"form.button_close")," "))},dependencies:[E],encapsulation:2})}return t})();var pe=()=>({standalone:!0}),de=(()=>{class t{$activeModal=x(V);roomName;dismissModal(){this.$activeModal.dismiss("Dismiss")}closeModal(e){this.$activeModal.close(e)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=M({type:t,selectors:[["ng-component"]],inputs:{roomName:"roomName"},decls:28,vars:19,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-folder-plus","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],["for","form-name",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["autocomplete","off","type","text","id","form-name","autofocus","",1,"form-control","custom-input",3,"ngModelChange","keyup.enter","ngModel","ngModelOptions"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),a(5,"translate"),l(),s(6,"button",3),a(7,"translate"),v("click",function(){return n.dismissModal()}),l()(),s(8,"div",4)(9,"div",5),f(10,"i",6),l(),s(11,"ul",7)(12,"li",8)(13,"label",9),c(14),a(15,"translate"),l(),s(16,"div",10)(17,"input",11),I("ngModelChange",function(F){return B(n.roomName,F)||(n.roomName=F),F}),v("keyup.enter",function(){return n.closeModal(n.roomName)}),l()()()()(),s(18,"div",12)(19,"div",13)(20,"button",14),v("click",function(){return n.dismissModal()}),c(21),a(22,"translate"),l()(),f(23,"div",15),s(24,"div",16)(25,"button",17),v("click",function(){return n.closeModal(n.roomName)}),c(26),a(27,"translate"),l()()()()()),i&2&&(o(4),p(r(5,8,"accessories.button_add_room")),o(2),C("aria-label",r(7,10,"form.button_close")),o(8),p(r(15,12,"accessories.room_name")),o(3),T("ngModel",n.roomName),_("ngModelOptions",R(18,pe)),o(4),k(" ",r(22,14,"form.button_close")," "),o(4),_("disabled",!n.roomName),o(),k(" ",r(27,16,"form.button_save")," "))},dependencies:[Y,X,G,J,K,U,Q,E],encapsulation:2})}return t})();var me=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275cmp=M({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(i,n){i&1&&(u(0,"div",0),A(1,"i",1),u(2,"div",2),c(3),a(4,"translate"),b()()),i&2&&(o(3),p(r(4,1,"accessories.control.drag_here")))},dependencies:[E],styles:[".accessory-box[_ngcontent-%COMP%]{opacity:.2}"]})}return t})();var ue=(t,g)=>({"fa-eye":t,"fa-eye-slash":g}),_e=t=>({"cursor-move":t}),be=t=>({"justify-content-between":t}),fe=t=>({link:t});function ge(t,g){if(t&1&&(s(0,"div",0)(1,"div",19)(2,"h5",20),c(3),a(4,"translate"),l()()()),t&2){let e=m().$implicit,i=m(2);o(2),_("ngClass",$(4,_e,!i.isMobile)),o(),k(" ",e.name==="Default Room"?r(4,2,"accessories.control.default_room"):e.name," ")}}function ve(t,g){if(t&1&&(s(0,"div",23),f(1,"app-accessory-tile",24),l()),t&2){let e=m().$implicit;o(),_("service",e)}}function xe(t,g){if(t&1&&w(0,ve,2,1,"div",23),t&2){let e=g.$implicit,i=m(4);S(!i.hideHidden||!e.hidden?0:-1)}}function Ce(t,g){if(t&1){let e=D();s(0,"div",21),I("dragulaModelChange",function(n){y(e);let d=m().$implicit;return B(d.services,n)||(d.services=n),h(n)}),L(1,xe,1,1,null,null,P),f(3,"div",22)(4,"div",22)(5,"div",22)(6,"div",22)(7,"div",22)(8,"div",22)(9,"div",22)(10,"div",22)(11,"div",22)(12,"div",22),l()}if(t&2){let e=m().$implicit,i=m(2);_("ngClass",$(3,be,i.isMobile))("dragula","services-bag"),T("dragulaModel",e.services),o(),N(e.services)}}function ye(t,g){if(t&1){let e=D();s(0,"div",25),I("dragulaModelChange",function(n){y(e);let d=m().$implicit;return B(d.services,n)||(d.services=n),h(n)}),f(1,"app-drag-here-placeholder",26),l()}if(t&2){let e=m().$implicit;_("dragula","services-bag"),T("dragulaModel",e.services)}}function he(t,g){if(t&1&&(s(0,"div"),w(1,ge,5,6,"div",0),s(2,"div",16),w(3,Ce,13,5,"div",17),w(4,ye,2,2,"div",18),l()()),t&2){let e=g.$implicit,i=m(2);o(),S(!i.isMobile||e.services.length?1:-1),o(2),S(e.services.length?3:-1),o(),S(!e.services.length&&!i.isMobile?4:-1)}}function Me(t,g){if(t&1){let e=D();s(0,"div",1)(1,"div",2)(2,"h3",3),c(3),a(4,"translate"),l()(),s(5,"div",4)(6,"button",5),a(7,"translate"),v("click",function(){y(e);let n=m();return h(n.openSupport())}),f(8,"i",6),l()(),s(9,"div",7)(10,"button",8),a(11,"translate"),a(12,"translate"),v("click",function(){y(e);let n=m();return h(n.addRoom())}),f(13,"i",9),l(),s(14,"button",8),a(15,"translate"),a(16,"translate"),a(17,"translate"),a(18,"translate"),v("click",function(){y(e);let n=m();return h(n.hideHidden=!n.hideHidden)}),f(19,"i",10),l(),s(20,"div",11)(21,"button",12),a(22,"translate"),a(23,"translate"),v("click",function(){y(e);let n=m();return h(n.toggleLayoutLock())}),f(24,"i",13),l(),s(25,"button",12),a(26,"translate"),a(27,"translate"),v("click",function(){y(e);let n=m();return h(n.toggleLayoutLock())}),f(28,"i",14),l()(),s(29,"button",5),a(30,"translate"),v("click",function(){y(e);let n=m();return h(n.openSupport())}),f(31,"i",6),l()()(),s(32,"div",15),I("dragulaModelChange",function(n){y(e);let d=m();return B(d.$accessories.rooms,n)||(d.$accessories.rooms=n),h(n)}),L(33,he,5,3,"div",null,P),l()}if(t&2){let e=m();o(3),p(r(4,18,"accessories.title_accessories")),o(3),C("aria-label",r(7,20,"support.title")),o(4),_("hidden",e.isMobile)("ngbTooltip",r(11,22,"accessories.button_add_room")),C("aria-label",r(12,24,"accessories.button_add_room")),o(4),_("hidden",e.isMobile)("ngbTooltip",e.hideHidden?r(15,26,"accessories.button_hidden_show"):r(16,28,"accessories.button_hidden_hide")),C("aria-label",e.hideHidden?r(17,30,"accessories.button_hidden_show"):r(18,32,"accessories.button_hidden_hide")),o(5),_("ngClass",j(44,ue,!e.hideHidden,e.hideHidden)),o(2),_("disabled",!e.isMobile)("ngbTooltip",r(22,34,"form.button_unlock")),C("aria-label",r(23,36,"form.button_unlock")),o(4),_("disabled",e.isMobile)("ngbTooltip",r(26,38,"form.button_lock")),C("aria-label",r(27,40,"form.button_lock")),o(4),C("aria-label",r(30,42,"support.title")),o(3),_("dragula","rooms-bag"),T("dragulaModel",e.$accessories.rooms),o(),N(e.$accessories.rooms)}}function Ee(t,g){t&1&&(s(0,"p",33),c(1),a(2,"translate"),l()),t&2&&(o(),p(r(2,1,"accessories.settings_link")))}function we(t,g){if(t&1&&(s(0,"div",0)(1,"div",27)(2,"h3",28),c(3),a(4,"translate"),l()(),s(5,"div",29)(6,"div",30)(7,"h5",31),c(8),a(9,"translate"),l(),f(10,"p",32),a(11,"translate"),w(12,Ee,3,3,"p",33),l()()()),t&2){let e=m();o(3),p(r(4,4,"accessories.title_accessories")),o(5),p(r(9,6,"accessories.control_disabled")),o(2),_("innerHTML",z(11,8,"accessories.message_must_use_insecure_mode",$(11,fe,e.linkInsecure)),W),o(2),S(e.isAdmin?12:-1)}}var it=(()=>{class t{$accessories=x(re);$auth=x(ae);dragulaService=x(te);$modal=x(Z);$settings=x(oe);$md=x(le);orderSubscription;isAdmin=this.$auth.user.admin;enableAccessories=this.$settings.env.enableAccessories;isMobile=!1;hideHidden=!0;linkInsecure='<a href="https://github.com/homebridge/homebridge-config-ui-x/wiki/Enabling-Accessory-Control" target="_blank"><i class="fa fa-fw fa-external-link-alt primary-text"></i></a>';constructor(){let e=this.dragulaService;this.isMobile=this.$md.detect.mobile(),e.createGroup("rooms-bag",{moves:(i,n,d)=>!this.isMobile&&d.classList.contains("drag-handle")}),e.createGroup("services-bag",{moves:i=>!this.isMobile&&!i.classList.contains("no-drag")}),this.orderSubscription=e.drop().subscribe(()=>{setTimeout(()=>{this.$accessories.saveLayout()})}),this.isMobile=!0}ngOnInit(){this.$accessories.start()}addRoom(){this.$modal.open(de,{size:"lg",backdrop:"static"}).result.then(e=>{!e||!e.length||this.$accessories.rooms.find(i=>i.name===e)||(this.$accessories.rooms.push({name:e,services:[]}),this.isMobile&&this.toggleLayoutLock())}).catch(()=>{})}toggleLayoutLock(){this.isMobile=!this.isMobile,this.isMobile?document.querySelectorAll(".services-bag").forEach(i=>{for(let n=0;n<10;n++){let d=document.createElement("div");d.className="accessory-box invisible py-0 my-0",d.style.height="0",i.appendChild(d)}}):document.querySelectorAll(".invisible").forEach(i=>i.remove())}openSupport(){this.$modal.open(ce,{size:"lg",backdrop:"static"})}ngOnDestroy(){this.$accessories.stop(),this.orderSubscription.unsubscribe(),this.dragulaService.destroy("rooms-bag"),this.dragulaService.destroy("services-bag")}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=M({type:t,selectors:[["app-accessories"]],decls:2,vars:1,consts:[[1,"row"],[1,"row","mb-3"],[1,"col-9","col-sm-6"],[1,"primary-text","m-0"],[1,"col-3","col-sm-6","text-end","d-inline-block","d-sm-none"],["type","button",1,"btn","btn-elegant","my-0","me-0",3,"click"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"col-3","col-sm-6","text-end","d-none","d-sm-inline-block"],["type","button","container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","hidden","ngbTooltip"],[1,"fas","fa-fw","fa-folder-plus"],[1,"fas","fa-fw",3,"ngClass"],["role","group",1,"btn-group","me-2"],["type","button","container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-unlock"],[1,"fas","fa-fw","fa-lock"],[3,"dragulaModelChange","dragula","dragulaModel"],[1,"row","mb-4"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"ngClass","dragula","dragulaModel"],[1,"col-md-12","d-flex","flex-wrap","noselect",3,"dragula","dragulaModel"],[1,"col-md-12"],[1,"primary-text","drag-handle","room-title","m-0","mb-1","mb-sm-0",3,"ngClass"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"dragulaModelChange","ngClass","dragula","dragulaModel"],[1,"accessory-box","invisible","py-0","my-0",2,"height","0"],[1,"accessory-item","accessory-tab"],[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,"mb-3","mt-0"],[1,"mb-0",3,"innerHTML"],[1,"mt-3","mb-0"]],template:function(i,n){i&1&&w(0,Me,35,47)(1,we,13,13,"div",0),i&2&&S(n.enableAccessories?0:1)},dependencies:[ee,q,ne,ie,se,me,E],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{it as AccessoriesComponent};
1
+ import{a as se}from"./chunk-JN7YT2VS.js";import{a as te,b as ie,c as ne}from"./chunk-YJ2Q2RAD.js";import{c as re}from"./chunk-CNNTXFBF.js";import"./chunk-6FHUI6EC.js";import{a as le}from"./chunk-THGDS273.js";import{m as V,n as Z,t as ee}from"./chunk-C3HWKB2Q.js";import{c as G,e as J,f as K,i as Q,l as U,m as X,z as Y}from"./chunk-WFYBML4S.js";import"./chunk-VLNYF5AS.js";import{b as ae}from"./chunk-3K4AKQIG.js";import"./chunk-ZJ3JJYIN.js";import{b as oe}from"./chunk-ZCSPADUX.js";import"./chunk-FPLWS5WP.js";import{b as E}from"./chunk-R3563DDE.js";import"./chunk-HBOWJDR5.js";import{Cc as R,Dc as $,Ec as j,Hb as C,Hc as a,Ib as w,Ic as r,Jb as S,Jc as z,Lb as P,Mb as L,Nb as N,Ob as _,Pb as s,Qb as l,Rb as f,Sb as u,Tb as b,Ub as A,Xa as W,_b as D,ab as o,bc as v,cc as H,dc as m,id as q,la as x,mb as M,qc as c,ra as y,rc as p,sa as h,sc as k,xc as T,yc as B,zc as I}from"./chunk-ULJPS3WS.js";var ce=(()=>{class t{$activeModal=x(V);dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=M({type:t,selectors:[["ng-component"]],decls:41,vars:30,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fa","fa-fw","fa-question-circle-o","primary-text",2,"font-size","75px"],[1,"ms-2"],[1,"mb-0"],[1,"ms-2","mt-2"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-end"]],template:function(i,n){i&1&&(u(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),a(5,"translate"),b(),u(6,"button",3),a(7,"translate"),H("click",function(){return n.dismissModal()}),b()(),u(8,"div",4)(9,"div",5),A(10,"i",6),b(),u(11,"h5",7),c(12),a(13,"translate"),b(),u(14,"ul",8)(15,"li"),c(16),a(17,"translate"),b(),u(18,"li"),c(19),a(20,"translate"),b()(),u(21,"h5",9),c(22),a(23,"translate"),b(),u(24,"ul",8)(25,"li"),c(26),a(27,"translate"),b(),u(28,"li"),c(29),a(30,"translate"),b(),u(31,"li"),c(32),a(33,"translate"),b()()(),u(34,"div",10),A(35,"div",11),u(36,"div",12)(37,"button",13),H("click",function(){return n.dismissModal()}),c(38),a(39,"translate"),b()(),A(40,"div",14),b()()()),i&2&&(o(4),p(r(5,10,"support.title")),o(2),C("aria-label",r(7,12,"form.button_close")),o(6),p(r(13,14,"accessories.title_accessories")),o(4),p(r(17,16,"accessories.support.acc_1")),o(3),p(r(20,18,"accessories.support.acc_2")),o(3),p(r(23,20,"accessories.title_rooms")),o(4),p(r(27,22,"accessories.support.rooms_1")),o(3),p(r(30,24,"accessories.support.rooms_2")),o(3),p(r(33,26,"accessories.support.rooms_3")),o(6),k(" ",r(39,28,"form.button_close")," "))},dependencies:[E],encapsulation:2})}return t})();var pe=()=>({standalone:!0}),de=(()=>{class t{$activeModal=x(V);roomName;dismissModal(){this.$activeModal.dismiss("Dismiss")}closeModal(e){this.$activeModal.close(e)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=M({type:t,selectors:[["ng-component"]],inputs:{roomName:"roomName"},decls:28,vars:19,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-folder-plus","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],["for","form-name",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["autocomplete","off","type","text","id","form-name","autofocus","",1,"form-control","custom-input",3,"ngModelChange","keyup.enter","ngModel","ngModelOptions"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),a(5,"translate"),l(),s(6,"button",3),a(7,"translate"),v("click",function(){return n.dismissModal()}),l()(),s(8,"div",4)(9,"div",5),f(10,"i",6),l(),s(11,"ul",7)(12,"li",8)(13,"label",9),c(14),a(15,"translate"),l(),s(16,"div",10)(17,"input",11),I("ngModelChange",function(F){return B(n.roomName,F)||(n.roomName=F),F}),v("keyup.enter",function(){return n.closeModal(n.roomName)}),l()()()()(),s(18,"div",12)(19,"div",13)(20,"button",14),v("click",function(){return n.dismissModal()}),c(21),a(22,"translate"),l()(),f(23,"div",15),s(24,"div",16)(25,"button",17),v("click",function(){return n.closeModal(n.roomName)}),c(26),a(27,"translate"),l()()()()()),i&2&&(o(4),p(r(5,8,"accessories.button_add_room")),o(2),C("aria-label",r(7,10,"form.button_close")),o(8),p(r(15,12,"accessories.room_name")),o(3),T("ngModel",n.roomName),_("ngModelOptions",R(18,pe)),o(4),k(" ",r(22,14,"form.button_close")," "),o(4),_("disabled",!n.roomName),o(),k(" ",r(27,16,"form.button_save")," "))},dependencies:[Y,X,G,J,K,U,Q,E],encapsulation:2})}return t})();var me=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275cmp=M({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(i,n){i&1&&(u(0,"div",0),A(1,"i",1),u(2,"div",2),c(3),a(4,"translate"),b()()),i&2&&(o(3),p(r(4,1,"accessories.control.drag_here")))},dependencies:[E],styles:[".accessory-box[_ngcontent-%COMP%]{opacity:.2}"]})}return t})();var ue=(t,g)=>({"fa-eye":t,"fa-eye-slash":g}),_e=t=>({"cursor-move":t}),be=t=>({"justify-content-between":t}),fe=t=>({link:t});function ge(t,g){if(t&1&&(s(0,"div",0)(1,"div",19)(2,"h5",20),c(3),a(4,"translate"),l()()()),t&2){let e=m().$implicit,i=m(2);o(2),_("ngClass",$(4,_e,!i.isMobile)),o(),k(" ",e.name==="Default Room"?r(4,2,"accessories.control.default_room"):e.name," ")}}function ve(t,g){if(t&1&&(s(0,"div",23),f(1,"app-accessory-tile",24),l()),t&2){let e=m().$implicit;o(),_("service",e)}}function xe(t,g){if(t&1&&w(0,ve,2,1,"div",23),t&2){let e=g.$implicit,i=m(4);S(!i.hideHidden||!e.hidden?0:-1)}}function Ce(t,g){if(t&1){let e=D();s(0,"div",21),I("dragulaModelChange",function(n){y(e);let d=m().$implicit;return B(d.services,n)||(d.services=n),h(n)}),L(1,xe,1,1,null,null,P),f(3,"div",22)(4,"div",22)(5,"div",22)(6,"div",22)(7,"div",22)(8,"div",22)(9,"div",22)(10,"div",22)(11,"div",22)(12,"div",22),l()}if(t&2){let e=m().$implicit,i=m(2);_("ngClass",$(3,be,i.isMobile))("dragula","services-bag"),T("dragulaModel",e.services),o(),N(e.services)}}function ye(t,g){if(t&1){let e=D();s(0,"div",25),I("dragulaModelChange",function(n){y(e);let d=m().$implicit;return B(d.services,n)||(d.services=n),h(n)}),f(1,"app-drag-here-placeholder",26),l()}if(t&2){let e=m().$implicit;_("dragula","services-bag"),T("dragulaModel",e.services)}}function he(t,g){if(t&1&&(s(0,"div"),w(1,ge,5,6,"div",0),s(2,"div",16),w(3,Ce,13,5,"div",17),w(4,ye,2,2,"div",18),l()()),t&2){let e=g.$implicit,i=m(2);o(),S(!i.isMobile||e.services.length?1:-1),o(2),S(e.services.length?3:-1),o(),S(!e.services.length&&!i.isMobile?4:-1)}}function Me(t,g){if(t&1){let e=D();s(0,"div",1)(1,"div",2)(2,"h3",3),c(3),a(4,"translate"),l()(),s(5,"div",4)(6,"button",5),a(7,"translate"),v("click",function(){y(e);let n=m();return h(n.openSupport())}),f(8,"i",6),l()(),s(9,"div",7)(10,"button",8),a(11,"translate"),a(12,"translate"),v("click",function(){y(e);let n=m();return h(n.addRoom())}),f(13,"i",9),l(),s(14,"button",8),a(15,"translate"),a(16,"translate"),a(17,"translate"),a(18,"translate"),v("click",function(){y(e);let n=m();return h(n.hideHidden=!n.hideHidden)}),f(19,"i",10),l(),s(20,"div",11)(21,"button",12),a(22,"translate"),a(23,"translate"),v("click",function(){y(e);let n=m();return h(n.toggleLayoutLock())}),f(24,"i",13),l(),s(25,"button",12),a(26,"translate"),a(27,"translate"),v("click",function(){y(e);let n=m();return h(n.toggleLayoutLock())}),f(28,"i",14),l()(),s(29,"button",5),a(30,"translate"),v("click",function(){y(e);let n=m();return h(n.openSupport())}),f(31,"i",6),l()()(),s(32,"div",15),I("dragulaModelChange",function(n){y(e);let d=m();return B(d.$accessories.rooms,n)||(d.$accessories.rooms=n),h(n)}),L(33,he,5,3,"div",null,P),l()}if(t&2){let e=m();o(3),p(r(4,18,"accessories.title_accessories")),o(3),C("aria-label",r(7,20,"support.title")),o(4),_("hidden",e.isMobile)("ngbTooltip",r(11,22,"accessories.button_add_room")),C("aria-label",r(12,24,"accessories.button_add_room")),o(4),_("hidden",e.isMobile)("ngbTooltip",e.hideHidden?r(15,26,"accessories.button_hidden_show"):r(16,28,"accessories.button_hidden_hide")),C("aria-label",e.hideHidden?r(17,30,"accessories.button_hidden_show"):r(18,32,"accessories.button_hidden_hide")),o(5),_("ngClass",j(44,ue,!e.hideHidden,e.hideHidden)),o(2),_("disabled",!e.isMobile)("ngbTooltip",r(22,34,"form.button_unlock")),C("aria-label",r(23,36,"form.button_unlock")),o(4),_("disabled",e.isMobile)("ngbTooltip",r(26,38,"form.button_lock")),C("aria-label",r(27,40,"form.button_lock")),o(4),C("aria-label",r(30,42,"support.title")),o(3),_("dragula","rooms-bag"),T("dragulaModel",e.$accessories.rooms),o(),N(e.$accessories.rooms)}}function Ee(t,g){t&1&&(s(0,"p",33),c(1),a(2,"translate"),l()),t&2&&(o(),p(r(2,1,"accessories.settings_link")))}function we(t,g){if(t&1&&(s(0,"div",0)(1,"div",27)(2,"h3",28),c(3),a(4,"translate"),l()(),s(5,"div",29)(6,"div",30)(7,"h5",31),c(8),a(9,"translate"),l(),f(10,"p",32),a(11,"translate"),w(12,Ee,3,3,"p",33),l()()()),t&2){let e=m();o(3),p(r(4,4,"accessories.title_accessories")),o(5),p(r(9,6,"accessories.control_disabled")),o(2),_("innerHTML",z(11,8,"accessories.message_must_use_insecure_mode",$(11,fe,e.linkInsecure)),W),o(2),S(e.isAdmin?12:-1)}}var it=(()=>{class t{$accessories=x(re);$auth=x(ae);dragulaService=x(te);$modal=x(Z);$settings=x(oe);$md=x(le);orderSubscription;isAdmin=this.$auth.user.admin;enableAccessories=this.$settings.env.enableAccessories;isMobile=!1;hideHidden=!0;linkInsecure='<a href="https://github.com/homebridge/homebridge-config-ui-x/wiki/Enabling-Accessory-Control" target="_blank"><i class="fa fa-fw fa-external-link-alt primary-text"></i></a>';constructor(){let e=this.dragulaService;this.isMobile=this.$md.detect.mobile(),e.createGroup("rooms-bag",{moves:(i,n,d)=>!this.isMobile&&d.classList.contains("drag-handle")}),e.createGroup("services-bag",{moves:i=>!this.isMobile&&!i.classList.contains("no-drag")}),this.orderSubscription=e.drop().subscribe(()=>{setTimeout(()=>{this.$accessories.saveLayout()})}),this.isMobile=!0}ngOnInit(){this.$accessories.start()}addRoom(){this.$modal.open(de,{size:"lg",backdrop:"static"}).result.then(e=>{!e||!e.length||this.$accessories.rooms.find(i=>i.name===e)||(this.$accessories.rooms.push({name:e,services:[]}),this.isMobile&&this.toggleLayoutLock())}).catch(()=>{})}toggleLayoutLock(){this.isMobile=!this.isMobile,this.isMobile?document.querySelectorAll(".services-bag").forEach(i=>{for(let n=0;n<10;n++){let d=document.createElement("div");d.className="accessory-box invisible py-0 my-0",d.style.height="0",i.appendChild(d)}}):document.querySelectorAll(".invisible").forEach(i=>i.remove())}openSupport(){this.$modal.open(ce,{size:"lg",backdrop:"static"})}ngOnDestroy(){this.$accessories.stop(),this.orderSubscription.unsubscribe(),this.dragulaService.destroy("rooms-bag"),this.dragulaService.destroy("services-bag")}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=M({type:t,selectors:[["app-accessories"]],decls:2,vars:1,consts:[[1,"row"],[1,"row","mb-3"],[1,"col-9","col-sm-6"],[1,"primary-text","m-0"],[1,"col-3","col-sm-6","text-end","d-inline-block","d-sm-none"],["type","button",1,"btn","btn-elegant","my-0","me-0",3,"click"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"col-3","col-sm-6","text-end","d-none","d-sm-inline-block"],["type","button","container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","hidden","ngbTooltip"],[1,"fas","fa-fw","fa-folder-plus"],[1,"fas","fa-fw",3,"ngClass"],["role","group",1,"btn-group","me-2"],["type","button","container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-unlock"],[1,"fas","fa-fw","fa-lock"],[3,"dragulaModelChange","dragula","dragulaModel"],[1,"row","mb-4"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"ngClass","dragula","dragulaModel"],[1,"col-md-12","d-flex","flex-wrap","noselect",3,"dragula","dragulaModel"],[1,"col-md-12"],[1,"primary-text","drag-handle","room-title","m-0","mb-1","mb-sm-0",3,"ngClass"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"dragulaModelChange","ngClass","dragula","dragulaModel"],[1,"accessory-box","invisible","py-0","my-0",2,"height","0"],[1,"accessory-item","accessory-tab"],[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,"mb-3","mt-0"],[1,"mb-0",3,"innerHTML"],[1,"mt-3","mb-0"]],template:function(i,n){i&1&&w(0,Me,35,47)(1,we,13,13,"div",0),i&2&&S(n.enableAccessories?0:1)},dependencies:[ee,q,ne,ie,se,me,E],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{it as AccessoriesComponent};
@@ -1 +1 @@
1
- import{g as r}from"./chunk-GEIS2BWE.js";import"./chunk-Q4CZ7LVK.js";import{ha as o,nb as e}from"./chunk-ULJPS3WS.js";var l=[{path:"",loadComponent:()=>import("./chunk-HOWJDZVR.js").then(t=>t.TerminalComponent)}],n=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[r.forChild(l),r]})}return t})();var p=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[n]})}return t})();export{p as TerminalModule};
1
+ import{g as r}from"./chunk-ZJ3JJYIN.js";import"./chunk-HBOWJDR5.js";import{ha as o,nb as e}from"./chunk-ULJPS3WS.js";var l=[{path:"",loadComponent:()=>import("./chunk-A3GG65TX.js").then(t=>t.TerminalComponent)}],n=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[r.forChild(l),r]})}return t})();var p=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[n]})}return t})();export{p as TerminalModule};
@@ -0,0 +1 @@
1
+ import{a as n}from"./chunk-7BGQ3WIH.js";import"./chunk-4G62IPBL.js";import"./chunk-JHPEPG44.js";import"./chunk-HUAADM2I.js";import"./chunk-THGDS273.js";import"./chunk-3WACEBJM.js";import"./chunk-BG5MCCBU.js";import"./chunk-QIOCGI3G.js";import"./chunk-EI76KND2.js";import"./chunk-YJWU65EW.js";import"./chunk-CHYWVK3W.js";import"./chunk-C3HWKB2Q.js";import"./chunk-WFYBML4S.js";import"./chunk-VLNYF5AS.js";import"./chunk-3K4AKQIG.js";import{g as r}from"./chunk-ZJ3JJYIN.js";import"./chunk-ZCSPADUX.js";import"./chunk-FPLWS5WP.js";import"./chunk-R3563DDE.js";import"./chunk-HBOWJDR5.js";import{ha as t,nb as i}from"./chunk-ULJPS3WS.js";var l=[{path:"",loadComponent:()=>import("./chunk-PQR6HK2C.js").then(o=>o.PluginsComponent)}],u=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=i({type:o});static \u0275inj=t({imports:[r.forChild(l),r]})}return o})();var f=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=i({type:o});static \u0275inj=t({imports:[n,u]})}return o})();export{f as PluginsModule};
@@ -1 +1 @@
1
- import{m as J}from"./chunk-C3HWKB2Q.js";import{e as O,l as W,r as z,s as q,t as G,z as H}from"./chunk-WFYBML4S.js";import{d as Y}from"./chunk-GEIS2BWE.js";import{k as X,n as Z}from"./chunk-IJVDEEEM.js";import{a as K,b as Q}from"./chunk-R3563DDE.js";import{Ec as N,Fc as P,Hb as A,Hc as m,Ib as _,Ic as p,Jb as u,Lb as k,Mb as E,Nb as $,Ob as C,Pb as o,Qb as a,Rb as w,_b as B,a as T,ab as s,b as R,bc as b,dc as d,h as M,id as j,la as y,mb as D,qc as c,ra as f,rc as g,sa as v,sc as h,tc as V,w as S,xc as F,yc as U,zc as L}from"./chunk-ULJPS3WS.js";var te=(t,l)=>({"btn-danger":t,"btn-elegant":l}),ie=(t,l,e)=>({"fa-trash":t,"fa-undo":l,"fa-spinner fa-pulse":e});function ne(t,l){t&1&&(o(0,"div",12),w(1,"i",13),a(),o(2,"p",14),c(3),m(4,"translate"),a()),t&2&&(s(3),g(p(4,1,"reset.no_accessories")))}function se(t,l){if(t&1&&(o(0,"option",24),c(1),a()),t&2){let e=l.$implicit;C("value",e._id),s(),V("",e.name," (",e._username,")")}}function oe(t,l){if(t&1){let e=B();o(0,"li",20),c(1),m(2,"translate"),a(),o(3,"li",18)(4,"label",21),c(5),m(6,"translate"),a(),o(7,"div",22)(8,"select",23),L("ngModelChange",function(i){f(e);let r=d(2);return U(r.selectedBridge,i)||(r.selectedBridge=i),v(i)}),b("change",function(i){f(e);let r=d(2);return v(r.onBridgeChange(i.target.value))}),E(9,se,2,3,"option",24,k),a()()()}if(t&2){let e=d(2);s(),g(p(2,3,"form.label.changes_kept")),s(4),g(p(6,5,"reset.accessory_ind.bridge")),s(3),F("ngModel",e.selectedBridge),s(),$(e.pairings)}}function ae(t,l){if(t&1&&(o(0,"li",18)(1,"label",25),c(2),m(3,"translate"),a(),o(4,"div",26),c(5),a()()),t&2){let e=d(2);s(2),g(p(3,2,"reset.accessory_ind.bridge")),s(3),h(" ",e.getCurrentlySelectedBridge()," ")}}function re(t,l){if(t&1){let e=B();o(0,"li",19)(1,"span"),c(2),w(3,"br"),o(4,"small")(5,"span",27),c(6),a()()(),o(7,"button",28),m(8,"translate"),b("click",function(){let i=f(e).$implicit,r=d(2);return v(r.toggleList(i.UUID,i.$cacheFile))}),w(9,"i",29),a()()}if(t&2){let e=l.$implicit,n=d(2);s(2),h(" ",e.displayName),s(4),g(e.UUID),s(),C("disabled",n.clicked)("ngClass",N(8,te,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile))),A("aria-label",p(8,6,"form.button_delete")),s(2),C("ngClass",P(11,ie,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile)&&!n.clicked,n.isInList(e.UUID,e.$cacheFile)&&n.clicked))}}function le(t,l){if(t&1&&(o(0,"div",12),w(1,"i",15),a(),o(2,"ul",16)(3,"li"),c(4),m(5,"translate"),a(),o(6,"li"),c(7),m(8,"translate"),a(),o(9,"li"),c(10),m(11,"translate"),a()(),o(12,"ul",17),_(13,oe,11,7),_(14,ae,6,4,"li",18),E(15,re,10,15,"li",19,k),a()),t&2){let e=d();s(4),g(p(5,5,"reset.accessory_ind.list_1")),s(3),g(p(8,7,"reset.accessory_ind.list_2")),s(3),g(p(11,9,"reset.accessory_ind.list_3")),s(3),u(e.pairings.length>1?13:-1),s(),u(e.pairings.length===1?14:-1),s(),$(e.selectedBridgeAccessories)}}function ce(t,l){if(t&1){let e=B();o(0,"button",30),b("click",function(){f(e);let i=d();return v(i.dismissModal())}),c(1),m(2,"translate"),a()}if(t&2){let e=d();C("disabled",e.clicked),s(),h(" ",p(2,2,"form.button_close")," ")}}function de(t,l){if(t&1){let e=B();o(0,"button",31),b("click",function(){f(e);let i=d();return v(i.dismissModal())}),c(1),m(2,"translate"),a()}t&2&&(s(),h(" ",p(2,1,"form.button_close")," "))}function me(t,l){if(t&1&&c(0),t&2){let e=d(3);h(" (",e.toDelete.length,") ")}}function pe(t,l){if(t&1&&(c(0),m(1,"translate"),_(2,me,1,1)),t&2){let e=d(2);h(" ",p(1,2,"form.button_remove")," "),s(2),u(e.toDelete.length>0?2:-1)}}function _e(t,l){t&1&&w(0,"i",33)}function ue(t,l){if(t&1){let e=B();o(0,"button",32),b("click",function(){f(e);let i=d();return v(i.removeAccessories())}),_(1,pe,3,4),_(2,_e,1,0,"i",33),a()}if(t&2){let e=d();C("disabled",!e.toDelete.length||e.clicked),s(),u(e.clicked?-1:1),s(),u(e.clicked?2:-1)}}var ke=(()=>{class t{$activeModal=y(J);$api=y(Z);$router=y(Y);$toastr=y(X);$translate=y(K);selectedBridge="";pairings=[];clicked=!1;selectedBridgeAccessories=[];accessoriesExist=!1;toDelete=[];ngOnInit(){this.loadCachedAccessories()}onBridgeChange(e){this.selectedBridge=e,this.selectedBridgeAccessories=this.pairings.find(n=>n._id===this.selectedBridge)?.accessories}getCurrentlySelectedBridge(){let e=this.pairings.find(n=>n._id===this.selectedBridge);return`${e.name} - ${e._username}`}toggleList(e,n){this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)?this.toDelete=this.toDelete.filter(i=>i.uuid!==e||i.cacheFile!==n):this.toDelete.push({cacheFile:n,uuid:e})}isInList(e,n){return this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)}removeAccessories(){return this.clicked=!0,this.$api.delete("/server/cached-accessories",{body:this.toDelete}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.accessory_ind.fail"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}loadCachedAccessories(){return M(this,null,function*(){try{let[e,n]=yield Promise.all([S(this.$api.get("/server/cached-accessories")),S(this.$api.get("/server/pairings"))]),i=new Map(n.map(r=>[r._id,R(T({},r),{accessories:[]})]));e.sort((r,x)=>r.displayName.localeCompare(x.displayName)).forEach(r=>{let x=n.find(ee=>ee._main),I=r.$cacheFile?.split(".")?.[1]||x._id;(!this.selectedBridge||this.selectedBridge===I)&&(i.has(I)||i.set(I,{_id:I,_username:I.match(/.{1,2}/g).join(":"),name:this.$translate.instant("reset.accessory_ind.unknown"),accessories:[]}),i.get(I).accessories.push(r))}),this.pairings=Array.from(i.values()).filter(r=>r.accessories.length>0).sort((r,x)=>r._main&&!x._main?-1:!r._main&&x._main?1:r.name.localeCompare(x.name)),this.selectedBridge=this.selectedBridge||this.pairings[0]?._id,this.selectedBridge&&(this.accessoriesExist=!0,this.selectedBridgeAccessories=this.pairings[0].accessories)}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("reset.error_message"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=D({type:t,selectors:[["ng-component"]],inputs:{selectedBridge:"selectedBridge"},decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-fw","fa-network-wired","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"list-group-item","text-center","grey-text","small"],["for","bridgeSelect",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["id","bridgeSelect",1,"custom-select",3,"ngModelChange","change","ngModel"],[3,"value"],[1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50","grey-text","font-monospace"],[1,"font-monospace","grey-text"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas","fa-fw",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(n,i){n&1&&(o(0,"div",0)(1,"div",1)(2,"h5",2),c(3),m(4,"translate"),a(),o(5,"button",3),m(6,"translate"),b("click",function(){return i.dismissModal()}),a()(),o(7,"div",4),_(8,ne,5,3),_(9,le,17,11),a(),o(10,"div",5)(11,"div",6),_(12,ce,3,4,"button",7),a(),o(13,"div",8),_(14,de,3,3,"button",9),a(),o(15,"div",10),_(16,ue,3,3,"button",11),a()()()),n&2&&(s(3),g(p(4,8,"reset.accessory_ind.title")),s(2),C("disabled",i.clicked),A("aria-label",p(6,10,"form.button_close")),s(3),u(i.accessoriesExist?-1:8),s(),u(i.accessoriesExist?9:-1),s(3),u(i.accessoriesExist?12:-1),s(2),u(i.accessoriesExist?-1:14),s(2),u(i.accessoriesExist?16:-1))},dependencies:[j,H,q,G,z,O,W,Q],encapsulation:2})}return t})();export{ke as a};
1
+ import{m as J}from"./chunk-C3HWKB2Q.js";import{e as O,l as W,r as z,s as q,t as G,z as H}from"./chunk-WFYBML4S.js";import{d as Y}from"./chunk-ZJ3JJYIN.js";import{k as X,n as Z}from"./chunk-FPLWS5WP.js";import{a as K,b as Q}from"./chunk-R3563DDE.js";import{Ec as N,Fc as P,Hb as A,Hc as m,Ib as _,Ic as p,Jb as u,Lb as k,Mb as E,Nb as $,Ob as C,Pb as o,Qb as a,Rb as w,_b as B,a as T,ab as s,b as R,bc as b,dc as d,h as M,id as j,la as y,mb as D,qc as c,ra as f,rc as g,sa as v,sc as h,tc as V,w as S,xc as F,yc as U,zc as L}from"./chunk-ULJPS3WS.js";var te=(t,l)=>({"btn-danger":t,"btn-elegant":l}),ie=(t,l,e)=>({"fa-trash":t,"fa-undo":l,"fa-spinner fa-pulse":e});function ne(t,l){t&1&&(o(0,"div",12),w(1,"i",13),a(),o(2,"p",14),c(3),m(4,"translate"),a()),t&2&&(s(3),g(p(4,1,"reset.no_accessories")))}function se(t,l){if(t&1&&(o(0,"option",24),c(1),a()),t&2){let e=l.$implicit;C("value",e._id),s(),V("",e.name," (",e._username,")")}}function oe(t,l){if(t&1){let e=B();o(0,"li",20),c(1),m(2,"translate"),a(),o(3,"li",18)(4,"label",21),c(5),m(6,"translate"),a(),o(7,"div",22)(8,"select",23),L("ngModelChange",function(i){f(e);let r=d(2);return U(r.selectedBridge,i)||(r.selectedBridge=i),v(i)}),b("change",function(i){f(e);let r=d(2);return v(r.onBridgeChange(i.target.value))}),E(9,se,2,3,"option",24,k),a()()()}if(t&2){let e=d(2);s(),g(p(2,3,"form.label.changes_kept")),s(4),g(p(6,5,"reset.accessory_ind.bridge")),s(3),F("ngModel",e.selectedBridge),s(),$(e.pairings)}}function ae(t,l){if(t&1&&(o(0,"li",18)(1,"label",25),c(2),m(3,"translate"),a(),o(4,"div",26),c(5),a()()),t&2){let e=d(2);s(2),g(p(3,2,"reset.accessory_ind.bridge")),s(3),h(" ",e.getCurrentlySelectedBridge()," ")}}function re(t,l){if(t&1){let e=B();o(0,"li",19)(1,"span"),c(2),w(3,"br"),o(4,"small")(5,"span",27),c(6),a()()(),o(7,"button",28),m(8,"translate"),b("click",function(){let i=f(e).$implicit,r=d(2);return v(r.toggleList(i.UUID,i.$cacheFile))}),w(9,"i",29),a()()}if(t&2){let e=l.$implicit,n=d(2);s(2),h(" ",e.displayName),s(4),g(e.UUID),s(),C("disabled",n.clicked)("ngClass",N(8,te,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile))),A("aria-label",p(8,6,"form.button_delete")),s(2),C("ngClass",P(11,ie,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile)&&!n.clicked,n.isInList(e.UUID,e.$cacheFile)&&n.clicked))}}function le(t,l){if(t&1&&(o(0,"div",12),w(1,"i",15),a(),o(2,"ul",16)(3,"li"),c(4),m(5,"translate"),a(),o(6,"li"),c(7),m(8,"translate"),a(),o(9,"li"),c(10),m(11,"translate"),a()(),o(12,"ul",17),_(13,oe,11,7),_(14,ae,6,4,"li",18),E(15,re,10,15,"li",19,k),a()),t&2){let e=d();s(4),g(p(5,5,"reset.accessory_ind.list_1")),s(3),g(p(8,7,"reset.accessory_ind.list_2")),s(3),g(p(11,9,"reset.accessory_ind.list_3")),s(3),u(e.pairings.length>1?13:-1),s(),u(e.pairings.length===1?14:-1),s(),$(e.selectedBridgeAccessories)}}function ce(t,l){if(t&1){let e=B();o(0,"button",30),b("click",function(){f(e);let i=d();return v(i.dismissModal())}),c(1),m(2,"translate"),a()}if(t&2){let e=d();C("disabled",e.clicked),s(),h(" ",p(2,2,"form.button_close")," ")}}function de(t,l){if(t&1){let e=B();o(0,"button",31),b("click",function(){f(e);let i=d();return v(i.dismissModal())}),c(1),m(2,"translate"),a()}t&2&&(s(),h(" ",p(2,1,"form.button_close")," "))}function me(t,l){if(t&1&&c(0),t&2){let e=d(3);h(" (",e.toDelete.length,") ")}}function pe(t,l){if(t&1&&(c(0),m(1,"translate"),_(2,me,1,1)),t&2){let e=d(2);h(" ",p(1,2,"form.button_remove")," "),s(2),u(e.toDelete.length>0?2:-1)}}function _e(t,l){t&1&&w(0,"i",33)}function ue(t,l){if(t&1){let e=B();o(0,"button",32),b("click",function(){f(e);let i=d();return v(i.removeAccessories())}),_(1,pe,3,4),_(2,_e,1,0,"i",33),a()}if(t&2){let e=d();C("disabled",!e.toDelete.length||e.clicked),s(),u(e.clicked?-1:1),s(),u(e.clicked?2:-1)}}var ke=(()=>{class t{$activeModal=y(J);$api=y(Z);$router=y(Y);$toastr=y(X);$translate=y(K);selectedBridge="";pairings=[];clicked=!1;selectedBridgeAccessories=[];accessoriesExist=!1;toDelete=[];ngOnInit(){this.loadCachedAccessories()}onBridgeChange(e){this.selectedBridge=e,this.selectedBridgeAccessories=this.pairings.find(n=>n._id===this.selectedBridge)?.accessories}getCurrentlySelectedBridge(){let e=this.pairings.find(n=>n._id===this.selectedBridge);return`${e.name} - ${e._username}`}toggleList(e,n){this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)?this.toDelete=this.toDelete.filter(i=>i.uuid!==e||i.cacheFile!==n):this.toDelete.push({cacheFile:n,uuid:e})}isInList(e,n){return this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)}removeAccessories(){return this.clicked=!0,this.$api.delete("/server/cached-accessories",{body:this.toDelete}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.accessory_ind.fail"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}loadCachedAccessories(){return M(this,null,function*(){try{let[e,n]=yield Promise.all([S(this.$api.get("/server/cached-accessories")),S(this.$api.get("/server/pairings"))]),i=new Map(n.map(r=>[r._id,R(T({},r),{accessories:[]})]));e.sort((r,x)=>r.displayName.localeCompare(x.displayName)).forEach(r=>{let x=n.find(ee=>ee._main),I=r.$cacheFile?.split(".")?.[1]||x._id;(!this.selectedBridge||this.selectedBridge===I)&&(i.has(I)||i.set(I,{_id:I,_username:I.match(/.{1,2}/g).join(":"),name:this.$translate.instant("reset.accessory_ind.unknown"),accessories:[]}),i.get(I).accessories.push(r))}),this.pairings=Array.from(i.values()).filter(r=>r.accessories.length>0).sort((r,x)=>r._main&&!x._main?-1:!r._main&&x._main?1:r.name.localeCompare(x.name)),this.selectedBridge=this.selectedBridge||this.pairings[0]?._id,this.selectedBridge&&(this.accessoriesExist=!0,this.selectedBridgeAccessories=this.pairings[0].accessories)}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("reset.error_message"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=D({type:t,selectors:[["ng-component"]],inputs:{selectedBridge:"selectedBridge"},decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-fw","fa-network-wired","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"list-group-item","text-center","grey-text","small"],["for","bridgeSelect",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["id","bridgeSelect",1,"custom-select",3,"ngModelChange","change","ngModel"],[3,"value"],[1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50","grey-text","font-monospace"],[1,"font-monospace","grey-text"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas","fa-fw",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(n,i){n&1&&(o(0,"div",0)(1,"div",1)(2,"h5",2),c(3),m(4,"translate"),a(),o(5,"button",3),m(6,"translate"),b("click",function(){return i.dismissModal()}),a()(),o(7,"div",4),_(8,ne,5,3),_(9,le,17,11),a(),o(10,"div",5)(11,"div",6),_(12,ce,3,4,"button",7),a(),o(13,"div",8),_(14,de,3,3,"button",9),a(),o(15,"div",10),_(16,ue,3,3,"button",11),a()()()),n&2&&(s(3),g(p(4,8,"reset.accessory_ind.title")),s(2),C("disabled",i.clicked),A("aria-label",p(6,10,"form.button_close")),s(3),u(i.accessoriesExist?-1:8),s(),u(i.accessoriesExist?9:-1),s(3),u(i.accessoriesExist?12:-1),s(2),u(i.accessoriesExist?-1:14),s(2),u(i.accessoriesExist?16:-1))},dependencies:[j,H,q,G,z,O,W,Q],encapsulation:2})}return t})();export{ke as a};
@@ -1 +1 @@
1
- import{d as n}from"./chunk-GEIS2BWE.js";import{b as s}from"./chunk-4AJSXM5Z.js";import{ga as o,h as r,la as e,w as i}from"./chunk-ULJPS3WS.js";var l=(()=>{class t{$router=e(n);$settings=e(s);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};
1
+ import{d as n}from"./chunk-ZJ3JJYIN.js";import{b as s}from"./chunk-ZCSPADUX.js";import{ga as o,h as r,la as e,w as i}from"./chunk-ULJPS3WS.js";var l=(()=>{class t{$router=e(n);$settings=e(s);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};
@@ -1 +1 @@
1
- import{b as s}from"./chunk-2CKLKY5R.js";import{d as i}from"./chunk-GEIS2BWE.js";import{k as o}from"./chunk-IJVDEEEM.js";import{a}from"./chunk-R3563DDE.js";import{ga as e,la as r}from"./chunk-ULJPS3WS.js";var v=(()=>{class t{$auth=r(s);$router=r(i);$translate=r(a);$toastr=r(o);canActivate(){return this.$auth.user&&this.$auth.user.admin?!0:(this.$toastr.error(this.$translate.instant("toast.no_auth"),this.$translate.instant("toast.title_error")),this.$router.navigate(["/"]),!1)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=e({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{v as a};
1
+ import{b as s}from"./chunk-3K4AKQIG.js";import{d as i}from"./chunk-ZJ3JJYIN.js";import{k as o}from"./chunk-FPLWS5WP.js";import{a}from"./chunk-R3563DDE.js";import{ga as e,la as r}from"./chunk-ULJPS3WS.js";var v=(()=>{class t{$auth=r(s);$router=r(i);$translate=r(a);$toastr=r(o);canActivate(){return this.$auth.user&&this.$auth.user.admin?!0:(this.$toastr.error(this.$translate.instant("toast.no_auth"),this.$translate.instant("toast.title_error")),this.$router.navigate(["/"]),!1)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=e({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{v as a};