homebridge-config-ui-x 5.4.0 → 5.4.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 (88) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/public/assets/service-icons/lock-mechanism.svg +39 -0
  4. package/public/assets/service-icons/security-system.svg +19 -0
  5. package/public/assets/service-icons/stateless-programmable-switch.svg +18 -0
  6. package/public/{chunk-M4QDQWSG.js → chunk-2C3X2ESN.js} +1 -1
  7. package/public/{chunk-R6KN5Y43.js → chunk-35BDVMXT.js} +1 -1
  8. package/public/{chunk-DCEE4BJT.js → chunk-3OME364T.js} +1 -1
  9. package/public/{chunk-HSAZV5QQ.js → chunk-456YQDZE.js} +1 -1
  10. package/public/{chunk-Z6DMMN6D.js → chunk-4VNWFSVF.js} +1 -1
  11. package/public/{chunk-ZO74PVYQ.js → chunk-4YR5OZ4C.js} +1 -1
  12. package/public/{chunk-2HZOWWRB.js → chunk-55LUVZFF.js} +1 -1
  13. package/public/{chunk-EQHN6CPG.js → chunk-5E4D6S2D.js} +1 -1
  14. package/public/{chunk-LJDW32KF.js → chunk-5Y2EPIYU.js} +1 -1
  15. package/public/{chunk-VRXR6ACJ.js → chunk-6FRCST3C.js} +1 -1
  16. package/public/{chunk-UFFQKHXE.js → chunk-6GQ5ZIPG.js} +1 -1
  17. package/public/{chunk-3WCZQYFM.js → chunk-6OU4B2KU.js} +1 -1
  18. package/public/{chunk-KYB236MX.js → chunk-7EQFLCW4.js} +1 -1
  19. package/public/chunk-7JVGNBY4.js +4 -0
  20. package/public/{chunk-FG5QICVJ.js → chunk-AM2JSGK5.js} +1 -1
  21. package/public/{chunk-U52WKM74.js → chunk-B3FSLPDD.js} +1 -1
  22. package/public/{chunk-6BITWEO6.js → chunk-B6AIZYQG.js} +1 -1
  23. package/public/{chunk-U4UZ4WQX.js → chunk-BEVTMKNJ.js} +1 -1
  24. package/public/{chunk-OW6LBBVH.js → chunk-CK5XMPJ4.js} +1 -1
  25. package/public/{chunk-HO4UVRDI.js → chunk-CMOVUX6R.js} +1 -1
  26. package/public/chunk-CULSHD5J.js +1 -0
  27. package/public/{chunk-3QBYXJ7T.js → chunk-D7VCPH6W.js} +1 -1
  28. package/public/{chunk-FIQUQJTU.js → chunk-DAIFVJBL.js} +1 -1
  29. package/public/{chunk-6HJHVJPI.js → chunk-DFFTJVRY.js} +1 -1
  30. package/public/{chunk-4I4YTNGD.js → chunk-E3ZSNO44.js} +1 -1
  31. package/public/{chunk-OSQ37ZQY.js → chunk-FBX4J2EQ.js} +1 -1
  32. package/public/{chunk-HHGB2T2Q.js → chunk-FVKMBZOU.js} +1 -1
  33. package/public/{chunk-ULWO2VVV.js → chunk-FXJWZ2UF.js} +1 -1
  34. package/public/{chunk-EKINPADV.js → chunk-GTAQOU3Z.js} +1 -1
  35. package/public/{chunk-DYB33NRF.js → chunk-H45DK7IX.js} +1 -1
  36. package/public/{chunk-V35TPDVW.js → chunk-H5WTK5UT.js} +1 -1
  37. package/public/{chunk-PPSFRNJC.js → chunk-HWAWBYVQ.js} +1 -1
  38. package/public/{chunk-V7OQR5Y4.js → chunk-HY6Q4MXH.js} +1 -1
  39. package/public/{chunk-73PB5ERF.js → chunk-I3UMQM3H.js} +1 -1
  40. package/public/chunk-IOKYXV5M.js +4 -0
  41. package/public/{chunk-FYI7RHOJ.js → chunk-IWFKJHPR.js} +1 -1
  42. package/public/{chunk-G6KV6PYE.js → chunk-J6CJ26QN.js} +1 -1
  43. package/public/{chunk-BQ7Q4FRF.js → chunk-JA44CSV7.js} +1 -1
  44. package/public/{chunk-FKZEDXUZ.js → chunk-K6JE5A5X.js} +1 -1
  45. package/public/{chunk-FYDO54CR.js → chunk-KZKL7DGI.js} +1 -1
  46. package/public/chunk-L5C2GJ7H.js +1 -0
  47. package/public/{chunk-QZWC7RP4.js → chunk-L6O2N56G.js} +1 -1
  48. package/public/{chunk-QM6QRTMV.js → chunk-MLA7ZCAV.js} +1 -1
  49. package/public/{chunk-TOI5IERI.js → chunk-MU2FLMKI.js} +1 -1
  50. package/public/{chunk-4A6F5427.js → chunk-MU2XMQD5.js} +1 -1
  51. package/public/{chunk-BLNEXUND.js → chunk-NMCVKK7Z.js} +1 -1
  52. package/public/{chunk-KLQ6BEKS.js → chunk-OA7Y3E5A.js} +1 -1
  53. package/public/{chunk-F6NZALU5.js → chunk-OBRUATIF.js} +1 -1
  54. package/public/{chunk-QL5UNVZO.js → chunk-OFHFS7MH.js} +1 -1
  55. package/public/{chunk-2TDOLECC.js → chunk-P3XUWDKC.js} +1 -1
  56. package/public/{chunk-VJOMQ46T.js → chunk-PI6E53UZ.js} +1 -1
  57. package/public/{chunk-5FOJUOIT.js → chunk-Q4NOFQ62.js} +1 -1
  58. package/public/{chunk-RZ4UMDVF.js → chunk-QX6BFGHZ.js} +1 -1
  59. package/public/{chunk-7NWB7MN6.js → chunk-R4ORTLQR.js} +1 -1
  60. package/public/{chunk-3L7PIOD5.js → chunk-ROGBVSML.js} +1 -1
  61. package/public/{chunk-7M4GTFPB.js → chunk-RPBVH6RL.js} +1 -1
  62. package/public/{chunk-GNULJZ2P.js → chunk-SANRE7BE.js} +1 -1
  63. package/public/chunk-V45NZ75A.js +12 -0
  64. package/public/{chunk-3JNJJOX6.js → chunk-V6JVOQNN.js} +1 -1
  65. package/public/{chunk-WG533VX7.js → chunk-VKXTOURK.js} +1 -1
  66. package/public/chunk-VWRFXUM2.js +1 -0
  67. package/public/{chunk-IAVKQO7M.js → chunk-W7IA26CJ.js} +1 -1
  68. package/public/{chunk-RCYYU6LQ.js → chunk-WCOLHYTR.js} +1 -1
  69. package/public/{chunk-JCYDPJQ5.js → chunk-WTDK2HE6.js} +1 -1
  70. package/public/{chunk-YPZJFK3W.js → chunk-XFUKUIRL.js} +1 -1
  71. package/public/{chunk-OMGXHYZA.js → chunk-XX775C5M.js} +1 -1
  72. package/public/{chunk-RGXCQLZU.js → chunk-Z2T4OZ7I.js} +1 -1
  73. package/public/{chunk-EZQF5CUM.js → chunk-ZUTM7S4U.js} +1 -1
  74. package/public/chunk-ZYA4AKRW.js +1 -0
  75. package/public/index.html +1 -1
  76. package/public/main-EQU6FWZV.js +1 -0
  77. package/public/assets/hap-icons/security-system-active.svg +0 -103
  78. package/public/assets/hap-icons/security-system-off.svg +0 -69
  79. package/public/assets/hap-icons/security-system-triggered.svg +0 -103
  80. package/public/assets/hap-icons/stateless-programmable-switch.svg +0 -52
  81. package/public/chunk-2ZM2CO7S.js +0 -1
  82. package/public/chunk-645YHJEQ.js +0 -4
  83. package/public/chunk-6NW4EKE6.js +0 -4
  84. package/public/chunk-BHQK7H4B.js +0 -1
  85. package/public/chunk-CLGDJPWG.js +0 -12
  86. package/public/chunk-KPOP67KE.js +0 -1
  87. package/public/chunk-O7RJ6JXM.js +0 -1
  88. package/public/main-HN6ISZGH.js +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
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.4.1 (Unreleased)
6
+
7
+ ### UI Changes
8
+
9
+ - updates to the `pl.json` language file (#2522) (@mkz212)
10
+ - refreshed icons: stateless programmable switch
11
+ - refreshed icons: security system
12
+ - refreshed icons: lock mechanism
13
+ - updates to the credits modal
14
+
15
+ ### Homebridge Dependencies
16
+
17
+ - `@homebridge/hap-client` @ `v3.1.1`
18
+ - `@homebridge/node-pty-prebuilt-multiarch` @ `v0.13.1`
19
+ - `@homebridge/plugin-ui-utils` @ `v2.1.0`
20
+
5
21
  ## v5.4.0 (2025-08-02)
6
22
 
7
23
  ### UI 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.4.0",
4
+ "version": "5.4.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",
@@ -0,0 +1,39 @@
1
+ <svg width="32px" height="32px" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
2
+ <!-- shackle, locked -->
3
+ <path
4
+ d="M8 16 C10 -4, 22 -4, 24 16"
5
+ fill="none"
6
+ stroke="#7f7f7f"
7
+ stroke-width="2"
8
+ class="shackle-locked"
9
+ stroke-linecap="round"
10
+ stroke-linejoin="round"
11
+ />
12
+
13
+ <!-- shackle, unlocked -->
14
+ <path
15
+ d="M8 16 C10 -4, 22 -1, 22 8"
16
+ fill="none"
17
+ stroke="#7f7f7f"
18
+ stroke-width="2"
19
+ class="shackle-unlocked"
20
+ stroke-linecap="round"
21
+ stroke-linejoin="round"
22
+ stroke-opacity="0"
23
+ />
24
+
25
+ <!-- main lock -->
26
+ <rect x="5" y="16" width="22" height="15" rx="3" fill="none" stroke="#7f7f7f" stroke-width="2" />
27
+
28
+ <!-- status keyhole -->
29
+ <circle
30
+ cx="16"
31
+ cy="23.5"
32
+ r="3"
33
+ stroke="#7f7f7f"
34
+ stroke-width="0.5"
35
+ fill="#4caf50"
36
+ fill-opacity="0.5"
37
+ class="keyhole"
38
+ />
39
+ </svg>
@@ -0,0 +1,19 @@
1
+ <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
2
+ <!-- siren dome -->
3
+ <path
4
+ class="dome"
5
+ d="M7 18 C7 5, 25 5, 25 18 V26 H7 V18 Z"
6
+ fill="none"
7
+ stroke="#7f7f7f"
8
+ stroke-width="1.5"
9
+ fill-opacity="0.5"
10
+ />
11
+
12
+ <!-- base -->
13
+ <rect x="2" y="26" width="28" height="4" fill="none" stroke="#7f7f7f" stroke-width="1.5" rx="1" />
14
+
15
+ <!-- light waves left to right -->
16
+ <line class="ray" x1="6" y1="3" x2="10" y2="7" stroke-width="3" />
17
+ <line class="ray" x1="16" y1="0" x2="16" y2="5" stroke-width="3" />
18
+ <line class="ray" x1="26" y1="3" x2="22" y2="7" stroke-width="3" />
19
+ </svg>
@@ -0,0 +1,18 @@
1
+ <svg width="32px" height="32px" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
2
+ <!-- frame -->
3
+ <rect x="1" y="1" width="30" height="30" rx="3" stroke="#7f7f7f" fill="none" stroke-width="2" />
4
+
5
+ <!-- single click -->
6
+ <circle class="single" cx="8.5" cy="9.5" r="5" stroke="#7f7f7f" stroke-width="1" fill="none" fill-opacity="0.5" />
7
+
8
+ <!-- double click, outer then inner -->
9
+ <circle class="double" cx="23.5" cy="9.5" r="5" stroke="#7f7f7f" stroke-width="1" fill="none" fill-opacity="0.5" />
10
+ <circle cx="23.5" cy="9.5" r="3" stroke="#7f7f7f" stroke-width="1" fill="none" />
11
+
12
+ <!-- long click -->
13
+ <circle class="long" cx="16" cy="23.5" r="5" stroke="#7f7f7f" stroke-width="1" fill="none" fill-opacity="0.5" />
14
+
15
+ <!-- long click lies, left then right -->
16
+ <line x1="5" y1="23.5" x2="11" y2="23.5" stroke="#7f7f7f" stroke-width="0.5" />
17
+ <line x1="21" y1="23.5" x2="27" y2="23.5" stroke="#7f7f7f" stroke-width="0.5" />
18
+ </svg>
@@ -1,2 +1,2 @@
1
- import{a as D}from"./chunk-KYB236MX.js";import{Bc as N,Da as l,E as c,Ub as g,fa as _,ha as M,hc as y,ic as b,ja as v,jc as E,la as a,mb as h,nb as w,qb as u,sd as O,ub as C,vb as f}from"./chunk-645YHJEQ.js";var T=["editorContainer"],z="[_nghost-%COMP%]{display:block;height:200px}.editor-container[_ngcontent-%COMP%]{width:100%;height:98%}",I=new v("NGX_MONACO_EDITOR_CONFIG"),R=!1,q,x=(()=>{let i=class i{constructor(){this.config=a(I),this.onInit=new C,this._insideNg=!1}set insideNg(e){this._insideNg=e,this._editor&&(this._editor.dispose(),this.initMonaco(this._options,this.insideNg))}get insideNg(){return this._insideNg}ngAfterViewInit(){R?q.then(()=>{this.initMonaco(this._options,this.insideNg)}):(R=!0,q=new Promise(e=>{let t=this.config.baseUrl;if((t==="assets"||!t)&&(t="./assets/monaco-0.21.3/min/vs"),typeof window.monaco=="object"){this.initMonaco(this._options,this.insideNg),e();return}let o=r=>{let m=r||window.require,p={paths:{vs:`${t}`}};Object.assign(p,this.config.requireConfig||{}),m.config(p),m(["vs/editor/editor.main"],()=>{typeof this.config.onMonacoLoad=="function"&&this.config.onMonacoLoad(),this.initMonaco(this._options,this.insideNg),e()})};if(this.config.monacoRequire)o(this.config.monacoRequire);else if(window.require)if(window.require.config)o();else{var s=`${t}/loader.js`,d=new XMLHttpRequest;d.addEventListener("load",()=>{let r=document.createElement("script");r.type="text/javascript",r.text=["var nodeRequire = require;",d.responseText.replace('"use strict";',""),"var monacoAmdRequire = require;","require = nodeRequire;","require.nodeRequire = require;"].join(`
1
+ import{a as D}from"./chunk-7EQFLCW4.js";import{Bc as N,Da as l,E as c,Ub as g,fa as _,ha as M,hc as y,ic as b,ja as v,jc as E,la as a,mb as h,nb as w,qb as u,td as O,ub as C,vb as f}from"./chunk-IOKYXV5M.js";var T=["editorContainer"],z="[_nghost-%COMP%]{display:block;height:200px}.editor-container[_ngcontent-%COMP%]{width:100%;height:98%}",I=new v("NGX_MONACO_EDITOR_CONFIG"),R=!1,q,x=(()=>{let i=class i{constructor(){this.config=a(I),this.onInit=new C,this._insideNg=!1}set insideNg(e){this._insideNg=e,this._editor&&(this._editor.dispose(),this.initMonaco(this._options,this.insideNg))}get insideNg(){return this._insideNg}ngAfterViewInit(){R?q.then(()=>{this.initMonaco(this._options,this.insideNg)}):(R=!0,q=new Promise(e=>{let t=this.config.baseUrl;if((t==="assets"||!t)&&(t="./assets/monaco-0.21.3/min/vs"),typeof window.monaco=="object"){this.initMonaco(this._options,this.insideNg),e();return}let o=r=>{let m=r||window.require,p={paths:{vs:`${t}`}};Object.assign(p,this.config.requireConfig||{}),m.config(p),m(["vs/editor/editor.main"],()=>{typeof this.config.onMonacoLoad=="function"&&this.config.onMonacoLoad(),this.initMonaco(this._options,this.insideNg),e()})};if(this.config.monacoRequire)o(this.config.monacoRequire);else if(window.require)if(window.require.config)o();else{var s=`${t}/loader.js`,d=new XMLHttpRequest;d.addEventListener("load",()=>{let r=document.createElement("script");r.type="text/javascript",r.text=["var nodeRequire = require;",d.responseText.replace('"use strict";',""),"var monacoAmdRequire = require;","require = nodeRequire;","require.nodeRequire = require;"].join(`
2
2
  `),document.body.appendChild(r),o(window.monacoAmdRequire)}),d.open("GET",s),d.send()}else{let r=document.createElement("script");r.type="text/javascript",r.src=`${t}/loader.js`,r.addEventListener("load",()=>{o()}),document.body.appendChild(r)}}))}ngOnDestroy(){this._windowResizeSubscription&&this._windowResizeSubscription.unsubscribe(),this._editor&&(this._editor.dispose(),this._editor=void 0)}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=h({type:i,selectors:[["ng-component"]],viewQuery:function(t,o){if(t&1&&y(T,7),t&2){let s;b(s=E())&&(o._editorContainer=s.first)}},inputs:{insideNg:"insideNg"},outputs:{onInit:"onInit"},standalone:!1,decls:0,vars:0,template:function(t,o){},encapsulation:2});let n=i;return n})(),X=(()=>{let i=class i extends x{constructor(){super(...arguments),this.zone=a(f),this._value="",this.propagateChange=e=>{},this.onTouched=()=>{}}set options(e){this._options=Object.assign({},this.config.defaultOptions,e),this._editor&&(this._editor.dispose(),this.initMonaco(this._options,this.insideNg))}get options(){return this._options}set model(e){this.options.model=e,this._editor&&(this._editor.dispose(),this.initMonaco(this.options,this.insideNg))}writeValue(e){this._value=e||"",setTimeout(()=>{this._editor&&!this.options.model&&this._editor.setValue(this._value)})}registerOnChange(e){this.propagateChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.options.readOnly=e}initMonaco(e,t){let o=!!e.model;if(o){let s=monaco.editor.getModel(e.model.uri||"");s?(e.model=s,e.model.setValue(this._value)):e.model=monaco.editor.createModel(e.model.value,e.model.language,e.model.uri)}t?this._editor=monaco.editor.create(this._editorContainer.nativeElement,e):this.zone.runOutsideAngular(()=>{this._editor=monaco.editor.create(this._editorContainer.nativeElement,e)}),o||this._editor.setValue(this._value),this._editor.onDidChangeModelContent(s=>{let d=this._editor.getValue();this.zone.run(()=>{this.propagateChange(d),this._value=d})}),this._editor.onDidBlurEditorWidget(()=>{this.onTouched()}),this._editor.setTheme=s=>{this.options.theme=s,monaco.editor.setTheme(s)},this._windowResizeSubscription&&this._windowResizeSubscription.unsubscribe(),this._windowResizeSubscription=c(window,"resize").subscribe(()=>this._editor.layout()),this.onInit.emit(this._editor)}};i.\u0275fac=(()=>{let e;return function(o){return(e||(e=l(i)))(o||i)}})(),i.\u0275cmp=h({type:i,selectors:[["ngx-monaco-editor"]],inputs:{options:"options",model:"model"},features:[N([{provide:D,useExisting:_(()=>i),multi:!0}]),u],decls:2,vars:0,consts:[["editorContainer",""],[1,"editor-container"]],template:function(t,o){t&1&&g(0,"div",1,0)},styles:["[_nghost-%COMP%]{display:block;height:200px}.editor-container[_ngcontent-%COMP%]{width:100%;height:98%}"],changeDetection:0});let n=i;return n})(),$=(()=>{let i=class i extends x{constructor(){super(...arguments),this.zone=a(f)}set options(e){this._options=Object.assign({},this.config.defaultOptions,e),this._editor&&(this._editor.dispose(),this.initMonaco(this._options,this.insideNg))}get options(){return this._options}set originalModel(e){this._originalModel=e,this._editor&&(this._editor.dispose(),this.initMonaco(this.options,this.insideNg))}set modifiedModel(e){this._modifiedModel=e,this._editor&&(this._editor.dispose(),this.initMonaco(this.options,this.insideNg))}initMonaco(e,t){if(!this._originalModel||!this._modifiedModel)throw new Error("originalModel or modifiedModel not found for ngx-monaco-diff-editor");this._originalModel.language=this._originalModel.language||e.language,this._modifiedModel.language=this._modifiedModel.language||e.language;let o=monaco.editor.createModel(this._originalModel.code,this._originalModel.language),s=monaco.editor.createModel(this._modifiedModel.code,this._modifiedModel.language);this._editorContainer.nativeElement.innerHTML="";let d=e.theme;t?this._editor=monaco.editor.createDiffEditor(this._editorContainer.nativeElement,e):this.zone.runOutsideAngular(()=>{this._editor=monaco.editor.createDiffEditor(this._editorContainer.nativeElement,e)}),e.theme=d,this._editor.setModel({original:o,modified:s}),this._windowResizeSubscription&&this._windowResizeSubscription.unsubscribe(),this._windowResizeSubscription=c(window,"resize").subscribe(()=>this._editor.layout()),this.onInit.emit(this._editor)}};i.\u0275fac=(()=>{let e;return function(o){return(e||(e=l(i)))(o||i)}})(),i.\u0275cmp=h({type:i,selectors:[["ngx-monaco-diff-editor"]],inputs:{options:"options",originalModel:"originalModel",modifiedModel:"modifiedModel"},features:[u],decls:2,vars:0,consts:[["editorContainer",""],[1,"editor-container"]],template:function(t,o){t&1&&g(0,"div",1,0)},styles:[z],changeDetection:0});let n=i;return n})(),H=(()=>{let i=class i{static forRoot(e={}){return{ngModule:i,providers:[{provide:I,useValue:e}]}}};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=w({type:i}),i.\u0275inj=M({imports:[O]});let n=i;return n})();export{X as a,$ as b,H as c};
@@ -1 +1 @@
1
- import{a as M}from"./chunk-UFFQKHXE.js";import"./chunk-HHGB2T2Q.js";import{a as O}from"./chunk-V35TPDVW.js";import{a as _}from"./chunk-EZQF5CUM.js";import{n as z,t as D}from"./chunk-FYI7RHOJ.js";import"./chunk-KYB236MX.js";import"./chunk-U52WKM74.js";import{b as H}from"./chunk-ZO74PVYQ.js";import"./chunk-Z6DMMN6D.js";import{k as F,n as V}from"./chunk-2ZM2CO7S.js";import{a as E,b as A}from"./chunk-FYDO54CR.js";import"./chunk-KLQ6BEKS.js";import{$a as y,Hb as u,Ib as x,Ic as a,Jb as C,Jc as s,Ob as f,Pb as c,Qb as r,Rb as m,Tc as k,_b as T,ab as l,bc as p,dc as b,g as q,h as w,kc as L,la as i,lc as S,mb as $,n as v,qc as I,ra as d,rc as B,sa as g}from"./chunk-645YHJEQ.js";var N=q(O(),1);var Q=["logoutput"];function W(o,P){if(o&1){let t=T();c(0,"div",4)(1,"button",7),a(2,"translate"),a(3,"translate"),p("click",function(){d(t);let n=b();return g(n.downloadLogFile())}),m(4,"i",8),r(),c(5,"button",9),a(6,"translate"),a(7,"translate"),p("click",function(){d(t);let n=b();return g(n.truncateLogFile())}),m(8,"i",10),r()()}o&2&&(l(),f("openDelay",150)("ngbTooltip",s(2,6,"form.button_download")),u("aria-label",s(3,8,"form.button_download")),l(4),f("openDelay",150)("ngbTooltip",s(6,10,"form.button_delete")),u("aria-label",s(7,12,"form.button_delete")))}var it=(()=>{class o{$api=i(V);$auth=i(H);$log=i(M);$modal=i(z);$toastr=i(F);$translate=i(E);termTarget=k("logoutput");resizeEvent=new v;isAdmin=this.$auth.user.admin;onWindowResize(){this.resizeEvent.next(void 0)}ngOnInit(){window.document.querySelector("body").classList.add("bg-black"),this.$log.startTerminal(this.termTarget(),{allowProposedApi:!0},this.resizeEvent)}ngOnDestroy(){window.document.querySelector("body").classList.remove("bg-black"),this.$log.destroyTerminal()}downloadLogFile(){let t=this.$modal.open(_,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_download_log_file"),t.componentInstance.message=this.$translate.instant("logs.download_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_download"),t.componentInstance.faIconClass="fas fa-fw fa-user-secret primary-text",t.result.then(()=>{this.$api.get("/platform-tools/hb-service/log/download",{observe:"response",responseType:"blob"}).subscribe({next:e=>{(0,N.saveAs)(e.body,"homebridge.log.txt")},error:e=>w(this,null,function*(){let n;try{n=JSON.parse(yield e.error.text()).message}catch(h){console.error(h)}this.$toastr.error(n||this.$translate.instant("logs.download.error"),this.$translate.instant("toast.title_error"))})})}).catch(()=>{})}truncateLogFile(){let t=this.$modal.open(_,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_truncate_log_file"),t.componentInstance.message=this.$translate.instant("logs.truncate_log_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_delete"),t.componentInstance.confirmButtonClass="btn-danger",t.componentInstance.faIconClass="fas fa-fw fa-circle-exclamation primary-text",t.result.then(()=>{this.$api.put("/platform-tools/hb-service/log/truncate",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("logs.log_file_truncated"),this.$translate.instant("toast.title_success")),this.$log.term.clear()},error:e=>{console.error(e),this.$toastr.error(e.error?.message||this.$translate.instant("logs.truncate.error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=$({type:o,selectors:[["ng-component"]],viewQuery:function(e,n){e&1&&L(n.termTarget,Q,5),e&2&&S()},hostBindings:function(e,n){e&1&&p("resize",function(j){return n.onWindowResize(j)},y)},decls:9,vars:4,consts:[["logoutput",""],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],[1,"flex-column","d-flex","align-items-stretch","adjust-for-mobile"],["id","log-output",1,"align-self-end","w-100","h-100","mb-1"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-download"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-0",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-trash-alt"]],template:function(e,n){e&1&&(c(0,"div",1)(1,"div",2)(2,"h3",3),I(3),a(4,"translate"),r()(),x(5,W,9,14,"div",4),r(),c(6,"div",5),m(7,"div",6,0),r()),e&2&&(l(3),B(s(4,2,"menu.linux.label_logs")),l(2),C(n.isAdmin?5:-1))},dependencies:[D,A],encapsulation:2})}return o})();export{it as LogsComponent};
1
+ import{a as M}from"./chunk-6GQ5ZIPG.js";import"./chunk-FVKMBZOU.js";import{a as O}from"./chunk-H5WTK5UT.js";import{a as _}from"./chunk-ZUTM7S4U.js";import{n as z,t as D}from"./chunk-IWFKJHPR.js";import"./chunk-7EQFLCW4.js";import"./chunk-B3FSLPDD.js";import{b as H}from"./chunk-4YR5OZ4C.js";import"./chunk-4VNWFSVF.js";import{k as F,n as V}from"./chunk-L5C2GJ7H.js";import{a as E,b as A}from"./chunk-KZKL7DGI.js";import"./chunk-OA7Y3E5A.js";import{$a as y,Hb as u,Ib as x,Jb as C,Jc as a,Kc as s,Ob as f,Pb as c,Qb as r,Rb as m,Uc as k,_b as T,ab as l,bc as p,dc as b,g as q,h as w,kc as L,la as i,lc as S,mb as $,n as v,qc as I,ra as d,rc as B,sa as g}from"./chunk-IOKYXV5M.js";var N=q(O(),1);var Q=["logoutput"];function W(o,P){if(o&1){let t=T();c(0,"div",4)(1,"button",7),a(2,"translate"),a(3,"translate"),p("click",function(){d(t);let n=b();return g(n.downloadLogFile())}),m(4,"i",8),r(),c(5,"button",9),a(6,"translate"),a(7,"translate"),p("click",function(){d(t);let n=b();return g(n.truncateLogFile())}),m(8,"i",10),r()()}o&2&&(l(),f("openDelay",150)("ngbTooltip",s(2,6,"form.button_download")),u("aria-label",s(3,8,"form.button_download")),l(4),f("openDelay",150)("ngbTooltip",s(6,10,"form.button_delete")),u("aria-label",s(7,12,"form.button_delete")))}var it=(()=>{class o{$api=i(V);$auth=i(H);$log=i(M);$modal=i(z);$toastr=i(F);$translate=i(E);termTarget=k("logoutput");resizeEvent=new v;isAdmin=this.$auth.user.admin;onWindowResize(){this.resizeEvent.next(void 0)}ngOnInit(){window.document.querySelector("body").classList.add("bg-black"),this.$log.startTerminal(this.termTarget(),{allowProposedApi:!0},this.resizeEvent)}ngOnDestroy(){window.document.querySelector("body").classList.remove("bg-black"),this.$log.destroyTerminal()}downloadLogFile(){let t=this.$modal.open(_,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_download_log_file"),t.componentInstance.message=this.$translate.instant("logs.download_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_download"),t.componentInstance.faIconClass="fas fa-fw fa-user-secret primary-text",t.result.then(()=>{this.$api.get("/platform-tools/hb-service/log/download",{observe:"response",responseType:"blob"}).subscribe({next:e=>{(0,N.saveAs)(e.body,"homebridge.log.txt")},error:e=>w(this,null,function*(){let n;try{n=JSON.parse(yield e.error.text()).message}catch(h){console.error(h)}this.$toastr.error(n||this.$translate.instant("logs.download.error"),this.$translate.instant("toast.title_error"))})})}).catch(()=>{})}truncateLogFile(){let t=this.$modal.open(_,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_truncate_log_file"),t.componentInstance.message=this.$translate.instant("logs.truncate_log_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_delete"),t.componentInstance.confirmButtonClass="btn-danger",t.componentInstance.faIconClass="fas fa-fw fa-circle-exclamation primary-text",t.result.then(()=>{this.$api.put("/platform-tools/hb-service/log/truncate",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("logs.log_file_truncated"),this.$translate.instant("toast.title_success")),this.$log.term.clear()},error:e=>{console.error(e),this.$toastr.error(e.error?.message||this.$translate.instant("logs.truncate.error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=$({type:o,selectors:[["ng-component"]],viewQuery:function(e,n){e&1&&L(n.termTarget,Q,5),e&2&&S()},hostBindings:function(e,n){e&1&&p("resize",function(j){return n.onWindowResize(j)},y)},decls:9,vars:4,consts:[["logoutput",""],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],[1,"flex-column","d-flex","align-items-stretch","adjust-for-mobile"],["id","log-output",1,"align-self-end","w-100","h-100","mb-1"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-download"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-0",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-trash-alt"]],template:function(e,n){e&1&&(c(0,"div",1)(1,"div",2)(2,"h3",3),I(3),a(4,"translate"),r()(),x(5,W,9,14,"div",4),r(),c(6,"div",5),m(7,"div",6,0),r()),e&2&&(l(3),B(s(4,2,"menu.linux.label_logs")),l(2),C(n.isAdmin?5:-1))},dependencies:[D,A],encapsulation:2})}return o})();export{it as LogsComponent};
@@ -1 +1 @@
1
- import{d as f,g as s}from"./chunk-6HJHVJPI.js";import{k as u,n as d}from"./chunk-2ZM2CO7S.js";import{a as l}from"./chunk-FYDO54CR.js";import"./chunk-KLQ6BEKS.js";import{ga as m,h as p,ha as i,la as e,nb as a,w as c}from"./chunk-645YHJEQ.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-5FOJUOIT.js").then(t=>t.StartupScriptComponent),resolve:{startupScript:n}},{path:"restart-container",loadComponent:()=>import("./chunk-HSAZV5QQ.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-DFFTJVRY.js";import{k as u,n as d}from"./chunk-L5C2GJ7H.js";import{a as l}from"./chunk-KZKL7DGI.js";import"./chunk-OA7Y3E5A.js";import{ga as m,h as p,ha as i,la as e,nb as a,w as c}from"./chunk-IOKYXV5M.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-Q4NOFQ62.js").then(t=>t.StartupScriptComponent),resolve:{startupScript:n}},{path:"restart-container",loadComponent:()=>import("./chunk-456YQDZE.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 b}from"./chunk-U52WKM74.js";import"./chunk-ZO74PVYQ.js";import{d as k}from"./chunk-6HJHVJPI.js";import{b as S}from"./chunk-Z6DMMN6D.js";import{k as T,n as w}from"./chunk-2ZM2CO7S.js";import{a as C,b as $}from"./chunk-FYDO54CR.js";import"./chunk-KLQ6BEKS.js";import{$b as E,Dc as g,Ib as d,Ic as m,Jb as f,Jc as c,Kc as y,Sb as r,Tb as i,Ub as l,Xa as x,ab as n,dc as h,la as o,mb as _,qc as a,rc as s}from"./chunk-645YHJEQ.js";var I=t=>({command:t});function D(t,u){if(t&1&&(r(0,"div",7),a(1),i()),t&2){let e=h();n(),s(e.error)}}function R(t,u){t&1&&(r(0,"p",9),a(1),m(2,"translate"),i(),r(3,"div",10)(4,"div",11),l(5,"i",12),i()()),t&2&&(n(),s(c(2,1,"restart.please_wait_while_server_restarts")))}function B(t,u){if(t&1&&(r(0,"div",8)(1,"p"),a(2),m(3,"translate"),i(),l(4,"p",13),m(5,"translate"),i()),t&2){let e=h();n(2),s(c(3,2,"platform.docker.server_long_time")),n(2),E("innerHTML",y(5,4,"platform.docker.run_with_restart",g(7,I,e.command)),x)}}var U=(()=>{class t{$api=o(w);$router=o(k);$settings=o(S);$toastr=o(T);$translate=o(C);$ws=o(b);checkTimeout;checkDelay;io;resp={};timeout=!1;error=!1;command='<span class="font-monospace">--restart=always</span>';ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$api.put("/platform-tools/docker/restart-container",{}).subscribe({next:e=>{this.resp=e,this.checkIfServerUp()},error:e=>{this.error=this.$translate.instant("restart.toast_server_restart_error"),console.error(e),this.$toastr.error(this.$translate.instant("restart.toast_server_restart_error"),this.$translate.instant("toast.title_error"))}})}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{(e.status==="up"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("platform.docker.container_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},1e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("restart.toast_server_restart_timeout"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},6e4)}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=_({type:t,selectors:[["ng-component"]],decls:14,vars:8,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fab","fa-fw","fa-docker",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"alert","alert-warning","my-4"],[1,"grey-text"],[1,"justify-content-center","my-4"],[1,"restart-progress-box","primary-text"],[1,"fas","fa-fw","fa-spinner","fa-spin"],[1,"grey-text","mb-0",3,"innerHTML"]],template:function(p,v){p&1&&(r(0,"div",0)(1,"h3",1),a(2),m(3,"translate"),i()(),r(4,"div",2)(5,"div",3),l(6,"i",4),i(),r(7,"div",5)(8,"h4",6),a(9),m(10,"translate"),i(),d(11,D,2,1,"div",7)(12,R,6,3),d(13,B,6,9,"div",8),i()()),p&2&&(n(2),s(c(3,4,"menu.restart.title")),n(7),s(c(10,6,"platform.docker.title_restarting")),n(2),f(v.error?11:12),n(2),f(v.timeout?13:-1))},dependencies:[$],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{U as ContainerRestartComponent};
1
+ import{a as b}from"./chunk-B3FSLPDD.js";import"./chunk-4YR5OZ4C.js";import{d as k}from"./chunk-DFFTJVRY.js";import{b as S}from"./chunk-4VNWFSVF.js";import{k as T,n as w}from"./chunk-L5C2GJ7H.js";import{a as C,b as $}from"./chunk-KZKL7DGI.js";import"./chunk-OA7Y3E5A.js";import{$b as E,Dc as g,Ib as d,Jb as f,Jc as m,Kc as c,Lc as y,Sb as r,Tb as i,Ub as l,Xa as x,ab as n,dc as h,la as o,mb as _,qc as a,rc as s}from"./chunk-IOKYXV5M.js";var I=t=>({command:t});function D(t,u){if(t&1&&(r(0,"div",7),a(1),i()),t&2){let e=h();n(),s(e.error)}}function R(t,u){t&1&&(r(0,"p",9),a(1),m(2,"translate"),i(),r(3,"div",10)(4,"div",11),l(5,"i",12),i()()),t&2&&(n(),s(c(2,1,"restart.please_wait_while_server_restarts")))}function B(t,u){if(t&1&&(r(0,"div",8)(1,"p"),a(2),m(3,"translate"),i(),l(4,"p",13),m(5,"translate"),i()),t&2){let e=h();n(2),s(c(3,2,"platform.docker.server_long_time")),n(2),E("innerHTML",y(5,4,"platform.docker.run_with_restart",g(7,I,e.command)),x)}}var U=(()=>{class t{$api=o(w);$router=o(k);$settings=o(S);$toastr=o(T);$translate=o(C);$ws=o(b);checkTimeout;checkDelay;io;resp={};timeout=!1;error=!1;command='<span class="font-monospace">--restart=always</span>';ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$api.put("/platform-tools/docker/restart-container",{}).subscribe({next:e=>{this.resp=e,this.checkIfServerUp()},error:e=>{this.error=this.$translate.instant("restart.toast_server_restart_error"),console.error(e),this.$toastr.error(this.$translate.instant("restart.toast_server_restart_error"),this.$translate.instant("toast.title_error"))}})}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{(e.status==="up"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("platform.docker.container_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},1e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("restart.toast_server_restart_timeout"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},6e4)}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=_({type:t,selectors:[["ng-component"]],decls:14,vars:8,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fab","fa-fw","fa-docker",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"alert","alert-warning","my-4"],[1,"grey-text"],[1,"justify-content-center","my-4"],[1,"restart-progress-box","primary-text"],[1,"fas","fa-fw","fa-spinner","fa-spin"],[1,"grey-text","mb-0",3,"innerHTML"]],template:function(p,v){p&1&&(r(0,"div",0)(1,"h3",1),a(2),m(3,"translate"),i()(),r(4,"div",2)(5,"div",3),l(6,"i",4),i(),r(7,"div",5)(8,"h4",6),a(9),m(10,"translate"),i(),d(11,D,2,1,"div",7)(12,R,6,3),d(13,B,6,9,"div",8),i()()),p&2&&(n(2),s(c(3,4,"menu.restart.title")),n(7),s(c(10,6,"platform.docker.title_restarting")),n(2),f(v.error?11:12),n(2),f(v.timeout?13:-1))},dependencies:[$],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{U as ContainerRestartComponent};
@@ -1 +1 @@
1
- import{k as et,n as it}from"./chunk-2ZM2CO7S.js";import{a as tt}from"./chunk-FYDO54CR.js";import{m as X}from"./chunk-KLQ6BEKS.js";import{T as G,e as ut,g as ct,ga as R,h as P,la as Y,n as Q,w as N}from"./chunk-645YHJEQ.js";var st=ut((J,K)=>{(function(w,D){typeof J=="object"&&typeof K<"u"?K.exports=D():typeof define=="function"&&define.amd?define(D):(w=typeof globalThis<"u"?globalThis:w||self).dayjs=D()})(J,function(){"use strict";var w=1e3,D=6e4,n=36e5,h="millisecond",d="second",m="minute",M="hour",y="day",f="week",b="month",E="quarter",S="year",x="date",Z="Invalid Date",nt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,rt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ot={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var i=["th","st","nd","rd"],t=r%100;return"["+r+(i[(t-20)%10]||i[t]||i[0])+"]"}},F=function(r,i,t){var s=String(r);return!s||s.length>=i?r:""+Array(i+1-s.length).join(t)+r},at={s:F,z:function(r){var i=-r.utcOffset(),t=Math.abs(i),s=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+F(s,2,"0")+":"+F(e,2,"0")},m:function r(i,t){if(i.date()<t.date())return-r(t,i);var s=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(s,b),o=t-e<0,a=i.clone().add(s+(o?-1:1),b);return+(-(s+(t-e)/(o?e-a:a-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:b,y:S,w:f,d:y,D:x,h:M,m,s:d,ms:h,Q:E}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},A="en",T={};T[A]=ot;var z="$isDayjsObject",U=function(r){return r instanceof V||!(!r||!r[z])},C=function r(i,t,s){var e;if(!i)return A;if(typeof i=="string"){var o=i.toLowerCase();T[o]&&(e=o),t&&(T[o]=t,e=o);var a=i.split("-");if(!e&&a.length>1)return r(a[0])}else{var c=i.name;T[c]=i,e=c}return!s&&e&&(A=e),e||!s&&A},g=function(r,i){if(U(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new V(t)},u=at;u.l=C,u.i=U,u.w=function(r,i){return g(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var V=function(){function r(t){this.$L=C(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[z]=!0}var i=r.prototype;return i.parse=function(t){this.$d=function(s){var e=s.date,o=s.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(nt);if(a){var c=a[2]-1||0,l=(a[7]||"0").substring(0,3);return o?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,l)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,l)}}return new Date(e)}(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return u},i.isValid=function(){return this.$d.toString()!==Z},i.isSame=function(t,s){var e=g(t);return this.startOf(s)<=e&&e<=this.endOf(s)},i.isAfter=function(t,s){return g(t)<this.startOf(s)},i.isBefore=function(t,s){return this.endOf(s)<g(t)},i.$g=function(t,s,e){return u.u(t)?this[s]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,s){var e=this,o=!!u.u(s)||s,a=u.p(t),c=function(_,v){var k=u.w(e.$u?Date.UTC(e.$y,v,_):new Date(e.$y,v,_),e);return o?k:k.endOf(y)},l=function(_,v){return u.w(e.toDate()[_].apply(e.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(v)),e)},$=this.$W,p=this.$M,L=this.$D,j="set"+(this.$u?"UTC":"");switch(a){case S:return o?c(1,0):c(31,11);case b:return o?c(1,p):c(0,p+1);case f:var O=this.$locale().weekStart||0,H=($<O?$+7:$)-O;return c(o?L-H:L+(6-H),p);case y:case x:return l(j+"Hours",0);case M:return l(j+"Minutes",1);case m:return l(j+"Seconds",2);case d:return l(j+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,s){var e,o=u.p(t),a="set"+(this.$u?"UTC":""),c=(e={},e[y]=a+"Date",e[x]=a+"Date",e[b]=a+"Month",e[S]=a+"FullYear",e[M]=a+"Hours",e[m]=a+"Minutes",e[d]=a+"Seconds",e[h]=a+"Milliseconds",e)[o],l=o===y?this.$D+(s-this.$W):s;if(o===b||o===S){var $=this.clone().set(x,1);$.$d[c](l),$.init(),this.$d=$.set(x,Math.min(this.$D,$.daysInMonth())).$d}else c&&this.$d[c](l);return this.init(),this},i.set=function(t,s){return this.clone().$set(t,s)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,s){var e,o=this;t=Number(t);var a=u.p(s),c=function(p){var L=g(o);return u.w(L.date(L.date()+Math.round(p*t)),o)};if(a===b)return this.set(b,this.$M+t);if(a===S)return this.set(S,this.$y+t);if(a===y)return c(1);if(a===f)return c(7);var l=(e={},e[m]=D,e[M]=n,e[d]=w,e)[a]||1,$=this.$d.getTime()+t*l;return u.w($,this)},i.subtract=function(t,s){return this.add(-1*t,s)},i.format=function(t){var s=this,e=this.$locale();if(!this.isValid())return e.invalidDate||Z;var o=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,l=this.$m,$=this.$M,p=e.weekdays,L=e.months,j=e.meridiem,O=function(v,k,I,W){return v&&(v[k]||v(s,o))||I[k].slice(0,W)},H=function(v){return u.s(c%12||12,v,"0")},_=j||function(v,k,I){var W=v<12?"AM":"PM";return I?W.toLowerCase():W};return o.replace(rt,function(v,k){return k||function(I){switch(I){case"YY":return String(s.$y).slice(-2);case"YYYY":return u.s(s.$y,4,"0");case"M":return $+1;case"MM":return u.s($+1,2,"0");case"MMM":return O(e.monthsShort,$,L,3);case"MMMM":return O(L,$);case"D":return s.$D;case"DD":return u.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return O(e.weekdaysMin,s.$W,p,2);case"ddd":return O(e.weekdaysShort,s.$W,p,3);case"dddd":return p[s.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return H(1);case"hh":return H(2);case"a":return _(c,l,!0);case"A":return _(c,l,!1);case"m":return String(l);case"mm":return u.s(l,2,"0");case"s":return String(s.$s);case"ss":return u.s(s.$s,2,"0");case"SSS":return u.s(s.$ms,3,"0");case"Z":return a}return null}(v)||a.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,s,e){var o,a=this,c=u.p(s),l=g(t),$=(l.utcOffset()-this.utcOffset())*D,p=this-l,L=function(){return u.m(a,l)};switch(c){case S:o=L()/12;break;case b:o=L();break;case E:o=L()/3;break;case f:o=(p-$)/6048e5;break;case y:o=(p-$)/864e5;break;case M:o=p/n;break;case m:o=p/D;break;case d:o=p/w;break;default:o=p}return e?o:u.a(o)},i.daysInMonth=function(){return this.endOf(b).$D},i.$locale=function(){return T[this.$L]},i.locale=function(t,s){if(!t)return this.$L;var e=this.clone(),o=C(t,s,!0);return o&&(e.$L=o),e},i.clone=function(){return u.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},r}(),B=V.prototype;return g.prototype=B,[["$ms",h],["$s",d],["$m",m],["$H",M],["$W",y],["$M",b],["$y",S],["$D",x]].forEach(function(r){B[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),g.extend=function(r,i){return r.$i||(r(i,V,g),r.$i=!0),g},g.locale=C,g.isDayjs=U,g.unix=function(r){return g(1e3*r)},g.en=T[A],g.Ls=T,g.p={},g})});var q=ct(st(),1);var vt=(()=>{class w{$api=Y(it);$title=Y(X);$toastr=Y(et);$translate=Y(tt);settingsLoadedSubject=new Q;defaultTheme="deep-purple";forbiddenKeys=["__proto__","constructor","prototype"];env={};formAuth=!0;sessionTimeout=28800;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;keepOrphans;wallpaper;serverTimeOffset=0;rtl=!1;onSettingsLoaded=this.settingsLoadedSubject.pipe(G());settingsLoaded=!1;themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];constructor(){this.getAppSettings()}getAppSettings(){return P(this,null,function*(){let n=yield N(this.$api.get("/auth/settings"));this.formAuth=n.formAuth,this.sessionTimeout=n.sessionTimeout,this.env=n.env,this.lightingMode=n.lightingMode,this.wallpaper=n.wallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(n.theme),this.setMenuMode(n.menuMode),this.setKeepOrphans(n.keepOrphans),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(n.serverTimestamp),this.setUiVersion(n.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0)})}setBrowserLightingMode(n){this.browserLightingMode=n,this.lightingMode==="auto"&&this.setLightingMode(n,"browser")}setLightingMode(n,h){h==="user"&&(this.lightingMode=n),this.currentLightingMode=n,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(n){(!n||!this.themeList.includes(n))&&(n=this.defaultTheme,N(this.$api.put("/config-editor/ui",{key:"theme",value:n})).catch(m=>console.error("Error saving setTheme:",m)));let h=window.document.querySelector("body");h.classList.remove(`config-ui-x-${this.theme}`),h.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=n,this.actualLightingMode==="dark"?(h.classList.add(`config-ui-x-dark-mode-${this.theme}`),h.classList.contains("dark-mode")||h.classList.add("dark-mode")):(h.classList.add(`config-ui-x-${this.theme}`),h.classList.contains("dark-mode")&&h.classList.remove("dark-mode")),window.document.querySelectorAll("iframe").forEach((m,M)=>{try{let y=m.contentDocument;if(y){let f=y.body;this.actualLightingMode==="dark"?(f.classList.contains(`config-ui-x-${this.theme}`)&&f.classList.remove(`config-ui-x-${this.theme}`),f.classList.contains(`config-ui-x-dark-mode-${this.theme}`)||f.classList.add(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")||f.classList.add("dark-mode"),f.style.backgroundColor="#242424 !important",f.style.color="#ffffff !important"):(f.classList.contains(`config-ui-x-${this.theme}`)||f.classList.add(`config-ui-x-${this.theme}`),f.classList.contains(`config-ui-x-dark-mode-${this.theme}`)&&f.classList.remove(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")&&f.classList.remove("dark-mode"),f.style.backgroundColor="#ffffff !important",f.style.color="#000000 !important"),m.contentWindow.postMessage({type:"theme-update",isDark:this.actualLightingMode==="dark",theme:n},window.location.origin)}}catch(y){console.warn(`Iframe ${M}: Access denied (cross-origin?)`,{error:y,src:m.src})}})}setMenuMode(n){this.menuMode=n}setKeepOrphans(n){this.keepOrphans=n}setLang(n){n?this.$translate.use(n):n="auto",this.env.lang=n}setItem(n,h){this[n]=h}setEnvItem(n,h){if(n.includes(".")){let d=n.split("."),m=this.env;for(let M=0;M<d.length-1;M++){if(this.forbiddenKeys.includes(d[M]))return;m[d[M]]||(m[d[M]]={}),m=m[d[M]]}this.forbiddenKeys.includes(d[d.length-1])||(m[d[d.length-1]]=h)}else this.env[n]=h}checkServerTime(n){let d=(0,q.default)(n).diff((0,q.default)(),"hour");this.serverTimeOffset=d*60*60,(d>=8||d<=-8)&&this.$toastr.warning(this.$translate.instant("settings.datetime.incorrect"),this.$translate.instant("toast.title_warning"),{timeOut:2e4,tapToDismiss:!1}).onTap.subscribe(()=>{window.open("https://homebridge.io/w/JqTFs","_blank")})}setUiVersion(n){this.uiVersion||(this.uiVersion=n)}setTitle(n){this.$title.setTitle(n||"Homebridge")}static \u0275fac=function(h){return new(h||w)};static \u0275prov=R({token:w,factory:w.\u0275fac,providedIn:"root"})}return w})();export{st as a,vt as b};
1
+ import{k as et,n as it}from"./chunk-L5C2GJ7H.js";import{a as tt}from"./chunk-KZKL7DGI.js";import{m as X}from"./chunk-OA7Y3E5A.js";import{T as G,e as ut,g as ct,ga as R,h as P,la as Y,n as Q,w as N}from"./chunk-IOKYXV5M.js";var st=ut((J,K)=>{(function(w,D){typeof J=="object"&&typeof K<"u"?K.exports=D():typeof define=="function"&&define.amd?define(D):(w=typeof globalThis<"u"?globalThis:w||self).dayjs=D()})(J,function(){"use strict";var w=1e3,D=6e4,n=36e5,h="millisecond",d="second",m="minute",M="hour",y="day",f="week",b="month",E="quarter",S="year",x="date",Z="Invalid Date",nt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,rt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ot={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var i=["th","st","nd","rd"],t=r%100;return"["+r+(i[(t-20)%10]||i[t]||i[0])+"]"}},F=function(r,i,t){var s=String(r);return!s||s.length>=i?r:""+Array(i+1-s.length).join(t)+r},at={s:F,z:function(r){var i=-r.utcOffset(),t=Math.abs(i),s=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+F(s,2,"0")+":"+F(e,2,"0")},m:function r(i,t){if(i.date()<t.date())return-r(t,i);var s=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(s,b),o=t-e<0,a=i.clone().add(s+(o?-1:1),b);return+(-(s+(t-e)/(o?e-a:a-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:b,y:S,w:f,d:y,D:x,h:M,m,s:d,ms:h,Q:E}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},A="en",T={};T[A]=ot;var z="$isDayjsObject",U=function(r){return r instanceof V||!(!r||!r[z])},C=function r(i,t,s){var e;if(!i)return A;if(typeof i=="string"){var o=i.toLowerCase();T[o]&&(e=o),t&&(T[o]=t,e=o);var a=i.split("-");if(!e&&a.length>1)return r(a[0])}else{var c=i.name;T[c]=i,e=c}return!s&&e&&(A=e),e||!s&&A},g=function(r,i){if(U(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new V(t)},u=at;u.l=C,u.i=U,u.w=function(r,i){return g(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var V=function(){function r(t){this.$L=C(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[z]=!0}var i=r.prototype;return i.parse=function(t){this.$d=function(s){var e=s.date,o=s.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(nt);if(a){var c=a[2]-1||0,l=(a[7]||"0").substring(0,3);return o?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,l)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,l)}}return new Date(e)}(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return u},i.isValid=function(){return this.$d.toString()!==Z},i.isSame=function(t,s){var e=g(t);return this.startOf(s)<=e&&e<=this.endOf(s)},i.isAfter=function(t,s){return g(t)<this.startOf(s)},i.isBefore=function(t,s){return this.endOf(s)<g(t)},i.$g=function(t,s,e){return u.u(t)?this[s]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,s){var e=this,o=!!u.u(s)||s,a=u.p(t),c=function(_,v){var k=u.w(e.$u?Date.UTC(e.$y,v,_):new Date(e.$y,v,_),e);return o?k:k.endOf(y)},l=function(_,v){return u.w(e.toDate()[_].apply(e.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(v)),e)},$=this.$W,p=this.$M,L=this.$D,j="set"+(this.$u?"UTC":"");switch(a){case S:return o?c(1,0):c(31,11);case b:return o?c(1,p):c(0,p+1);case f:var O=this.$locale().weekStart||0,H=($<O?$+7:$)-O;return c(o?L-H:L+(6-H),p);case y:case x:return l(j+"Hours",0);case M:return l(j+"Minutes",1);case m:return l(j+"Seconds",2);case d:return l(j+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,s){var e,o=u.p(t),a="set"+(this.$u?"UTC":""),c=(e={},e[y]=a+"Date",e[x]=a+"Date",e[b]=a+"Month",e[S]=a+"FullYear",e[M]=a+"Hours",e[m]=a+"Minutes",e[d]=a+"Seconds",e[h]=a+"Milliseconds",e)[o],l=o===y?this.$D+(s-this.$W):s;if(o===b||o===S){var $=this.clone().set(x,1);$.$d[c](l),$.init(),this.$d=$.set(x,Math.min(this.$D,$.daysInMonth())).$d}else c&&this.$d[c](l);return this.init(),this},i.set=function(t,s){return this.clone().$set(t,s)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,s){var e,o=this;t=Number(t);var a=u.p(s),c=function(p){var L=g(o);return u.w(L.date(L.date()+Math.round(p*t)),o)};if(a===b)return this.set(b,this.$M+t);if(a===S)return this.set(S,this.$y+t);if(a===y)return c(1);if(a===f)return c(7);var l=(e={},e[m]=D,e[M]=n,e[d]=w,e)[a]||1,$=this.$d.getTime()+t*l;return u.w($,this)},i.subtract=function(t,s){return this.add(-1*t,s)},i.format=function(t){var s=this,e=this.$locale();if(!this.isValid())return e.invalidDate||Z;var o=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,l=this.$m,$=this.$M,p=e.weekdays,L=e.months,j=e.meridiem,O=function(v,k,I,W){return v&&(v[k]||v(s,o))||I[k].slice(0,W)},H=function(v){return u.s(c%12||12,v,"0")},_=j||function(v,k,I){var W=v<12?"AM":"PM";return I?W.toLowerCase():W};return o.replace(rt,function(v,k){return k||function(I){switch(I){case"YY":return String(s.$y).slice(-2);case"YYYY":return u.s(s.$y,4,"0");case"M":return $+1;case"MM":return u.s($+1,2,"0");case"MMM":return O(e.monthsShort,$,L,3);case"MMMM":return O(L,$);case"D":return s.$D;case"DD":return u.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return O(e.weekdaysMin,s.$W,p,2);case"ddd":return O(e.weekdaysShort,s.$W,p,3);case"dddd":return p[s.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return H(1);case"hh":return H(2);case"a":return _(c,l,!0);case"A":return _(c,l,!1);case"m":return String(l);case"mm":return u.s(l,2,"0");case"s":return String(s.$s);case"ss":return u.s(s.$s,2,"0");case"SSS":return u.s(s.$ms,3,"0");case"Z":return a}return null}(v)||a.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,s,e){var o,a=this,c=u.p(s),l=g(t),$=(l.utcOffset()-this.utcOffset())*D,p=this-l,L=function(){return u.m(a,l)};switch(c){case S:o=L()/12;break;case b:o=L();break;case E:o=L()/3;break;case f:o=(p-$)/6048e5;break;case y:o=(p-$)/864e5;break;case M:o=p/n;break;case m:o=p/D;break;case d:o=p/w;break;default:o=p}return e?o:u.a(o)},i.daysInMonth=function(){return this.endOf(b).$D},i.$locale=function(){return T[this.$L]},i.locale=function(t,s){if(!t)return this.$L;var e=this.clone(),o=C(t,s,!0);return o&&(e.$L=o),e},i.clone=function(){return u.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},r}(),B=V.prototype;return g.prototype=B,[["$ms",h],["$s",d],["$m",m],["$H",M],["$W",y],["$M",b],["$y",S],["$D",x]].forEach(function(r){B[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),g.extend=function(r,i){return r.$i||(r(i,V,g),r.$i=!0),g},g.locale=C,g.isDayjs=U,g.unix=function(r){return g(1e3*r)},g.en=T[A],g.Ls=T,g.p={},g})});var q=ct(st(),1);var vt=(()=>{class w{$api=Y(it);$title=Y(X);$toastr=Y(et);$translate=Y(tt);settingsLoadedSubject=new Q;defaultTheme="deep-purple";forbiddenKeys=["__proto__","constructor","prototype"];env={};formAuth=!0;sessionTimeout=28800;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;keepOrphans;wallpaper;serverTimeOffset=0;rtl=!1;onSettingsLoaded=this.settingsLoadedSubject.pipe(G());settingsLoaded=!1;themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];constructor(){this.getAppSettings()}getAppSettings(){return P(this,null,function*(){let n=yield N(this.$api.get("/auth/settings"));this.formAuth=n.formAuth,this.sessionTimeout=n.sessionTimeout,this.env=n.env,this.lightingMode=n.lightingMode,this.wallpaper=n.wallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(n.theme),this.setMenuMode(n.menuMode),this.setKeepOrphans(n.keepOrphans),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(n.serverTimestamp),this.setUiVersion(n.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0)})}setBrowserLightingMode(n){this.browserLightingMode=n,this.lightingMode==="auto"&&this.setLightingMode(n,"browser")}setLightingMode(n,h){h==="user"&&(this.lightingMode=n),this.currentLightingMode=n,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(n){(!n||!this.themeList.includes(n))&&(n=this.defaultTheme,N(this.$api.put("/config-editor/ui",{key:"theme",value:n})).catch(m=>console.error("Error saving setTheme:",m)));let h=window.document.querySelector("body");h.classList.remove(`config-ui-x-${this.theme}`),h.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=n,this.actualLightingMode==="dark"?(h.classList.add(`config-ui-x-dark-mode-${this.theme}`),h.classList.contains("dark-mode")||h.classList.add("dark-mode")):(h.classList.add(`config-ui-x-${this.theme}`),h.classList.contains("dark-mode")&&h.classList.remove("dark-mode")),window.document.querySelectorAll("iframe").forEach((m,M)=>{try{let y=m.contentDocument;if(y){let f=y.body;this.actualLightingMode==="dark"?(f.classList.contains(`config-ui-x-${this.theme}`)&&f.classList.remove(`config-ui-x-${this.theme}`),f.classList.contains(`config-ui-x-dark-mode-${this.theme}`)||f.classList.add(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")||f.classList.add("dark-mode"),f.style.backgroundColor="#242424 !important",f.style.color="#ffffff !important"):(f.classList.contains(`config-ui-x-${this.theme}`)||f.classList.add(`config-ui-x-${this.theme}`),f.classList.contains(`config-ui-x-dark-mode-${this.theme}`)&&f.classList.remove(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")&&f.classList.remove("dark-mode"),f.style.backgroundColor="#ffffff !important",f.style.color="#000000 !important"),m.contentWindow.postMessage({type:"theme-update",isDark:this.actualLightingMode==="dark",theme:n},window.location.origin)}}catch(y){console.warn(`Iframe ${M}: Access denied (cross-origin?)`,{error:y,src:m.src})}})}setMenuMode(n){this.menuMode=n}setKeepOrphans(n){this.keepOrphans=n}setLang(n){n?this.$translate.use(n):n="auto",this.env.lang=n}setItem(n,h){this[n]=h}setEnvItem(n,h){if(n.includes(".")){let d=n.split("."),m=this.env;for(let M=0;M<d.length-1;M++){if(this.forbiddenKeys.includes(d[M]))return;m[d[M]]||(m[d[M]]={}),m=m[d[M]]}this.forbiddenKeys.includes(d[d.length-1])||(m[d[d.length-1]]=h)}else this.env[n]=h}checkServerTime(n){let d=(0,q.default)(n).diff((0,q.default)(),"hour");this.serverTimeOffset=d*60*60,(d>=8||d<=-8)&&this.$toastr.warning(this.$translate.instant("settings.datetime.incorrect"),this.$translate.instant("toast.title_warning"),{timeOut:2e4,tapToDismiss:!1}).onTap.subscribe(()=>{window.open("https://homebridge.io/w/JqTFs","_blank")})}setUiVersion(n){this.uiVersion||(this.uiVersion=n)}setTitle(n){this.$title.setTitle(n||"Homebridge")}static \u0275fac=function(h){return new(h||w)};static \u0275prov=R({token:w,factory:w.\u0275fac,providedIn:"root"})}return w})();export{st as a,vt as b};
@@ -1 +1 @@
1
- import{a as _,b as D}from"./chunk-Z6DMMN6D.js";import{m as c,n as S}from"./chunk-2ZM2CO7S.js";import{f as x}from"./chunk-KLQ6BEKS.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-645YHJEQ.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-4VNWFSVF.js";import{m as c,n as S}from"./chunk-L5C2GJ7H.js";import{f as x}from"./chunk-OA7Y3E5A.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-IOKYXV5M.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,2 +1,2 @@
1
- import{A as Z,c as G,d as k,e as j,f as D,g as K,j as $,m as A,p as J,q as Q,w as X,z as Y}from"./chunk-KYB236MX.js";import{a as ae}from"./chunk-U52WKM74.js";import{b as oe}from"./chunk-ZO74PVYQ.js";import{b as re}from"./chunk-Z6DMMN6D.js";import{k as ie,m as U,n as ne}from"./chunk-2ZM2CO7S.js";import{a as ee,b as te}from"./chunk-FYDO54CR.js";import{m as q}from"./chunk-KLQ6BEKS.js";import{Ad as R,Cc as L,Dc as B,Ec as E,Hb as M,Ib as z,Ic as a,Jb as T,Jc as s,Ob as m,Pb as o,Qb as r,Rb as u,Xa as W,_b as I,ab as n,bc as x,dc as _,h as S,jd as H,la as w,mb as V,md as N,nc as O,qc as l,ra as C,rc as f,sa as b,sc as g,w as h}from"./chunk-645YHJEQ.js";var pe=t=>({background:t}),de=t=>({anim:t}),ce=t=>({"progress-bar-animated":t}),me=()=>["restoring","restarting","restore-complete"],P=(t,d)=>({"is-valid":t,"is-invalid":d});function ue(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),u(4,"div",7),a(5,"translate"),o(6,"button",8),x("click",function(){C(e);let i=_();return b(i.onClickGettingStarted())}),l(7),a(8,"translate"),r(),o(9,"a",9),x("click",function(){C(e);let i=_();return b(i.onClickRestoreBackup())}),l(10),a(11,"translate"),r()()}t&2&&(n(2),f(s(3,4,"setup.welcome_to_homebridge")),n(2),m("innerHTML",s(5,6,"setup.intro"),W),n(3),g(" ",s(8,8,"setup.button_get_started")," "),n(3),f(s(11,10,"setup_wizard_restore")))}function ge(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"div",11)(8,"form",12),x("ngSubmit",function(){C(e);let i=_();return b(i.createFirstUser())}),o(9,"div",13)(10,"span",14),u(11,"i",15),r(),u(12,"input",16),a(13,"translate"),r(),o(14,"div",13)(15,"span",14),u(16,"i",17),r(),u(17,"input",18),a(18,"translate"),r(),o(19,"div",13)(20,"span",14),u(21,"i",17),r(),u(22,"input",19),a(23,"translate"),r(),o(24,"div",20)(25,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(26),a(27,"translate"),r(),o(28,"button",22),l(29),a(30,"translate"),r()()()()()}if(t&2){let e=_();n(2),f(s(3,16,"setup.create_account")),n(3),f(s(6,18,"setup_wizard_create_info")),n(3),m("formGroup",e.createUserForm),n(4),m("readonly",e.loading)("ngClass",E(30,P,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.valid,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.invalid))("placeholder",s(13,20,"users.label_username")),n(5),m("readonly",e.loading)("ngClass",E(33,P,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.valid,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.errors))("placeholder",s(18,22,"users.label_password")),n(5),m("readonly",e.loading)("ngClass",E(36,P,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.valid,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.errors))("placeholder",s(23,24,"users.label_confirm_password")),n(3),m("disabled",e.restoreUploading),n(),g(" ",s(27,26,"form.button_back")," "),n(2),m("disabled",e.createUserForm.invalid||e.loading),n(),g(" ",s(30,28,"form.button_continue")," ")}}function _e(t,d){t&1&&(u(0,"i",25),l(1),a(2,"translate")),t&2&&(n(),g(" ",s(2,1,"backup.label_uploading")," "))}function fe(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"form.button_continue")," ")}function he(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"input",23),x("change",function(i){C(e);let F=_();return b(F.handleRestoreFileInput(i.target.files))}),r(),o(8,"div",20)(9,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(10),a(11,"translate"),r(),o(12,"button",24),x("click",function(){C(e);let i=_();return b(i.onRestoreBackupClick())}),z(13,_e,3,3)(14,fe,2,3),r()()()}if(t&2){let e=_();n(2),f(s(3,6,"setup_wizard_restore")),n(3),f(s(6,8,"backup.restore_help_one")),n(4),m("disabled",e.restoreUploading),n(),g(" ",s(11,10,"form.button_back")," "),n(2),m("disabled",e.restoreUploading||!e.selectedFile),n(),T(e.restoreUploading?13:14)}}function we(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_restoring")," ")}function Ce(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_starting")," ")}function be(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_complete")," ")}function xe(t,d){t&1&&(o(0,"a",27),l(1),a(2,"translate"),r()),t&2&&(n(),g(" ",s(2,1,"form.button_continue")," "))}function ve(t,d){if(t&1&&(o(0,"div",5)(1,"h4",6),z(2,we,2,3)(3,Ce,2,3)(4,be,2,3),r(),u(5,"div",26),z(6,xe,3,3,"a",27),r()),t&2){let e=_();n(2),T(e.step==="restoring"?2:e.step==="restarting"?3:e.step==="restore-complete"?4:-1),n(4),T(e.step==="restore-complete"?6:-1)}}function ye(t,d){t&1&&(o(0,"div",5)(1,"h4",28),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"a",29),l(8),a(9,"translate"),r()()),t&2&&(n(2),f(s(3,3,"setup_wizard_complete_title")),n(3),f(s(6,5,"setup_wizard_completed")),n(3),g(" ",s(9,7,"form.button_continue")," "))}var He=(()=>{class t{$api=w(ne);$auth=w(oe);$settings=w(re);$title=w(q);$toastr=w(ie);$translate=w(ee);$ws=w(ae);io;step="welcome";backgroundStyle;progress=1;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;loading=!1;selectedFile;restoreUploading=!1;createUserForm=new K({username:new $("",[k.required]),password:new $("",[k.compose([k.required,k.minLength(4)])]),passwordConfirm:new $("",[k.required])},this.matchPassword);ngOnInit(){return S(this,null,function*(){this.$title.setTitle(this.$translate.instant("setup_wizard_page_title")),yield this.setBackground()})}onClickGettingStarted(){this.step="create-account",this.progress=50}onClickRestoreBackup(){this.step="restore-backup",this.progress=20}onClickCancelRestore(){this.selectedFile=null,this.step="welcome",this.progress=1}createFirstUser(){return S(this,null,function*(){this.loading=!0,this.progress=75;let e=this.createUserForm.getRawValue();e.name=e.username;try{yield h(this.$api.post("/setup-wizard/create-first-user",e)),this.$settings.env.setupWizardComplete=!0,this.progress=100,this.loading=!1,yield this.$auth.login({username:e.username,password:e.password}),this.step="setup-complete"}catch(p){this.loading=!1,this.progress=50,console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.progress=40):(delete this.selectedFile,this.progress=20)}onRestoreBackupClick(){return S(this,null,function*(){this.restoreUploading=!0,this.step="restoring",this.progress=60;try{let e=yield h(this.$api.get("/setup-wizard/get-setup-wizard-token"));window.localStorage.setItem(U.jwt.tokenKey,e.access_token),this.$auth.token=e.access_token,this.progress=65;let p=new FormData;p.append("restoreArchive",this.selectedFile,this.selectedFile.name),yield h(this.$api.post("/backup/restore",p)),this.progress=70,this.io=this.$ws.connectToNamespace("backup");let i=document.getElementById("output");this.io.socket.on("stdout",c=>{c.split(`
1
+ import{A as Z,c as G,d as k,e as j,f as D,g as K,j as $,m as A,p as J,q as Q,w as X,z as Y}from"./chunk-7EQFLCW4.js";import{a as ae}from"./chunk-B3FSLPDD.js";import{b as oe}from"./chunk-4YR5OZ4C.js";import{b as re}from"./chunk-4VNWFSVF.js";import{k as ie,m as U,n as ne}from"./chunk-L5C2GJ7H.js";import{a as ee,b as te}from"./chunk-KZKL7DGI.js";import{m as q}from"./chunk-OA7Y3E5A.js";import{Bd as R,Cc as L,Dc as B,Ec as E,Hb as M,Ib as z,Jb as T,Jc as a,Kc as s,Ob as m,Pb as o,Qb as r,Rb as u,Xa as W,_b as I,ab as n,bc as x,dc as _,h as S,kd as H,la as w,mb as V,nc as O,nd as N,qc as l,ra as C,rc as f,sa as b,sc as g,w as h}from"./chunk-IOKYXV5M.js";var pe=t=>({background:t}),de=t=>({anim:t}),ce=t=>({"progress-bar-animated":t}),me=()=>["restoring","restarting","restore-complete"],P=(t,d)=>({"is-valid":t,"is-invalid":d});function ue(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),u(4,"div",7),a(5,"translate"),o(6,"button",8),x("click",function(){C(e);let i=_();return b(i.onClickGettingStarted())}),l(7),a(8,"translate"),r(),o(9,"a",9),x("click",function(){C(e);let i=_();return b(i.onClickRestoreBackup())}),l(10),a(11,"translate"),r()()}t&2&&(n(2),f(s(3,4,"setup.welcome_to_homebridge")),n(2),m("innerHTML",s(5,6,"setup.intro"),W),n(3),g(" ",s(8,8,"setup.button_get_started")," "),n(3),f(s(11,10,"setup_wizard_restore")))}function ge(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"div",11)(8,"form",12),x("ngSubmit",function(){C(e);let i=_();return b(i.createFirstUser())}),o(9,"div",13)(10,"span",14),u(11,"i",15),r(),u(12,"input",16),a(13,"translate"),r(),o(14,"div",13)(15,"span",14),u(16,"i",17),r(),u(17,"input",18),a(18,"translate"),r(),o(19,"div",13)(20,"span",14),u(21,"i",17),r(),u(22,"input",19),a(23,"translate"),r(),o(24,"div",20)(25,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(26),a(27,"translate"),r(),o(28,"button",22),l(29),a(30,"translate"),r()()()()()}if(t&2){let e=_();n(2),f(s(3,16,"setup.create_account")),n(3),f(s(6,18,"setup_wizard_create_info")),n(3),m("formGroup",e.createUserForm),n(4),m("readonly",e.loading)("ngClass",E(30,P,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.valid,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.invalid))("placeholder",s(13,20,"users.label_username")),n(5),m("readonly",e.loading)("ngClass",E(33,P,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.valid,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.errors))("placeholder",s(18,22,"users.label_password")),n(5),m("readonly",e.loading)("ngClass",E(36,P,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.valid,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.errors))("placeholder",s(23,24,"users.label_confirm_password")),n(3),m("disabled",e.restoreUploading),n(),g(" ",s(27,26,"form.button_back")," "),n(2),m("disabled",e.createUserForm.invalid||e.loading),n(),g(" ",s(30,28,"form.button_continue")," ")}}function _e(t,d){t&1&&(u(0,"i",25),l(1),a(2,"translate")),t&2&&(n(),g(" ",s(2,1,"backup.label_uploading")," "))}function fe(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"form.button_continue")," ")}function he(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"input",23),x("change",function(i){C(e);let F=_();return b(F.handleRestoreFileInput(i.target.files))}),r(),o(8,"div",20)(9,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(10),a(11,"translate"),r(),o(12,"button",24),x("click",function(){C(e);let i=_();return b(i.onRestoreBackupClick())}),z(13,_e,3,3)(14,fe,2,3),r()()()}if(t&2){let e=_();n(2),f(s(3,6,"setup_wizard_restore")),n(3),f(s(6,8,"backup.restore_help_one")),n(4),m("disabled",e.restoreUploading),n(),g(" ",s(11,10,"form.button_back")," "),n(2),m("disabled",e.restoreUploading||!e.selectedFile),n(),T(e.restoreUploading?13:14)}}function we(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_restoring")," ")}function Ce(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_starting")," ")}function be(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_complete")," ")}function xe(t,d){t&1&&(o(0,"a",27),l(1),a(2,"translate"),r()),t&2&&(n(),g(" ",s(2,1,"form.button_continue")," "))}function ve(t,d){if(t&1&&(o(0,"div",5)(1,"h4",6),z(2,we,2,3)(3,Ce,2,3)(4,be,2,3),r(),u(5,"div",26),z(6,xe,3,3,"a",27),r()),t&2){let e=_();n(2),T(e.step==="restoring"?2:e.step==="restarting"?3:e.step==="restore-complete"?4:-1),n(4),T(e.step==="restore-complete"?6:-1)}}function ye(t,d){t&1&&(o(0,"div",5)(1,"h4",28),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"a",29),l(8),a(9,"translate"),r()()),t&2&&(n(2),f(s(3,3,"setup_wizard_complete_title")),n(3),f(s(6,5,"setup_wizard_completed")),n(3),g(" ",s(9,7,"form.button_continue")," "))}var He=(()=>{class t{$api=w(ne);$auth=w(oe);$settings=w(re);$title=w(q);$toastr=w(ie);$translate=w(ee);$ws=w(ae);io;step="welcome";backgroundStyle;progress=1;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;loading=!1;selectedFile;restoreUploading=!1;createUserForm=new K({username:new $("",[k.required]),password:new $("",[k.compose([k.required,k.minLength(4)])]),passwordConfirm:new $("",[k.required])},this.matchPassword);ngOnInit(){return S(this,null,function*(){this.$title.setTitle(this.$translate.instant("setup_wizard_page_title")),yield this.setBackground()})}onClickGettingStarted(){this.step="create-account",this.progress=50}onClickRestoreBackup(){this.step="restore-backup",this.progress=20}onClickCancelRestore(){this.selectedFile=null,this.step="welcome",this.progress=1}createFirstUser(){return S(this,null,function*(){this.loading=!0,this.progress=75;let e=this.createUserForm.getRawValue();e.name=e.username;try{yield h(this.$api.post("/setup-wizard/create-first-user",e)),this.$settings.env.setupWizardComplete=!0,this.progress=100,this.loading=!1,yield this.$auth.login({username:e.username,password:e.password}),this.step="setup-complete"}catch(p){this.loading=!1,this.progress=50,console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.progress=40):(delete this.selectedFile,this.progress=20)}onRestoreBackupClick(){return S(this,null,function*(){this.restoreUploading=!0,this.step="restoring",this.progress=60;try{let e=yield h(this.$api.get("/setup-wizard/get-setup-wizard-token"));window.localStorage.setItem(U.jwt.tokenKey,e.access_token),this.$auth.token=e.access_token,this.progress=65;let p=new FormData;p.append("restoreArchive",this.selectedFile,this.selectedFile.name),yield h(this.$api.post("/backup/restore",p)),this.progress=70,this.io=this.$ws.connectToNamespace("backup");let i=document.getElementById("output");this.io.socket.on("stdout",c=>{c.split(`
2
2
  \r`).forEach(v=>{if(v&&!/^[⠇⠏⠋⠙⠹⠸]+$/.test(v)){let y=document.createElement("div"),le=/\x1B\[(\d{1,2}(;\d{1,2})?)?[mGK]/g;y.innerHTML=v.replace(le,""),v.includes("[0;31m")?y.classList.add("red-text"):v.includes("[0;32m")?y.classList.add("green-text"):v.includes("[0;33m")?y.classList.add("orange-text"):v.includes("[0;36m")&&y.classList.add("cyan-text"),i.appendChild(y),i.scrollTop=i.scrollHeight}})}),this.restoreStarted=!0,this.restoreInProgress=!0,this.progress=75,yield h(this.io.request("do-restore")),this.progress=80,this.restoreInProgress=!1,yield h(this.$api.put("/backup/restart",{})),this.step="restarting",this.progress=85,window.localStorage.removeItem(U.jwt.tokenKey),this.$auth.token=null;let F=document.createElement("div");F.classList.add("orange-text"),F.innerHTML="Starting Homebridge, please wait...",i.appendChild(F),i.scrollTop=i.scrollHeight,yield new Promise(c=>setTimeout(c,3e3)),this.progress=88,yield new Promise(c=>setTimeout(c,3e3)),this.progress=91,yield new Promise(c=>setTimeout(c,3e3)),this.progress=94,yield new Promise(c=>setTimeout(c,3e3)),this.progress=97,yield new Promise(c=>setTimeout(c,3e3)),this.progress=99;let se=setInterval(()=>S(this,null,function*(){try{yield h(this.$api.get("/auth/settings")),clearInterval(se),this.progress=100,this.restoreUploading=!1,this.step="restore-complete"}catch{}}),1e3)}catch(e){console.error(e),this.restoreUploading=!1,this.restoreFailed=!0,this.progress=20,this.step="restore-backup",this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}finally{this.io&&this.io.end()}})}setBackground(){return S(this,null,function*(){if(this.$settings.settingsLoaded||(yield h(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash){let e=`${U.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`;this.backgroundStyle=`url('${e}') center/cover`}})}matchPassword(e){let p=e.get("password").value,i=e.get("passwordConfirm").value;if(p!==i)e.get("passwordConfirm").setErrors({matchPassword:!0});else return null}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=V({type:t,selectors:[["ng-component"]],decls:10,vars:14,consts:[[1,"setup-container","gradient","d-flex","align-items-start","justify-content-center",3,"ngStyle","ngClass"],[1,"w-100","setup-card","d-flex","py-4","flex-column"],["ngSrc","/assets/homebridge-color-round.svg","alt","Homebridge Logo","height","100","width","100","priority","true",1,"homebridge-logo","mx-auto","my-3"],[1,"progress","w-100","my-4"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",1,"progress-bar","progress-bar-striped","bg-success",3,"ngClass"],[1,"w-100","d-flex","flex-column","align-items-center","mb-2"],[1,"mb-3","text-center"],[1,"mb-4","small","grey-text","text-center",3,"innerHTML"],["type","button",1,"btn","btn-lg","btn-primary","mb-4",3,"click"],["href","javascript:void(0)",1,"grey-text",3,"click"],[1,"mb-4","small","grey-text","text-center"],[1,"w-100"],["novalidate","",3,"ngSubmit","formGroup"],[1,"input-group","mb-4"],[1,"input-group-text","custom-input"],[1,"fas","fa-fw","fa-user","primary-text","fa-lg"],["formControlName","username","type","text","id","form-username","autocomplete","username","autocapitalize","none","tabindex","1","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],[1,"fas","fa-fw","fa-lock","primary-text","fa-lg"],["formControlName","password","type","password","id","form-pass","autocomplete","new-password","tabindex","2","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],["formControlName","passwordConfirm","type","password","id","form-pass-confirm","autocomplete","new-password","tabindex","2","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],[1,"mt-3","w-100","d-flex","justify-content-between"],["type","button",1,"btn","btn-elegant","ms-0",3,"click","disabled"],["type","submit",1,"btn","btn-primary",3,"disabled"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz",1,"form-control","custom-input","mb-3",3,"change"],["type","button",1,"btn","btn-primary","me-0",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],["id","output",1,"font-monospace","small","alert","alert-info","w-100","text-start","mt-1","mb-0"],["href","/login",1,"btn","btn-lg","btn-primary","mt-4"],[1,"mb-3"],["href","/",1,"btn","btn-lg","btn-primary"]],template:function(p,i){p&1&&(o(0,"div",0)(1,"div",1),u(2,"img",2),o(3,"div",3),u(4,"div",4),r(),z(5,ue,12,12,"div",5)(6,ge,31,39,"div",5)(7,he,15,12,"div",5)(8,ve,7,2,"div",5)(9,ye,10,9,"div",5),r()()),p&2&&(m("ngStyle",B(7,pe,i.backgroundStyle))("ngClass",B(9,de,!i.backgroundStyle)),n(4),O("width",i.progress+"%"),m("ngClass",B(11,ce,i.loading||i.restoreUploading)),M("aria-valuenow",i.progress),n(),T(i.step==="welcome"?5:i.step==="create-account"?6:i.step==="restore-backup"?7:L(13,me).includes(i.step)?8:i.step==="setup-complete"?9:-1))},dependencies:[H,R,Y,A,G,j,D,X,Z,J,Q,N,te],styles:["body{overflow:scroll!important} body.dark-mode .setup-card{background-color:#2b2b2b;color:#fff}.setup-container[_ngcontent-%COMP%]{z-index:-1;padding-top:2em;padding-bottom:2em;min-height:100%;background-size:300% 300%}.anim[_ngcontent-%COMP%]{-webkit-animation:_ngcontent-%COMP%_gradient 20s ease infinite;-moz-animation:gradient 20s ease infinite;-o-animation:gradient 20s ease infinite;animation:_ngcontent-%COMP%_gradient 20s ease infinite}@keyframes _ngcontent-%COMP%_gradient{0%{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}.setup-card[_ngcontent-%COMP%]{max-width:550px;border-radius:1rem;padding-right:25px;padding-left:25px;background-color:#ffffffe6}.setup-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 575px){.setup-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}}.homebridge-logo[_ngcontent-%COMP%]{margin-bottom:10px}.progress[_ngcontent-%COMP%]{background-color:#ddd}#output[_ngcontent-%COMP%]{height:200px;overflow-y:scroll;white-space:pre-wrap}"]})}return t})();export{He as SetupWizardComponent};
@@ -1 +1 @@
1
- import{b as H}from"./chunk-DYB33NRF.js";import{a as L,b as S}from"./chunk-G6KV6PYE.js";import{m as T}from"./chunk-FYI7RHOJ.js";import{b as B}from"./chunk-FYDO54CR.js";import{Ac as I,Hb as C,Ib as r,Ic as g,Jb as l,Jc as _,Ob as p,Pb as i,Qb as a,Rb as m,Xa as u,Ya as O,_b as k,ab as o,bc as b,dc as d,la as h,mb as v,pc as y,qc as f,ra as x,rc as w,sa as P,sc as M}from"./chunk-645YHJEQ.js";function E(t,c){if(t&1&&m(0,"i",16),t&2){let n=d();y(I("fas fa-fw ",n.faIconClass," mb-3"))}}function z(t,c){if(t&1&&m(0,"h5",6),t&2){let n=d();p("innerHTML",n.subtitle,u)}}function V(t,c){if(t&1&&m(0,"p",8),t&2){let n=d();p("innerHTML",n.message2,u)}}function D(t,c){if(t&1&&m(0,"markdown",9),t&2){let n=d();p("data",n.markdownMessage2)}}function N(t,c){if(t&1){let n=k();i(0,"button",17),g(1,"translate"),b("click",function(){x(n);let e=d();return P(e.dismissModal())}),f(2),g(3,"translate"),a()}t&2&&(C("aria-label",_(1,2,"form.button_close")),o(2),M(" ",_(3,4,"form.button_close")," "))}function j(t,c){if(t&1){let n=k();i(0,"button",17),g(1,"translate"),b("click",function(){x(n);let e=d();return P(e.dismissModal())}),f(2),g(3,"translate"),a()}t&2&&(C("aria-label",_(1,2,"form.button_close")),o(2),M(" ",_(3,4,"form.button_close")," "))}function A(t,c){if(t&1&&(i(0,"a",15),f(1),m(2,"i",18),a()),t&2){let n=d();p("href",n.ctaButtonLink,O),o(),M(" ",n.ctaButtonLabel," ")}}var X=(()=>{class t{$activeModal=h(T);title;subtitle;message;message2;ctaButtonLabel;ctaButtonLink;faIconClass;markdownMessage2;dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(s){return new(s||t)};static \u0275cmp=v({type:t,selectors:[["ng-component"]],inputs:{title:"title",subtitle:"subtitle",message:"message",message2:"message2",ctaButtonLabel:"ctaButtonLabel",ctaButtonLink:"ctaButtonLink",faIconClass:"faIconClass",markdownMessage2:"markdownMessage2"},decls:19,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body","text-center"],[2,"font-size","75px",3,"class"],[1,"mb-3",3,"innerHTML"],[1,"mb-0",3,"innerHTML"],[1,"mb-0","mt-3",3,"innerHTML"],[1,"plugin-md",3,"data"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","text-decoration-none",3,"href"],[2,"font-size","75px"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"fas","fa-fw","fa-external-link-alt"]],template:function(s,e){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),f(3),a(),i(4,"button",3),g(5,"translate"),b("click",function(){return e.dismissModal()}),a()(),i(6,"div",4),r(7,E,1,3,"i",5),r(8,z,1,1,"h5",6),m(9,"p",7),r(10,V,1,1,"p",8),r(11,D,1,1,"markdown",9),a(),i(12,"div",10)(13,"div",11),r(14,N,4,6,"button",12),a(),i(15,"div",13),r(16,j,4,6,"button",12),a(),i(17,"div",14),r(18,A,3,2,"a",15),a()()()),s&2&&(o(3),w(e.title),o(),C("aria-label",_(5,10,"form.button_close")),o(3),l(e.faIconClass?7:-1),o(),l(e.subtitle?8:-1),o(),p("innerHTML",e.message,u),o(),l(e.message2?10:-1),o(),l(e.markdownMessage2?11:-1),o(3),l(e.ctaButtonLink?14:-1),o(2),l(e.ctaButtonLink?-1:16),o(2),l(e.ctaButtonLink?18:-1))},dependencies:[S,L,H,B],styles:["[_nghost-%COMP%] .plugin-md{display:block!important;background-color:#f6f8fa!important;border-radius:6px!important;padding:16px!important;margin:16px auto!important;width:100%!important;max-width:632px!important}[_nghost-%COMP%] .plugin-md table{width:100%;max-width:600px;margin:0 auto!important;border-collapse:collapse;border:1px solid #d0d7de!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif!important;font-size:14px!important;color:#24292e!important}[_nghost-%COMP%] .plugin-md th, [_nghost-%COMP%] .plugin-md td{padding:6px 13px!important;border:1px solid #d0d7de!important;text-align:left;color:#24292e!important}[_nghost-%COMP%] .plugin-md th{background-color:#f6f8fa!important;font-weight:600!important;text-align:center!important}[_nghost-%COMP%] .plugin-md td[align=center]{text-align:center!important}[_nghost-%COMP%] .plugin-md tr{color:#24292e!important}[_nghost-%COMP%] .plugin-md tr:nth-child(odd){background-color:#fff!important}[_nghost-%COMP%] .plugin-md tr:nth-child(2n){background-color:#f6f8fa!important}[_nghost-%COMP%] .plugin-md tr:hover{background-color:#f0f2f5!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%]{background-color:#2b2b2b!important;color:#fff!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] table[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#fff!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#3c3c3c!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(odd){background-color:#323232!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(2n){background-color:#2b2b2b!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background-color:#454545!important}"]})}return t})();export{X as a};
1
+ import{b as H}from"./chunk-H45DK7IX.js";import{a as L,b as S}from"./chunk-J6CJ26QN.js";import{m as T}from"./chunk-IWFKJHPR.js";import{b as B}from"./chunk-KZKL7DGI.js";import{Ac as I,Hb as C,Ib as r,Jb as l,Jc as g,Kc as _,Ob as p,Pb as i,Qb as a,Rb as m,Xa as u,Ya as O,_b as k,ab as o,bc as b,dc as d,la as h,mb as v,pc as y,qc as f,ra as x,rc as w,sa as P,sc as M}from"./chunk-IOKYXV5M.js";function E(t,c){if(t&1&&m(0,"i",16),t&2){let n=d();y(I("fas fa-fw ",n.faIconClass," mb-3"))}}function z(t,c){if(t&1&&m(0,"h5",6),t&2){let n=d();p("innerHTML",n.subtitle,u)}}function V(t,c){if(t&1&&m(0,"p",8),t&2){let n=d();p("innerHTML",n.message2,u)}}function D(t,c){if(t&1&&m(0,"markdown",9),t&2){let n=d();p("data",n.markdownMessage2)}}function N(t,c){if(t&1){let n=k();i(0,"button",17),g(1,"translate"),b("click",function(){x(n);let e=d();return P(e.dismissModal())}),f(2),g(3,"translate"),a()}t&2&&(C("aria-label",_(1,2,"form.button_close")),o(2),M(" ",_(3,4,"form.button_close")," "))}function j(t,c){if(t&1){let n=k();i(0,"button",17),g(1,"translate"),b("click",function(){x(n);let e=d();return P(e.dismissModal())}),f(2),g(3,"translate"),a()}t&2&&(C("aria-label",_(1,2,"form.button_close")),o(2),M(" ",_(3,4,"form.button_close")," "))}function A(t,c){if(t&1&&(i(0,"a",15),f(1),m(2,"i",18),a()),t&2){let n=d();p("href",n.ctaButtonLink,O),o(),M(" ",n.ctaButtonLabel," ")}}var X=(()=>{class t{$activeModal=h(T);title;subtitle;message;message2;ctaButtonLabel;ctaButtonLink;faIconClass;markdownMessage2;dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(s){return new(s||t)};static \u0275cmp=v({type:t,selectors:[["ng-component"]],inputs:{title:"title",subtitle:"subtitle",message:"message",message2:"message2",ctaButtonLabel:"ctaButtonLabel",ctaButtonLink:"ctaButtonLink",faIconClass:"faIconClass",markdownMessage2:"markdownMessage2"},decls:19,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body","text-center"],[2,"font-size","75px",3,"class"],[1,"mb-3",3,"innerHTML"],[1,"mb-0",3,"innerHTML"],[1,"mb-0","mt-3",3,"innerHTML"],[1,"plugin-md",3,"data"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","text-decoration-none",3,"href"],[2,"font-size","75px"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"fas","fa-fw","fa-external-link-alt"]],template:function(s,e){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),f(3),a(),i(4,"button",3),g(5,"translate"),b("click",function(){return e.dismissModal()}),a()(),i(6,"div",4),r(7,E,1,3,"i",5),r(8,z,1,1,"h5",6),m(9,"p",7),r(10,V,1,1,"p",8),r(11,D,1,1,"markdown",9),a(),i(12,"div",10)(13,"div",11),r(14,N,4,6,"button",12),a(),i(15,"div",13),r(16,j,4,6,"button",12),a(),i(17,"div",14),r(18,A,3,2,"a",15),a()()()),s&2&&(o(3),w(e.title),o(),C("aria-label",_(5,10,"form.button_close")),o(3),l(e.faIconClass?7:-1),o(),l(e.subtitle?8:-1),o(),p("innerHTML",e.message,u),o(),l(e.message2?10:-1),o(),l(e.markdownMessage2?11:-1),o(3),l(e.ctaButtonLink?14:-1),o(2),l(e.ctaButtonLink?-1:16),o(2),l(e.ctaButtonLink?18:-1))},dependencies:[S,L,H,B],styles:["[_nghost-%COMP%] .plugin-md{display:block!important;background-color:#f6f8fa!important;border-radius:6px!important;padding:16px!important;margin:16px auto!important;width:100%!important;max-width:632px!important}[_nghost-%COMP%] .plugin-md table{width:100%;max-width:600px;margin:0 auto!important;border-collapse:collapse;border:1px solid #d0d7de!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif!important;font-size:14px!important;color:#24292e!important}[_nghost-%COMP%] .plugin-md th, [_nghost-%COMP%] .plugin-md td{padding:6px 13px!important;border:1px solid #d0d7de!important;text-align:left;color:#24292e!important}[_nghost-%COMP%] .plugin-md th{background-color:#f6f8fa!important;font-weight:600!important;text-align:center!important}[_nghost-%COMP%] .plugin-md td[align=center]{text-align:center!important}[_nghost-%COMP%] .plugin-md tr{color:#24292e!important}[_nghost-%COMP%] .plugin-md tr:nth-child(odd){background-color:#fff!important}[_nghost-%COMP%] .plugin-md tr:nth-child(2n){background-color:#f6f8fa!important}[_nghost-%COMP%] .plugin-md tr:hover{background-color:#f0f2f5!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%]{background-color:#2b2b2b!important;color:#fff!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] table[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#fff!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#3c3c3c!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(odd){background-color:#323232!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(2n){background-color:#2b2b2b!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background-color:#454545!important}"]})}return t})();export{X as a};
@@ -1,4 +1,4 @@
1
- import{a as Mp}from"./chunk-OMGXHYZA.js";import{a as tl,c as Ep,d as Pp,e as Fn,f as oi,g as Xx}from"./chunk-FG5QICVJ.js";import{a as Cp}from"./chunk-M4QDQWSG.js";import{a as $p}from"./chunk-3QBYXJ7T.js";import{a as kp}from"./chunk-UFFQKHXE.js";import{a as wp,b as Ip,c as Sp}from"./chunk-HHGB2T2Q.js";import{a as xr}from"./chunk-V35TPDVW.js";import{a as Tp}from"./chunk-RCYYU6LQ.js";import{a as pa,b as ha}from"./chunk-DYB33NRF.js";import{a as fa,b as ma}from"./chunk-G6KV6PYE.js";import{a as xp}from"./chunk-EZQF5CUM.js";import{a as aa,b as sa,c as la,d as ua,e as ca,f as da,g as Nn,m as je,n as et,o as gp,p as _p,q as yp,r as bp,s as vp,t as Ai}from"./chunk-FYI7RHOJ.js";import{A as Cr,a as lp,b as Di,c as On,e as bt,f as up,h as cp,i as dp,j as pp,k as fp,l as Ni,m as mp,o as Fi,r as Dn,s as sn,t as ln,y as hp,z as Gt}from"./chunk-KYB236MX.js";import{a as ji}from"./chunk-U52WKM74.js";import{d as ri}from"./chunk-6HJHVJPI.js";import{b as Be}from"./chunk-Z6DMMN6D.js";import{k as we,m as qi,n as ve}from"./chunk-2ZM2CO7S.js";import{a as xe,b as Ve}from"./chunk-FYDO54CR.js";import{e as sp}from"./chunk-KLQ6BEKS.js";import{$a as Yd,Ac as np,Ad as ap,Bc as rp,Ca as Pi,Cc as Te,D as Wd,Da as Xd,Dc as Kt,Ec as on,Fa as Tn,Fc as At,Gc as Mn,Hb as G,Ib as E,Ic as w,Jb as P,Jc as S,Kc as Ue,Lb as dt,M as En,Mb as pt,Nb as ft,Ob as b,Pb as f,Qb as m,Rb as $,Rc as mt,Sb as ea,Sc as z,Tb as ta,Tc as Oi,Ub as ia,Vb as ep,Vc as op,Wb as tp,Xa as he,Z as Ys,_b as H,a as X,aa as vr,ab as d,b as $e,bc as j,cc as na,dc as _,e as g,fa as Kd,fb as Qo,g as Me,ga as Tt,gb as fi,h as K,ha as Pn,hc as Qs,ib as tn,ic as Zs,ja as Gd,jc as el,jd as qt,k as Ld,ka as Jd,kc as Ti,kd as an,la as k,lc as ki,ld as ht,mb as Q,mc as ip,n as Pt,nb as kn,nc as Wt,o as Xs,ob as nn,oc as Mi,pb as Qd,pc as Y,q as Ud,qc as C,ra as A,rc as U,sa as q,sb as ue,sc as B,sd as oa,tc as rn,ub as Zd,uc as ra,v as zd,vb as Zo,w as le,x as Hd,xc as Oe,yc as De,za as Yo,zc as Ne}from"./chunk-645YHJEQ.js";var Sr=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 wr=class{};be._CodeOrName=wr;be.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var un=class extends wr{constructor(i){if(super(),!be.IDENTIFIER.test(i))throw new Error("CodeGen: name must be a valid identifier");this.str=i}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};be.Name=un;var jt=class extends wr{constructor(i){super(),this._items=typeof i=="string"?[i]:i}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let i=this._items[0];return i===""||i==='""'}get str(){var i;return(i=this._str)!==null&&i!==void 0?i:this._str=this._items.reduce((t,n)=>`${t}${n}`,"")}get names(){var i;return(i=this._names)!==null&&i!==void 0?i:this._names=this._items.reduce((t,n)=>(n instanceof un&&(t[n.str]=(t[n.str]||0)+1),t),{})}};be._Code=jt;be.nil=new jt("");function Op(e,...i){let t=[e[0]],n=0;for(;n<i.length;)nl(t,i[n]),t.push(e[++n]);return new jt(t)}be._=Op;var il=new jt("+");function Dp(e,...i){let t=[Ir(e[0])],n=0;for(;n<i.length;)t.push(il),nl(t,i[n]),t.push(il,Ir(e[++n]));return Yx(t),new jt(t)}be.str=Dp;function nl(e,i){i instanceof jt?e.push(...i._items):i instanceof un?e.push(i):e.push(ew(i))}be.addCodeArg=nl;function Yx(e){let i=1;for(;i<e.length-1;){if(e[i]===il){let t=Qx(e[i-1],e[i+1]);if(t!==void 0){e.splice(i-1,3,t);continue}e[i++]="+"}i++}}function Qx(e,i){if(i==='""')return e;if(e==='""')return i;if(typeof e=="string")return i instanceof un||e[e.length-1]!=='"'?void 0:typeof i!="string"?`${e.slice(0,-1)}${i}"`:i[0]==='"'?e.slice(0,-1)+i.slice(1):void 0;if(typeof i=="string"&&i[0]==='"'&&!(e instanceof un))return`"${e}${i.slice(1)}`}function Zx(e,i){return i.emptyStr()?e:e.emptyStr()?i:Dp`${e}${i}`}be.strConcat=Zx;function ew(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Ir(Array.isArray(e)?e.join(","):e)}function tw(e){return new jt(Ir(e))}be.stringify=tw;function Ir(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}be.safeStringify=Ir;function iw(e){return typeof e=="string"&&be.IDENTIFIER.test(e)?new jt(`.${e}`):Op`[${e}]`}be.getProperty=iw;function nw(e){if(typeof e=="string"&&be.IDENTIFIER.test(e))return new jt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}be.getEsmExportName=nw;function rw(e){return new jt(e.toString())}be.regexpCode=rw});var al=g(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.ValueScope=Ct.ValueScopeName=Ct.Scope=Ct.varKinds=Ct.UsedValueState=void 0;var vt=Sr(),rl=class extends Error{constructor(i){super(`CodeGen: "code" for ${i} not defined`),this.value=i.value}},ga=function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e}(ga||(Ct.UsedValueState=ga={}));Ct.varKinds={const:new vt.Name("const"),let:new vt.Name("let"),var:new vt.Name("var")};var _a=class{constructor({prefixes:i,parent:t}={}){this._names={},this._prefixes=i,this._parent=t}toName(i){return i instanceof vt.Name?i:this.name(i)}name(i){return new vt.Name(this._newName(i))}_newName(i){let t=this._names[i]||this._nameGroup(i);return`${i}${t.index++}`}_nameGroup(i){var t,n;if(!((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0)&&n.has(i)||this._prefixes&&!this._prefixes.has(i))throw new Error(`CodeGen: prefix "${i}" is not allowed in this scope`);return this._names[i]={prefix:i,index:0}}};Ct.Scope=_a;var ya=class extends vt.Name{constructor(i,t){super(t),this.prefix=i}setValue(i,{property:t,itemIndex:n}){this.value=i,this.scopePath=(0,vt._)`.${new vt.Name(t)}[${n}]`}};Ct.ValueScopeName=ya;var ow=(0,vt._)`\n`,ol=class extends _a{constructor(i){super(i),this._values={},this._scope=i.scope,this.opts=$e(X({},i),{_n:i.lines?ow:vt.nil})}get(){return this._scope}name(i){return new ya(i,this._newName(i))}value(i,t){var n;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let r=this.toName(i),{prefix:o}=r,a=(n=t.key)!==null&&n!==void 0?n:t.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]=t.ref,r.setValue(t,{property:o,itemIndex:u}),r}getValue(i,t){let n=this._values[i];if(n)return n.get(t)}scopeRefs(i,t=this._values){return this._reduceValues(t,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,vt._)`${i}${n.scopePath}`})}scopeCode(i=this._values,t,n){return this._reduceValues(i,r=>{if(r.value===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return r.value.code},t,n)}_reduceValues(i,t,n={},r){let o=vt.nil;for(let a in i){let s=i[a];if(!s)continue;let l=n[a]=n[a]||new Map;s.forEach(u=>{if(l.has(u))return;l.set(u,ga.Started);let c=t(u);if(c){let p=this.opts.es5?Ct.varKinds.var:Ct.varKinds.const;o=(0,vt._)`${o}${p} ${u} = ${c};${this.opts._n}`}else if(c=r?.(u))o=(0,vt._)`${o}${c}${this.opts._n}`;else throw new rl(u);l.set(u,ga.Completed)})}return o}};Ct.ValueScope=ol});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=Sr(),Jt=al(),Vi=Sr();Object.defineProperty(ce,"_",{enumerable:!0,get:function(){return Vi._}});Object.defineProperty(ce,"str",{enumerable:!0,get:function(){return Vi.str}});Object.defineProperty(ce,"strConcat",{enumerable:!0,get:function(){return Vi.strConcat}});Object.defineProperty(ce,"nil",{enumerable:!0,get:function(){return Vi.nil}});Object.defineProperty(ce,"getProperty",{enumerable:!0,get:function(){return Vi.getProperty}});Object.defineProperty(ce,"stringify",{enumerable:!0,get:function(){return Vi.stringify}});Object.defineProperty(ce,"regexpCode",{enumerable:!0,get:function(){return Vi.regexpCode}});Object.defineProperty(ce,"Name",{enumerable:!0,get:function(){return Vi.Name}});var wa=al();Object.defineProperty(ce,"Scope",{enumerable:!0,get:function(){return wa.Scope}});Object.defineProperty(ce,"ValueScope",{enumerable:!0,get:function(){return wa.ValueScope}});Object.defineProperty(ce,"ValueScopeName",{enumerable:!0,get:function(){return wa.ValueScopeName}});Object.defineProperty(ce,"varKinds",{enumerable:!0,get:function(){return wa.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 mi=class{optimizeNodes(){return this}optimizeNames(i,t){return this}},sl=class extends mi{constructor(i,t,n){super(),this.varKind=i,this.name=t,this.rhs=n}render({es5:i,_n:t}){let n=i?Jt.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(i,t){if(i[this.name.str])return this.rhs&&(this.rhs=An(this.rhs,i,t)),this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}},va=class extends mi{constructor(i,t,n){super(),this.lhs=i,this.rhs=t,this.sideEffects=n}render({_n:i}){return`${this.lhs} = ${this.rhs};`+i}optimizeNames(i,t){if(!(this.lhs instanceof ge.Name&&!i[this.lhs.str]&&!this.sideEffects))return this.rhs=An(this.rhs,i,t),this}get names(){let i=this.lhs instanceof ge.Name?{}:X({},this.lhs.names);return xa(i,this.rhs)}},ll=class extends va{constructor(i,t,n,r){super(i,n,r),this.op=t}render({_n:i}){return`${this.lhs} ${this.op}= ${this.rhs};`+i}},ul=class extends mi{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`${this.label}:`+i}},cl=class extends mi{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`break${this.label?` ${this.label}`:""};`+i}},dl=class extends mi{constructor(i){super(),this.error=i}render({_n:i}){return`throw ${this.error};`+i}get names(){return this.error.names}},pl=class extends mi{constructor(i){super(),this.code=i}render({_n:i}){return`${this.code};`+i}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(i,t){return this.code=An(this.code,i,t),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}},$r=class extends mi{constructor(i=[]){super(),this.nodes=i}render(i){return this.nodes.reduce((t,n)=>t+n.render(i),"")}optimizeNodes(){let{nodes:i}=this,t=i.length;for(;t--;){let n=i[t].optimizeNodes();Array.isArray(n)?i.splice(t,1,...n):n?i[t]=n:i.splice(t,1)}return i.length>0?this:void 0}optimizeNames(i,t){let{nodes:n}=this,r=n.length;for(;r--;){let o=n[r];o.optimizeNames(i,t)||(aw(i,o.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((i,t)=>cn(i,t.names),{})}},hi=class extends $r{render(i){return"{"+i._n+super.render(i)+"}"+i._n}},fl=class extends $r{},ml=(()=>{class e extends hi{}return e.kind="else",e})(),ba=(()=>{class e extends hi{constructor(t,n){super(n),this.condition=t}render(t){let n=`if(${this.condition})`+super.render(t);return this.else&&(n+="else "+this.else.render(t)),n}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let r=n.optimizeNodes();n=this.else=Array.isArray(r)?new ml(r):r}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(jp(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,n){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(t,n),!!(super.optimizeNames(t,n)||this.else))return this.condition=An(this.condition,t,n),this}get names(){let t=super.names;return xa(t,this.condition),this.else&&cn(t,this.else.names),t}}return e.kind="if",e})(),Ia=(()=>{class e extends hi{}return e.kind="for",e})(),hl=class extends Ia{constructor(i){super(),this.iteration=i}render(i){return`for(${this.iteration})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iteration=An(this.iteration,i,t),this}get names(){return cn(super.names,this.iteration.names)}},gl=class extends Ia{constructor(i,t,n,r){super(),this.varKind=i,this.name=t,this.from=n,this.to=r}render(i){let t=i.es5?Jt.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(i)}get names(){let i=xa(super.names,this.from);return xa(i,this.to)}},Ca=class extends Ia{constructor(i,t,n,r){super(),this.loop=i,this.varKind=t,this.name=n,this.iterable=r}render(i){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iterable=An(this.iterable,i,t),this}get names(){return cn(super.names,this.iterable.names)}},Np=(()=>{class e extends hi{constructor(t,n,r){super(),this.name=t,this.args=n,this.async=r}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}return e.kind="func",e})(),Fp=(()=>{class e extends $r{render(t){return"return "+super.render(t)}}return e.kind="return",e})(),_l=class extends hi{render(i){let t="try"+super.render(i);return this.catch&&(t+=this.catch.render(i)),this.finally&&(t+=this.finally.render(i)),t}optimizeNodes(){var i,t;return super.optimizeNodes(),(i=this.catch)===null||i===void 0||i.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(i,t){var n,r;return super.optimizeNames(i,t),(n=this.catch)===null||n===void 0||n.optimizeNames(i,t),(r=this.finally)===null||r===void 0||r.optimizeNames(i,t),this}get names(){let i=super.names;return this.catch&&cn(i,this.catch.names),this.finally&&cn(i,this.finally.names),i}},Ap=(()=>{class e extends hi{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}return e.kind="catch",e})(),qp=(()=>{class e extends hi{render(t){return"finally"+super.render(t)}}return e.kind="finally",e})(),yl=class{constructor(i,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts=$e(X({},t),{_n:t.lines?`
1
+ import{a as Mp}from"./chunk-XX775C5M.js";import{a as tl,c as Ep,d as Pp,e as Fn,f as oi,g as Xx}from"./chunk-AM2JSGK5.js";import{a as Cp}from"./chunk-2C3X2ESN.js";import{a as $p}from"./chunk-D7VCPH6W.js";import{a as kp}from"./chunk-6GQ5ZIPG.js";import{a as wp,b as Ip,c as Sp}from"./chunk-FVKMBZOU.js";import{a as xr}from"./chunk-H5WTK5UT.js";import{a as Tp}from"./chunk-WCOLHYTR.js";import{a as pa,b as ha}from"./chunk-H45DK7IX.js";import{a as fa,b as ma}from"./chunk-J6CJ26QN.js";import{a as xp}from"./chunk-ZUTM7S4U.js";import{a as aa,b as sa,c as la,d as ua,e as ca,f as da,g as Nn,m as je,n as et,o as gp,p as _p,q as yp,r as bp,s as vp,t as Ai}from"./chunk-IWFKJHPR.js";import{A as Cr,a as lp,b as Di,c as On,e as bt,f as up,h as cp,i as dp,j as pp,k as fp,l as Ni,m as mp,o as Fi,r as Dn,s as sn,t as ln,y as hp,z as Gt}from"./chunk-7EQFLCW4.js";import{a as ji}from"./chunk-B3FSLPDD.js";import{d as ri}from"./chunk-DFFTJVRY.js";import{b as Be}from"./chunk-4VNWFSVF.js";import{k as we,m as qi,n as ve}from"./chunk-L5C2GJ7H.js";import{a as xe,b as Ve}from"./chunk-KZKL7DGI.js";import{e as sp}from"./chunk-OA7Y3E5A.js";import{$a as Yd,Ac as np,Bc as rp,Bd as ap,Ca as Pi,Cc as Te,D as Wd,Da as Xd,Dc as Kt,Ec as on,Fa as Tn,Fc as At,Gc as Mn,Hb as G,Ib as E,Jb as P,Jc as w,Kc as S,Lb as dt,Lc as Ue,M as En,Mb as pt,Nb as ft,Ob as b,Pb as f,Qb as m,Rb as $,Sb as ea,Sc as mt,Tb as ta,Tc as z,Ub as ia,Uc as Oi,Vb as ep,Wb as tp,Wc as op,Xa as he,Z as Ys,_b as H,a as X,aa as vr,ab as d,b as $e,bc as j,cc as na,dc as _,e as g,fa as Kd,fb as Qo,g as Me,ga as Tt,gb as fi,h as K,ha as Pn,hc as Qs,ib as tn,ic as Zs,ja as Gd,jc as el,k as Ld,ka as Jd,kc as Ti,kd as qt,la as k,lc as ki,ld as an,mb as Q,mc as ip,md as ht,n as Pt,nb as kn,nc as Wt,o as Xs,ob as nn,oc as Mi,pb as Qd,pc as Y,q as Ud,qc as C,ra as A,rc as U,sa as q,sb as ue,sc as B,tc as rn,td as oa,ub as Zd,uc as ra,v as zd,vb as Zo,w as le,x as Hd,xc as Oe,yc as De,za as Yo,zc as Ne}from"./chunk-IOKYXV5M.js";var Sr=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 wr=class{};be._CodeOrName=wr;be.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var un=class extends wr{constructor(i){if(super(),!be.IDENTIFIER.test(i))throw new Error("CodeGen: name must be a valid identifier");this.str=i}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};be.Name=un;var jt=class extends wr{constructor(i){super(),this._items=typeof i=="string"?[i]:i}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let i=this._items[0];return i===""||i==='""'}get str(){var i;return(i=this._str)!==null&&i!==void 0?i:this._str=this._items.reduce((t,n)=>`${t}${n}`,"")}get names(){var i;return(i=this._names)!==null&&i!==void 0?i:this._names=this._items.reduce((t,n)=>(n instanceof un&&(t[n.str]=(t[n.str]||0)+1),t),{})}};be._Code=jt;be.nil=new jt("");function Op(e,...i){let t=[e[0]],n=0;for(;n<i.length;)nl(t,i[n]),t.push(e[++n]);return new jt(t)}be._=Op;var il=new jt("+");function Dp(e,...i){let t=[Ir(e[0])],n=0;for(;n<i.length;)t.push(il),nl(t,i[n]),t.push(il,Ir(e[++n]));return Yx(t),new jt(t)}be.str=Dp;function nl(e,i){i instanceof jt?e.push(...i._items):i instanceof un?e.push(i):e.push(ew(i))}be.addCodeArg=nl;function Yx(e){let i=1;for(;i<e.length-1;){if(e[i]===il){let t=Qx(e[i-1],e[i+1]);if(t!==void 0){e.splice(i-1,3,t);continue}e[i++]="+"}i++}}function Qx(e,i){if(i==='""')return e;if(e==='""')return i;if(typeof e=="string")return i instanceof un||e[e.length-1]!=='"'?void 0:typeof i!="string"?`${e.slice(0,-1)}${i}"`:i[0]==='"'?e.slice(0,-1)+i.slice(1):void 0;if(typeof i=="string"&&i[0]==='"'&&!(e instanceof un))return`"${e}${i.slice(1)}`}function Zx(e,i){return i.emptyStr()?e:e.emptyStr()?i:Dp`${e}${i}`}be.strConcat=Zx;function ew(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Ir(Array.isArray(e)?e.join(","):e)}function tw(e){return new jt(Ir(e))}be.stringify=tw;function Ir(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}be.safeStringify=Ir;function iw(e){return typeof e=="string"&&be.IDENTIFIER.test(e)?new jt(`.${e}`):Op`[${e}]`}be.getProperty=iw;function nw(e){if(typeof e=="string"&&be.IDENTIFIER.test(e))return new jt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}be.getEsmExportName=nw;function rw(e){return new jt(e.toString())}be.regexpCode=rw});var al=g(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.ValueScope=Ct.ValueScopeName=Ct.Scope=Ct.varKinds=Ct.UsedValueState=void 0;var vt=Sr(),rl=class extends Error{constructor(i){super(`CodeGen: "code" for ${i} not defined`),this.value=i.value}},ga=function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e}(ga||(Ct.UsedValueState=ga={}));Ct.varKinds={const:new vt.Name("const"),let:new vt.Name("let"),var:new vt.Name("var")};var _a=class{constructor({prefixes:i,parent:t}={}){this._names={},this._prefixes=i,this._parent=t}toName(i){return i instanceof vt.Name?i:this.name(i)}name(i){return new vt.Name(this._newName(i))}_newName(i){let t=this._names[i]||this._nameGroup(i);return`${i}${t.index++}`}_nameGroup(i){var t,n;if(!((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0)&&n.has(i)||this._prefixes&&!this._prefixes.has(i))throw new Error(`CodeGen: prefix "${i}" is not allowed in this scope`);return this._names[i]={prefix:i,index:0}}};Ct.Scope=_a;var ya=class extends vt.Name{constructor(i,t){super(t),this.prefix=i}setValue(i,{property:t,itemIndex:n}){this.value=i,this.scopePath=(0,vt._)`.${new vt.Name(t)}[${n}]`}};Ct.ValueScopeName=ya;var ow=(0,vt._)`\n`,ol=class extends _a{constructor(i){super(i),this._values={},this._scope=i.scope,this.opts=$e(X({},i),{_n:i.lines?ow:vt.nil})}get(){return this._scope}name(i){return new ya(i,this._newName(i))}value(i,t){var n;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let r=this.toName(i),{prefix:o}=r,a=(n=t.key)!==null&&n!==void 0?n:t.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]=t.ref,r.setValue(t,{property:o,itemIndex:u}),r}getValue(i,t){let n=this._values[i];if(n)return n.get(t)}scopeRefs(i,t=this._values){return this._reduceValues(t,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,vt._)`${i}${n.scopePath}`})}scopeCode(i=this._values,t,n){return this._reduceValues(i,r=>{if(r.value===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return r.value.code},t,n)}_reduceValues(i,t,n={},r){let o=vt.nil;for(let a in i){let s=i[a];if(!s)continue;let l=n[a]=n[a]||new Map;s.forEach(u=>{if(l.has(u))return;l.set(u,ga.Started);let c=t(u);if(c){let p=this.opts.es5?Ct.varKinds.var:Ct.varKinds.const;o=(0,vt._)`${o}${p} ${u} = ${c};${this.opts._n}`}else if(c=r?.(u))o=(0,vt._)`${o}${c}${this.opts._n}`;else throw new rl(u);l.set(u,ga.Completed)})}return o}};Ct.ValueScope=ol});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=Sr(),Jt=al(),Vi=Sr();Object.defineProperty(ce,"_",{enumerable:!0,get:function(){return Vi._}});Object.defineProperty(ce,"str",{enumerable:!0,get:function(){return Vi.str}});Object.defineProperty(ce,"strConcat",{enumerable:!0,get:function(){return Vi.strConcat}});Object.defineProperty(ce,"nil",{enumerable:!0,get:function(){return Vi.nil}});Object.defineProperty(ce,"getProperty",{enumerable:!0,get:function(){return Vi.getProperty}});Object.defineProperty(ce,"stringify",{enumerable:!0,get:function(){return Vi.stringify}});Object.defineProperty(ce,"regexpCode",{enumerable:!0,get:function(){return Vi.regexpCode}});Object.defineProperty(ce,"Name",{enumerable:!0,get:function(){return Vi.Name}});var wa=al();Object.defineProperty(ce,"Scope",{enumerable:!0,get:function(){return wa.Scope}});Object.defineProperty(ce,"ValueScope",{enumerable:!0,get:function(){return wa.ValueScope}});Object.defineProperty(ce,"ValueScopeName",{enumerable:!0,get:function(){return wa.ValueScopeName}});Object.defineProperty(ce,"varKinds",{enumerable:!0,get:function(){return wa.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 mi=class{optimizeNodes(){return this}optimizeNames(i,t){return this}},sl=class extends mi{constructor(i,t,n){super(),this.varKind=i,this.name=t,this.rhs=n}render({es5:i,_n:t}){let n=i?Jt.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(i,t){if(i[this.name.str])return this.rhs&&(this.rhs=An(this.rhs,i,t)),this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}},va=class extends mi{constructor(i,t,n){super(),this.lhs=i,this.rhs=t,this.sideEffects=n}render({_n:i}){return`${this.lhs} = ${this.rhs};`+i}optimizeNames(i,t){if(!(this.lhs instanceof ge.Name&&!i[this.lhs.str]&&!this.sideEffects))return this.rhs=An(this.rhs,i,t),this}get names(){let i=this.lhs instanceof ge.Name?{}:X({},this.lhs.names);return xa(i,this.rhs)}},ll=class extends va{constructor(i,t,n,r){super(i,n,r),this.op=t}render({_n:i}){return`${this.lhs} ${this.op}= ${this.rhs};`+i}},ul=class extends mi{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`${this.label}:`+i}},cl=class extends mi{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`break${this.label?` ${this.label}`:""};`+i}},dl=class extends mi{constructor(i){super(),this.error=i}render({_n:i}){return`throw ${this.error};`+i}get names(){return this.error.names}},pl=class extends mi{constructor(i){super(),this.code=i}render({_n:i}){return`${this.code};`+i}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(i,t){return this.code=An(this.code,i,t),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}},$r=class extends mi{constructor(i=[]){super(),this.nodes=i}render(i){return this.nodes.reduce((t,n)=>t+n.render(i),"")}optimizeNodes(){let{nodes:i}=this,t=i.length;for(;t--;){let n=i[t].optimizeNodes();Array.isArray(n)?i.splice(t,1,...n):n?i[t]=n:i.splice(t,1)}return i.length>0?this:void 0}optimizeNames(i,t){let{nodes:n}=this,r=n.length;for(;r--;){let o=n[r];o.optimizeNames(i,t)||(aw(i,o.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((i,t)=>cn(i,t.names),{})}},hi=class extends $r{render(i){return"{"+i._n+super.render(i)+"}"+i._n}},fl=class extends $r{},ml=(()=>{class e extends hi{}return e.kind="else",e})(),ba=(()=>{class e extends hi{constructor(t,n){super(n),this.condition=t}render(t){let n=`if(${this.condition})`+super.render(t);return this.else&&(n+="else "+this.else.render(t)),n}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let r=n.optimizeNodes();n=this.else=Array.isArray(r)?new ml(r):r}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(jp(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,n){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(t,n),!!(super.optimizeNames(t,n)||this.else))return this.condition=An(this.condition,t,n),this}get names(){let t=super.names;return xa(t,this.condition),this.else&&cn(t,this.else.names),t}}return e.kind="if",e})(),Ia=(()=>{class e extends hi{}return e.kind="for",e})(),hl=class extends Ia{constructor(i){super(),this.iteration=i}render(i){return`for(${this.iteration})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iteration=An(this.iteration,i,t),this}get names(){return cn(super.names,this.iteration.names)}},gl=class extends Ia{constructor(i,t,n,r){super(),this.varKind=i,this.name=t,this.from=n,this.to=r}render(i){let t=i.es5?Jt.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(i)}get names(){let i=xa(super.names,this.from);return xa(i,this.to)}},Ca=class extends Ia{constructor(i,t,n,r){super(),this.loop=i,this.varKind=t,this.name=n,this.iterable=r}render(i){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iterable=An(this.iterable,i,t),this}get names(){return cn(super.names,this.iterable.names)}},Np=(()=>{class e extends hi{constructor(t,n,r){super(),this.name=t,this.args=n,this.async=r}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}return e.kind="func",e})(),Fp=(()=>{class e extends $r{render(t){return"return "+super.render(t)}}return e.kind="return",e})(),_l=class extends hi{render(i){let t="try"+super.render(i);return this.catch&&(t+=this.catch.render(i)),this.finally&&(t+=this.finally.render(i)),t}optimizeNodes(){var i,t;return super.optimizeNodes(),(i=this.catch)===null||i===void 0||i.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(i,t){var n,r;return super.optimizeNames(i,t),(n=this.catch)===null||n===void 0||n.optimizeNames(i,t),(r=this.finally)===null||r===void 0||r.optimizeNames(i,t),this}get names(){let i=super.names;return this.catch&&cn(i,this.catch.names),this.finally&&cn(i,this.finally.names),i}},Ap=(()=>{class e extends hi{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}return e.kind="catch",e})(),qp=(()=>{class e extends hi{render(t){return"finally"+super.render(t)}}return e.kind="finally",e})(),yl=class{constructor(i,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts=$e(X({},t),{_n:t.lines?`
2
2
  `:""}),this._extScope=i,this._scope=new Jt.Scope({parent:i}),this._nodes=[new fl]}toString(){return this._root.render(this.opts)}name(i){return this._scope.name(i)}scopeName(i){return this._extScope.name(i)}scopeValue(i,t){let n=this._extScope.value(i,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(i,t){return this._extScope.getValue(i,t)}scopeRefs(i){return this._extScope.scopeRefs(i,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(i,t,n,r){let o=this._scope.toName(t);return n!==void 0&&r&&(this._constants[o.str]=n),this._leafNode(new sl(i,o,n)),o}const(i,t,n){return this._def(Jt.varKinds.const,i,t,n)}let(i,t,n){return this._def(Jt.varKinds.let,i,t,n)}var(i,t,n){return this._def(Jt.varKinds.var,i,t,n)}assign(i,t,n){return this._leafNode(new va(i,t,n))}add(i,t){return this._leafNode(new ll(i,ce.operators.ADD,t))}code(i){return typeof i=="function"?i():i!==ge.nil&&this._leafNode(new pl(i)),this}object(...i){let t=["{"];for(let[n,r]of i)t.length>1&&t.push(","),t.push(n),(n!==r||this.opts.es5)&&(t.push(":"),(0,ge.addCodeArg)(t,r));return t.push("}"),new ge._Code(t)}if(i,t,n){if(this._blockNode(new ba(i)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(i){return this._elseNode(new ba(i))}else(){return this._elseNode(new ml)}endIf(){return this._endBlockNode(ba,ml)}_for(i,t){return this._blockNode(i),t&&this.code(t).endFor(),this}for(i,t){return this._for(new hl(i),t)}forRange(i,t,n,r,o=this.opts.es5?Jt.varKinds.var:Jt.varKinds.let){let a=this._scope.toName(i);return this._for(new gl(o,a,t,n),()=>r(a))}forOf(i,t,n,r=Jt.varKinds.const){let o=this._scope.toName(i);if(this.opts.es5){let a=t instanceof ge.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,ge._)`${a}.length`,s=>{this.var(o,(0,ge._)`${a}[${s}]`),n(o)})}return this._for(new Ca("of",r,o,t),()=>n(o))}forIn(i,t,n,r=this.opts.es5?Jt.varKinds.var:Jt.varKinds.const){if(this.opts.ownProperties)return this.forOf(i,(0,ge._)`Object.keys(${t})`,n);let o=this._scope.toName(i);return this._for(new Ca("in",r,o,t),()=>n(o))}endFor(){return this._endBlockNode(Ia)}label(i){return this._leafNode(new ul(i))}break(i){return this._leafNode(new cl(i))}return(i){let t=new Fp;if(this._blockNode(t),this.code(i),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Fp)}try(i,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let r=new _l;if(this._blockNode(r),this.code(i),t){let o=this.name("e");this._currNode=r.catch=new Ap(o),t(o)}return n&&(this._currNode=r.finally=new qp,this.code(n)),this._endBlockNode(Ap,qp)}throw(i){return this._leafNode(new dl(i))}block(i,t){return this._blockStarts.push(this._nodes.length),i&&this.code(i).endBlock(t),this}endBlock(i){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-t;if(n<0||i!==void 0&&n!==i)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${i} expected`);return this._nodes.length=t,this}func(i,t=ge.nil,n,r){return this._blockNode(new Np(i,t,n)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(Np)}optimize(i=1){for(;i-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(i){return this._currNode.nodes.push(i),this}_blockNode(i){this._currNode.nodes.push(i),this._nodes.push(i)}_endBlockNode(i,t){let n=this._currNode;if(n instanceof i||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${i.kind}/${t.kind}`:i.kind}"`)}_elseNode(i){let t=this._currNode;if(!(t instanceof ba))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=i,this}get _root(){return this._nodes[0]}get _currNode(){let i=this._nodes;return i[i.length-1]}set _currNode(i){let t=this._nodes;t[t.length-1]=i}};ce.CodeGen=yl;function cn(e,i){for(let t in i)e[t]=(e[t]||0)+(i[t]||0);return e}function xa(e,i){return i instanceof ge._CodeOrName?cn(e,i.names):e}function An(e,i,t){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=t[o.str];return a===void 0||i[o.str]!==1?o:(delete i[o.str],a)}function r(o){return o instanceof ge._Code&&o._items.some(a=>a instanceof ge.Name&&i[a.str]===1&&t[a.str]!==void 0)}}function aw(e,i){for(let t in i)e[t]=(e[t]||0)-(i[t]||0)}function jp(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ge._)`!${bl(e)}`}ce.not=jp;var sw=Vp(ce.operators.AND);function lw(...e){return e.reduce(sw)}ce.and=lw;var uw=Vp(ce.operators.OR);function cw(...e){return e.reduce(uw)}ce.or=cw;function Vp(e){return(i,t)=>i===ge.nil?t:t===ge.nil?i:(0,ge._)`${bl(i)} ${e} ${bl(t)}`}function bl(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(),dw=Sr();function pw(e){let i={};for(let t of e)i[t]=!0;return i}de.toHash=pw;function fw(e,i){return typeof i=="boolean"?i:Object.keys(i).length===0?!0:(Lp(e,i),!Up(i,e.self.RULES.all))}de.alwaysValidSchema=fw;function Lp(e,i=e.schema){let{opts:t,self:n}=e;if(!t.strictSchema||typeof i=="boolean")return;let r=n.RULES.keywords;for(let o in i)r[o]||Wp(e,`unknown keyword: "${o}"`)}de.checkUnknownRules=Lp;function Up(e,i){if(typeof e=="boolean")return!e;for(let t in e)if(i[t])return!0;return!1}de.schemaHasRules=Up;function mw(e,i){if(typeof e=="boolean")return!e;for(let t in e)if(t!=="$ref"&&i.all[t])return!0;return!1}de.schemaHasRulesButRef=mw;function hw({topSchemaRef:e,schemaPath:i},t,n,r){if(!r){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,Ee._)`${t}`}return(0,Ee._)`${e}${i}${(0,Ee.getProperty)(n)}`}de.schemaRefOrVal=hw;function gw(e){return zp(decodeURIComponent(e))}de.unescapeFragment=gw;function _w(e){return encodeURIComponent(Cl(e))}de.escapeFragment=_w;function Cl(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}de.escapeJsonPointer=Cl;function zp(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}de.unescapeJsonPointer=zp;function yw(e,i){if(Array.isArray(e))for(let t of e)i(t);else i(e)}de.eachItem=yw;function Bp({mergeNames:e,mergeToName:i,mergeValues:t,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):i(r,o,a),a):o instanceof Ee.Name?(i(r,a,o),o):t(o,a);return s===Ee.Name&&!(l instanceof Ee.Name)?n(r,l):l}}de.mergeEvaluated={props:Bp({mergeNames:(e,i,t)=>e.if((0,Ee._)`${t} !== true && ${i} !== undefined`,()=>{e.if((0,Ee._)`${i} === true`,()=>e.assign(t,!0),()=>e.assign(t,(0,Ee._)`${t} || {}`).code((0,Ee._)`Object.assign(${t}, ${i})`))}),mergeToName:(e,i,t)=>e.if((0,Ee._)`${t} !== true`,()=>{i===!0?e.assign(t,!0):(e.assign(t,(0,Ee._)`${t} || {}`),xl(e,t,i))}),mergeValues:(e,i)=>e===!0?!0:X(X({},e),i),resultToName:Hp}),items:Bp({mergeNames:(e,i,t)=>e.if((0,Ee._)`${t} !== true && ${i} !== undefined`,()=>e.assign(t,(0,Ee._)`${i} === true ? true : ${t} > ${i} ? ${t} : ${i}`)),mergeToName:(e,i,t)=>e.if((0,Ee._)`${t} !== true`,()=>e.assign(t,i===!0?!0:(0,Ee._)`${t} > ${i} ? ${t} : ${i}`)),mergeValues:(e,i)=>e===!0?!0:Math.max(e,i),resultToName:(e,i)=>e.var("items",i)})};function Hp(e,i){if(i===!0)return e.var("props",!0);let t=e.var("props",(0,Ee._)`{}`);return i!==void 0&&xl(e,t,i),t}de.evaluatedPropsToName=Hp;function xl(e,i,t){Object.keys(t).forEach(n=>e.assign((0,Ee._)`${i}${(0,Ee.getProperty)(n)}`,!0))}de.setEvaluated=xl;var Rp={};function bw(e,i){return e.scopeValue("func",{ref:i,code:Rp[i.code]||(Rp[i.code]=new dw._Code(i.code))})}de.useFunc=bw;var vl=function(e){return e[e.Num=0]="Num",e[e.Str=1]="Str",e}(vl||(de.Type=vl={}));function vw(e,i,t){if(e instanceof Ee.Name){let n=i===vl.Num;return t?n?(0,Ee._)`"[" + ${e} + "]"`:(0,Ee._)`"['" + ${e} + "']"`:n?(0,Ee._)`"/" + ${e}`:(0,Ee._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,Ee.getProperty)(e).toString():"/"+Cl(e)}de.getErrorPath=vw;function Wp(e,i,t=e.opts.strictSchema){if(t){if(i=`strict mode: ${i}`,t===!0)throw new Error(i);e.self.logger.warn(i)}}de.checkStrictMode=Wp});var Vt=g(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});var ot=ee(),Cw={data:new ot.Name("data"),valCxt:new ot.Name("valCxt"),instancePath:new ot.Name("instancePath"),parentData:new ot.Name("parentData"),parentDataProperty:new ot.Name("parentDataProperty"),rootData:new ot.Name("rootData"),dynamicAnchors:new ot.Name("dynamicAnchors"),vErrors:new ot.Name("vErrors"),errors:new ot.Name("errors"),this:new ot.Name("this"),self:new ot.Name("self"),scope:new ot.Name("scope"),json:new ot.Name("json"),jsonPos:new ot.Name("jsonPos"),jsonLen:new ot.Name("jsonLen"),jsonPart:new ot.Name("jsonPart")};wl.default=Cw});var Er=g(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.extendErrors=at.resetErrorsCount=at.reportExtraError=at.reportError=at.keyword$DataError=at.keywordError=void 0;var ye=ee(),Sa=pe(),gt=Vt();at.keywordError={message:({keyword:e})=>(0,ye.str)`must pass "${e}" keyword validation`};at.keyword$DataError={message:({keyword:e,schemaType:i})=>i?(0,ye.str)`"${e}" keyword must be ${i} ($data)`:(0,ye.str)`"${e}" keyword is invalid ($data)`};function xw(e,i=at.keywordError,t,n){let{it:r}=e,{gen:o,compositeRule:a,allErrors:s}=r,l=Jp(e,i,t);n??(a||s)?Kp(o,l):Gp(r,(0,ye._)`[${l}]`)}at.reportError=xw;function ww(e,i=at.keywordError,t){let{it:n}=e,{gen:r,compositeRule:o,allErrors:a}=n,s=Jp(e,i,t);Kp(r,s),o||a||Gp(n,gt.default.vErrors)}at.reportExtraError=ww;function Iw(e,i){e.assign(gt.default.errors,i),e.if((0,ye._)`${gt.default.vErrors} !== null`,()=>e.if(i,()=>e.assign((0,ye._)`${gt.default.vErrors}.length`,i),()=>e.assign(gt.default.vErrors,null)))}at.resetErrorsCount=Iw;function Sw({gen:e,keyword:i,schemaValue:t,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,gt.default.errors,s=>{e.const(a,(0,ye._)`${gt.default.vErrors}[${s}]`),e.if((0,ye._)`${a}.instancePath === undefined`,()=>e.assign((0,ye._)`${a}.instancePath`,(0,ye.strConcat)(gt.default.instancePath,o.errorPath))),e.assign((0,ye._)`${a}.schemaPath`,(0,ye.str)`${o.errSchemaPath}/${i}`),o.opts.verbose&&(e.assign((0,ye._)`${a}.schema`,t),e.assign((0,ye._)`${a}.data`,n))})}at.extendErrors=Sw;function Kp(e,i){let t=e.const("err",i);e.if((0,ye._)`${gt.default.vErrors} === null`,()=>e.assign(gt.default.vErrors,(0,ye._)`[${t}]`),(0,ye._)`${gt.default.vErrors}.push(${t})`),e.code((0,ye._)`${gt.default.errors}++`)}function Gp(e,i){let{gen:t,validateName:n,schemaEnv:r}=e;r.$async?t.throw((0,ye._)`new ${e.ValidationError}(${i})`):(t.assign((0,ye._)`${n}.errors`,i),t.return(!1))}var dn={keyword:new ye.Name("keyword"),schemaPath:new ye.Name("schemaPath"),params:new ye.Name("params"),propertyName:new ye.Name("propertyName"),message:new ye.Name("message"),schema:new ye.Name("schema"),parentSchema:new ye.Name("parentSchema")};function Jp(e,i,t){let{createErrors:n}=e.it;return n===!1?(0,ye._)`{}`:$w(e,i,t)}function $w(e,i,t={}){let{gen:n,it:r}=e,o=[Ew(r,t),Pw(e,t)];return Tw(e,i,o),n.object(...o)}function Ew({errorPath:e},{instancePath:i}){let t=i?(0,ye.str)`${e}${(0,Sa.getErrorPath)(i,Sa.Type.Str)}`:e;return[gt.default.instancePath,(0,ye.strConcat)(gt.default.instancePath,t)]}function Pw({keyword:e,it:{errSchemaPath:i}},{schemaPath:t,parentSchema:n}){let r=n?i:(0,ye.str)`${i}/${e}`;return t&&(r=(0,ye.str)`${r}${(0,Sa.getErrorPath)(t,Sa.Type.Str)}`),[dn.schemaPath,r]}function Tw(e,{params:i,message:t},n){let{keyword:r,data:o,schemaValue:a,it:s}=e,{opts:l,propertyName:u,topSchemaRef:c,schemaPath:p}=s;n.push([dn.keyword,r],[dn.params,typeof i=="function"?i(e):i||(0,ye._)`{}`]),l.messages&&n.push([dn.message,typeof t=="function"?t(e):t]),l.verbose&&n.push([dn.schema,a],[dn.parentSchema,(0,ye._)`${c}${p}`],[gt.default.data,o]),u&&n.push([dn.propertyName,u])}});var Yp=g(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.boolOrEmptySchema=qn.topBoolOrEmptySchema=void 0;var kw=Er(),Mw=ee(),Ow=Vt(),Dw={message:"boolean schema is false"};function Nw(e){let{gen:i,schema:t,validateName:n}=e;t===!1?Xp(e,!1):typeof t=="object"&&t.$async===!0?i.return(Ow.default.data):(i.assign((0,Mw._)`${n}.errors`,null),i.return(!0))}qn.topBoolOrEmptySchema=Nw;function Fw(e,i){let{gen:t,schema:n}=e;n===!1?(t.var(i,!1),Xp(e)):t.var(i,!0)}qn.boolOrEmptySchema=Fw;function Xp(e,i){let{gen:t,data:n}=e,r={gen:t,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,kw.reportError)(r,Dw,void 0,i)}});var Il=g(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.getRules=jn.isJSONType=void 0;var Aw=["string","number","integer","boolean","null","object","array"],qw=new Set(Aw);function jw(e){return typeof e=="string"&&qw.has(e)}jn.isJSONType=jw;function Vw(){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:{}}}jn.getRules=Vw});var Sl=g(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.shouldUseRule=Bi.shouldUseGroup=Bi.schemaHasRulesForType=void 0;function Bw({schema:e,self:i},t){let n=i.RULES.types[t];return n&&n!==!0&&Qp(e,n)}Bi.schemaHasRulesForType=Bw;function Qp(e,i){return i.rules.some(t=>Zp(e,t))}Bi.shouldUseGroup=Qp;function Zp(e,i){var t;return e[i.keyword]!==void 0||((t=i.definition.implements)===null||t===void 0?void 0:t.some(n=>e[n]!==void 0))}Bi.shouldUseRule=Zp});var Pr=g(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.reportTypeError=st.checkDataTypes=st.checkDataType=st.coerceAndCheckDataType=st.getJSONTypes=st.getSchemaTypes=st.DataType=void 0;var Rw=Il(),Lw=Sl(),Uw=Er(),ae=ee(),ef=pe(),Vn=function(e){return e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong",e}(Vn||(st.DataType=Vn={}));function zw(e){let i=tf(e.type);if(i.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!i.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&i.push("null")}return i}st.getSchemaTypes=zw;function tf(e){let i=Array.isArray(e)?e:e?[e]:[];if(i.every(Rw.isJSONType))return i;throw new Error("type must be JSONType or JSONType[]: "+i.join(","))}st.getJSONTypes=tf;function Hw(e,i){let{gen:t,data:n,opts:r}=e,o=Ww(i,r.coerceTypes),a=i.length>0&&!(o.length===0&&i.length===1&&(0,Lw.schemaHasRulesForType)(e,i[0]));if(a){let s=El(i,n,r.strictNumbers,Vn.Wrong);t.if(s,()=>{o.length?Kw(e,i,o):Pl(e)})}return a}st.coerceAndCheckDataType=Hw;var nf=new Set(["string","number","integer","boolean","null"]);function Ww(e,i){return i?e.filter(t=>nf.has(t)||i==="array"&&t==="array"):[]}function Kw(e,i,t){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(El(i,r,o.strictNumbers),()=>n.assign(s,r))),n.if((0,ae._)`${s} !== undefined`);for(let u of t)(nf.has(u)||u==="array"&&o.coerceTypes==="array")&&l(u);n.else(),Pl(e),n.endIf(),n.if((0,ae._)`${s} !== undefined`,()=>{n.assign(r,s),Gw(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"